Use ADIS devm functions for trigger/buffer setup
Subsystems (6)
Nuno Sá
maintainerv2 cover Use ADIS devm functions for trigger/buffer setup
This series updates all users of adis_setup_buffer_and_trigger() to use the devm version of it. The ultimate goal of the series is to drop it from the lib as stated by Jonathan in [1].
[1]: https://marc.info/?l=linux-iio&m=158326796924980&w=2
Nuno Sá (10):
iio: adis16201: Use Managed device functions
iio: adis16209: Use Managed device functions
iio: adis16136: Use Managed device functions
iio: adis16260: Use Managed device functions
iio: adis16400: Use Managed device functions
iio: adis16460: Use Managed device functions
iio: adis16480: Use Managed device functions
staging: iio: adis16203: Use Managed device functions
staging: iio: adis16240: Use Managed device functions
iio: adis: Drop non Managed device functions
drivers/iio/accel/adis16201.c | 26 ++--------- drivers/iio/accel/adis16209.c | 25 ++--------- drivers/iio/gyro/adis16136.c | 37 ++++++---------- drivers/iio/gyro/adis16260.c | 33 +++++--------- drivers/iio/imu/adis16400.c | 38 +++++++--------- drivers/iio/imu/adis16460.c | 25 ++--------- drivers/iio/imu/adis16480.c | 55 +++++++++++------------ drivers/iio/imu/adis_buffer.c | 64 ++------------------------- drivers/iio/imu/adis_trigger.c | 60 ------------------------- drivers/staging/iio/accel/adis16203.c | 26 ++--------- drivers/staging/iio/accel/adis16240.c | 25 ++--------- include/linux/iio/imu/adis.h | 27 ----------- 12 files changed, 84 insertions(+), 357 deletions(-)
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 1/10 iio: adis16201: Use Managed device functions
Use the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/accel/adis16201.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-)
drivers/iio/accel/adis16201.c +3 -23
@@ -281,34 +281,15 @@ static int adis16201_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (st, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (st, indio_dev,NULL );if (ret)return ret; ret =adis_initial_startup (st);if (ret) - goto error_cleanup_buffer_trigger; - - ret =iio_device_register (indio_dev); -if (ret <0 ) - goto error_cleanup_buffer_trigger; - -return 0 ; - -error_cleanup_buffer_trigger: -adis_cleanup_buffer_and_trigger (st, indio_dev); -return ret; -} - -static int adis16201_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis *st =iio_priv (indio_dev); - -iio_device_unregister (indio_dev); -adis_cleanup_buffer_and_trigger (st, indio_dev); +return ret; -return 0 ; +return devm_iio_device_register (&spi->dev, indio_dev); }static struct spi_driver adis16201_driver = {
@@ -316,7 +297,6 @@ static struct spi_driver adis16201_driver = { .name = "adis16201", }, .probe = adis16201_probe, - .remove = adis16201_remove, };module_spi_driver (adis16201_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 2/10 iio: adis16209: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/accel/adis16209.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-)
drivers/iio/accel/adis16209.c +3 -22
@@ -291,33 +291,15 @@ static int adis16209_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (st, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (st, indio_dev,NULL );if (ret)return ret; ret =adis_initial_startup (st);if (ret) - goto error_cleanup_buffer_trigger; - ret =iio_device_register (indio_dev); -if (ret) - goto error_cleanup_buffer_trigger; - -return 0 ; - -error_cleanup_buffer_trigger: -adis_cleanup_buffer_and_trigger (st, indio_dev); -return ret; -} - -static int adis16209_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis *st =iio_priv (indio_dev); - -iio_device_unregister (indio_dev); -adis_cleanup_buffer_and_trigger (st, indio_dev); +return ret; -return 0 ; +return devm_iio_device_register (&spi->dev, indio_dev); }static struct spi_driver adis16209_driver = {
@@ -325,7 +307,6 @@ static struct spi_driver adis16209_driver = { .name = "adis16209", }, .probe = adis16209_probe, - .remove = adis16209_remove, };module_spi_driver (adis16209_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 3/10 iio: adis16136: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/gyro/adis16136.c | 37 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 24 deletions(-)
drivers/iio/gyro/adis16136.c +13 -24
@@ -523,6 +523,11 @@ static const struct adis16136_chip_info adis16136_chip_info[] = { }, }; +static void adis16136_stop (void *data) +{ +adis16136_stop_device (data); +} +static int adis16136_probe (struct spi_device *spi) {const struct spi_device_id *id =spi_get_device_id (spi);
@@ -552,38 +557,23 @@ static int adis16136_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (&adis16136->adis, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (&adis16136->adis, indio_dev,NULL );if (ret)return ret; ret =adis16136_initial_setup (indio_dev);if (ret) - goto error_cleanup_buffer; +return ret; - ret =iio_device_register (indio_dev); + ret =devm_add_action_or_reset (&spi->dev, adis16136_stop, indio_dev);if (ret) - goto error_stop_device; - -adis16136_debugfs_init (indio_dev); - -return 0 ; - -error_stop_device: -adis16136_stop_device (indio_dev); -error_cleanup_buffer: -adis_cleanup_buffer_and_trigger (&adis16136->adis, indio_dev); -return ret; -} - -static int adis16136_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis16136 *adis16136 =iio_priv (indio_dev); +return ret; -iio_device_unregister (indio_dev); -adis16136_stop_device (indio_dev); + ret =devm_iio_device_register (&spi->dev, indio_dev); +if (ret) +return ret; -adis_cleanup_buffer_and_trigger (&adis16136->adis, indio_dev); +adis16136_debugfs_init (indio_dev);return 0 ; }
@@ -603,7 +593,6 @@ static struct spi_driver adis16136_driver = { }, .id_table = adis16136_ids, .probe = adis16136_probe, - .remove = adis16136_remove, };module_spi_driver (adis16136_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 4/10 iio: adis16260: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/gyro/adis16260.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-)
drivers/iio/gyro/adis16260.c +11 -22
@@ -359,6 +359,11 @@ static const struct adis_data adis16260_data = { BIT(ADIS16260_DIAG_STAT_POWER_LOW_BIT), }; +static void adis16260_stop (void *data) +{ +adis16260_stop_device (data); +} +static int adis16260_probe (struct spi_device *spi) {const struct spi_device_id *id;
@@ -390,35 +395,20 @@ static int adis16260_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (&adis16260->adis, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (&adis16260->adis, indio_dev,NULL );if (ret)return ret;/* Get the device into a sane initial state */ ret =adis_initial_startup (&adis16260->adis);if (ret) - goto error_cleanup_buffer_trigger; - ret =iio_device_register (indio_dev); -if (ret) - goto error_cleanup_buffer_trigger; - -return 0 ; - -error_cleanup_buffer_trigger: -adis_cleanup_buffer_and_trigger (&adis16260->adis, indio_dev); -return ret; -} - -static int adis16260_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis16260 *adis16260 =iio_priv (indio_dev); +return ret; -iio_device_unregister (indio_dev); -adis16260_stop_device (indio_dev); -adis_cleanup_buffer_and_trigger (&adis16260->adis, indio_dev); + ret =devm_add_action_or_reset (&spi->dev, adis16260_stop, indio_dev); +if (ret) +return ret; -return 0 ; +return devm_iio_device_register (&spi->dev, indio_dev); }/*
@@ -441,7 +431,6 @@ static struct spi_driver adis16260_driver = { .name = "adis16260", }, .probe = adis16260_probe, - .remove = adis16260_remove, .id_table = adis16260_id, };module_spi_driver (adis16260_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 5/10 iio: adis16400: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/imu/adis16400.c | 38 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 23 deletions(-)
drivers/iio/imu/adis16400.c +15 -23
@@ -1164,6 +1164,12 @@ static void adis16400_setup_chan_mask(struct adis16400_state *st) st->avail_scan_mask[0 ] |=BIT (ch->scan_index); } } + +static void adis16400_stop (void *data) +{ +adis16400_stop_device (data); +} +static int adis16400_probe (struct spi_device *spi) {struct adis16400_state *st;
@@ -1201,37 +1207,24 @@ static int adis16400_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (&st->adis, indio_dev, - adis16400_trigger_handler); + ret =devm_adis_setup_buffer_and_trigger (&st->adis, indio_dev, adis16400_trigger_handler);if (ret)return ret;/* Get the device into a sane initial state */ ret =adis16400_initial_setup (indio_dev);if (ret) - goto error_cleanup_buffer; - ret =iio_device_register (indio_dev); -if (ret) - goto error_cleanup_buffer; - -adis16400_debugfs_init (indio_dev); -return 0 ; - -error_cleanup_buffer: -adis_cleanup_buffer_and_trigger (&st->adis, indio_dev); -return ret; -} - -static int adis16400_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis16400_state *st =iio_priv (indio_dev); +return ret; -iio_device_unregister (indio_dev); -adis16400_stop_device (indio_dev); + ret =devm_add_action_or_reset (&spi->dev, adis16400_stop, indio_dev); +if (ret) +return ret; -adis_cleanup_buffer_and_trigger (&st->adis, indio_dev); + ret =devm_iio_device_register (&spi->dev, indio_dev); +if (ret) +return ret; +adis16400_debugfs_init (indio_dev);return 0 ; }
@@ -1261,7 +1254,6 @@ static struct spi_driver adis16400_driver = { }, .id_table = adis16400_id, .probe = adis16400_probe, - .remove = adis16400_remove, };module_spi_driver (adis16400_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 6/10 iio: adis16460: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/imu/adis16460.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-)
drivers/iio/imu/adis16460.c +4 -21
@@ -403,7 +403,7 @@ static int adis16460_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (&st->adis, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (&st->adis, indio_dev,NULL );if (ret)return ret;
@@ -411,30 +411,14 @@ static int adis16460_probe(struct spi_device *spi) ret =__adis_initial_startup (&st->adis);if (ret) - goto error_cleanup_buffer; +return ret; - ret =iio_device_register (indio_dev); + ret =devm_iio_device_register (&spi->dev, indio_dev);if (ret) - goto error_cleanup_buffer; +return ret;adis16460_debugfs_init (indio_dev); -return 0 ; - -error_cleanup_buffer: -adis_cleanup_buffer_and_trigger (&st->adis, indio_dev); -return ret; -} - -static int adis16460_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis16460 *st =iio_priv (indio_dev); - -iio_device_unregister (indio_dev); - -adis_cleanup_buffer_and_trigger (&st->adis, indio_dev); -return 0 ; }
@@ -457,7 +441,6 @@ static struct spi_driver adis16460_driver = { }, .id_table = adis16460_ids, .probe = adis16460_probe, - .remove = adis16460_remove, };module_spi_driver (adis16460_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 7/10 iio: adis16480: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/iio/imu/adis16480.c | 55 +++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 30 deletions(-)
drivers/iio/imu/adis16480.c +25 -30
@@ -1212,6 +1212,16 @@ static int adis16480_get_ext_clocks(struct adis16480 *st)return 0 ; } +static void adis16480_stop (void *data) +{ +adis16480_stop_device (data); +} + +static void adis16480_clk_disable (void *data) +{ +clk_disable_unprepare (data); +} +static int adis16480_probe (struct spi_device *spi) {const struct spi_device_id *id =spi_get_device_id (spi);
@@ -1245,18 +1255,26 @@ static int adis16480_probe(struct spi_device *spi)if (ret)return ret; + ret =devm_add_action_or_reset (&spi->dev, adis16480_stop, indio_dev); +if (ret) +return ret; + ret =adis16480_config_irq_pin (spi->dev.of_node, st);if (ret) - goto error_stop_device; +return ret; ret =adis16480_get_ext_clocks (st);if (ret) - goto error_stop_device; +return ret;if (!IS_ERR_OR_NULL (st->ext_clk)) { ret =adis16480_ext_clk_config (st, spi->dev.of_node, true);if (ret) - goto error_stop_device; +return ret; + + ret =devm_add_action_or_reset (&spi->dev, adis16480_clk_disable, st->ext_clk); +if (ret) +return ret; st->clk_freq =clk_get_rate (st->ext_clk); st->clk_freq *=1000 ;/* micro */
@@ -1264,38 +1282,16 @@ static int adis16480_probe(struct spi_device *spi) st->clk_freq = st->chip_info->int_clk; } - ret =adis_setup_buffer_and_trigger (&st->adis, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (&st->adis, indio_dev,NULL );if (ret) - goto error_clk_disable_unprepare; +return ret; - ret =iio_device_register (indio_dev); + ret =devm_iio_device_register (&spi->dev, indio_dev);if (ret) - goto error_cleanup_buffer; +return ret;adis16480_debugfs_init (indio_dev); -return 0 ; - -error_cleanup_buffer: -adis_cleanup_buffer_and_trigger (&st->adis, indio_dev); -error_clk_disable_unprepare: -clk_disable_unprepare (st->ext_clk); -error_stop_device: -adis16480_stop_device (indio_dev); -return ret; -} - -static int adis16480_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis16480 *st =iio_priv (indio_dev); - -iio_device_unregister (indio_dev); -adis16480_stop_device (indio_dev); - -adis_cleanup_buffer_and_trigger (&st->adis, indio_dev); -clk_disable_unprepare (st->ext_clk); -return 0 ; }
@@ -1338,7 +1334,6 @@ static struct spi_driver adis16480_driver = { }, .id_table = adis16480_ids, .probe = adis16480_probe, - .remove = adis16480_remove, };module_spi_driver (adis16480_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 8/10 staging: iio: adis16203: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/staging/iio/accel/adis16203.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-)
drivers/staging/iio/accel/adis16203.c +3 -23
@@ -286,35 +286,16 @@ static int adis16203_probe(struct spi_device *spi)if (ret)return ret; - ret =adis_setup_buffer_and_trigger (st, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (st, indio_dev,NULL );if (ret)return ret;/* Get the device into a sane initial state */ ret =adis_initial_startup (st);if (ret) - goto error_cleanup_buffer_trigger; - - ret =iio_device_register (indio_dev); -if (ret) - goto error_cleanup_buffer_trigger; - -return 0 ; - -error_cleanup_buffer_trigger: -adis_cleanup_buffer_and_trigger (st, indio_dev); -return ret; -} - -static int adis16203_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis *st =iio_priv (indio_dev); - -iio_device_unregister (indio_dev); -adis_cleanup_buffer_and_trigger (st, indio_dev); +return ret; -return 0 ; +return devm_iio_device_register (&spi->dev, indio_dev); }static const struct of_device_id adis16203_of_match[] = {
@@ -330,7 +311,6 @@ static struct spi_driver adis16203_driver = { .of_match_table = adis16203_of_match, }, .probe = adis16203_probe, - .remove = adis16203_remove, };module_spi_driver (adis16203_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 9/10 staging: iio: adis16240: Use Managed device functions
In reply to Nuno SáUse the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib.
Since we are here, drop the .remove callback by further using devm functions.
---
Changes in v2:
* Further use devm functions to keep cleanup order and to drop .remove.
drivers/staging/iio/accel/adis16240.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-)
drivers/staging/iio/accel/adis16240.c +3 -22
@@ -415,35 +415,17 @@ static int adis16240_probe(struct spi_device *spi) ret =adis_init (st, indio_dev, spi, &adis16240_data);if (ret)return ret; - ret =adis_setup_buffer_and_trigger (st, indio_dev,NULL ); + ret =devm_adis_setup_buffer_and_trigger (st, indio_dev,NULL );if (ret)return ret;/* Get the device into a sane initial state */ ret =adis_initial_startup (st);if (ret) - goto error_cleanup_buffer_trigger; - ret =iio_device_register (indio_dev); -if (ret) - goto error_cleanup_buffer_trigger; -return 0 ; - -error_cleanup_buffer_trigger: -adis_cleanup_buffer_and_trigger (st, indio_dev); -return ret; -} - -static int adis16240_remove (struct spi_device *spi) -{ -struct iio_dev *indio_dev =spi_get_drvdata (spi); -struct adis *st =iio_priv (indio_dev); - -iio_device_unregister (indio_dev); -adis_cleanup_buffer_and_trigger (st, indio_dev); +return ret; -return 0 ; +return devm_iio_device_register (&spi->dev, indio_dev); } -static const struct of_device_id adis16240_of_match[] = { { .compatible ="adi,adis16240" }, { },
@@ -456,7 +438,6 @@ static struct spi_driver adis16240_driver = { .of_match_table = adis16240_of_match, }, .probe = adis16240_probe, - .remove = adis16240_remove, };module_spi_driver (adis16240_driver);
Signature · 1 line
2.28.0
Nuno Sá
maintainerPATCH v2 10/10 iio: adis: Drop non Managed device functions
In reply to Nuno SáDrop adis_setup_buffer_and_trigger(). All users were updated to use the devm version of this function. This avoids having almost the same code repeated.
---
Changes in v2:
* Nothing changed.
drivers/iio/imu/adis_buffer.c | 64 +++------------------------------- drivers/iio/imu/adis_trigger.c | 60 ------------------------------- include/linux/iio/imu/adis.h | 27 -------------- 3 files changed, 4 insertions(+), 147 deletions(-)
drivers/iio/imu/adis_buffer.c +4 -60
@@ -169,48 +169,6 @@ static void adis_buffer_cleanup(void *arg)kfree (adis->xfer); } -/** -* adis_setup_buffer_and_trigger() - Sets up buffer and trigger for the adis device -* @adis: The adis device. -* @indio_dev: The IIO device. -* @trigger_handler: Optional trigger handler, may be NULL. -* -* Returns 0 on success, a negative error code otherwise. -* -* This function sets up the buffer and trigger for a adis devices. If -* 'trigger_handler' is NULL the default trigger handler will be used. The -* default trigger handler will simply read the registers assigned to the -* currently active channels. -* -* adis_cleanup_buffer_and_trigger() should be called to free the resources -* allocated by this function. -*/ -int adis_setup_buffer_and_trigger (struct adis *adis,struct iio_dev *indio_dev, -irqreturn_t (*trigger_handler)(int ,void *)) -{ -int ret; - -if (!trigger_handler) - trigger_handler = adis_trigger_handler; - - ret =iio_triggered_buffer_setup (indio_dev, &iio_pollfunc_store_time, - trigger_handler,NULL ); -if (ret) -return ret; - -if (adis->spi->irq) { - ret =adis_probe_trigger (adis, indio_dev); -if (ret) - goto error_buffer_cleanup; - } -return 0 ; - -error_buffer_cleanup: -iio_triggered_buffer_cleanup (indio_dev); -return ret; -} -EXPORT_SYMBOL_GPL (adis_setup_buffer_and_trigger); -/** * devm_adis_setup_buffer_and_trigger() - Sets up buffer and trigger for * the managed adis device
@@ -220,7 +178,10 @@ EXPORT_SYMBOL_GPL(adis_setup_buffer_and_trigger);* * Returns 0 on success, a negative error code otherwise. * -* This function perfoms exactly the same as adis_setup_buffer_and_trigger() +* This function sets up the buffer and trigger for a adis devices. If +* 'trigger_handler' is NULL the default trigger handler will be used. The +* default trigger handler will simply read the registers assigned to the +* currently active channels. */ int devm_adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev,
@@ -248,20 +209,3 @@ devm_adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev, }EXPORT_SYMBOL_GPL (devm_adis_setup_buffer_and_trigger); -/** -* adis_cleanup_buffer_and_trigger() - Free buffer and trigger resources -* @adis: The adis device. -* @indio_dev: The IIO device. -* -* Frees resources allocated by adis_setup_buffer_and_trigger() -*/ -void adis_cleanup_buffer_and_trigger (struct adis *adis, -struct iio_dev *indio_dev) -{ -if (adis->spi->irq) -adis_remove_trigger (adis); -kfree (adis->buffer); -kfree (adis->xfer); -iio_triggered_buffer_cleanup (indio_dev); -} -EXPORT_SYMBOL_GPL (adis_cleanup_buffer_and_trigger);
drivers/iio/imu/adis_trigger.c +0 -60
69 lines not on this page · raw message
include/linux/iio/imu/adis.h +0 -27
@@ -517,14 +517,8 @@ struct adis_burst {int devm_adis_setup_buffer_and_trigger (struct adis *adis,struct iio_dev *indio_dev,irq_handler_t trigger_handler); -int adis_setup_buffer_and_trigger (struct adis *adis, -struct iio_dev *indio_dev,irqreturn_t (*trigger_handler)(int ,void *)); -void adis_cleanup_buffer_and_trigger (struct adis *adis, -struct iio_dev *indio_dev);int devm_adis_probe_trigger (struct adis *adis,struct iio_dev *indio_dev); -int adis_probe_trigger (struct adis *adis,struct iio_dev *indio_dev); -void adis_remove_trigger (struct adis *adis);int adis_update_scan_mode (struct iio_dev *indio_dev,const unsigned long *scan_mask);
@@ -538,33 +532,12 @@ devm_adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev, return 0; } -static inline int adis_setup_buffer_and_trigger (struct adis *adis, -struct iio_dev *indio_dev,irqreturn_t (*trigger_handler)(int ,void *)) -{ -return 0 ; -} - -static inline void adis_cleanup_buffer_and_trigger (struct adis *adis, -struct iio_dev *indio_dev) -{ -} -static inline int devm_adis_probe_trigger (struct adis *adis,struct iio_dev *indio_dev) {return 0 ; } -static inline int adis_probe_trigger (struct adis *adis, -struct iio_dev *indio_dev) -{ -return 0 ; -} - -static inline void adis_remove_trigger (struct adis *adis) -{ -} -#define adis_update_scan_mode NULL#endif /* CONFIG_IIO_BUFFER */
Signature · 1 line
2.28.0