From david-b@pacbell.net Sun May 27 11:14:44 2007 From: Vikram Pandita To: Greg KH Subject: USB Core: hub.c: prevent re-enumeration on HNP Date: Fri, 25 May 2007 21:31:07 -0700 Cc: Alan Stern , "Pandita, Vikram" Content-Disposition: inline Message-Id: <200705252131.10380.david-b@pacbell.net> From: Vikram Pandita 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 --- drivers/usb/core/hub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1449,7 +1449,7 @@ int usb_new_device(struct usb_device *ud if (err < 0) dev_dbg(&udev->dev, "HNP fail, %d\n", err); } - err = -ENODEV; + err = -ENOTSUPP; goto fail; } #endif @@ -2588,7 +2588,7 @@ loop: ep0_reinit(udev); release_address(udev); usb_put_dev(udev); - if (status == -ENOTCONN) + if ((status == -ENOTCONN) || (status == -ENOTSUPP)) break; }