Skip to content

Commit

Permalink
usb: core: return -ENOTSUPP for all targeted hosts
Browse files Browse the repository at this point in the history
The current code only returns -ENOTSUPP for OTG host, but in fact,
embedded host also needs to returns -ENOTSUPP if the peripheral
is not at TPL.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Chen authored and Greg Kroah-Hartman committed Sep 29, 2014
1 parent bb50564 commit e5a9d62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2319,11 +2319,12 @@ static int usb_enumerate_device(struct usb_device *udev)
return err;

if (IS_ENABLED(CONFIG_USB_OTG_WHITELIST) && hcd->tpl_support &&
!is_targeted(udev) && IS_ENABLED(CONFIG_USB_OTG)) {
!is_targeted(udev)) {
/* Maybe it can talk to us, though we can't talk to it.
* (Includes HNP test device.)
*/
if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {
if (IS_ENABLED(CONFIG_USB_OTG) && (udev->bus->b_hnp_enable
|| udev->bus->is_b_host)) {
err = usb_port_suspend(udev, PMSG_AUTO_SUSPEND);
if (err < 0)
dev_dbg(&udev->dev, "HNP fail, %d\n", err);
Expand Down

0 comments on commit e5a9d62

Please sign in to comment.