diff options
author | David Härdeman <david@hardeman.nu> | 2017-06-25 14:31:19 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2017-10-04 18:49:49 +0200 |
commit | de226ec8a6ac10e65fcc689a28761c966986e6a6 (patch) | |
tree | 1157167611d07225512ac170a3cb22b470b9ee42 /drivers/media/rc/lirc_dev.c | |
parent | Merge tag 'v4.14-rc2' into patchwork (diff) | |
download | linux-de226ec8a6ac10e65fcc689a28761c966986e6a6.tar.xz linux-de226ec8a6ac10e65fcc689a28761c966986e6a6.zip |
[media] media: lirc_dev: clarify error handling
If an error is generated, it is more logical to error out ASAP.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/rc/lirc_dev.c')
-rw-r--r-- | drivers/media/rc/lirc_dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 9080e39ea391..5e3c4779d866 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -286,7 +286,7 @@ EXPORT_SYMBOL(lirc_unregister_driver); int lirc_dev_fop_open(struct inode *inode, struct file *file) { struct irctl *ir; - int retval = 0; + int retval; if (iminor(inode) >= MAX_IRCTL_DEVICES) { pr_err("open result for %d is -ENODEV\n", iminor(inode)); @@ -327,9 +327,11 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file) ir->open++; -error: nonseekable_open(inode, file); + return 0; + +error: return retval; } EXPORT_SYMBOL(lirc_dev_fop_open); |