提交 4ca0e75e 编写于 作者: S Srinivas Pandruvada 提交者: Zhang Rui

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: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: NZhang Rui <rui.zhang@intel.com>
上级 86326031
...@@ -238,8 +238,16 @@ static int int3403_add(struct platform_device *pdev) ...@@ -238,8 +238,16 @@ 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)) { if (ACPI_FAILURE(status)) {
result = -EINVAL; unsigned long long tmp;
goto err;
status = acpi_evaluate_integer(priv->adev->handle, "_TMP",
NULL, &tmp);
if (ACPI_FAILURE(status)) {
result = -EINVAL;
goto err;
} else {
priv->type = INT3403_TYPE_SENSOR;
}
} }
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册