Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal: int340x: check for sensor when PTYP is missing

For INT3403 sensor PTYP field is mandatory. But some platforms didn't
have this field for sensors. This cause load failure for int3403 driver.

This change checks for the presence of _TMP method and if present, then
treats this device as a sensor.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>

authored by

Srinivas Pandruvada and committed by
Zhang Rui
4ca0e75e 86326031

+10 -2
+10 -2
drivers/thermal/int340x_thermal/int3403_thermal.c
··· 238 238 status = acpi_evaluate_integer(priv->adev->handle, "PTYP", 239 239 NULL, &priv->type); 240 240 if (ACPI_FAILURE(status)) { 241 - result = -EINVAL; 242 - goto err; 241 + unsigned long long tmp; 242 + 243 + status = acpi_evaluate_integer(priv->adev->handle, "_TMP", 244 + NULL, &tmp); 245 + if (ACPI_FAILURE(status)) { 246 + result = -EINVAL; 247 + goto err; 248 + } else { 249 + priv->type = INT3403_TYPE_SENSOR; 250 + } 243 251 } 244 252 245 253 platform_set_drvdata(pdev, priv);