iio: afe: rescale: Make use of device properties
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 13 Apr 2022 19:01:17 +0000 (22:01 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 28 Apr 2022 18:22:54 +0000 (19:22 +0100)
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>
drivers/iio/afe/Kconfig
drivers/iio/afe/iio-rescale.c

index 4fa3978..9a1d95c 100644 (file)
@@ -8,7 +8,6 @@ menu "Analog Front Ends"
 
 config IIO_RESCALE
        tristate "IIO rescale"
-       depends on OF || COMPILE_TEST
        help
          Say yes here to build support for the IIO rescaling
          that handles voltage dividers, current sense shunts and
index 7e51129..c6cf709 100644 (file)
@@ -10,9 +10,8 @@
 
 #include <linux/err.h>
 #include <linux/gcd.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 
@@ -536,7 +535,7 @@ static int rescale_probe(struct platform_device *pdev)
 
        rescale = iio_priv(indio_dev);
 
-       rescale->cfg = of_device_get_match_data(dev);
+       rescale->cfg = device_get_match_data(dev);
        rescale->numerator = 1;
        rescale->denominator = 1;
        rescale->offset = 0;