iio: imu: bmi323: use irq_get_trigger_type()

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>
This commit is contained in:
Jonathan Cameron 2024-09-01 14:59:44 +01:00
parent bb0c6f4e4b
commit 9c1125b4c4

View 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;