thermal: exynos_thermal: return a proper error code while thermal_zone_device_registe...
authorDevendra Naga <devendra.aaru@gmail.com>
Mon, 4 Mar 2013 16:52:48 +0000 (16:52 +0000)
committerZhang Rui <rui.zhang@intel.com>
Mon, 11 Mar 2013 15:09:29 +0000 (23:09 +0800)
we are returning EINVAL while the thermal_zone_device_register function fail.
instead we can use the return value from the thermal_zone_device_register by
using PTR_ERR.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/exynos_thermal.c

index e04ebd8671aca27dc390c32d6ec00d6033c7d7ae..46568c078dee8d2fe4c195cc4659e68e6653f36d 100644 (file)
@@ -476,7 +476,7 @@ static int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf)
 
        if (IS_ERR(th_zone->therm_dev)) {
                pr_err("Failed to register thermal zone device\n");
-               ret = -EINVAL;
+               ret = PTR_ERR(th_zone->therm_dev);
                goto err_unregister;
        }
        th_zone->mode = THERMAL_DEVICE_ENABLED;