Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+1 -10
+1 -10
drivers/iio/imu/bmi160/bmi160_core.c
··· 690 690 static int bmi160_setup_irq(struct iio_dev *indio_dev, int irq, 691 691 enum bmi160_int_pin pin) 692 692 { 693 - struct irq_data *desc; 694 - u32 irq_type; 693 + u32 irq_type = irq_get_trigger_type(irq); 695 694 int ret; 696 - 697 - desc = irq_get_irq_data(irq); 698 - if (!desc) { 699 - dev_err(&indio_dev->dev, "Could not find IRQ %d\n", irq); 700 - return -EINVAL; 701 - } 702 - 703 - irq_type = irqd_get_trigger_type(desc); 704 695 705 696 ret = bmi160_config_device_irq(indio_dev, irq_type, pin); 706 697 if (ret)