aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ntc_thermistor.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-06-02 02:05:42 -0400
committerIngo Molnar <mingo@kernel.org>2015-06-02 02:05:42 -0400
commitf407a8258610169cd8e975dba7f0b2824562014c (patch)
tree6c87b2d168a4665411a9e16b9f481599f2db25bc /drivers/hwmon/ntc_thermistor.c
parent960d447b94b22ceba286917056871d1dac8da697 (diff)
parentc46a024ea5eb0165114dbbc8c82c29b7bcf66e71 (diff)
Merge branch 'linus' into sched/core, to resolve conflict
Conflicts: arch/sparc/include/asm/topology_64.h Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/hwmon/ntc_thermistor.c')
-rw-r--r--drivers/hwmon/ntc_thermistor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
index 112e4d45e4a0..68800115876b 100644
--- a/drivers/hwmon/ntc_thermistor.c
+++ b/drivers/hwmon/ntc_thermistor.c
@@ -239,8 +239,10 @@ static struct ntc_thermistor_platform_data *
239ntc_thermistor_parse_dt(struct platform_device *pdev) 239ntc_thermistor_parse_dt(struct platform_device *pdev)
240{ 240{
241 struct iio_channel *chan; 241 struct iio_channel *chan;
242 enum iio_chan_type type;
242 struct device_node *np = pdev->dev.of_node; 243 struct device_node *np = pdev->dev.of_node;
243 struct ntc_thermistor_platform_data *pdata; 244 struct ntc_thermistor_platform_data *pdata;
245 int ret;
244 246
245 if (!np) 247 if (!np)
246 return NULL; 248 return NULL;
@@ -253,6 +255,13 @@ ntc_thermistor_parse_dt(struct platform_device *pdev)
253 if (IS_ERR(chan)) 255 if (IS_ERR(chan))
254 return ERR_CAST(chan); 256 return ERR_CAST(chan);
255 257
258 ret = iio_get_channel_type(chan, &type);
259 if (ret < 0)
260 return ERR_PTR(ret);
261
262 if (type != IIO_VOLTAGE)
263 return ERR_PTR(-EINVAL);
264
256 if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv)) 265 if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv))
257 return ERR_PTR(-ENODEV); 266 return ERR_PTR(-ENODEV);
258 if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm)) 267 if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm))