Skip to content
Snippets Groups Projects
Commit 4ca0e75e authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Zhang Rui
Browse files

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: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 86326031
No related branches found
No related tags found
No related merge requests found
...@@ -237,9 +237,17 @@ static int int3403_add(struct platform_device *pdev) ...@@ -237,9 +237,17 @@ static int int3403_add(struct platform_device *pdev)
status = acpi_evaluate_integer(priv->adev->handle, "PTYP", status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
NULL, &priv->type); NULL, &priv->type);
if (ACPI_FAILURE(status)) {
unsigned long long tmp;
status = acpi_evaluate_integer(priv->adev->handle, "_TMP",
NULL, &tmp);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
result = -EINVAL; result = -EINVAL;
goto err; goto err;
} else {
priv->type = INT3403_TYPE_SENSOR;
}
} }
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment