Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: afe: rescale: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220413190117.29814-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
d272cfc3 61c8686c

+2 -4
-1
drivers/iio/afe/Kconfig
··· 8 8 9 9 config IIO_RESCALE 10 10 tristate "IIO rescale" 11 - depends on OF || COMPILE_TEST 12 11 help 13 12 Say yes here to build support for the IIO rescaling 14 13 that handles voltage dividers, current sense shunts and
+2 -3
drivers/iio/afe/iio-rescale.c
··· 10 10 11 11 #include <linux/err.h> 12 12 #include <linux/gcd.h> 13 + #include <linux/mod_devicetable.h> 13 14 #include <linux/module.h> 14 - #include <linux/of.h> 15 - #include <linux/of_device.h> 16 15 #include <linux/platform_device.h> 17 16 #include <linux/property.h> 18 17 ··· 535 536 536 537 rescale = iio_priv(indio_dev); 537 538 538 - rescale->cfg = of_device_get_match_data(dev); 539 + rescale->cfg = device_get_match_data(dev); 539 540 rescale->numerator = 1; 540 541 rescale->denominator = 1; 541 542 rescale->offset = 0;