diff options
-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 | ||