summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2014-07-23 15:51:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-24 08:57:57 +0200
commitf261bce3a699fd11f7f2d0bbbde26ec26ed1d55f (patch)
treeef4163c94a1acdf466e29db6433271238cbd68a5
parent756c95b7644748b334130332e2c4e56cbb217406 (diff)
downloadbarebox-f261bce3a699fd11f7f2d0bbbde26ec26ed1d55f.tar.gz
USB: EHCI: use descriptor length fields
Instead of hard-coding descriptor length, pick it from the corresponding descriptor. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/host/ehci-hcd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a3063f9..ab1bc03 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -503,12 +503,12 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
case USB_DT_DEVICE:
dev_dbg(ehci->dev, "USB_DT_DEVICE request\n");
srcptr = &descriptor.device;
- srclen = 0x12;
+ srclen = descriptor.device.bLength;
break;
case USB_DT_CONFIG:
dev_dbg(ehci->dev, "USB_DT_CONFIG config\n");
srcptr = &descriptor.config;
- srclen = 0x19;
+ srclen = le16_to_cpu(descriptor.config.wTotalLength);
break;
case USB_DT_STRING:
dev_dbg(ehci->dev, "USB_DT_STRING config\n");
@@ -543,7 +543,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
case USB_DT_HUB:
dev_dbg(ehci->dev, "USB_DT_HUB config\n");
srcptr = &descriptor.hub;
- srclen = 0x8;
+ srclen = descriptor.hub.bLength;
break;
default:
dev_dbg(ehci->dev, "unknown value %x\n", le16_to_cpu(req->value));