From patchwork Tue May 10 15:07:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Berger X-Patchwork-Id: 9058721 Return-Path: X-Original-To: patchwork-tpmdd-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5CBDFBF29F for ; Tue, 10 May 2016 15:07:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C10320145 for ; Tue, 10 May 2016 15:07:44 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F3BC200E8 for ; Tue, 10 May 2016 15:07:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1b09G9-0005B5-Nr; Tue, 10 May 2016 15:07:41 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1b09G9-0005B0-3c for tpmdd-devel@lists.sourceforge.net; Tue, 10 May 2016 15:07:41 +0000 X-ACL-Warn: Received: from e37.co.us.ibm.com ([32.97.110.158]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1b09G5-0001Fp-Dq for tpmdd-devel@lists.sourceforge.net; Tue, 10 May 2016 15:07:41 +0000 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 May 2016 09:07:25 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 10 May 2016 09:07:23 -0600 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: stefanb@linux.vnet.ibm.com X-IBM-RcptTo: tpmdd-devel@lists.sourceforge.net; jgunthorpe@obsidianresearch.com Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id F10BC1FF006F; Tue, 10 May 2016 09:07:07 -0600 (MDT) Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u4AF7Ns145809898; Tue, 10 May 2016 08:07:23 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD430BE040; Tue, 10 May 2016 09:07:22 -0600 (MDT) Received: from sbct-3.watson.ibm.com (unknown [9.2.141.158]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 6D00CBE03E; Tue, 10 May 2016 09:07:22 -0600 (MDT) From: Stefan Berger To: tpmdd-devel@lists.sourceforge.net Date: Tue, 10 May 2016 11:07:14 -0400 Message-Id: <1462892834-5631-1-git-send-email-stefanb@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.5 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16051015-0025-0000-0000-00003D4B1F8A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused X-Spam-Score: -2.1 (--) X-Headers-End: 1b09G5-0001Fp-Dq Subject: [tpmdd-devel] [PATCH] tpm: Fix suspend regression X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the suspend regression due to wrong way of retrieving the chip from the parent device. Reported-by: Jeremiah Mahler Signed-off-by: Stefan Berger Tested-by: Stefan Berger Reviewed-by: Jason Gunthorpe --- 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;