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.
Unified · Split
| @@ -27,8 +27,6 @@ · 26 unmodified lines | |||
| 27 | #include <linux/hwmon.h> | 27 | #include <linux/hwmon.h> |
| 28 | #include <linux/hwmon-sysfs.h> | 28 | #include <linux/hwmon-sysfs.h> |
| 29 | 29 | ||
| 30 | #include <linux/platform_data/ina2xx.h> | ||
| 31 | |||
| 32 | /* register definitions */ | 30 | /* register definitions */ |
| 33 | #define INA209_CONFIGURATION 0x00 | 31 | #define INA209_CONFIGURATION 0x00 |
| 34 | #define INA209_STATUS 0x01 | 32 | #define INA209_STATUS 0x01 |
| @@ -487,7 +485,6 @@ static void ina209_restore_conf(struct i2c_client *client, · 452 unmodified lines | |||
| 487 | static int ina209_init_client(struct i2c_client *client, | 485 | static int ina209_init_client(struct i2c_client *client, |
| 488 | struct ina209_data *data) | 486 | struct ina209_data *data) |
| 489 | { | 487 | { |
| 490 | struct ina2xx_platform_data *pdata = dev_get_platdata(&client->dev); | ||
| 491 | u32 shunt; | 488 | u32 shunt; |
| 492 | int reg; | 489 | int reg; |
| 493 | 490 | ||
| @@ -501,12 +498,8 @@ static int ina209_init_client(struct i2c_client *client, · 7 unmodified lines | |||
| 501 | return reg; | 498 | return reg; |
| 502 | data->config_orig = reg; | 499 | data->config_orig = reg; |
| 503 | 500 | ||
| 504 | if (pdata) { | 501 | if (!of_property_read_u32(client->dev.of_node, "shunt-resistor", |
| 505 | if (pdata->shunt_uohms <= 0) | 502 | &shunt)) { |
| 506 | return -EINVAL; | ||
| 507 | shunt = pdata->shunt_uohms; | ||
| 508 | } else if (!of_property_read_u32(client->dev.of_node, "shunt-resistor", | ||
| 509 | &shunt)) { | ||
| 510 | if (shunt == 0) | 503 | if (shunt == 0) |
| 511 | return -EINVAL; | 504 | return -EINVAL; |
| 512 | } else { | 505 | } else { |
| @@ -33,8 +33,6 @@ · 32 unmodified lines | |||
| 33 | #include <linux/sched/task.h> | 33 | #include <linux/sched/task.h> |
| 34 | #include <linux/util_macros.h> | 34 | #include <linux/util_macros.h> |
| 35 | 35 | ||
| 36 | #include <linux/platform_data/ina2xx.h> | ||
| 37 | |||
| 38 | /* INA2XX registers definition */ | 36 | /* INA2XX registers definition */ |
| 39 | #define INA2XX_CONFIG 0x00 | 37 | #define INA2XX_CONFIG 0x00 |
| 40 | #define INA2XX_SHUNT_VOLTAGE 0x01 /* readonly */ | 38 | #define INA2XX_SHUNT_VOLTAGE 0x01 /* readonly */ |
| @@ -980,16 +978,8 @@ static int ina2xx_probe(struct i2c_client *client) · 939 unmodified lines | |||
| 980 | 978 | ||
| 981 | mutex_init(&chip->state_lock); | 979 | mutex_init(&chip->state_lock); |
| 982 | 980 | ||
| 983 | if (of_property_read_u32(client->dev.of_node, | 981 | if (of_property_read_u32(client->dev.of_node, "shunt-resistor", &val) < 0) |
| 984 | "shunt-resistor", &val) < 0) { | 982 | val = INA2XX_RSHUNT_DEFAULT; |
| 985 | struct ina2xx_platform_data *pdata = | ||
| 986 | dev_get_platdata(&client->dev); | ||
| 987 | |||
| 988 | if (pdata) | ||
| 989 | val = pdata->shunt_uohms; | ||
| 990 | else | ||
| 991 | val = INA2XX_RSHUNT_DEFAULT; | ||
| 992 | } | ||
| 993 | 983 | ||
| 994 | ret = set_shunt_resistor(chip, val); | 984 | ret = set_shunt_resistor(chip, val); |
| 995 | if (ret) | 985 | if (ret) |
| @@ -1,16 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
| 2 | /* | ||
| 3 | * Driver for Texas Instruments INA219, INA226 power monitor chips | ||
| 4 | * | ||
| 5 | * Copyright (C) 2012 Lothar Felten <lothar.felten@gmail.com> | ||
| 6 | * | ||
| 7 | * For further information, see the Documentation/hwmon/ina2xx.rst file. | ||
| 8 | */ | ||
| 9 | |||
| 10 | /** | ||
| 11 | * struct ina2xx_platform_data - ina2xx info | ||
| 12 | * @shunt_uohms shunt resistance in microohms | ||
| 13 | */ | ||
| 14 | struct ina2xx_platform_data { | ||
| 15 | long shunt_uohms; | ||
| 16 | }; | ||