Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+6 -10
+4 -4
Documentation/hwmon/ina238.rst
··· 29 29 interface. It includes a number of programmable functions including alerts, 30 30 conversion rate, sample averaging and selectable shunt voltage accuracy. 31 31 32 - The shunt value in micro-ohms can be set via platform data or device tree at 33 - compile-time or via the shunt_resistor attribute in sysfs at run-time. Please 34 - refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings 35 - if the device tree is used. 32 + The shunt value in micro-ohms can be set via device properties, either from 33 + platform code or from device tree data. Please refer to 34 + Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings if 35 + device tree is used. 36 36 37 37 Sysfs entries 38 38 -------------
+2 -6
drivers/hwmon/ina238.c
··· 16 16 #include <linux/of.h> 17 17 #include <linux/regmap.h> 18 18 19 - #include <linux/platform_data/ina2xx.h> 20 - 21 19 /* INA238 register definitions */ 22 20 #define INA238_CONFIG 0x0 23 21 #define INA238_ADC_CONFIG 0x1 ··· 743 745 744 746 static int ina238_probe(struct i2c_client *client) 745 747 { 746 - struct ina2xx_platform_data *pdata = dev_get_platdata(&client->dev); 747 748 struct device *dev = &client->dev; 748 749 struct device *hwmon_dev; 749 750 struct ina238_data *data; ··· 769 772 } 770 773 771 774 /* load shunt value */ 772 - data->rshunt = INA238_RSHUNT_DEFAULT; 773 - if (device_property_read_u32(dev, "shunt-resistor", &data->rshunt) < 0 && pdata) 774 - data->rshunt = pdata->shunt_uohms; 775 + if (device_property_read_u32(dev, "shunt-resistor", &data->rshunt) < 0) 776 + data->rshunt = INA238_RSHUNT_DEFAULT; 775 777 if (data->rshunt == 0) { 776 778 dev_err(dev, "invalid shunt resister value %u\n", data->rshunt); 777 779 return -EINVAL;