]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
media: cec: return -ENODEV instead of -ENXIO if unregistered
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 23 Feb 2024 09:08:47 +0000 (10:08 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 24 Apr 2024 11:49:55 +0000 (13:49 +0200)
If the CEC device is unregistered, then an attempt to open
the device node should result in an -ENODEV error instead of
-ENXIO.

Document this as well in cec-func-open.rst.

This is consistent with the error code returned by other
file operations such as ioctl.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Documentation/userspace-api/media/cec/cec-func-open.rst
drivers/media/cec/core/cec-core.c

index d86563a34b9e779680ff9a9444e7bb7b802aff64..125c8ac6680b9653fe03004e231354c2c8cd72d3 100644 (file)
@@ -70,5 +70,5 @@ include:
 ``ENOMEM``
     Insufficient kernel memory was available.
 
-``ENXIO``
-    No device corresponding to this device special file exists.
+``ENODEV``
+    Device not found or was removed.
index 5a54db839e5d641db9d635a43a74a71e1cfe2bfd..6f940df0230c95469a99a83387c4b3cfdbbb3d97 100644 (file)
@@ -62,12 +62,12 @@ int cec_get_device(struct cec_devnode *devnode)
         */
        mutex_lock(&devnode->lock);
        /*
-        * return ENXIO if the cec device has been removed
+        * return ENODEV if the cec device has been removed
         * already or if it is not registered anymore.
         */
        if (!devnode->registered) {
                mutex_unlock(&devnode->lock);
-               return -ENXIO;
+               return -ENODEV;
        }
        /* and increase the device refcount */
        get_device(&devnode->dev);