Skip to content

Commit 043e465

Browse files
Devendra Nagazhang-rui
authored andcommitted
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 <devendra.aaru@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
1 parent fb84d99 commit 043e465

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/thermal/exynos_thermal.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf)
476476

477477
if (IS_ERR(th_zone->therm_dev)) {
478478
pr_err("Failed to register thermal zone device\n");
479-
ret = -EINVAL;
479+
ret = PTR_ERR(th_zone->therm_dev);
480480
goto err_unregister;
481481
}
482482
th_zone->mode = THERMAL_DEVICE_ENABLED;

0 commit comments

Comments
 (0)