History

hwmon: (ina2xx) drop unused platform data

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.

Bartosz Golaszewski committed 7 months ago

Commit 331e5fd1 parent b95ba513 files · +4 −37Browse files

Unified · Split

3 files
  1. drivers/hwmon/ina209.c +2 −9
  2. drivers/iio/adc/ina2xx-adc.c +2 −12
  3. include/linux/platform_data/ina2xx.h +0 −16
drivers/hwmon/ina209.c+2−9
@@ -27,8 +27,6 @@ · 26 unmodified lines
2727 #include <linux/hwmon.h>
2828 #include <linux/hwmon-sysfs.h>
2929
30−#include <linux/platform_data/ina2xx.h>
31−
3230 /* register definitions */
3331 #define INA209_CONFIGURATION 0x00
3432 #define INA209_STATUS 0x01
@@ -487,7 +485,6 @@ static void ina209_restore_conf(struct i2c_client *client, · 452 unmodified lines
487485 static int ina209_init_client(struct i2c_client *client,
488486 struct ina209_data *data)
489487 {
490− struct ina2xx_platform_data *pdata = dev_get_platdata(&client->dev);
491488 u32 shunt;
492489 int reg;
493490
@@ -501,12 +498,8 @@ static int ina209_init_client(struct i2c_client *client, · 7 unmodified lines
501498 return reg;
502499 data->config_orig = reg;
503500
504− if (pdata) {
505− if (pdata->shunt_uohms <= 0)
506− return -EINVAL;
507− shunt = pdata->shunt_uohms;
508− } else if (!of_property_read_u32(client->dev.of_node, "shunt-resistor",
509− &shunt)) {
501+ if (!of_property_read_u32(client->dev.of_node, "shunt-resistor",
502+ &shunt)) {
510503 if (shunt == 0)
511504 return -EINVAL;
512505 } else {
drivers/iio/adc/ina2xx-adc.c+2−12
@@ -33,8 +33,6 @@ · 32 unmodified lines
3333 #include <linux/sched/task.h>
3434 #include <linux/util_macros.h>
3535
36−#include <linux/platform_data/ina2xx.h>
37−
3836 /* INA2XX registers definition */
3937 #define INA2XX_CONFIG 0x00
4038 #define INA2XX_SHUNT_VOLTAGE 0x01 /* readonly */
@@ -980,16 +978,8 @@ static int ina2xx_probe(struct i2c_client *client) · 939 unmodified lines
980978
981979 mutex_init(&chip->state_lock);
982980
983− if (of_property_read_u32(client->dev.of_node,
984− "shunt-resistor", &val) < 0) {
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− }
981+ if (of_property_read_u32(client->dev.of_node, "shunt-resistor", &val) < 0)
982+ val = INA2XX_RSHUNT_DEFAULT;
993983
994984 ret = set_shunt_resistor(chip, val);
995985 if (ret)
include/linux/platform_data/ina2xx.h+0−16
@@ -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−};