提交 114e4337 编写于 作者: L Liguang Zhang 提交者: Jarkko Sakkinen

tpm_tis_spi: set default probe function if device id not match

In DSDT table, TPM _CID was SMO0768, and no _HID definition. After a
kernel upgrade from 4.19 to 5.10, TPM probe function was changed which
causes device probe fails. In order to make newer kernel to be
compatible with the older acpi definition, it would be best set default
probe function.
Signed-off-by: NLiguang Zhang <zhangliguang@linux.alibaba.com>
Reviewed-by: NJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: NJarkko Sakkinen <jarkko@kernel.org>
上级 7937bd53
...@@ -240,10 +240,14 @@ static int tpm_tis_spi_driver_probe(struct spi_device *spi) ...@@ -240,10 +240,14 @@ static int tpm_tis_spi_driver_probe(struct spi_device *spi)
tpm_tis_spi_probe_func probe_func; tpm_tis_spi_probe_func probe_func;
probe_func = of_device_get_match_data(&spi->dev); probe_func = of_device_get_match_data(&spi->dev);
if (!probe_func && spi_dev_id) if (!probe_func) {
probe_func = (tpm_tis_spi_probe_func)spi_dev_id->driver_data; if (spi_dev_id) {
if (!probe_func) probe_func = (tpm_tis_spi_probe_func)spi_dev_id->driver_data;
return -ENODEV; if (!probe_func)
return -ENODEV;
} else
probe_func = tpm_tis_spi_probe;
}
return probe_func(spi); return probe_func(spi);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册