Commit 6eb61a93 authored by Zhang Rui's avatar Zhang Rui

thermal/int3403_thermal: favor _TMP instead of PTYP

All the INT3403 devices with _TMP can be a sensor.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=202671Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent dc4060a5
...@@ -220,6 +220,7 @@ static int int3403_add(struct platform_device *pdev) ...@@ -220,6 +220,7 @@ static int int3403_add(struct platform_device *pdev)
{ {
struct int3403_priv *priv; struct int3403_priv *priv;
int result = 0; int result = 0;
unsigned long long tmp;
acpi_status status; acpi_status status;
priv = devm_kzalloc(&pdev->dev, sizeof(struct int3403_priv), priv = devm_kzalloc(&pdev->dev, sizeof(struct int3403_priv),
...@@ -234,20 +235,19 @@ static int int3403_add(struct platform_device *pdev) ...@@ -234,20 +235,19 @@ static int int3403_add(struct platform_device *pdev)
goto err; goto err;
} }
status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
NULL, &priv->type);
if (ACPI_FAILURE(status)) {
unsigned long long tmp;
status = acpi_evaluate_integer(priv->adev->handle, "_TMP", status = acpi_evaluate_integer(priv->adev->handle, "_TMP",
NULL, &tmp); NULL, &tmp);
if (ACPI_FAILURE(status)) {
status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
NULL, &priv->type);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
result = -EINVAL; result = -EINVAL;
goto err; goto err;
}
} else { } else {
priv->type = INT3403_TYPE_SENSOR; priv->type = INT3403_TYPE_SENSOR;
} }
}
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
switch (priv->type) { switch (priv->type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment