summaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
diff options
context:
space:
mode:
authorAlexandru Ardelean <aardelean@deviqon.com>2021-08-23 14:22:03 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-09-14 12:00:31 +0100
commit6b658c31bb6bc033f6ae60141c676383fb78784c (patch)
treefeac0d86c7a3e18a3c2dda835ce97829f6ed19aa /drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
parent5363c6c17b1014f696bf0b2984af4b694062ce8f (diff)
downloadlinux-stable-6b658c31bb6bc033f6ae60141c676383fb78784c.tar.gz
linux-stable-6b658c31bb6bc033f6ae60141c676383fb78784c.tar.bz2
linux-stable-6b658c31bb6bc033f6ae60141c676383fb78784c.zip
iio: st_sensors: remove all driver remove functions
At this point all ST driver remove functions do iio_device_unregister(). This change removes them from them and replaces all iio_device_register() with devm_iio_device_register(). This can be done in a single change relatively easy, since all these remove functions are define in st_sensors.h. 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-5-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c')
-rw-r--r--drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
index 5e6625140db7..d276f663fe57 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
@@ -142,23 +142,10 @@ int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap)
return ret;
/* Setup magnetometer device */
- ret = st_lsm9ds0_probe_magn(lsm9ds0, regmap);
- if (ret)
- st_accel_common_remove(lsm9ds0->accel);
-
- return ret;
+ return st_lsm9ds0_probe_magn(lsm9ds0, regmap);
}
EXPORT_SYMBOL_GPL(st_lsm9ds0_probe);
-int st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0)
-{
- st_magn_common_remove(lsm9ds0->magn);
- st_accel_common_remove(lsm9ds0->accel);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(st_lsm9ds0_remove);
-
MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
MODULE_DESCRIPTION("STMicroelectronics LSM9DS0 IMU core driver");
MODULE_LICENSE("GPL v2");