diff mbox series

[06/15] iio: gyro: mpu3050: use irq_get_trigger_type()

Message ID 20240901135950.797396-7-jic23@kernel.org (mailing list archive)
State Accepted
Headers show
Series IIO: use irq_get_trigger_type() instead of opencoding. | expand

Commit Message

Jonathan Cameron Sept. 1, 2024, 1:59 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Use irq_get_trigger_type() to replace getting the irq data then the
type in two steps.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/gyro/mpu3050-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Sept. 2, 2024, 9:13 a.m. UTC | #1
On Sun, Sep 1, 2024 at 4:00 PM Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Use irq_get_trigger_type() to replace getting the irq data then the
> type in two steps.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Andy Shevchenko Sept. 2, 2024, 11:46 a.m. UTC | #2
On Sun, Sep 01, 2024 at 02:59:41PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Use irq_get_trigger_type() to replace getting the irq data then the
> type in two steps.

...

> -	irq_trig = irqd_get_trigger_type(irq_get_irq_data(irq));
> +	irq_trig = irq_get_trigger_type(irq);

Same remark about comment vs. assignment.

>  	/*
>  	 * Configure the interrupt generator hardware to supply whatever
>  	 * the interrupt is configured for, edges low/high level low/high,
diff mbox series

Patch

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index 35af68b41408..b38d0678277e 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -1059,7 +1059,7 @@  static int mpu3050_trigger_probe(struct iio_dev *indio_dev, int irq)
 	/* Check if IRQ is open drain */
 	mpu3050->irq_opendrain = device_property_read_bool(dev, "drive-open-drain");
 
-	irq_trig = irqd_get_trigger_type(irq_get_irq_data(irq));
+	irq_trig = irq_get_trigger_type(irq);
 	/*
 	 * Configure the interrupt generator hardware to supply whatever
 	 * the interrupt is configured for, edges low/high level low/high,