Skip to content

Commit 114e433

Browse files
luanshi0212jarkkojs
authored andcommitted
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: Liguang Zhang <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 7937bd5 commit 114e433

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/char/tpm/tpm_tis_spi_main.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,14 @@ static int tpm_tis_spi_driver_probe(struct spi_device *spi)
240240
tpm_tis_spi_probe_func probe_func;
241241

242242
probe_func = of_device_get_match_data(&spi->dev);
243-
if (!probe_func && spi_dev_id)
244-
probe_func = (tpm_tis_spi_probe_func)spi_dev_id->driver_data;
245-
if (!probe_func)
246-
return -ENODEV;
243+
if (!probe_func) {
244+
if (spi_dev_id) {
245+
probe_func = (tpm_tis_spi_probe_func)spi_dev_id->driver_data;
246+
if (!probe_func)
247+
return -ENODEV;
248+
} else
249+
probe_func = tpm_tis_spi_probe;
250+
}
247251

248252
return probe_func(spi);
249253
}

0 commit comments

Comments
 (0)