Skip to content

Commit

Permalink
thermal/int3403_thermal: favor _TMP instead of PTYP
Browse files Browse the repository at this point in the history
All the INT3403 devices with _TMP can be a sensor.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=202671
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Zhang Rui committed Apr 22, 2019
1 parent dc4060a commit 6eb61a9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/thermal/intel/int340x_thermal/int3403_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ static int int3403_add(struct platform_device *pdev)
{
struct int3403_priv *priv;
int result = 0;
unsigned long long tmp;
acpi_status status;

priv = devm_kzalloc(&pdev->dev, sizeof(struct int3403_priv),
Expand All @@ -234,19 +235,18 @@ static int int3403_add(struct platform_device *pdev)
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",
NULL, &tmp);
status = acpi_evaluate_integer(priv->adev->handle, "_TMP",
NULL, &tmp);
if (ACPI_FAILURE(status)) {
status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
NULL, &priv->type);
if (ACPI_FAILURE(status)) {
result = -EINVAL;
goto err;
} else {
priv->type = INT3403_TYPE_SENSOR;
}
} else {
priv->type = INT3403_TYPE_SENSOR;
}

platform_set_drvdata(pdev, priv);
Expand Down

0 comments on commit 6eb61a9

Please sign in to comment.