diff options
author | Alexandru Ardelean <aardelean@deviqon.com> | 2021-05-13 15:07:45 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-06-13 17:00:16 +0100 |
commit | 718fb2bcf1034232599045fc710644d903c2af4b (patch) | |
tree | f13aeaec21b13db500e7f5cbbbfb7ea055479ee8 /include/linux | |
parent | e6148fe791071a091fe7fd8bc1d99ccc4958c70e (diff) |
iio: adc: ad_sigma_delta: introduct devm_ad_sd_setup_buffer_and_trigger()
This is a version of ad_sd_setup_buffer_and_trigger() with all underlying
functions (that are used) being replaced with their device-managed
variants.
One thing to take care here is with {devm_}iio_trigger_alloc(), where both
functions take a parent-device object as the first parameter.
To make sure nothing quirky is happening, the devm_ad_sd_probe_trigger()
function is checking that the provided 'dev' reference is the same as the
one stored on the 'struct ad_sigma_delta' driver data.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210513120752.90074-6-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/iio/adc/ad_sigma_delta.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h index 7199280d89ca..be81ad39fb7a 100644 --- a/include/linux/iio/adc/ad_sigma_delta.h +++ b/include/linux/iio/adc/ad_sigma_delta.h @@ -26,6 +26,7 @@ struct ad_sd_calib_data { }; struct ad_sigma_delta; +struct device; struct iio_dev; /** @@ -135,6 +136,8 @@ int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev); void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev); +int devm_ad_sd_setup_buffer_and_trigger(struct device *dev, struct iio_dev *indio_dev); + int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig); #endif |