From: Srinivas Pandruvada Date: Sat, 26 May 2018 01:10:10 +0000 (-0700) Subject: thermal: int340x: Prevent error in reading trip hysteresis attribute X-Git-Tag: v4.18-rc1~40^2^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8e3a61318b9b18b56680bd62e93afbafae16263;p=thirdparty%2Fkernel%2Flinux.git thermal: int340x: Prevent error in reading trip hysteresis attribute Some of the INT340X devices may not have hysteresis defined in the ACPI definition. In that case reading trip hysteresis results in error. This spams logs of user space utilities. In this case instead of returning error, just return hysteresis as 0, which is correct as there is no hysteresis defined for the device. Signed-off-by: Srinivas Pandruvada Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c index 145a5c53ff5c0..dfdf6dbc2ddcd 100644 --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c @@ -147,9 +147,9 @@ static int int340x_thermal_get_trip_hyst(struct thermal_zone_device *zone, status = acpi_evaluate_integer(d->adev->handle, "GTSH", NULL, &hyst); if (ACPI_FAILURE(status)) - return -EIO; - - *temp = hyst * 100; + *temp = 0; + else + *temp = hyst * 100; return 0; }