From: Sebastian Andrzej Siewior Date: Tue, 20 Aug 2013 16:35:44 +0000 (+0200) Subject: usb: musb: only remove host/udc if it has been added X-Git-Tag: v3.12-rc1~186^2~19^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9047428894660f8f46305917e519ab62f7395cac;p=pandora-kernel.git usb: musb: only remove host/udc if it has been added musb_shutdown() removes always USB host and device. musb_init_controller() adds host and device depending on port_mode. If port mode is set to HOST then the removal of UDC leads only to: |(NULL device *): gadget not registered. and nothing else happens. If port mode is set to DEVICE and we remove the host then we oops in usb_remove_hcd(). This patch ensures that we only remove host in OTG/host mode and device only in OTG/device mode to avoid any trouble. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi --- Reading git-diff-tree failed