Use of devm_request_irq simplifies error unwinding. Signed-off-by: Ladislav Michl <ladis@xxxxxxxxxxxxxx> --- drivers/media/rc/gpio-ir-recv.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 1d84085f1021..68278109f460 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -185,24 +185,16 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpio_dev); - rc = request_irq(gpio_to_irq(pdata->gpio_nr), + return devm_request_irq(dev, gpio_to_irq(pdata->gpio_nr), gpio_ir_recv_irq, - IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, - "gpio-ir-recv-irq", gpio_dev); - if (rc < 0) - goto err_request_irq; - - return 0; - -err_request_irq: - return rc; + IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, + "gpio-ir-recv-irq", gpio_dev); } static int gpio_ir_recv_remove(struct platform_device *pdev) { struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); - free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev); del_timer_sync(&gpio_dev->flush_timer); return 0; } -- 2.11.0