Re: [PATCH v2 next 2/5] iio: sca3000: switch IRQ handling to devm helpers

David Lechner
2026-02-02T23:06:58Z

On 2/2/26 1:40 PM, Harshit Mogalapalli wrote:
> Convert the threaded IRQ registration to devm_request_threaded_irq() so
> that the probe and remove paths can drop manual freeing of irqs.
>
> No functionality change.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> v1->v2: Fix indentation in devm_request_threaded_irq() call[ Thanks to
> Jonathan]
> ---
> drivers/iio/accel/sca3000.c | 25 ++++++++-----------------
> 1 file changed, 8 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index afe6ef61a53b..37ef724d5dc5 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -1473,34 +1473,27 @@ static int sca3000_probe(struct spi_device *spi)
> return ret;
>
> if (spi->irq) {
> - ret = request_threaded_irq(spi->irq,
> - NULL,
> - &sca3000_event_handler,
> - IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> - "sca3000",
> - indio_dev);
> + ret = devm_request_threaded_irq(dev, spi->irq, NULL,
> + &sca3000_event_handler,
> + IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> + "sca3000",
> + indio_dev);
> if (ret)
> return ret;
> }
> ret = sca3000_clean_setup(st);
> if (ret)
> - goto error_free_irq;
> + return ret;
>
> ret = sca3000_print_rev(indio_dev);
> if (ret)
> - goto error_free_irq;
> + return ret;
>
> ret = iio_device_register(indio_dev);
> if (ret)
> - goto error_free_irq;
> + return ret;
>
> return 0;
Could return directly here already, but it gets cleaned up in a
later patch, so its OK.

Reviewed-by: David Lechner <dlechner@baylibe.com>