From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>, linux-iio@vger.kernel.org
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v2 06/12] iio:light:cm3605: Switch to generic firmware properties.
Date: Sat, 4 Dec 2021 17:12:31 +0000 [thread overview]
Message-ID: <20211204171237.2769210-7-jic23@kernel.org> (raw)
In-Reply-To: <20211204171237.2769210-1-jic23@kernel.org>
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This enables use of other firmware types with minimal driver changes.
Part of an ongoing effort to move all IIO drivers over to generic
accessors in order to reduce the chance of of_* versions being
copied into new drivers. Also updated the headers to reflect this change
including using mod_devicetable.h for struct of_device_id definition
rather than going via of.h
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/iio/light/cm3605.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c
index 3e7fb16ab1f6..50d34a98839c 100644
--- a/drivers/iio/light/cm3605.c
+++ b/drivers/iio/light/cm3605.c
@@ -10,6 +10,7 @@
*/
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
@@ -18,7 +19,7 @@
#include <linux/init.h>
#include <linux/leds.h>
#include <linux/platform_device.h>
-#include <linux/of.h>
+#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
@@ -156,7 +157,6 @@ static int cm3605_probe(struct platform_device *pdev)
struct cm3605 *cm3605;
struct iio_dev *indio_dev;
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
enum iio_chan_type ch_type;
u32 rset;
int irq;
@@ -171,7 +171,7 @@ static int cm3605_probe(struct platform_device *pdev)
cm3605->dev = dev;
cm3605->dir = IIO_EV_DIR_FALLING;
- ret = of_property_read_u32(np, "capella,aset-resistance-ohms", &rset);
+ ret = device_property_read_u32(dev, "capella,aset-resistance-ohms", &rset);
if (ret) {
dev_info(dev, "no RSET specified, assuming 100K\n");
rset = 100000;
--
2.34.1
next prev parent reply other threads:[~2021-12-04 17:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 17:12 [PATCH v2 00/12] IIO: More of to generic fw conversions Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
2021-12-05 15:02 ` Andy Shevchenko
2021-12-05 15:36 ` Andy Shevchenko
2021-12-05 16:26 ` Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 02/12] iio:dac:ad5758: Drop unused of specific headers Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 03/12] iio:dac:dpot-dac: Swap of.h for mod_devicetable.h Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 04/12] iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 05/12] iio:pot:mcp41010: Switch to generic firmware properties Jonathan Cameron
2021-12-04 17:12 ` Jonathan Cameron [this message]
2021-12-04 17:12 ` [PATCH v2 07/12] iio:adc:max9611: " Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 08/12] iio:adc:mcp3911: " Jonathan Cameron
2021-12-05 15:07 ` Andy Shevchenko
2021-12-05 16:19 ` Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 09/12] iio:adc:ti-adc12138: " Jonathan Cameron
2021-12-05 15:12 ` Andy Shevchenko
2021-12-05 15:13 ` Andy Shevchenko
2021-12-05 16:38 ` Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 10/12] iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 11/12] iio:adc:ti-ads124s08: Drop dependency on OF Jonathan Cameron
2021-12-04 17:12 ` [PATCH v2 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies Jonathan Cameron
2021-12-05 15:15 ` Andy Shevchenko
2021-12-05 16:48 ` Jonathan Cameron
2021-12-05 15:16 ` [PATCH v2 00/12] IIO: More of to generic fw conversions Andy Shevchenko
2021-12-05 15:17 ` Andy Shevchenko
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=20211204171237.2769210-7-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).