diff options
| -rw-r--r-- | drivers/usb/host/ohci-exynos.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 91ec9b2cd378..9897d70e4c15 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
| @@ -191,23 +191,14 @@ static int exynos_ohci_suspend(struct device *dev) | |||
| 191 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); | 191 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
| 192 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | 192 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
| 193 | struct platform_device *pdev = to_platform_device(dev); | 193 | struct platform_device *pdev = to_platform_device(dev); |
| 194 | bool do_wakeup = device_may_wakeup(dev); | ||
| 194 | unsigned long flags; | 195 | unsigned long flags; |
| 195 | int rc = 0; | 196 | int rc = ohci_suspend(hcd, do_wakeup); |
| 196 | 197 | ||
| 197 | /* | 198 | if (rc) |
| 198 | * Root hub was already suspended. Disable irq emission and | 199 | return rc; |
| 199 | * mark HW unaccessible, bail out if RH has been resumed. Use | ||
| 200 | * the spinlock to properly synchronize with possible pending | ||
| 201 | * RH suspend or resume activity. | ||
| 202 | */ | ||
| 203 | spin_lock_irqsave(&ohci->lock, flags); | ||
| 204 | if (ohci->rh_state != OHCI_RH_SUSPENDED && | ||
| 205 | ohci->rh_state != OHCI_RH_HALTED) { | ||
| 206 | rc = -EINVAL; | ||
| 207 | goto fail; | ||
| 208 | } | ||
| 209 | 200 | ||
| 210 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 201 | spin_lock_irqsave(&ohci->lock, flags); |
| 211 | 202 | ||
| 212 | if (exynos_ohci->otg) | 203 | if (exynos_ohci->otg) |
| 213 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); | 204 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
| @@ -216,10 +207,9 @@ static int exynos_ohci_suspend(struct device *dev) | |||
| 216 | 207 | ||
| 217 | clk_disable_unprepare(exynos_ohci->clk); | 208 | clk_disable_unprepare(exynos_ohci->clk); |
| 218 | 209 | ||
| 219 | fail: | ||
| 220 | spin_unlock_irqrestore(&ohci->lock, flags); | 210 | spin_unlock_irqrestore(&ohci->lock, flags); |
| 221 | 211 | ||
| 222 | return rc; | 212 | return 0; |
| 223 | } | 213 | } |
| 224 | 214 | ||
| 225 | static int exynos_ohci_resume(struct device *dev) | 215 | static int exynos_ohci_resume(struct device *dev) |
