diff mbox

[U-Boot,5/5] usb: ehci: Increase usb_companion_device_count when handing over devices

Message ID 1430832500-7126-6-git-send-email-hdegoede@redhat.com
State Changes Requested
Delegated to: Simon Glass
Headers show

Commit Message

Hans de Goede May 5, 2015, 1:28 p.m. UTC
Increase usb_companion_device_count when handing over devices to the ehci's
companion controller. usb_init() will use this to short-circuit companion
bus scanning when no devices were handed over at all.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/usb/host/ehci-hcd.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 25981ef..40d6dc1 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -873,6 +873,7 @@  static int ehci_submit_root(struct usb_device *dev, unsigned long pipe,
 				/* Low speed device, give up ownership. */
 				debug("port %d low speed --> companion\n",
 				      port - 1);
+				usb_companion_device_count++;
 				reg |= EHCI_PS_PO;
 				ehci_writel(status_reg, reg);
 				break;
@@ -902,6 +903,7 @@  static int ehci_submit_root(struct usb_device *dev, unsigned long pipe,
 					if ((reg & (EHCI_PS_PE | EHCI_PS_CS))
 					    == EHCI_PS_CS && !ehci_is_TDI()) {
 						debug("port %d full speed --> companion\n", port - 1);
+						usb_companion_device_count++;
 						reg &= ~EHCI_PS_CLEAR;
 						reg |= EHCI_PS_PO;
 						ehci_writel(status_reg, reg);