summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2025-08-31 14:53:58 -0700
committerGuenter Roeck <linux@roeck-us.net>2025-09-07 16:33:58 -0700
commit9a8113a5c6eb23aaaafa9bde043b76a22a3a4e44 (patch)
tree372e4e7b7b6d4c929dadbebc450e9bd8803970bb
parent0bcd01f757bc06471c82a137eafee281ef1b6e38 (diff)
downloadlinux-next-9a8113a5c6eb23aaaafa9bde043b76a22a3a4e44.tar.gz
linux-next-9a8113a5c6eb23aaaafa9bde043b76a22a3a4e44.zip
hwmon: (ina238) Drop platform data support
There are no in-tree users of ina2xx platform data. Drop support for it. The driver already supports device properties which can be used as alternative if needed. Also remove reference to the non-existing shunt_resistor sysfs attribute from the driver documentation. Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--Documentation/hwmon/ina238.rst8
-rw-r--r--drivers/hwmon/ina238.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/Documentation/hwmon/ina238.rst b/Documentation/hwmon/ina238.rst
index 9a24da4786a4..9b830e37c986 100644
--- a/Documentation/hwmon/ina238.rst
+++ b/Documentation/hwmon/ina238.rst
@@ -29,10 +29,10 @@ The INA238 is a current shunt, power and temperature monitor with an I2C
interface. It includes a number of programmable functions including alerts,
conversion rate, sample averaging and selectable shunt voltage accuracy.
-The shunt value in micro-ohms can be set via platform data or device tree at
-compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
-refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
-if the device tree is used.
+The shunt value in micro-ohms can be set via device properties, either from
+platform code or from device tree data. Please refer to
+Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings if
+device tree is used.
Sysfs entries
-------------
diff --git a/drivers/hwmon/ina238.c b/drivers/hwmon/ina238.c
index 59a2c8889fa2..22e2b862fb33 100644
--- a/drivers/hwmon/ina238.c
+++ b/drivers/hwmon/ina238.c
@@ -16,8 +16,6 @@
#include <linux/of.h>
#include <linux/regmap.h>
-#include <linux/platform_data/ina2xx.h>
-
/* INA238 register definitions */
#define INA238_CONFIG 0x0
#define INA238_ADC_CONFIG 0x1
@@ -745,7 +743,6 @@ ATTRIBUTE_GROUPS(ina238);
static int ina238_probe(struct i2c_client *client)
{
- struct ina2xx_platform_data *pdata = dev_get_platdata(&client->dev);
struct device *dev = &client->dev;
struct device *hwmon_dev;
struct ina238_data *data;
@@ -772,9 +769,8 @@ static int ina238_probe(struct i2c_client *client)
}
/* load shunt value */
- data->rshunt = INA238_RSHUNT_DEFAULT;
- if (device_property_read_u32(dev, "shunt-resistor", &data->rshunt) < 0 && pdata)
- data->rshunt = pdata->shunt_uohms;
+ if (device_property_read_u32(dev, "shunt-resistor", &data->rshunt) < 0)
+ data->rshunt = INA238_RSHUNT_DEFAULT;
if (data->rshunt == 0) {
dev_err(dev, "invalid shunt resister value %u\n", data->rshunt);
return -EINVAL;