mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
[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>
This commit is contained in:
parent
cf09e3c904
commit
de226ec8a6
1 changed files with 4 additions and 2 deletions
|
@ -286,7 +286,7 @@ EXPORT_SYMBOL(lirc_unregister_driver);
|
||||||
int lirc_dev_fop_open(struct inode *inode, struct file *file)
|
int lirc_dev_fop_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct irctl *ir;
|
struct irctl *ir;
|
||||||
int retval = 0;
|
int retval;
|
||||||
|
|
||||||
if (iminor(inode) >= MAX_IRCTL_DEVICES) {
|
if (iminor(inode) >= MAX_IRCTL_DEVICES) {
|
||||||
pr_err("open result for %d is -ENODEV\n", iminor(inode));
|
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++;
|
ir->open++;
|
||||||
|
|
||||||
error:
|
|
||||||
nonseekable_open(inode, file);
|
nonseekable_open(inode, file);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(lirc_dev_fop_open);
|
EXPORT_SYMBOL(lirc_dev_fop_open);
|
||||||
|
|
Loading…
Reference in a new issue