From: Devendra Naga Date: Mon, 4 Mar 2013 16:52:48 +0000 (+0000) Subject: thermal: exynos_thermal: return a proper error code while thermal_zone_device_registe... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=043e4652bf3378883e7c0db38fa47fa8e2558f9c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git thermal: exynos_thermal: return a proper error code while thermal_zone_device_register fail. 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 Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c index e04ebd8671ac..46568c078dee 100644 --- a/drivers/thermal/exynos_thermal.c +++ b/drivers/thermal/exynos_thermal.c @@ -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;