summaryrefslogtreecommitdiff
path: root/drivers/media/rc/sir_ir.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-05-17 20:32:51 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-06 15:15:00 +0300
commitb462e1b20dc39f4af05bcbf850e574c381b17038 (patch)
tree3c8eb87876f56634b9b827ddd7956c3ba2d96628 /drivers/media/rc/sir_ir.c
parent1beb5a7d1b17f187491599410709fd0544ea1c16 (diff)
downloadlinux-b462e1b20dc39f4af05bcbf850e574c381b17038.tar.xz
[media] sir_ir: use dev managed resources
Several error paths do not free up resources. This simplifies the code and fixes this. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/sir_ir.c')
-rw-r--r--drivers/media/rc/sir_ir.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c
index c27d6b406d7c..1ee41adb2ab1 100644
--- a/drivers/media/rc/sir_ir.c
+++ b/drivers/media/rc/sir_ir.c
@@ -334,14 +334,13 @@ static int init_port(void)
setup_timer(&timerlist, sir_timeout, 0);
/* get I/O port access and IRQ line */
- if (!request_region(io, 8, KBUILD_MODNAME)) {
+ if (!devm_request_region(&sir_ir_dev->dev, io, 8, KBUILD_MODNAME)) {
pr_err("i/o port 0x%.4x already in use.\n", io);
return -EBUSY;
}
- retval = request_irq(irq, sir_interrupt, 0,
- KBUILD_MODNAME, NULL);
+ retval = devm_request_irq(&sir_ir_dev->dev, irq, sir_interrupt, 0,
+ KBUILD_MODNAME, NULL);
if (retval < 0) {
- release_region(io, 8);
pr_err("IRQ %d already in use.\n", irq);
return retval;
}
@@ -352,9 +351,7 @@ static int init_port(void)
static void drop_port(void)
{
- free_irq(irq, NULL);
del_timer_sync(&timerlist);
- release_region(io, 8);
}
static int init_sir_ir(void)