summaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-06-21 10:24:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-30 12:46:25 +0200
commit9ca0e573af89a5d2ce0bc682633560891275bf71 (patch)
tree2ce5087c96e40c5596141565e6f5c8f084648958 /drivers/usb/storage
parent787fa164dd3766f3822e9456a3cdd9d437b9bc5b (diff)
downloadbarebox-9ca0e573af89a5d2ce0bc682633560891275bf71.tar.gz
barebox-9ca0e573af89a5d2ce0bc682633560891275bf71.tar.xz
USB storage: use dma_alloc where appropriate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/transport.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index e7a5972750..68170b65c0 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -26,6 +26,7 @@
#include <clock.h>
#include <scsi.h>
#include <errno.h>
+#include <dma.h>
#undef USB_STOR_DEBUG
@@ -65,8 +66,8 @@ int usb_stor_Bulk_clear_endpt_stall(struct us_data *us, unsigned int pipe)
/* Determine what the maximum LUN supported is */
int usb_stor_Bulk_max_lun(struct us_data *us)
{
- int len;
- unsigned char iobuf[1];
+ int len, ret = 0;
+ unsigned char *iobuf = dma_alloc(1);
/* issue the command */
iobuf[0] = 0;
@@ -81,7 +82,9 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
/* if we have a successful request, return the result */
if (len > 0)
- return (int)iobuf[0];
+ ret = iobuf[0];
+
+ dma_free(iobuf);
/*
* Some devices don't like GetMaxLUN. They may STALL the control
@@ -90,7 +93,7 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
* ways. In these cases the best approach is to use the default
* value: only one LUN.
*/
- return 0;
+ return ret;
}
int usb_stor_Bulk_transport(ccb *srb, struct us_data *us)