usb: dwc2: rework initialization of host and gadget in dual-role mode
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 10 Mar 2015 12:41:10 +0000 (13:41 +0100)
committerFelipe Balbi <balbi@ti.com>
Thu, 12 Mar 2015 17:18:49 +0000 (12:18 -0500)
commite39af88f18dfe9a7938765c97ce9ed448915e6d5
tree88205ee3959d9fdaeda0d2e0f5824dd82516ae72
parent9024c495f35be735a917571406fab30a789c27d1
usb: dwc2: rework initialization of host and gadget in dual-role mode

If device is configured to work only in HOST or DEVICE mode, there is
no point in initializing both subdrivers. This patch also fixes
resource leakage if host subdriver fails to initialize.

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/core.h
drivers/usb/dwc2/platform.c