All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rohit Sarkar <rohitsarkar5398@gmail.com>
To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: jic23@kernel.org, alexandru.Ardelean@analog.com,
	dragos.bogdan@kernel.org
Subject: [PATCH] iio: health: max30100: use generic property handler
Date: Fri, 13 Mar 2020 08:59:13 +0530	[thread overview]
Message-ID: <5e6afe0d.1c69fb81.25912.f2eb@mx.google.com> (raw)

Instead of of_property_read_xxx use device_property_read_xxx as it is
compatible with ACPI too as opposed to only device tree.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
---
 drivers/iio/health/max30100.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c
index 84010501762d..8249c6b36818 100644
--- a/drivers/iio/health/max30100.c
+++ b/drivers/iio/health/max30100.c
@@ -16,7 +16,7 @@
 #include <linux/irq.h>
 #include <linux/i2c.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
@@ -267,11 +267,10 @@ static int max30100_get_current_idx(unsigned int val, int *reg)
 static int max30100_led_init(struct max30100_data *data)
 {
 	struct device *dev = &data->client->dev;
-	struct device_node *np = dev->of_node;
 	unsigned int val[2];
 	int reg, ret;
 
-	ret = of_property_read_u32_array(np, "maxim,led-current-microamp",
+	ret = device_property_read_u32_array(dev, "maxim,led-current-microamp",
 					(unsigned int *) &val, 2);
 	if (ret) {
 		/* Default to 24 mA RED LED, 50 mA IR LED */
-- 
2.23.0.385.gbc12974a89


             reply	other threads:[~2020-03-13  3:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  3:29 Rohit Sarkar [this message]
2020-03-15 12:50 ` [PATCH] iio: health: max30100: use generic property handler Jonathan Cameron
2020-03-15 15:27   ` Rohit Sarkar
2020-03-16  8:08   ` Matt Ranostay
2020-03-16 11:56     ` 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=5e6afe0d.1c69fb81.25912.f2eb@mx.google.com \
    --to=rohitsarkar5398@gmail.com \
    --cc=alexandru.Ardelean@analog.com \
    --cc=dragos.bogdan@kernel.org \
    --cc=jic23@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.