Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Alisa-Dariana Roman" <alisa.roman@analog.com>,
	"Haibo Chen" <haibo.chen@nxp.com>,
	"Sean Nyekjaer" <sean@geanix.com>,
	"Andreas Klinger" <ak@it-klinger.de>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: [PATCH 8/8] iio: adc: hx711: Switch from of specific to fwnode property handling.
Date: Sun, 18 Feb 2024 17:27:31 +0000	[thread overview]
Message-ID: <20240218172731.1023367-9-jic23@kernel.org> (raw)
In-Reply-To: <20240218172731.1023367-1-jic23@kernel.org>

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Allows driver to be used with other firmware types and removes an
example that might be copied into new IIO drivers.

Cc: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/adc/hx711.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index c80c55fb8c6c..fef97c1d226a 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -7,7 +7,7 @@
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/slab.h>
@@ -459,7 +459,6 @@ static const struct iio_chan_spec hx711_chan_spec[] = {
 static int hx711_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev->of_node;
 	struct hx711_data *hx711_data;
 	struct iio_dev *indio_dev;
 	int ret;
@@ -533,7 +532,7 @@ static int hx711_probe(struct platform_device *pdev)
 	hx711_data->gain_chan_a = 128;
 
 	hx711_data->clock_frequency = 400000;
-	ret = of_property_read_u32(np, "clock-frequency",
+	ret = device_property_read_u32(&pdev->dev, "clock-frequency",
 					&hx711_data->clock_frequency);
 
 	/*
-- 
2.43.2


  parent reply	other threads:[~2024-02-18 17:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-18 17:27 [PATCH 0/8] IIO: Convert DT specific handling over to fwnode Jonathan Cameron
2024-02-18 17:27 ` [PATCH 1/8] iio: adc: fsl-imx25-gcq: Switch from of specific handing to fwnode based Jonathan Cameron
2024-02-18 17:27 ` [PATCH 2/8] iio: adc: fsl-imx25-gcq: Use devm_* and dev_err_probe() to simplify probe Jonathan Cameron
2024-02-18 17:27 ` [PATCH 3/8] iio: adc: ad7124: Switch from of specific to fwnode based property handling Jonathan Cameron
2024-02-19  9:24   ` Nuno Sá
2024-02-19 11:59     ` Andy Shevchenko
2024-02-19 11:58   ` Andy Shevchenko
2024-02-24 15:19     ` Jonathan Cameron
2024-02-18 17:27 ` [PATCH 4/8] iio: adc: ad7292: Switch from of specific to fwnode " Jonathan Cameron
2024-02-19  9:26   ` Nuno Sá
2024-02-18 17:27 ` [PATCH 5/8] iio: adc: ad7192: Convert " Jonathan Cameron
2024-02-19  9:30   ` Nuno Sá
2024-02-19 12:02   ` Andy Shevchenko
2024-02-18 17:27 ` [PATCH 6/8] iio: accel: mma8452: Switch " Jonathan Cameron
2024-02-23 11:10   ` Bough Chen
2024-02-18 17:27 ` [PATCH 7/8] iio: accel: fxls8962af: Switch from of specific to fwnode based properties Jonathan Cameron
2024-02-19 12:03   ` Andy Shevchenko
2024-02-18 17:27 ` Jonathan Cameron [this message]
2024-02-19 12:06   ` [PATCH 8/8] iio: adc: hx711: Switch from of specific to fwnode property handling Andy Shevchenko
2024-02-19 12:06 ` [PATCH 0/8] IIO: Convert DT specific handling over to fwnode Andy Shevchenko
2024-02-24 15:31   ` Jonathan Cameron

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=20240218172731.1023367-9-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=ak@it-klinger.de \
    --cc=alisa.roman@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=haibo.chen@nxp.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sean@geanix.com \
    /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