summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPiotr Wilczek <p.wilczek@samsung.com>2013-04-10 14:07:51 +0200
committerMarek Vasut <marex@denx.de>2013-06-30 18:41:07 +0200
commit12595e99e40ba4d0a08744e375f4e2144dc5acb6 (patch)
treea31deba681317dc567e386a9b54cf942620878db /drivers/usb
parent7f3cf4060fe8e93d785581ea2047929c1cb15a18 (diff)
usb:composite: use memcpy to avoid unaligned access
This patch memcpy is used instead of an assignment to avoid unaligned access execption on some ARM platforms. Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/composite.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index f30778a163..f8677931b4 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -997,7 +997,8 @@ static int composite_bind(struct usb_gadget *gadget)
if (status < 0)
goto fail;
- cdev->desc = *composite->dev;
+ memcpy(&cdev->desc, composite->dev,
+ sizeof(struct usb_device_descriptor));
cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
debug("%s: ready\n", composite->name);