[PATCH 4/4] hwmon: (ntc_thermistor) Return error code from hwmon_device_register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
Cc: Donggeun Kim <dg77.kim@xxxxxxxxxxx>
---
 drivers/hwmon/ntc_thermistor.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
index 09a1b26..6da9696 100644
--- a/drivers/hwmon/ntc_thermistor.c
+++ b/drivers/hwmon/ntc_thermistor.c
@@ -378,9 +378,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;
 	}
 
-- 
1.7.9.48.g85da4d


_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux