From 639995327c54e5159287db0494c59cbbf95ff74a Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Thu, 21 Sep 2006 23:16:48 +0200 Subject: [PATCH] --- yaml --- r: 34143 b: refs/heads/master c: 17c2dae3aaff9b1e5d83996a5f098ad693f3aeca h: refs/heads/master i: 34141: f804920dd92310f47a1979ad7d6be6d4cdfcb825 34139: 07c2e7dad66709aa067c66c74518bea76545e3d1 34135: b979978f3c38a54b2e22fa01f68a0380a722630e 34127: 3a4a61b0651bc7cbc606edafdd7e8219f7a01863 34111: d85ee9dbfe1e2404aac5ef554056ee26dec3b3a2 v: v3 --- [refs] | 2 +- trunk/drivers/mtd/maps/physmap.c | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 480a8c5640ac..94fc60c6267a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 25f0c659fe64832d8ee06aa623fffaad708dcf8b +refs/heads/master: 17c2dae3aaff9b1e5d83996a5f098ad693f3aeca diff --git a/trunk/drivers/mtd/maps/physmap.c b/trunk/drivers/mtd/maps/physmap.c index 7799a25a7f2a..bc7cc71788bc 100644 --- a/trunk/drivers/mtd/maps/physmap.c +++ b/trunk/drivers/mtd/maps/physmap.c @@ -158,9 +158,42 @@ static int physmap_flash_probe(struct platform_device *dev) return err; } +#ifdef CONFIG_PM +static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state) +{ + struct physmap_flash_info *info = platform_get_drvdata(dev); + int ret = 0; + + if (info) + ret = info->mtd->suspend(info->mtd); + + return ret; +} + +static int physmap_flash_resume(struct platform_device *dev) +{ + struct physmap_flash_info *info = platform_get_drvdata(dev); + if (info) + info->mtd->resume(info->mtd); + return 0; +} + +static void physmap_flash_shutdown(struct platform_device *dev) +{ + struct physmap_flash_info *info = platform_get_drvdata(dev); + if (info && info->mtd->suspend(info->mtd) == 0) + info->mtd->resume(info->mtd); +} +#endif + static struct platform_driver physmap_flash_driver = { .probe = physmap_flash_probe, .remove = physmap_flash_remove, +#ifdef CONFIG_PM + .suspend = physmap_flash_suspend, + .resume = physmap_flash_resume, + .shutdown = physmap_flash_shutdown, +#endif .driver = { .name = "physmap-flash", },