From: Vikram Pandita Date: Sat, 26 May 2007 04:31:07 +0000 (-0700) Subject: USB Core: hub.c: prevent re-enumeration on HNP X-Git-Tag: v2.6.23-rc1~1083^2~104 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffcdc18d64d73ecce49c182f969977ae88ff4384;p=linux-2.6 USB Core: hub.c: prevent re-enumeration on HNP Patch is to prevent the OTG host of doing 3 times enumeration of device when the Host suspends for HNP. The error code used in this case is ENOTSUPP. Signed-off-by: Vikram Pandita Acked-by: Alan Stern Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 08f0c22fa9..7946d7b6c7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1443,7 +1443,7 @@ int usb_new_device(struct usb_device *udev) if (err < 0) dev_dbg(&udev->dev, "HNP fail, %d\n", err); } - err = -ENODEV; + err = -ENOTSUPP; goto fail; } #endif @@ -2582,7 +2582,7 @@ loop: ep0_reinit(udev); release_address(udev); usb_put_dev(udev); - if (status == -ENOTCONN) + if ((status == -ENOTCONN) || (status == -ENOTSUPP)) break; }