All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>,
	Debora Velarde <debora@linux.vnet.ibm.com>,
	Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
	Marcel Selhorst <m.selhorst@sirrix.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] tpm_infineon: Fix suspend/resume handler for pnp_driver
Date: Wed, 30 Dec 2009 02:41:10 +0900	[thread overview]
Message-ID: <87d41xu18p.fsf@devron.myhome.or.jp> (raw)

Hi,

With recent quick review, I found the bug of tpm_infineon. (I don't have
this device, and compile test only)


PNP driver must use pnp_driver->suspend/resume anymore.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 drivers/char/tpm/tpm_infineon.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff -puN drivers/char/tpm/tpm_infineon.c~tpm-pnp_driver-convert drivers/char/tpm/tpm_infineon.c
--- linux-2.6/drivers/char/tpm/tpm_infineon.c~tpm-pnp_driver-convert	2009-12-30 02:27:07.000000000 +0900
+++ linux-2.6-hirofumi/drivers/char/tpm/tpm_infineon.c	2009-12-30 02:27:07.000000000 +0900
@@ -611,16 +611,26 @@ static __devexit void tpm_inf_pnp_remove
 	}
 }
 
+static int tpm_pnp_suspend(struct pnp_dev *dev, pm_message_t pm_state)
+{
+	return tpm_pm_suspend(&dev->dev, pm_state);
+}
+
+static int tpm_pnp_resume(struct pnp_dev *dev)
+{
+	return tpm_pm_resume(&dev->dev);
+}
+
 static struct pnp_driver tpm_inf_pnp_driver = {
 	.name = "tpm_inf_pnp",
-	.driver = {
-		.owner = THIS_MODULE,
-		.suspend = tpm_pm_suspend,
-		.resume = tpm_pm_resume,
-	},
 	.id_table = tpm_pnp_tbl,
 	.probe = tpm_inf_pnp_probe,
 	.remove = __devexit_p(tpm_inf_pnp_remove),
+	.suspend = tpm_pnp_suspend,
+	.resume = tpm_pnp_resume,
+	.driver = {
+		.owner = THIS_MODULE,
+	},
 };
 
 static int __init init_inf(void)
_

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

             reply	other threads:[~2009-12-29 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-29 17:41 OGAWA Hirofumi [this message]
2010-01-05 23:59 ` [PATCH] tpm_infineon: Fix suspend/resume handler for pnp_driver Andrew Morton
2010-01-09 23:39   ` OGAWA Hirofumi
2010-01-11 12:19     ` Marcel Selhorst
2010-02-01 11:14     ` Marcel Selhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d41xu18p.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=debora@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.selhorst@sirrix.com \
    --cc=srajiv@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.