summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 10:04:17 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 10:04:17 -0800
commit2faa83e2a519abea1055d156ce1b42b8fa57e87b (patch)
tree8aaca988b9b62dcdaa0ace8e70b11fbc13d8ef2d /drivers
parent224acb1839f5fbb4ba85a440f6dd30dfb0e561b6 (diff)
downloadlwn-2faa83e2a519abea1055d156ce1b42b8fa57e87b.tar.gz
lwn-2faa83e2a519abea1055d156ce1b42b8fa57e87b.zip
Revert "USB: musb: pm: don't rely fully on clock support"
This reverts commit 32d5dc9520f0c6f60f691dd478741c774e292406. Needed to properly merge the musb changes that are in the usb-next branch into Linus's tree. Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/musb/musb_core.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 99beebce8550..365a4fab5c64 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2413,6 +2413,9 @@ static int musb_suspend(struct device *dev)
unsigned long flags;
struct musb *musb = dev_to_musb(&pdev->dev);
+ if (!musb->clock)
+ return 0;
+
spin_lock_irqsave(&musb->lock, flags);
if (is_peripheral_active(musb)) {
@@ -2427,12 +2430,10 @@ static int musb_suspend(struct device *dev)
musb_save_context(musb);
- if (musb->clock) {
- if (musb->set_clock)
- musb->set_clock(musb->clock, 0);
- else
- clk_disable(musb->clock);
- }
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 0);
+ else
+ clk_disable(musb->clock);
spin_unlock_irqrestore(&musb->lock, flags);
return 0;
}
@@ -2442,12 +2443,13 @@ static int musb_resume_noirq(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct musb *musb = dev_to_musb(&pdev->dev);
- if (musb->clock) {
- if (musb->set_clock)
- musb->set_clock(musb->clock, 1);
- else
- clk_enable(musb->clock);
- }
+ if (!musb->clock)
+ return 0;
+
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 1);
+ else
+ clk_enable(musb->clock);
musb_restore_context(musb);