aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <[email protected]>2024-07-23 13:23:30 -0700
committerGuenter Roeck <[email protected]>2024-08-30 08:34:23 -0700
commit61a4a8414e1c6331a5a2fcfd235e6252c985f9d7 (patch)
treeeb5e4e323b1acc58a420d76103906f3fd17f775c
parent9e60bb811f582a13a1f8346675f270db7e48404c (diff)
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]>
-rw-r--r--drivers/hwmon/ina2xx.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index a6a619a85eb6..897657f8d685 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -30,13 +30,11 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/of.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/util_macros.h>
-#include <linux/platform_data/ina2xx.h>
-
/* common register definitions */
#define INA2XX_CONFIG 0x00
#define INA2XX_SHUNT_VOLTAGE 0x01 /* readonly */
@@ -643,14 +641,8 @@ static int ina2xx_probe(struct i2c_client *client)
data->config = &ina2xx_config[chip];
mutex_init(&data->config_lock);
- if (of_property_read_u32(dev->of_node, "shunt-resistor", &val) < 0) {
- struct ina2xx_platform_data *pdata = dev_get_platdata(dev);
-
- if (pdata)
- val = pdata->shunt_uohms;
- else
- val = INA2XX_RSHUNT_DEFAULT;
- }
+ if (device_property_read_u32(dev, "shunt-resistor", &val) < 0)
+ val = INA2XX_RSHUNT_DEFAULT;
ina2xx_set_shunt(data, val);
@@ -667,7 +659,7 @@ static int ina2xx_probe(struct i2c_client *client)
return dev_err_probe(dev, ret, "failed to enable vs regulator\n");
if (chip == ina226) {
- if (of_property_read_bool(dev->of_node, "ti,alert-polarity-active-high")) {
+ if (device_property_read_bool(dev, "ti,alert-polarity-active-high")) {
ret = ina2xx_set_alert_polarity(data,
INA226_ALERT_POL_HIGH);
if (ret < 0) {