Skip to content
Commit afb5abc2 authored by Jarkko Sakkinen's avatar Jarkko Sakkinen Committed by Peter Huewe
Browse files

tpm: two-phase chip management functions



tpm_register_hardware() and tpm_remove_hardware() are called often
before initializing the device. The problem is that the device might
not be fully initialized when it comes visible to the user space.

This patch resolves the issue by diving initialization into two
parts:

- tpmm_chip_alloc() creates struct tpm_chip.

- tpm_chip_register() sets up the character device and sysfs
  attributes.

The framework takes care of freeing struct tpm_chip by using the devres
API. The broken release callback has been wiped. ACPI drivers do not
ever get this callback.

Regards to Jason Gunthorpe for carefully reviewing this part of the
code.

Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: default avatarJasob Gunthorpe <jason.gunthorpe@obsidianresearch.com>
Reviewed-by: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: default avatarScot Doyle <lkml14@scotdoyle.com>
Tested-by: default avatarPeter Huewe <peterhuewe@gmx.de>
[phuewe: update to upstream changes]
Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
parent 87155b73
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment