diff options
-rw-r--r-- | drivers/usb/musb/musb_core.c | 9 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index e01116e4c067..f1ea4494dcb2 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2291,6 +2291,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
2291 | if (status) | 2291 | if (status) |
2292 | goto fail5; | 2292 | goto fail5; |
2293 | 2293 | ||
2294 | musb->is_initialized = 1; | ||
2294 | pm_runtime_mark_last_busy(musb->controller); | 2295 | pm_runtime_mark_last_busy(musb->controller); |
2295 | pm_runtime_put_autosuspend(musb->controller); | 2296 | pm_runtime_put_autosuspend(musb->controller); |
2296 | 2297 | ||
@@ -2629,7 +2630,6 @@ static int musb_runtime_suspend(struct device *dev) | |||
2629 | static int musb_runtime_resume(struct device *dev) | 2630 | static int musb_runtime_resume(struct device *dev) |
2630 | { | 2631 | { |
2631 | struct musb *musb = dev_to_musb(dev); | 2632 | struct musb *musb = dev_to_musb(dev); |
2632 | static int first = 1; | ||
2633 | 2633 | ||
2634 | /* | 2634 | /* |
2635 | * When pm_runtime_get_sync called for the first time in driver | 2635 | * When pm_runtime_get_sync called for the first time in driver |
@@ -2640,9 +2640,10 @@ static int musb_runtime_resume(struct device *dev) | |||
2640 | * Also context restore without save does not make | 2640 | * Also context restore without save does not make |
2641 | * any sense | 2641 | * any sense |
2642 | */ | 2642 | */ |
2643 | if (!first) | 2643 | if (!musb->is_initialized) |
2644 | musb_restore_context(musb); | 2644 | return 0; |
2645 | first = 0; | 2645 | |
2646 | musb_restore_context(musb); | ||
2646 | 2647 | ||
2647 | if (musb->need_finish_resume) { | 2648 | if (musb->need_finish_resume) { |
2648 | musb->need_finish_resume = 0; | 2649 | musb->need_finish_resume = 0; |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 2cb88a498f8a..c04abf424c5c 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -385,6 +385,8 @@ struct musb { | |||
385 | int a_wait_bcon; /* VBUS timeout in msecs */ | 385 | int a_wait_bcon; /* VBUS timeout in msecs */ |
386 | unsigned long idle_timeout; /* Next timeout in jiffies */ | 386 | unsigned long idle_timeout; /* Next timeout in jiffies */ |
387 | 387 | ||
388 | unsigned is_initialized:1; | ||
389 | |||
388 | /* active means connected and not suspended */ | 390 | /* active means connected and not suspended */ |
389 | unsigned is_active:1; | 391 | unsigned is_active:1; |
390 | 392 | ||