diff mbox series

[2/7] iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate irq_disable()

Message ID 20210402184544.488862-3-jic23@kernel.org (mailing list archive)
State New, archived
Headers show
Series iio: Use IRQF_NO_AUTOEN | expand

Commit Message

Jonathan Cameron April 2, 2021, 6:45 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Disabling an irq before the driver has actually atempted to request it
may work, but is definitely not as clean as just requesting it as
normal but with the auto enable disabled.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/iio/adc/exynos_adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Song Bao Hua (Barry Song) April 2, 2021, 8:11 p.m. UTC | #1
> -----Original Message-----
> From: Jonathan Cameron [mailto:jic23@kernel.org]
> Sent: Saturday, April 3, 2021 7:46 AM
> To: linux-iio@vger.kernel.org
> Cc: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>; Jonathan Cameron
> <jonathan.cameron@huawei.com>; Krzysztof Kozlowski <krzk@kernel.org>
> Subject: [PATCH 2/7] iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather
> than separate irq_disable()
> 
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Disabling an irq before the driver has actually atempted to request it
> may work, but is definitely not as clean as just requesting it as
> normal but with the auto enable disabled.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/iio/adc/exynos_adc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>

> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index 784c10deeb1a..8c98d8c9ab1f 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -778,9 +778,9 @@ static int exynos_adc_ts_init(struct exynos_adc *info)
>  		return ret;
>  	}
> 
> -	disable_irq(info->tsirq);
>  	ret = request_threaded_irq(info->tsirq, NULL, exynos_ts_isr,
> -				   IRQF_ONESHOT, "touchscreen", info);
> +				   IRQF_ONESHOT | IRQF_NO_AUTOEN,
> +				   "touchscreen", info);
>  	if (ret)
>  		input_unregister_device(info->input);
> 
> --
> 2.31.1
Krzysztof Kozlowski April 4, 2021, 7:20 p.m. UTC | #2
On 02/04/2021 20:45, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Disabling an irq before the driver has actually atempted to request it
> may work, but is definitely not as clean as just requesting it as
> normal but with the auto enable disabled.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>



Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof
Jonathan Cameron April 5, 2021, 2:29 p.m. UTC | #3
On Sun, 4 Apr 2021 21:20:21 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:

> On 02/04/2021 20:45, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Disabling an irq before the driver has actually atempted to request it
> > may work, but is definitely not as clean as just requesting it as
> > normal but with the auto enable disabled.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Krzysztof Kozlowski <krzk@kernel.org>  
> 
> 
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> 
> Best regards,
> Krzysztof

Applied to the togreg branch of iio.git and pushed out as testing
to let the autobuilders poke at it.

Thanks,

Jonathan
diff mbox series

Patch

diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 784c10deeb1a..8c98d8c9ab1f 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -778,9 +778,9 @@  static int exynos_adc_ts_init(struct exynos_adc *info)
 		return ret;
 	}
 
-	disable_irq(info->tsirq);
 	ret = request_threaded_irq(info->tsirq, NULL, exynos_ts_isr,
-				   IRQF_ONESHOT, "touchscreen", info);
+				   IRQF_ONESHOT | IRQF_NO_AUTOEN,
+				   "touchscreen", info);
 	if (ret)
 		input_unregister_device(info->input);