tpm_tis: Clean up the force=1 module parameter
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Fri, 8 Jan 2016 00:36:24 +0000 (17:36 -0700)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Wed, 10 Feb 2016 02:11:37 +0000 (04:11 +0200)
commit00194826e6be333083ba9ddbd6e83fb423206f8a
treef0539c44583256010bf71730b8ef13f71e1d2c76
parent51dd43dff74b0547ad844638f6910ca29c956819
tpm_tis: Clean up the force=1 module parameter

The TPM core has long assumed that every device has a driver attached,
however the force path was attaching the TPM core outside of a driver
context. This isn't generally reliable as the user could detatch the
driver using sysfs or something, but commit b8b2c7d845d5 ("base/platform:
assert that dev_pm_domain callbacks are called unconditionally")
forced the issue by leaving the driver pointer NULL if there is
no probe.

Rework the TPM setup to create a platform device with resources and
then allow the driver core to naturally bind and probe it through the
normal mechanisms. All this structure is needed anyhow to enable TPM
for OF environments.

Finally, since the entire flow is changing convert the init/exit to use
the modern ifdef-less coding style when possible

Reported-by: "Wilck, Martin" <martin.wilck@ts.fujitsu.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Wilck, Martin <martin.wilck@ts.fujitsu.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
drivers/char/tpm/tpm_tis.c