tpm: fix raciness of PPI interface lookup

Traversal of the ACPI device tree was not done right. PPI interface
should be looked up only from the ACPI device that is the platform
device for the TPM. This could cause problems with systems with
two TPM chips such as 4th gen Intel systems.

In addition, added the missing license and copyright platter to
the tpm_ppi.c.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jasob Gunthorpe <jason.gunthorpe@obsidianresearch.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Scot Doyle <lkml14@scotdoyle.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
This commit is contained in:
Jarkko Sakkinen
2014-12-12 11:46:35 -08:00
committed by Peter Huewe
parent afb5abc262
commit 0dc5536521
4 changed files with 112 additions and 64 deletions

View File

@@ -147,7 +147,7 @@ int tpm_chip_register(struct tpm_chip *chip)
if (rc)
goto del_misc;
rc = tpm_add_ppi(&chip->dev->kobj);
rc = tpm_add_ppi(chip);
if (rc)
goto del_sysfs;
@@ -191,7 +191,7 @@ void tpm_chip_unregister(struct tpm_chip *chip)
if (chip->bios_dir)
tpm_bios_log_teardown(chip->bios_dir);
tpm_remove_ppi(&chip->dev->kobj);
tpm_remove_ppi(chip);
tpm_sysfs_del_device(chip);
tpm_dev_del_device(chip);