libpayload: usb: Detach unused USB devices
If a payload decides not to use a USB device then the device can be detached. This prevents the device from interfering with normal operation on some platforms. Also, it aligns the behavior of usb_generic_init with class-specific init functions such as usb_msc_init, which will detach unsupported devices. BUG=None TEST=Manual on Squawks. Test recovery boot w/ USB 2.0 media, verify that media boots and no babble error is encountered. BRANCH=rambi Change-Id: I8fb30951d273e4144cda214a30a2e86df90f2c1c Original-Change-Id: Iee522344558749603defb2966e18765aa195dae2 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/195401 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
375a86be9b
commit
f7778ace68
1 changed files with 5 additions and 0 deletions
|
|
@ -640,4 +640,9 @@ usb_generic_init (usbdev_t *dev)
|
|||
|
||||
if (usb_generic_create)
|
||||
usb_generic_create(dev);
|
||||
|
||||
if (dev->data == NULL) {
|
||||
usb_debug("Detaching device not used by payload\n");
|
||||
usb_detach_device(dev->controller, dev->address);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue