]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iio: imu: bmi323: use irq_get_trigger_type()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 1 Sep 2024 13:59:44 +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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20240901135950.797396-10-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/bmi323/bmi323_core.c

index 671401ce80dcf947b7b64ea3af112d2a42ca5501..89eab40bcfdf1ca7048fbd0a2d33c047c7836256 100644 (file)
@@ -1881,7 +1881,6 @@ static int bmi323_trigger_probe(struct bmi323_data *data,
        struct fwnode_handle *fwnode;
        enum bmi323_irq_pin irq_pin;
        int ret, irq, irq_type;
-       struct irq_data *desc;
 
        fwnode = dev_fwnode(data->dev);
        if (!fwnode)
@@ -1898,12 +1897,7 @@ static int bmi323_trigger_probe(struct bmi323_data *data,
                irq_pin = BMI323_IRQ_INT2;
        }
 
-       desc = irq_get_irq_data(irq);
-       if (!desc)
-               return dev_err_probe(data->dev, -EINVAL,
-                                    "Could not find IRQ %d\n", irq);
-
-       irq_type = irqd_get_trigger_type(desc);
+       irq_type = irq_get_trigger_type(irq);
        switch (irq_type) {
        case IRQF_TRIGGER_RISING:
                latch = false;