Fix the suspend regression due to wrong way of retrieving
the chip from the parent device.

Reported-by: Jeremiah Mahler <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
Tested-by: Stefan Berger <[email protected]>
---
 drivers/char/tpm/tpm-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 080dade..5e3c1b6 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;
-- 
2.4.3


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to