summaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer/st_magn.h
diff options
context:
space:
mode:
authorAlexandru Ardelean <aardelean@deviqon.com>2021-07-20 10:46:41 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-07-24 16:35:05 +0100
commit899f6791469f658d395199c33997391cdd53fa5e (patch)
tree105ab5747f5f94cb15e83fb1d2209bfb7519bd18 /drivers/iio/magnetometer/st_magn.h
parenta442673b40f22be1d7ce7bfb9626461638a638da (diff)
downloadlinux-899f6791469f658d395199c33997391cdd53fa5e.tar.bz2
iio: magn: st_magn: use devm_iio_triggered_buffer_setup() for buffer
The st_magn_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_magn_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_magn_allocate_ring() as well. This change also removes some omitted st_magn_{probe,remove}_trigger() inline hooks. Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Link: https://lore.kernel.org/r/20210720074642.223293-3-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/magnetometer/st_magn.h')
-rw-r--r--drivers/iio/magnetometer/st_magn.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/iio/magnetometer/st_magn.h b/drivers/iio/magnetometer/st_magn.h
index fb6c906c4c0c..785b7f7b8b06 100644
--- a/drivers/iio/magnetometer/st_magn.h
+++ b/drivers/iio/magnetometer/st_magn.h
@@ -25,25 +25,13 @@
#ifdef CONFIG_IIO_BUFFER
int st_magn_allocate_ring(struct iio_dev *indio_dev);
-void st_magn_deallocate_ring(struct iio_dev *indio_dev);
int st_magn_trig_set_state(struct iio_trigger *trig, bool state);
#define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state)
#else /* CONFIG_IIO_BUFFER */
-static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq)
-{
- return 0;
-}
-static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq)
-{
- return;
-}
static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
{
return 0;
}
-static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
-{
-}
#define ST_MAGN_TRIGGER_SET_STATE NULL
#endif /* CONFIG_IIO_BUFFER */