Commit dd05fd12 authored by Hans Verkuil's avatar Hans Verkuil

media: cec: return -ENODEV instead of -ENXIO if unregistered

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: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 1ed4477f
...@@ -70,5 +70,5 @@ include: ...@@ -70,5 +70,5 @@ include:
``ENOMEM`` ``ENOMEM``
Insufficient kernel memory was available. Insufficient kernel memory was available.
``ENXIO`` ``ENODEV``
No device corresponding to this device special file exists. Device not found or was removed.
...@@ -62,12 +62,12 @@ int cec_get_device(struct cec_devnode *devnode) ...@@ -62,12 +62,12 @@ int cec_get_device(struct cec_devnode *devnode)
*/ */
mutex_lock(&devnode->lock); 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. * already or if it is not registered anymore.
*/ */
if (!devnode->registered) { if (!devnode->registered) {
mutex_unlock(&devnode->lock); mutex_unlock(&devnode->lock);
return -ENXIO; return -ENODEV;
} }
/* and increase the device refcount */ /* and increase the device refcount */
get_device(&devnode->dev); get_device(&devnode->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment