mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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>
This commit is contained in:
parent
41141e64e6
commit
425d247680
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue