summaryrefslogtreecommitdiff
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorAlexandru Ardelean <aardelean@deviqon.com>2021-08-23 14:22:01 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-09-14 14:00:31 +0300
commit82bcb7fb649844a561ff1ac2e2ace4252bdff793 (patch)
treee94da76d2b426e95190d7c33cf49d8e13ece345f /drivers/iio/accel
parent9f0b3e0cc0c88618aa9e5cecef747b1337ae0a5d (diff)
downloadlinux-82bcb7fb649844a561ff1ac2e2ace4252bdff793.tar.xz
iio: st_sensors: remove st_sensors_deallocate_trigger() function
This change converts the st_sensors_allocate_trigger() to use device-managed functions. The parent device of the IIO device object is used. This is based on the assumption that all other devm_ calls in the ST sensors use this reference. That makes the st_sensors_deallocate_trigger() function un-needed, so it can be removed. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210823112204.243255-3-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r--drivers/iio/accel/st_accel_core.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index f1e6ec380667..a7be1633bff1 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -1380,29 +1380,13 @@ int st_accel_common_probe(struct iio_dev *indio_dev)
return err;
}
- err = iio_device_register(indio_dev);
- if (err)
- goto st_accel_device_register_error;
-
- dev_info(&indio_dev->dev, "registered accelerometer %s\n",
- indio_dev->name);
-
- return 0;
-
-st_accel_device_register_error:
- if (adata->irq > 0)
- st_sensors_deallocate_trigger(indio_dev);
- return err;
+ return iio_device_register(indio_dev);
}
EXPORT_SYMBOL(st_accel_common_probe);
void st_accel_common_remove(struct iio_dev *indio_dev)
{
- struct st_sensor_data *adata = iio_priv(indio_dev);
-
iio_device_unregister(indio_dev);
- if (adata->irq > 0)
- st_sensors_deallocate_trigger(indio_dev);
}
EXPORT_SYMBOL(st_accel_common_remove);