[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ylgwhu9zdmwwYnAq@shaak>
Date: Thu, 14 Apr 2022 10:32:38 -0400
From: Liam Beguin <liambeguin@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Peter Rosin <peda@...ntia.se>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v1 1/1] iio: afe: rescale: Make use of device properties
Hi Andy,
On Wed, Apr 13, 2022 at 10:01:17PM +0300, Andy Shevchenko wrote:
> 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@...ux.intel.com>
> ---
> drivers/iio/afe/Kconfig | 1 -
> drivers/iio/afe/iio-rescale.c | 5 ++---
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/afe/Kconfig b/drivers/iio/afe/Kconfig
> index 4fa397822cff..9a1d95c1c7ed 100644
> --- a/drivers/iio/afe/Kconfig
> +++ b/drivers/iio/afe/Kconfig
> @@ -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
> diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c
> index 7e511293d6d1..c6cf709f0f05 100644
> --- a/drivers/iio/afe/iio-rescale.c
> +++ b/drivers/iio/afe/iio-rescale.c
> @@ -10,9 +10,8 @@
>
> #include <linux/err.h>
> #include <linux/gcd.h>
> +#include <linux/mod_devicetable.h>
Is this really needed?
device_get_match_data() is already defined in <linux/property.h>
Cheers,
Liam
> #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;
> --
> 2.35.1
>
Powered by blists - more mailing lists