Commit d272cfc3 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220413190117.29814-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 61c8686c
...@@ -8,7 +8,6 @@ menu "Analog Front Ends" ...@@ -8,7 +8,6 @@ menu "Analog Front Ends"
config IIO_RESCALE config IIO_RESCALE
tristate "IIO rescale" tristate "IIO rescale"
depends on OF || COMPILE_TEST
help help
Say yes here to build support for the IIO rescaling Say yes here to build support for the IIO rescaling
that handles voltage dividers, current sense shunts and that handles voltage dividers, current sense shunts and
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/gcd.h> #include <linux/gcd.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h> #include <linux/property.h>
...@@ -536,7 +535,7 @@ static int rescale_probe(struct platform_device *pdev) ...@@ -536,7 +535,7 @@ static int rescale_probe(struct platform_device *pdev)
rescale = iio_priv(indio_dev); rescale = iio_priv(indio_dev);
rescale->cfg = of_device_get_match_data(dev); rescale->cfg = device_get_match_data(dev);
rescale->numerator = 1; rescale->numerator = 1;
rescale->denominator = 1; rescale->denominator = 1;
rescale->offset = 0; rescale->offset = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment