From 9fa733f24bb54dd532b5f5d7abc275c4a547c69f Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Fri, 29 May 2015 17:01:50 +0300 Subject: [PATCH] usb: xhci: Fix suspend/resume when used with OTG core In the OTG case, the controller might not yet have been added or is removed before the system suspends. Assign xhci->main_hcd during probe to prevent NULL pointer de-reference in xhci_suspend/resume(). Use the hcd->state flag to check if HCD is halted and if that is so do nothing for xhci_suspend/resume(). [Only for xhci-plat devices, pci devices need it in gen_setup -Mathias] Signed-off-by: Roger Quadros Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed