diff options
author | Bob Liu <lliubbo@gmail.com> | 2010-10-23 06:11:58 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2010-11-05 08:08:15 -0400 |
commit | 32d5dc9520f0c6f60f691dd478741c774e292406 (patch) | |
tree | b4ea6e2286efadab034bf1a93c3e8b7bb38311a1 /drivers/usb | |
parent | 5d726f5add3af537952f7c35fdaebab43b718c2d (diff) |
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')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 2f42a5d50a5a..7efb380f9765 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) | |||
2410 | unsigned long flags; | 2410 | unsigned long flags; |
2411 | struct musb *musb = dev_to_musb(&pdev->dev); | 2411 | struct musb *musb = dev_to_musb(&pdev->dev); |
2412 | 2412 | ||
2413 | if (!musb->clock) | ||
2414 | return 0; | ||
2415 | |||
2416 | spin_lock_irqsave(&musb->lock, flags); | 2413 | spin_lock_irqsave(&musb->lock, flags); |
2417 | 2414 | ||
2418 | if (is_peripheral_active(musb)) { | 2415 | if (is_peripheral_active(musb)) { |
@@ -2427,10 +2424,12 @@ static int musb_suspend(struct device *dev) | |||
2427 | 2424 | ||
2428 | musb_save_context(musb); | 2425 | musb_save_context(musb); |
2429 | 2426 | ||
2430 | if (musb->set_clock) | 2427 | if (musb->clock) { |
2431 | musb->set_clock(musb->clock, 0); | 2428 | if (musb->set_clock) |
2432 | else | 2429 | musb->set_clock(musb->clock, 0); |
2433 | clk_disable(musb->clock); | 2430 | else |
2431 | clk_disable(musb->clock); | ||
2432 | } | ||
2434 | spin_unlock_irqrestore(&musb->lock, flags); | 2433 | spin_unlock_irqrestore(&musb->lock, flags); |
2435 | return 0; | 2434 | return 0; |
2436 | } | 2435 | } |
@@ -2440,13 +2439,12 @@ static int musb_resume_noirq(struct device *dev) | |||
2440 | struct platform_device *pdev = to_platform_device(dev); | 2439 | struct platform_device *pdev = to_platform_device(dev); |
2441 | struct musb *musb = dev_to_musb(&pdev->dev); | 2440 | struct musb *musb = dev_to_musb(&pdev->dev); |
2442 | 2441 | ||
2443 | if (!musb->clock) | 2442 | if (musb->clock) { |
2444 | return 0; | 2443 | if (musb->set_clock) |
2445 | 2444 | musb->set_clock(musb->clock, 1); | |
2446 | if (musb->set_clock) | 2445 | else |
2447 | musb->set_clock(musb->clock, 1); | 2446 | clk_enable(musb->clock); |
2448 | else | 2447 | } |
2449 | clk_enable(musb->clock); | ||
2450 | 2448 | ||
2451 | musb_restore_context(musb); | 2449 | musb_restore_context(musb); |
2452 | 2450 | ||