iio: gyro: mpu3050: use irq_get_trigger_type()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 1 Sep 2024 13:59:41 +0000 (14:59 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:20:58 +0000 (09:20 +0100)
Use irq_get_trigger_type() to replace getting the irq data then the
type in two steps.

Tweaked ordering wrt to comment whilst here.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20240901135950.797396-7-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/gyro/mpu3050-core.c

index 35af68b..b6883e8 100644 (file)
@@ -1059,12 +1059,12 @@ 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));
        /*
         * Configure the interrupt generator hardware to supply whatever
         * the interrupt is configured for, edges low/high level low/high,
         * we can provide it all.
         */
+       irq_trig = irq_get_trigger_type(irq);
        switch (irq_trig) {
        case IRQF_TRIGGER_RISING:
                dev_info(&indio_dev->dev,