mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
iio: imu: bmi160: 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-9-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
9b068d37ba
commit
bb0c6f4e4b
@ -690,18 +690,9 @@ static int bmi160_config_device_irq(struct iio_dev *indio_dev, int irq_type,
|
||||
static int bmi160_setup_irq(struct iio_dev *indio_dev, int irq,
|
||||
enum bmi160_int_pin pin)
|
||||
{
|
||||
struct irq_data *desc;
|
||||
u32 irq_type;
|
||||
u32 irq_type = irq_get_trigger_type(irq);
|
||||
int ret;
|
||||
|
||||
desc = irq_get_irq_data(irq);
|
||||
if (!desc) {
|
||||
dev_err(&indio_dev->dev, "Could not find IRQ %d\n", irq);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
irq_type = irqd_get_trigger_type(desc);
|
||||
|
||||
ret = bmi160_config_device_irq(indio_dev, irq_type, pin);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user