From: Vivek Gautam Date: Sat, 13 Oct 2012 13:50:18 +0000 (+0530) Subject: usb: dwc3: shutdown usb_phy when removing the device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=01b8daf71b2fd2f6ece5f063a089abf4b13f1d6e;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git usb: dwc3: shutdown usb_phy when removing the device We call usb_phy_init() from dwc3_core_init() during probe, so adding usb_phy_shutdown() to dwc3_core_exit() while removing the device so we don't keep PHYs turned on, consuming power, unnecessarily. Signed-off-by: Vivek Gautam Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b415c0c859d..c14ebc975ba 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -409,6 +409,10 @@ static void dwc3_core_exit(struct dwc3 *dwc) { dwc3_event_buffers_cleanup(dwc); dwc3_free_event_buffers(dwc); + + usb_phy_shutdown(dwc->usb2_phy); + usb_phy_shutdown(dwc->usb3_phy); + } #define DWC3_ALIGN_MASK (16 - 1)