Skip to content

Commit ec03c50

Browse files
stefanbergerJarkko Sakkinen
authored andcommitted
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: e89f8b1 ("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>
1 parent 7525455 commit ec03c50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/char/tpm/tpm-interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ static struct tpm_input_header savestate_header = {
934934
*/
935935
int tpm_pm_suspend(struct device *dev)
936936
{
937-
struct tpm_chip *chip = to_tpm_chip(dev);
937+
struct tpm_chip *chip = dev_get_drvdata(dev);
938938
struct tpm_cmd_t cmd;
939939
int rc, try;
940940

@@ -995,7 +995,7 @@ EXPORT_SYMBOL_GPL(tpm_pm_suspend);
995995
*/
996996
int tpm_pm_resume(struct device *dev)
997997
{
998-
struct tpm_chip *chip = to_tpm_chip(dev);
998+
struct tpm_chip *chip = dev_get_drvdata(dev);
999999

10001000
if (chip == NULL)
10011001
return -ENODEV;

0 commit comments

Comments
 (0)