提交 59cf4243 编写于 作者: J Jean Delvare

hwmon: (ntc_thermistor) Fix dependencies

In commit 9e8269de, support was added for ntc_thermistor devices being
declared in the device tree and implemented on top of IIO. With that
change, a dependency was added to the ntc_thermistor driver:

	depends on (!OF && !IIO) || (OF && IIO)

This construct has the drawback that the driver can no longer be
selected when OF is set and IIO isn't, nor when IIO is set and OF is
not. This is a regression for the original users of the driver.

As the new code depends on IIO and is useless without OF, include it
only if both are enabled, and set the dependencies accordingly. This
is clearer, more simple and more correct.
Signed-off-by: NJean Delvare <jdelvare@suse.de>
Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: Doug Anderson <dianders@chromium.org>
上级 01325145
...@@ -1053,7 +1053,7 @@ config SENSORS_PC87427 ...@@ -1053,7 +1053,7 @@ config SENSORS_PC87427
config SENSORS_NTC_THERMISTOR config SENSORS_NTC_THERMISTOR
tristate "NTC thermistor support" tristate "NTC thermistor support"
depends on (!OF && !IIO) || (OF && IIO) depends on !OF || IIO=n || IIO
help help
This driver supports NTC thermistors sensor reading and its This driver supports NTC thermistors sensor reading and its
interpretation. The driver can also monitor the temperature and interpretation. The driver can also monitor the temperature and
......
...@@ -141,7 +141,7 @@ struct ntc_data { ...@@ -141,7 +141,7 @@ struct ntc_data {
char name[PLATFORM_NAME_SIZE]; char name[PLATFORM_NAME_SIZE];
}; };
#ifdef CONFIG_OF #if defined(CONFIG_OF) && IS_ENABLED(CONFIG_IIO)
static int ntc_adc_iio_read(struct ntc_thermistor_platform_data *pdata) static int ntc_adc_iio_read(struct ntc_thermistor_platform_data *pdata)
{ {
struct iio_channel *channel = pdata->chan; struct iio_channel *channel = pdata->chan;
...@@ -223,6 +223,8 @@ ntc_thermistor_parse_dt(struct platform_device *pdev) ...@@ -223,6 +223,8 @@ ntc_thermistor_parse_dt(struct platform_device *pdev)
return NULL; return NULL;
} }
#define ntc_match NULL
static void ntc_iio_channel_release(struct ntc_thermistor_platform_data *pdata) static void ntc_iio_channel_release(struct ntc_thermistor_platform_data *pdata)
{ } { }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册