iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request then disable
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 2 Apr 2021 18:45:41 +0000 (19:45 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 7 Apr 2021 07:36:39 +0000 (08:36 +0100)
This new flag ensures a requested irq is not autoenabled, thus removing
the need for the disable_irq() that follows and closing off any chance
of spurious interrupts.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-5-jic23@kernel.org
drivers/iio/adc/sun4i-gpadc-iio.c

index 99b43f28e879ae8337e350cf73d965f53d2f1030..2d393a4dfff6a8665ef980768993dc59b0cf2780 100644 (file)
@@ -470,7 +470,8 @@ static int sun4i_irq_init(struct platform_device *pdev, const char *name,
        }
 
        *irq = ret;
-       ret = devm_request_any_context_irq(&pdev->dev, *irq, handler, 0,
+       ret = devm_request_any_context_irq(&pdev->dev, *irq, handler,
+                                          IRQF_NO_AUTOEN,
                                           devname, info);
        if (ret < 0) {
                dev_err(&pdev->dev, "could not request %s interrupt: %d\n",
@@ -478,7 +479,6 @@ static int sun4i_irq_init(struct platform_device *pdev, const char *name,
                return ret;
        }
 
-       disable_irq(*irq);
        atomic_set(atomic, 0);
 
        return 0;