aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2010-10-23 05:11:58 -0500
committerFelipe Balbi <balbi@ti.com>2010-11-05 14:08:15 +0200
commit32d5dc9520f0c6f60f691dd478741c774e292406 (patch)
treeb4ea6e2286efadab034bf1a93c3e8b7bb38311a1 /drivers/usb/musb
parent5d726f5add3af537952f7c35fdaebab43b718c2d (diff)
downloadkernel_samsung_aries-32d5dc9520f0c6f60f691dd478741c774e292406.zip
kernel_samsung_aries-32d5dc9520f0c6f60f691dd478741c774e292406.tar.gz
kernel_samsung_aries-32d5dc9520f0c6f60f691dd478741c774e292406.tar.bz2
USB: musb: pm: don't rely fully on clock support
Since clock support is optional across processors, don't make the whole musb pm paths depend upon it. Just conditionalize the clock accesses. Signed-off-by: Bob Liu <lliubbo@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_core.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 2f42a5d..7efb380 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2410,9 +2410,6 @@ 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,10 +2424,12 @@ static int musb_suspend(struct device *dev)
musb_save_context(musb);
- if (musb->set_clock)
- musb->set_clock(musb->clock, 0);
- else
- clk_disable(musb->clock);
+ if (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;
}
@@ -2440,13 +2439,12 @@ 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)
- return 0;
-
- if (musb->set_clock)
- musb->set_clock(musb->clock, 1);
- else
- clk_enable(musb->clock);
+ if (musb->clock) {
+ if (musb->set_clock)
+ musb->set_clock(musb->clock, 1);
+ else
+ clk_enable(musb->clock);
+ }
musb_restore_context(musb);