summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/s3c_udc_otg.c
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2014-03-05 12:51:26 +0100
committerStefano Babic <sbabic@denx.de>2014-03-05 12:51:26 +0100
commit1ad6364eeb4f578e423081d1748e8a3fdf1ab01d (patch)
treef55731737edf1cfd653b21f2ff9d387e6c53ae24 /drivers/usb/gadget/s3c_udc_otg.c
parent335143c76612a0ae26eef8abeda77641d4f63b50 (diff)
parentcc07294bc704694ae33db75b25ac557e5917a83f (diff)
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'drivers/usb/gadget/s3c_udc_otg.c')
-rw-r--r--drivers/usb/gadget/s3c_udc_otg.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index ba17a04265..63d4487a9b 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -843,7 +843,7 @@ static struct s3c_udc memory = {
int s3c_udc_probe(struct s3c_plat_otg_data *pdata)
{
struct s3c_udc *dev = &memory;
- int retval = 0, i;
+ int retval = 0;
debug("%s: %p\n", __func__, pdata);
@@ -864,16 +864,15 @@ int s3c_udc_probe(struct s3c_plat_otg_data *pdata)
the_controller = dev;
- for (i = 0; i < S3C_MAX_ENDPOINTS+1; i++) {
- dev->dma_buf[i] = memalign(CONFIG_SYS_CACHELINE_SIZE,
- DMA_BUFFER_SIZE);
- dev->dma_addr[i] = (dma_addr_t) dev->dma_buf[i];
- invalidate_dcache_range((unsigned long) dev->dma_buf[i],
- (unsigned long) (dev->dma_buf[i]
- + DMA_BUFFER_SIZE));
+ usb_ctrl = memalign(CONFIG_SYS_CACHELINE_SIZE,
+ ROUND(sizeof(struct usb_ctrlrequest),
+ CONFIG_SYS_CACHELINE_SIZE));
+ if (!usb_ctrl) {
+ error("No memory available for UDC!\n");
+ return -ENOMEM;
}
- usb_ctrl = dev->dma_buf[0];
- usb_ctrl_dma_addr = dev->dma_addr[0];
+
+ usb_ctrl_dma_addr = (dma_addr_t) usb_ctrl;
udc_reinit(dev);