From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Andreas Klinger <ak@it-klinger.de>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v1 1/1] iio: proximity: srf04: Make use of device properties
Date: Sat, 7 May 2022 15:33:06 +0100 [thread overview]
Message-ID: <20220507153306.51d5409f@jic23-huawei> (raw)
In-Reply-To: <20220504113557.59048-1-andriy.shevchenko@linux.intel.com>
On Wed, 4 May 2022 14:35:57 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> 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@linux.intel.com>
Applied.
Thanks,
Jonathan
> ---
> drivers/iio/proximity/srf04.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/proximity/srf04.c b/drivers/iio/proximity/srf04.c
> index 4e6286765f01..05015351a34a 100644
> --- a/drivers/iio/proximity/srf04.c
> +++ b/drivers/iio/proximity/srf04.c
> @@ -37,9 +37,8 @@
> #include <linux/err.h>
> #include <linux/gpio/consumer.h>
> #include <linux/kernel.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>
> #include <linux/sched.h>
> @@ -261,7 +260,7 @@ static int srf04_probe(struct platform_device *pdev)
>
> data = iio_priv(indio_dev);
> data->dev = dev;
> - data->cfg = of_match_device(of_srf04_match, dev)->data;
> + data->cfg = device_get_match_data(dev);
>
> mutex_init(&data->lock);
> init_completion(&data->rising);
> @@ -289,10 +288,8 @@ static int srf04_probe(struct platform_device *pdev)
> return PTR_ERR(data->gpiod_power);
> }
> if (data->gpiod_power) {
> -
> - if (of_property_read_u32(dev->of_node, "startup-time-ms",
> - &data->startup_time_ms))
> - data->startup_time_ms = 100;
> + data->startup_time_ms = 100;
> + device_property_read_u32(dev, "startup-time-ms", &data->startup_time_ms);
> dev_dbg(dev, "using power gpio: startup-time-ms=%d\n",
> data->startup_time_ms);
> }
prev parent reply other threads:[~2022-05-07 14:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-04 11:35 [PATCH v1 1/1] iio: proximity: srf04: Make use of device properties Andy Shevchenko
2022-05-07 14:33 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220507153306.51d5409f@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=ak@it-klinger.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox