Skip to content

Commit

Permalink
hwmon: (ntc_thermistor) Return error code from hwmon_device_register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guenter Roeck committed May 21, 2012
1 parent 41141e6 commit 425d247
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/ntc_thermistor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 425d247

Please sign in to comment.