summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2024-09-01 14:59:46 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-09-30 09:20:59 +0100
commitdbd88a69d4eb17a45b0595f96e1c1dbb025134d7 (patch)
treec33427b8f4e323e08d55685fb96b0a5f29e6f221
parent95bce3fcdbfaffb12c3203d08b9d44c8e12b527b (diff)
downloadlwn-dbd88a69d4eb17a45b0595f96e1c1dbb025134d7.tar.gz
lwn-dbd88a69d4eb17a45b0595f96e1c1dbb025134d7.zip
iio: imu: inv_mpu6050: 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-12-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_core.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 14d95f34e981..fdb48c5e5686 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -1859,7 +1859,6 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
struct inv_mpu6050_platform_data *pdata;
struct device *dev = regmap_get_device(regmap);
int result;
- struct irq_data *desc;
int irq_type;
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
@@ -1893,13 +1892,7 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
}
if (irq > 0) {
- desc = irq_get_irq_data(irq);
- if (!desc) {
- dev_err(dev, "Could not find IRQ %d\n", irq);
- return -EINVAL;
- }
-
- irq_type = irqd_get_trigger_type(desc);
+ irq_type = irq_get_trigger_type(irq);
if (!irq_type)
irq_type = IRQF_TRIGGER_RISING;
} else {