-
由 Jason Gunthorpe 提交于
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 b8b2c7d8 ("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: N"Wilck, Martin" <martin.wilck@ts.fujitsu.com> Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com> Tested-by: NWilck, Martin <martin.wilck@ts.fujitsu.com> Tested-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Acked-by: NPeter Huewe <peterhuewe@gmx.de>
00194826