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>
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));
ir->open++;
-error:
nonseekable_open(inode, file);
+ return 0;
+
+error:
return retval;
}
EXPORT_SYMBOL(lirc_dev_fop_open);