aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-07-08 07:22:56 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2009-07-21 18:28:39 -0400
commit48fea9659ec1a35641db3832adaf3860ecabb6ba (patch)
tree00d218b148617d9dd0802c8fba5eb92413f6052a
parent6a6c6189b1fef97de9b8b936131fe2085ac42a5a (diff)
USB: Rework musb suspend()/resume_early()
This patch reworks platform driver power management code for musb from legacy callbacks to dev_pm_ops. The callbacks are converted for CONFIG_SUSPEND like this: suspend() -> suspend() resume_early() -> resume_noirq() Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--drivers/usb/musb/musb_core.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 554a414f65d1..1191928902f4 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2168,8 +2168,9 @@ static int __devexit musb_remove(struct platform_device *pdev)
2168 2168
2169#ifdef CONFIG_PM 2169#ifdef CONFIG_PM
2170 2170
2171static int musb_suspend(struct platform_device *pdev, pm_message_t message) 2171static int musb_suspend(struct device *dev)
2172{ 2172{
2173 struct platform_device *pdev = to_platform_device(dev);
2173 unsigned long flags; 2174 unsigned long flags;
2174 struct musb *musb = dev_to_musb(&pdev->dev); 2175 struct musb *musb = dev_to_musb(&pdev->dev);
2175 2176
@@ -2196,8 +2197,9 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message)
2196 return 0; 2197 return 0;
2197} 2198}
2198 2199
2199static int musb_resume_early(struct platform_device *pdev) 2200static int musb_resume_noirq(struct device *dev)
2200{ 2201{
2202 struct platform_device *pdev = to_platform_device(dev);
2201 struct musb *musb = dev_to_musb(&pdev->dev); 2203 struct musb *musb = dev_to_musb(&pdev->dev);
2202 2204
2203 if (!musb->clock) 2205 if (!musb->clock)
@@ -2215,9 +2217,14 @@ static int musb_resume_early(struct platform_device *pdev)
2215 return 0; 2217 return 0;
2216} 2218}
2217 2219
2220static struct dev_pm_ops musb_dev_pm_ops = {
2221 .suspend = musb_suspend,
2222 .resume_noirq = musb_resume_noirq,
2223};
2224
2225#define MUSB_DEV_PM_OPS (&musb_dev_pm_ops)
2218#else 2226#else
2219#define musb_suspend NULL 2227#define MUSB_DEV_PM_OPS NULL
2220#define musb_resume_early NULL
2221#endif 2228#endif
2222 2229
2223static struct platform_driver musb_driver = { 2230static struct platform_driver musb_driver = {
@@ -2225,11 +2232,10 @@ static struct platform_driver musb_driver = {
2225 .name = (char *)musb_driver_name, 2232 .name = (char *)musb_driver_name,
2226 .bus = &platform_bus_type, 2233 .bus = &platform_bus_type,
2227 .owner = THIS_MODULE, 2234 .owner = THIS_MODULE,
2235 .pm = MUSB_DEV_PM_OPS,
2228 }, 2236 },
2229 .remove = __devexit_p(musb_remove), 2237 .remove = __devexit_p(musb_remove),
2230 .shutdown = musb_shutdown, 2238 .shutdown = musb_shutdown,
2231 .suspend = musb_suspend,
2232 .resume_early = musb_resume_early,
2233}; 2239};
2234 2240
2235/*-------------------------------------------------------------------------*/ 2241/*-------------------------------------------------------------------------*/