Commit bb8759f2 authored by Rohit Sarkar's avatar Rohit Sarkar Committed by Jonathan Cameron

iio: health: max30100: use generic property handler

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: default avatarRohit Sarkar <rohitsarkar5398@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 1579fc06
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/of.h> #include <linux/property.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/buffer.h> #include <linux/iio/buffer.h>
...@@ -267,11 +267,10 @@ static int max30100_get_current_idx(unsigned int val, int *reg) ...@@ -267,11 +267,10 @@ static int max30100_get_current_idx(unsigned int val, int *reg)
static int max30100_led_init(struct max30100_data *data) static int max30100_led_init(struct max30100_data *data)
{ {
struct device *dev = &data->client->dev; struct device *dev = &data->client->dev;
struct device_node *np = dev->of_node;
unsigned int val[2]; unsigned int val[2];
int reg, ret; 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); (unsigned int *) &val, 2);
if (ret) { if (ret) {
/* Default to 24 mA RED LED, 50 mA IR LED */ /* Default to 24 mA RED LED, 50 mA IR LED */
...@@ -502,7 +501,7 @@ MODULE_DEVICE_TABLE(of, max30100_dt_ids); ...@@ -502,7 +501,7 @@ MODULE_DEVICE_TABLE(of, max30100_dt_ids);
static struct i2c_driver max30100_driver = { static struct i2c_driver max30100_driver = {
.driver = { .driver = {
.name = MAX30100_DRV_NAME, .name = MAX30100_DRV_NAME,
.of_match_table = of_match_ptr(max30100_dt_ids), .of_match_table = max30100_dt_ids,
}, },
.probe = max30100_probe, .probe = max30100_probe,
.remove = max30100_remove, .remove = max30100_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment