iio: adc: ad_sigma_delta: introduct devm_ad_sd_setup_buffer_and_trigger()
authorAlexandru Ardelean <aardelean@deviqon.com>
Thu, 13 May 2021 12:07:45 +0000 (15:07 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Jun 2021 16:00:16 +0000 (17:00 +0100)
commit718fb2bcf1034232599045fc710644d903c2af4b
treef13aeaec21b13db500e7f5cbbbfb7ea055479ee8
parente6148fe791071a091fe7fd8bc1d99ccc4958c70e
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>
drivers/iio/adc/ad_sigma_delta.c
include/linux/iio/adc/ad_sigma_delta.h