提交 ec03c50b 编写于 作者: S Stefan Berger 提交者: Jarkko Sakkinen

tpm: Fix suspend regression

Fix the suspend regression due to the wrong way of retrieving the
chip structure. The suspend functions are attached to the hardware
device, not the chip and thus must rely on drvdata.

Fixes: e89f8b1ade9cc1a ("tpm: Remove all uses of drvdata from the TPM Core")
Reported-by: NJeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: NJeremiah Mahler <jmmahler@gmail.com>
Acked-by: NJarkko Sakkinen <jarkko.sakkine@linux.intel.com>
Signed-off-by: NJarkko Sakkinen <jarkko.sakkine@linux.intel.com>
上级 75254557
......@@ -934,7 +934,7 @@ static struct tpm_input_header savestate_header = {
*/
int tpm_pm_suspend(struct device *dev)
{
struct tpm_chip *chip = to_tpm_chip(dev);
struct tpm_chip *chip = dev_get_drvdata(dev);
struct tpm_cmd_t cmd;
int rc, try;
......@@ -995,7 +995,7 @@ EXPORT_SYMBOL_GPL(tpm_pm_suspend);
*/
int tpm_pm_resume(struct device *dev)
{
struct tpm_chip *chip = to_tpm_chip(dev);
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip == NULL)
return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册