]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (ina2xx) drop unused platform data
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 26 Mar 2026 09:30:00 +0000 (10:30 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Mar 2026 02:45:06 +0000 (19:45 -0700)
Nobody defines struct ina2xx_platform_data. Remove platform data support
from the drivers which still have it (it's effectively dead code) and
remove the header.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://lore.kernel.org/r/20260326-drop-ina2xx-pdata-v1-1-c159437bb2df@oss.qualcomm.com
[groeck: Fixed continuation line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina209.c
drivers/iio/adc/ina2xx-adc.c
include/linux/platform_data/ina2xx.h [deleted file]

index bd7b3380d847af4439327f0753745fd832e3e22c..a116f1600e810f4d8869e4684e24b3b12b677ef5 100644 (file)
@@ -27,8 +27,6 @@
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
 
-#include <linux/platform_data/ina2xx.h>
-
 /* register definitions */
 #define INA209_CONFIGURATION           0x00
 #define INA209_STATUS                  0x01
@@ -487,7 +485,6 @@ static void ina209_restore_conf(struct i2c_client *client,
 static int ina209_init_client(struct i2c_client *client,
                              struct ina209_data *data)
 {
-       struct ina2xx_platform_data *pdata = dev_get_platdata(&client->dev);
        u32 shunt;
        int reg;
 
@@ -501,12 +498,8 @@ static int ina209_init_client(struct i2c_client *client,
                return reg;
        data->config_orig = reg;
 
-       if (pdata) {
-               if (pdata->shunt_uohms <= 0)
-                       return -EINVAL;
-               shunt = pdata->shunt_uohms;
-       } else if (!of_property_read_u32(client->dev.of_node, "shunt-resistor",
-                                        &shunt)) {
+       if (!of_property_read_u32(client->dev.of_node, "shunt-resistor",
+                                 &shunt)) {
                if (shunt == 0)
                        return -EINVAL;
        } else {
index 857e1b69d6cd4d65d7ebe5de222fe92875eccdcc..c6cded508738f95e5001ebd276edfa07890e217c 100644 (file)
@@ -33,8 +33,6 @@
 #include <linux/sched/task.h>
 #include <linux/util_macros.h>
 
-#include <linux/platform_data/ina2xx.h>
-
 /* INA2XX registers definition */
 #define INA2XX_CONFIG                   0x00
 #define INA2XX_SHUNT_VOLTAGE            0x01   /* readonly */
@@ -980,16 +978,8 @@ static int ina2xx_probe(struct i2c_client *client)
 
        mutex_init(&chip->state_lock);
 
-       if (of_property_read_u32(client->dev.of_node,
-                                "shunt-resistor", &val) < 0) {
-               struct ina2xx_platform_data *pdata =
-                   dev_get_platdata(&client->dev);
-
-               if (pdata)
-                       val = pdata->shunt_uohms;
-               else
-                       val = INA2XX_RSHUNT_DEFAULT;
-       }
+       if (of_property_read_u32(client->dev.of_node, "shunt-resistor", &val) < 0)
+               val = INA2XX_RSHUNT_DEFAULT;
 
        ret = set_shunt_resistor(chip, val);
        if (ret)
diff --git a/include/linux/platform_data/ina2xx.h b/include/linux/platform_data/ina2xx.h
deleted file mode 100644 (file)
index 2aa5ee9..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Driver for Texas Instruments INA219, INA226 power monitor chips
- *
- * Copyright (C) 2012 Lothar Felten <lothar.felten@gmail.com>
- *
- * For further information, see the Documentation/hwmon/ina2xx.rst file.
- */
-
-/**
- * struct ina2xx_platform_data - ina2xx info
- * @shunt_uohms                shunt resistance in microohms
- */
-struct ina2xx_platform_data {
-       long shunt_uohms;
-};