From: Stefan Berger Date: Wed, 11 May 2016 15:28:27 +0000 (-0400) Subject: tpm: Fix suspend regression X-Git-Tag: v4.8-rc1~95^2~53 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ec03c50b132d159352f118055a58f599366084f9;p=linux.git 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: Jeremiah Mahler Signed-off-by: Stefan Berger Tested-by: Stefan Berger Reviewed-by: Jason Gunthorpe Tested-by: Jeremiah Mahler Acked-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index 080dade5e80f..5e3c1b684859 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -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;