From 2daa4d665bbfbf32dda8200ba27cc8bf653bd7a6 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Sat, 27 Sep 2014 22:23:39 +0800 Subject: MLK-9617-6 usb: core: otg: do not break otg device enumeration If a HNP capable device STALL b_hnp_enable set feature request, A device as host should not break otg device enumeration, because this set feature failure only indicates the B device does not want to be host role for the moment, A device as host talk to it should be okay. see charpter 6.2.2.2 of OTG and EH 2.0: "If the a_hnp_support feature is set, but the b_hnp_enable feature is not set, then it is likely that b_hnp_enable will be set later when the A-device is finished using the bus." Signed-off-by: Li Jun (cherry picked from commit 51317577d16034ba151da8d502319f4befb91278) (cherry picked from commit 3d5d5139b3aef654e8004a2ad9ce757af50aee57) --- drivers/usb/core/hub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 09251d2daa40..6909b5db3254 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -2207,9 +2207,9 @@ static inline void announce_device(struct usb_device *udev) { } */ static int usb_enumerate_device_otg(struct usb_device *udev) { +#ifdef CONFIG_USB_OTG int err = 0; -#ifdef CONFIG_USB_OTG /* * OTG-aware devices on OTG-capable root hubs may be able to use SRP, * to wake us after we've powered off VBUS; and HNP, switching roles @@ -2266,7 +2266,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev) } } #endif - return err; + return 0; } -- cgit v1.2.3