14
14
#include <linux/interrupt.h>
15
15
#include <linux/kernel.h>
16
16
#include <linux/module.h>
17
- #include <linux/of .h>
17
+ #include <linux/property .h>
18
18
#include <linux/of_device.h>
19
19
#include <linux/power/sbs-battery.h>
20
20
#include <linux/power_supply.h>
@@ -1016,7 +1016,7 @@ static int sbs_probe(struct i2c_client *client,
1016
1016
if (!chip )
1017
1017
return - ENOMEM ;
1018
1018
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 );
1020
1020
chip -> client = client ;
1021
1021
chip -> enable_detection = false;
1022
1022
psy_cfg .of_node = client -> dev .of_node ;
@@ -1027,13 +1027,13 @@ static int sbs_probe(struct i2c_client *client,
1027
1027
/* use pdata if available, fall back to DT properties,
1028
1028
* or hardcoded defaults if not
1029
1029
*/
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 );
1032
1032
if (rc )
1033
1033
chip -> i2c_retry_count = 0 ;
1034
1034
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 );
1037
1037
if (rc )
1038
1038
chip -> poll_retry_count = 0 ;
1039
1039
@@ -1043,7 +1043,7 @@ static int sbs_probe(struct i2c_client *client,
1043
1043
}
1044
1044
chip -> i2c_retry_count = chip -> i2c_retry_count + 1 ;
1045
1045
1046
- chip -> charger_broadcasts = !of_property_read_bool ( client -> dev . of_node ,
1046
+ chip -> charger_broadcasts = !device_property_read_bool ( & client -> dev ,
1047
1047
"sbs,disable-charger-broadcasts" );
1048
1048
1049
1049
chip -> gpio_detect = devm_gpiod_get_optional (& client -> dev ,
0 commit comments