aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2017-06-25 09:31:19 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-04 13:49:49 -0300
commitde226ec8a6ac10e65fcc689a28761c966986e6a6 (patch)
tree1157167611d07225512ac170a3cb22b470b9ee42 /drivers/media/rc
parentcf09e3c904bf424f8b6a8203958e09bf7d9bcbc0 (diff)
[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')
-rw-r--r--drivers/media/rc/lirc_dev.c6
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);

Privacy Policy