提交 e5a9d621 编写于 作者: P Peter Chen 提交者: Greg Kroah-Hartman

usb: core: return -ENOTSUPP for all targeted hosts

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: NPeter Chen <peter.chen@freescale.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bb505642
...@@ -2319,11 +2319,12 @@ static int usb_enumerate_device(struct usb_device *udev) ...@@ -2319,11 +2319,12 @@ static int usb_enumerate_device(struct usb_device *udev)
return err; return err;
if (IS_ENABLED(CONFIG_USB_OTG_WHITELIST) && hcd->tpl_support && 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. /* Maybe it can talk to us, though we can't talk to it.
* (Includes HNP test device.) * (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); err = usb_port_suspend(udev, PMSG_AUTO_SUSPEND);
if (err < 0) if (err < 0)
dev_dbg(&udev->dev, "HNP fail, %d\n", err); dev_dbg(&udev->dev, "HNP fail, %d\n", err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册