Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 043e4652 authored by Devendra Naga's avatar Devendra Naga Committed by Zhang Rui
Browse files

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: default avatarDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent fb84d990
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -476,7 +476,7 @@ static int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf)


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