diff options
author | Piotr Wilczek <p.wilczek@samsung.com> | 2013-04-10 12:07:51 (GMT) |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2013-06-30 16:41:07 (GMT) |
commit | 12595e99e40ba4d0a08744e375f4e2144dc5acb6 (patch) | |
tree | a31deba681317dc567e386a9b54cf942620878db /drivers/usb/gadget | |
parent | 7f3cf4060fe8e93d785581ea2047929c1cb15a18 (diff) | |
download | u-boot-12595e99e40ba4d0a08744e375f4e2144dc5acb6.tar.xz |
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/gadget')
-rw-r--r-- | drivers/usb/gadget/composite.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f30778a..f867793 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); |