Skip to content

Commit 61a4a84

Browse files
committed
hwmon: (ina2xx) Replace platform data with device properties
There are no in-tree users of ina2xx platform data. Drop it and support device properties instead as alternative if it should ever be needed. Reviewed-by: Tzung-Bi Shih <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
1 parent 9e60bb8 commit 61a4a84

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/hwmon/ina2xx.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@
3030
#include <linux/init.h>
3131
#include <linux/kernel.h>
3232
#include <linux/module.h>
33-
#include <linux/of.h>
33+
#include <linux/property.h>
3434
#include <linux/regmap.h>
3535
#include <linux/slab.h>
3636
#include <linux/util_macros.h>
3737

38-
#include <linux/platform_data/ina2xx.h>
39-
4038
/* common register definitions */
4139
#define INA2XX_CONFIG 0x00
4240
#define INA2XX_SHUNT_VOLTAGE 0x01 /* readonly */
@@ -643,14 +641,8 @@ static int ina2xx_probe(struct i2c_client *client)
643641
data->config = &ina2xx_config[chip];
644642
mutex_init(&data->config_lock);
645643

646-
if (of_property_read_u32(dev->of_node, "shunt-resistor", &val) < 0) {
647-
struct ina2xx_platform_data *pdata = dev_get_platdata(dev);
648-
649-
if (pdata)
650-
val = pdata->shunt_uohms;
651-
else
652-
val = INA2XX_RSHUNT_DEFAULT;
653-
}
644+
if (device_property_read_u32(dev, "shunt-resistor", &val) < 0)
645+
val = INA2XX_RSHUNT_DEFAULT;
654646

655647
ina2xx_set_shunt(data, val);
656648

@@ -667,7 +659,7 @@ static int ina2xx_probe(struct i2c_client *client)
667659
return dev_err_probe(dev, ret, "failed to enable vs regulator\n");
668660

669661
if (chip == ina226) {
670-
if (of_property_read_bool(dev->of_node, "ti,alert-polarity-active-high")) {
662+
if (device_property_read_bool(dev, "ti,alert-polarity-active-high")) {
671663
ret = ina2xx_set_alert_polarity(data,
672664
INA226_ALERT_POL_HIGH);
673665
if (ret < 0) {

0 commit comments

Comments
 (0)