tpm: move the PPI attributes to character device directory.
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 14 Apr 2015 14:56:48 +0000 (17:56 +0300)
committerPeter Huewe <peterhuewe@gmx.de>
Sun, 18 Oct 2015 23:01:20 +0000 (01:01 +0200)
commit9b774d5cf2db4b27324784e8d2c95a06cdf82373
treed1dc28f7780d6372238c907eedab83ac59f05eb3
parent37c1c04cca920de8a68285751b2c7b3d937ad50c
tpm: move the PPI attributes to character device directory.

Moved PPI attributes to the character device directory. This aligns with
the sysfs guidelines and makes them race free because they are created
atomically with the character device as part of device_register().The
character device and the sysfs attributes appear at the same time to the
user space.

As part of this change we enable PPI attributes also for TPM 2.0
devices. In order to retain backwards compatibility with TPM 1.x
devices, a symlink is created to the platform device directory.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jason.gunthorpe@obsidianresearch.com>
Tested-by: Mimi Zohar <zohar@linux.vnet.ibm.com> (on TPM 1.2)
Tested-by: Chris J Arges <chris.j.arges@canonical.com>
Tested-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm_ppi.c