summaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel/st_accel.h
diff options
context:
space:
mode:
authorAlexandru Ardelean <aardelean@deviqon.com>2021-07-20 10:46:40 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-07-24 16:35:05 +0100
commita442673b40f22be1d7ce7bfb9626461638a638da (patch)
treee0968f177536528d4ae80b2fbefbec85cbbead7b /drivers/iio/accel/st_accel.h
parent674db1e9217a8cebe4e348989f9e9ec428ff2859 (diff)
downloadlinux-a442673b40f22be1d7ce7bfb9626461638a638da.tar.bz2
iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer
The st_accel_allocate_ring() function calls iio_triggered_buffer_setup() to allocate a triggered buffer. But the same can be done with devm_iio_triggered_buffer_setup() and then the st_accel_common_remove() no longer needs to manually deallocate it. We know that the parent of the IIO device is used to manage other instances of the devm unwind, so it can be used in the st_accel_allocate_ring() as well. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210720074642.223293-2-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/st_accel.h')
-rw-r--r--drivers/iio/accel/st_accel.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h
index f5b0b8bbaff7..8750dea56fcb 100644
--- a/drivers/iio/accel/st_accel.h
+++ b/drivers/iio/accel/st_accel.h
@@ -64,7 +64,6 @@ enum st_accel_type {
#ifdef CONFIG_IIO_BUFFER
int st_accel_allocate_ring(struct iio_dev *indio_dev);
-void st_accel_deallocate_ring(struct iio_dev *indio_dev);
int st_accel_trig_set_state(struct iio_trigger *trig, bool state);
#define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state)
#else /* CONFIG_IIO_BUFFER */
@@ -72,9 +71,6 @@ static inline int st_accel_allocate_ring(struct iio_dev *indio_dev)
{
return 0;
}
-static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev)
-{
-}
#define ST_ACCEL_TRIGGER_SET_STATE NULL
#endif /* CONFIG_IIO_BUFFER */