aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-msm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-msm.c')
-rw-r--r--drivers/usb/host/ehci-msm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index d3afc89d00f5..2f8d3af811ce 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -179,22 +179,32 @@ static int ehci_msm_remove(struct platform_device *pdev)
179static int ehci_msm_pm_suspend(struct device *dev) 179static int ehci_msm_pm_suspend(struct device *dev)
180{ 180{
181 struct usb_hcd *hcd = dev_get_drvdata(dev); 181 struct usb_hcd *hcd = dev_get_drvdata(dev);
182 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
182 bool do_wakeup = device_may_wakeup(dev); 183 bool do_wakeup = device_may_wakeup(dev);
183 184
184 dev_dbg(dev, "ehci-msm PM suspend\n"); 185 dev_dbg(dev, "ehci-msm PM suspend\n");
185 186
186 return ehci_suspend(hcd, do_wakeup); 187 /* Only call ehci_suspend if ehci_setup has been done */
188 if (ehci->sbrn)
189 return ehci_suspend(hcd, do_wakeup);
190
191 return 0;
187} 192}
188 193
189static int ehci_msm_pm_resume(struct device *dev) 194static int ehci_msm_pm_resume(struct device *dev)
190{ 195{
191 struct usb_hcd *hcd = dev_get_drvdata(dev); 196 struct usb_hcd *hcd = dev_get_drvdata(dev);
197 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
192 198
193 dev_dbg(dev, "ehci-msm PM resume\n"); 199 dev_dbg(dev, "ehci-msm PM resume\n");
194 ehci_resume(hcd, false); 200
201 /* Only call ehci_resume if ehci_setup has been done */
202 if (ehci->sbrn)
203 ehci_resume(hcd, false);
195 204
196 return 0; 205 return 0;
197} 206}
207
198#else 208#else
199#define ehci_msm_pm_suspend NULL 209#define ehci_msm_pm_suspend NULL
200#define ehci_msm_pm_resume NULL 210#define ehci_msm_pm_resume NULL