Skip to content

Commit 03b758b

Browse files
committed
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 <[email protected]>
1 parent 182fc88 commit 03b758b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/power/supply/sbs-battery.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/interrupt.h>
1515
#include <linux/kernel.h>
1616
#include <linux/module.h>
17-
#include <linux/of.h>
17+
#include <linux/property.h>
1818
#include <linux/of_device.h>
1919
#include <linux/power/sbs-battery.h>
2020
#include <linux/power_supply.h>
@@ -1016,7 +1016,7 @@ static int sbs_probe(struct i2c_client *client,
10161016
if (!chip)
10171017
return -ENOMEM;
10181018

1019-
chip->flags = (u32)(uintptr_t)of_device_get_match_data(&client->dev);
1019+
chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev);
10201020
chip->client = client;
10211021
chip->enable_detection = false;
10221022
psy_cfg.of_node = client->dev.of_node;
@@ -1027,13 +1027,13 @@ static int sbs_probe(struct i2c_client *client,
10271027
/* use pdata if available, fall back to DT properties,
10281028
* or hardcoded defaults if not
10291029
*/
1030-
rc = of_property_read_u32(client->dev.of_node, "sbs,i2c-retry-count",
1031-
&chip->i2c_retry_count);
1030+
rc = device_property_read_u32(&client->dev, "sbs,i2c-retry-count",
1031+
&chip->i2c_retry_count);
10321032
if (rc)
10331033
chip->i2c_retry_count = 0;
10341034

1035-
rc = of_property_read_u32(client->dev.of_node, "sbs,poll-retry-count",
1036-
&chip->poll_retry_count);
1035+
rc = device_property_read_u32(&client->dev, "sbs,poll-retry-count",
1036+
&chip->poll_retry_count);
10371037
if (rc)
10381038
chip->poll_retry_count = 0;
10391039

@@ -1043,7 +1043,7 @@ static int sbs_probe(struct i2c_client *client,
10431043
}
10441044
chip->i2c_retry_count = chip->i2c_retry_count + 1;
10451045

1046-
chip->charger_broadcasts = !of_property_read_bool(client->dev.of_node,
1046+
chip->charger_broadcasts = !device_property_read_bool(&client->dev,
10471047
"sbs,disable-charger-broadcasts");
10481048

10491049
chip->gpio_detect = devm_gpiod_get_optional(&client->dev,

0 commit comments

Comments
 (0)