summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2014-02-05 10:10:41 +0100
committerMarek Vasut <marex@denx.de>2014-02-06 02:22:44 +0100
commit16b7a29fc6fac16431051de06d62da689360c40a (patch)
tree0265a10d68017893cebf4b86df921fd6b2e27725 /drivers/usb
parente141652b9cd0cb4f899f7a0fd71c8a438300e365 (diff)
downloadu-boot-imx-16b7a29fc6fac16431051de06d62da689360c40a.zip
u-boot-imx-16b7a29fc6fac16431051de06d62da689360c40a.tar.gz
u-boot-imx-16b7a29fc6fac16431051de06d62da689360c40a.tar.bz2
usb:gadget:ums: Replace malloc calls with memalign to fix cache buffer alignment
Calls to malloc() have been replaced by memalign. It now provides proper buffer alignment. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index b1fe8bd..f896169 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2515,7 +2515,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
buffhds_first_it:
bh->inreq_busy = 0;
bh->outreq_busy = 0;
- bh->buf = kmalloc(FSG_BUFLEN, GFP_KERNEL);
+ bh->buf = memalign(CONFIG_SYS_CACHELINE_SIZE, FSG_BUFLEN);
if (unlikely(!bh->buf)) {
rc = -ENOMEM;
goto error_release;
@@ -2622,7 +2622,7 @@ usb_copy_descriptors(struct usb_descriptor_header **src)
bytes += (*tmp)->bLength;
bytes += (n_desc + 1) * sizeof(*tmp);
- mem = kmalloc(bytes, GFP_KERNEL);
+ mem = memalign(CONFIG_SYS_CACHELINE_SIZE, bytes);
if (!mem)
return NULL;