public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tpm_infineon: Fix suspend/resume handler for pnp_driver
@ 2009-12-29 17:41 OGAWA Hirofumi
  2010-01-05 23:59 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: OGAWA Hirofumi @ 2009-12-29 17:41 UTC (permalink / raw)
  To: Andrew Morton, Debora Velarde, Rajiv Andrade, Marcel Selhorst
  Cc: linux-kernel

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-01 11:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-29 17:41 [PATCH] tpm_infineon: Fix suspend/resume handler for pnp_driver OGAWA Hirofumi
2010-01-05 23:59 ` Andrew Morton
2010-01-09 23:39   ` OGAWA Hirofumi
2010-01-11 12:19     ` Marcel Selhorst
2010-02-01 11:14     ` Marcel Selhorst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox