[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200513185615.508236-17-sebastian.reichel@collabora.com>
Date: Wed, 13 May 2020 20:56:12 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Sebastian Reichel <sre@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>
Cc: linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel@...labora.com,
Sebastian Reichel <sebastian.reichel@...labora.com>
Subject: [PATCHv1 16/19] power: supply: sbs-battery: switch from of_property_* to device_property_*
Switch from DT specific of_property_* API to generic and more
modern device_property_* API.
Signed-off-by: Sebastian Reichel <sebastian.reichel@...labora.com>
---
drivers/power/supply/sbs-battery.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index 7c6905a486da..73dfe526c867 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -14,7 +14,7 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/of.h>
+#include <linux/property.h>
#include <linux/of_device.h>
#include <linux/power/sbs-battery.h>
#include <linux/power_supply.h>
@@ -1016,7 +1016,7 @@ static int sbs_probe(struct i2c_client *client,
if (!chip)
return -ENOMEM;
- chip->flags = (u32)(uintptr_t)of_device_get_match_data(&client->dev);
+ chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev);
chip->client = client;
chip->enable_detection = false;
psy_cfg.of_node = client->dev.of_node;
@@ -1027,13 +1027,13 @@ static int sbs_probe(struct i2c_client *client,
/* use pdata if available, fall back to DT properties,
* or hardcoded defaults if not
*/
- rc = of_property_read_u32(client->dev.of_node, "sbs,i2c-retry-count",
- &chip->i2c_retry_count);
+ rc = device_property_read_u32(&client->dev, "sbs,i2c-retry-count",
+ &chip->i2c_retry_count);
if (rc)
chip->i2c_retry_count = 0;
- rc = of_property_read_u32(client->dev.of_node, "sbs,poll-retry-count",
- &chip->poll_retry_count);
+ rc = device_property_read_u32(&client->dev, "sbs,poll-retry-count",
+ &chip->poll_retry_count);
if (rc)
chip->poll_retry_count = 0;
@@ -1043,7 +1043,7 @@ static int sbs_probe(struct i2c_client *client,
}
chip->i2c_retry_count = chip->i2c_retry_count + 1;
- chip->charger_broadcasts = !of_property_read_bool(client->dev.of_node,
+ chip->charger_broadcasts = !device_property_read_bool(&client->dev,
"sbs,disable-charger-broadcasts");
chip->gpio_detect = devm_gpiod_get_optional(&client->dev,
--
2.26.2
Powered by blists - more mailing lists