diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-02-23 12:08:47 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-04-24 14:49:55 +0300 |
commit | dd05fd125e66932e54da696f33f0cee51d4f8e95 (patch) | |
tree | 35be9fea16ea6f47f14707293850299e3f236bcc /drivers | |
parent | 1ed4477f2ea4743e7c5e1f9f3722152d14e6eeb1 (diff) | |
download | linux-dd05fd125e66932e54da696f33f0cee51d4f8e95.tar.xz |
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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/cec/core/cec-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index 5a54db839e5d..6f940df0230c 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -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); |