diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2010-02-27 21:32:17 +0300 |
---|---|---|
committer | Remy Bohmer <linux@bohmer.net> | 2010-04-08 21:39:59 +0200 |
commit | e06a055bcd966adf62a5653c84db781915392e41 (patch) | |
tree | 299fb689b13deb038b1cfec7004203cc6a904208 /drivers | |
parent | 6d313c84ded168427240e62d108b6ba9afdcf535 (diff) |
EHCI: fix off-by-one error in ehci_submit_root()
USB devices on the 2nd port are not detected and I get the following message:
The request port(1) is not configured
That's with default CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS value of 2. 'req->index'
is 1-based, so the comparison in ehci_submit_root() can't be correct.
Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index e48819f32e4..d90a23a1f1c 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -536,7 +536,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, uint32_t reg; uint32_t *status_reg; - if (le16_to_cpu(req->index) >= CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) { + if (le16_to_cpu(req->index) > CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) { printf("The request port(%d) is not configured\n", le16_to_cpu(req->index) - 1); return -1; |