diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-11-25 05:08:39 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2021-12-27 02:02:05 +0300 |
commit | 76f240ff9523673106385120bc9af15ada9ca2f8 (patch) | |
tree | 802a1385d206d2d4e44bb18c1803183a1312999d /drivers/hwmon | |
parent | 11a24ca7e34d968991a7d437b950d1924396bd81 (diff) | |
download | linux-76f240ff9523673106385120bc9af15ada9ca2f8.tar.xz |
hwmon: (ntc_thermistor) Drop get_ohm()
Nothing in the kernel (this driver) is using the callback to
read ohms directly. We always read a voltage and convert it
to a resistance. Drop this callback.
Cc: Peter Rosin <peda@axentia.se>
Cc: Chris Lesiak <chris.lesiak@licor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20211125020841.3616359-3-linus.walleij@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 034ef55d0706..8a78e899fa12 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c @@ -28,10 +28,6 @@ enum ntc_thermistor_type { struct ntc_thermistor_platform_data { /* - * One (not both) of read_uV and read_ohm should be provided and only - * one of the two should be provided. - * Both functions should return negative value for an error case. - * * pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use * read_uV() * @@ -50,8 +46,6 @@ struct ntc_thermistor_platform_data { unsigned int pulldown_ohm; enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; struct iio_channel *chan; - - int (*read_ohm)(void); }; struct ntc_compensation { @@ -600,9 +594,6 @@ static int ntc_thermistor_get_ohm(struct ntc_data *data) { int read_uv; - if (data->pdata->read_ohm) - return data->pdata->read_ohm(); - if (data->pdata->read_uv) { read_uv = data->pdata->read_uv(data->pdata); if (read_uv < 0) @@ -690,19 +681,11 @@ static int ntc_thermistor_probe(struct platform_device *pdev) return -ENODEV; } - /* Either one of the two is required. */ - if (!pdata->read_uv && !pdata->read_ohm) { - dev_err(dev, - "Both read_uv and read_ohm missing. Need either one of the two.\n"); + if (!pdata->read_uv) { + dev_err(dev, "read_uv missing\n"); return -EINVAL; } - if (pdata->read_uv && pdata->read_ohm) { - dev_warn(dev, - "Only one of read_uv and read_ohm is needed; ignoring read_uv.\n"); - pdata->read_uv = NULL; - } - if (pdata->read_uv && (pdata->pullup_uv == 0 || (pdata->pullup_ohm == 0 && pdata->connect == NTC_CONNECTED_GROUND) || |