mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-14 12:37:32 +00:00
usb: host: ehci-msm: Conditionally call ehci suspend/resume
This patch fixes a suspend/resume issue where the driver is blindly calling ehci_suspend/resume functions when the ehci hasn't been setup. This results in a crash during suspend/resume operations. Signed-off-by: Andy Gross <andy.gross@linaro.org> Tested-by: Pramod Gurav <pramod.gurav@linaro.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1700bd9872
commit
815c9d6a3c
1 changed files with 12 additions and 2 deletions
|
@ -179,22 +179,32 @@ static int ehci_msm_remove(struct platform_device *pdev)
|
||||||
static int ehci_msm_pm_suspend(struct device *dev)
|
static int ehci_msm_pm_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
||||||
|
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
||||||
bool do_wakeup = device_may_wakeup(dev);
|
bool do_wakeup = device_may_wakeup(dev);
|
||||||
|
|
||||||
dev_dbg(dev, "ehci-msm PM suspend\n");
|
dev_dbg(dev, "ehci-msm PM suspend\n");
|
||||||
|
|
||||||
|
/* Only call ehci_suspend if ehci_setup has been done */
|
||||||
|
if (ehci->sbrn)
|
||||||
return ehci_suspend(hcd, do_wakeup);
|
return ehci_suspend(hcd, do_wakeup);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ehci_msm_pm_resume(struct device *dev)
|
static int ehci_msm_pm_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
||||||
|
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
||||||
|
|
||||||
dev_dbg(dev, "ehci-msm PM resume\n");
|
dev_dbg(dev, "ehci-msm PM resume\n");
|
||||||
|
|
||||||
|
/* Only call ehci_resume if ehci_setup has been done */
|
||||||
|
if (ehci->sbrn)
|
||||||
ehci_resume(hcd, false);
|
ehci_resume(hcd, false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define ehci_msm_pm_suspend NULL
|
#define ehci_msm_pm_suspend NULL
|
||||||
#define ehci_msm_pm_resume NULL
|
#define ehci_msm_pm_resume NULL
|
||||||
|
|
Loading…
Reference in a new issue