aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2016-05-11 11:28:27 -0400
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-06-25 10:26:35 -0400
commitec03c50b132d159352f118055a58f599366084f9 (patch)
treed7d4cad028906a99cde58e78a818f98827c8f02d /drivers/char/tpm
parent75254557fb8fc9ff93dc6f39e37532410d9ae083 (diff)
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 <jmmahler@gmail.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Tested-by: Jeremiah Mahler <jmmahler@gmail.com> Acked-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r--drivers/char/tpm/tpm-interface.c4
1 files changed, 2 insertions, 2 deletions
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 = {
934 */ 934 */
935int tpm_pm_suspend(struct device *dev) 935int tpm_pm_suspend(struct device *dev)
936{ 936{
937 struct tpm_chip *chip = to_tpm_chip(dev); 937 struct tpm_chip *chip = dev_get_drvdata(dev);
938 struct tpm_cmd_t cmd; 938 struct tpm_cmd_t cmd;
939 int rc, try; 939 int rc, try;
940 940
@@ -995,7 +995,7 @@ EXPORT_SYMBOL_GPL(tpm_pm_suspend);
995 */ 995 */
996int tpm_pm_resume(struct device *dev) 996int tpm_pm_resume(struct device *dev)
997{ 997{
998 struct tpm_chip *chip = to_tpm_chip(dev); 998 struct tpm_chip *chip = dev_get_drvdata(dev);
999 999
1000 if (chip == NULL) 1000 if (chip == NULL)
1001 return -ENODEV; 1001 return -ENODEV;