iio: ad7793: implement IIO_CHAN_INFO_SAMP_FREQ
authorMichael Nosthoff <committed@heine.so>
Fri, 9 Mar 2018 15:13:52 +0000 (16:13 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 17 Mar 2018 20:33:01 +0000 (20:33 +0000)
commit490fba90a90eb7b741f57fefd2bcf2c1e11eb471
tree33bb99acb294478224e1a6572b39ead5f9d44c98
parent8b438686a001db64c21782d04ef68111e53c45d9
iio: ad7793: implement IIO_CHAN_INFO_SAMP_FREQ

This commit is a follow-up to changes made to ad_sigma_delta.h
in staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ
which broke ad7793 as it was not altered to match those changes.

This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ
attribute wherein usage has some advantages like it can be accessed by
in-kernel consumers as well as reduces the code size.

Therefore, use IIO_CHAN_INFO_SAMP_FREQ to implement the
sampling_frequency attribute instead of using IIO_DEV_ATTR_SAMP_FREQ()
macro.

Move code from the functions associated with IIO_DEV_ATTR_SAMP_FREQ()
into respective read and write hooks with the mask set to
IIO_CHAN_INFO_SAMP_FREQ.

Fixes: a13e831fcaa7 ("staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ")

Signed-off-by: Michael Nosthoff <committed@heine.so>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7793.c