diff options
author | Alexandru Ardelean <aardelean@deviqon.com> | 2021-07-20 10:46:39 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-07-24 16:35:05 +0100 |
commit | 674db1e9217a8cebe4e348989f9e9ec428ff2859 (patch) | |
tree | 0d2461b3c853d8dff037d9e96c2f1204f80e5c78 /drivers/iio/pressure/st_pressure.h | |
parent | 78a6af334662879780718b18d91dc5f2576f5e5d (diff) | |
download | linux-674db1e9217a8cebe4e348989f9e9ec428ff2859.tar.gz linux-674db1e9217a8cebe4e348989f9e9ec428ff2859.tar.bz2 linux-674db1e9217a8cebe4e348989f9e9ec428ff2859.zip |
iio: pressure: st_pressure: use devm_iio_triggered_buffer_setup() for buffer
The st_press_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_press_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_press_allocate_ring() as
well.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210720074642.223293-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure/st_pressure.h')
-rw-r--r-- | drivers/iio/pressure/st_pressure.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/iio/pressure/st_pressure.h b/drivers/iio/pressure/st_pressure.h index 9417b3bd7513..156e6a72dc5c 100644 --- a/drivers/iio/pressure/st_pressure.h +++ b/drivers/iio/pressure/st_pressure.h @@ -43,7 +43,6 @@ static __maybe_unused const struct st_sensors_platform_data default_press_pdata #ifdef CONFIG_IIO_BUFFER int st_press_allocate_ring(struct iio_dev *indio_dev); -void st_press_deallocate_ring(struct iio_dev *indio_dev); int st_press_trig_set_state(struct iio_trigger *trig, bool state); #define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state) #else /* CONFIG_IIO_BUFFER */ @@ -51,10 +50,6 @@ static inline int st_press_allocate_ring(struct iio_dev *indio_dev) { return 0; } - -static inline void st_press_deallocate_ring(struct iio_dev *indio_dev) -{ -} #define ST_PRESS_TRIGGER_SET_STATE NULL #endif /* CONFIG_IIO_BUFFER */ |