summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ntc_thermistor.c
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2012-04-23 10:41:03 -0700
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-05-20 19:41:49 -0700
commit425d247680d050fe3ee7e53b9cf0240bf6b4b351 (patch)
tree5f29561c91a3602a2bf817ff9ba059bdb067e097 /drivers/hwmon/ntc_thermistor.c
parent41141e64e63dd250a05218b66c91e125f1020b92 (diff)
hwmon: (ntc_thermistor) Return error code from hwmon_device_register
hwmon_device_register() never returns a NULL pointer in case of errors, but an error value. Use it. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Diffstat (limited to 'drivers/hwmon/ntc_thermistor.c')
-rw-r--r--drivers/hwmon/ntc_thermistor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
index 4be7faff321b..b31bf1d3172a 100644
--- a/drivers/hwmon/ntc_thermistor.c
+++ b/drivers/hwmon/ntc_thermistor.c
@@ -382,9 +382,9 @@ static int __devinit ntc_thermistor_probe(struct platform_device *pdev)
}
data->hwmon_dev = hwmon_device_register(data->dev);
- if (IS_ERR_OR_NULL(data->hwmon_dev)) {
+ if (IS_ERR(data->hwmon_dev)) {
dev_err(data->dev, "unable to register as hwmon device.\n");
- ret = -EINVAL;
+ ret = PTR_ERR(data->hwmon_dev);
goto err_after_sysfs;
}