With a few tweaks we can compile this code with sandbox and enable testing
of the USB storage layer.

Signed-off-by: Simon Glass <s...@chromium.org>
---

Changes in v2: None

 common/usb_storage.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index 64d01ea..acea5ae 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <command.h>
 #include <inttypes.h>
+#include <mapmem.h>
 #include <asm/byteorder.h>
 #include <asm/processor.h>
 
@@ -295,8 +296,9 @@ static int us_one_transfer(struct us_data *us, int pipe, 
char *buf, int length)
                /* set up the transfer loop */
                do {
                        /* transfer the data */
-                       debug("Bulk xfer 0x%x(%d) try #%d\n",
-                             (unsigned int)buf, this_xfer, 11 - maxtry);
+                       debug("Bulk xfer 0x%lx(%d) try #%d\n",
+                             (ulong)map_to_sysmem(buf), this_xfer,
+                             11 - maxtry);
                        result = usb_bulk_msg(us->pusb_dev, pipe, buf,
                                              this_xfer, &partial,
                                              USB_CNTL_TIMEOUT * 5);
@@ -562,7 +564,7 @@ static int usb_stor_CBI_get_status(ccb *srb, struct us_data 
*us)
                        (void *) &us->ip_data, us->irqmaxp, us->irqinterval);
        timeout = 1000;
        while (timeout--) {
-               if ((volatile int *) us->ip_wanted == NULL)
+               if (*(volatile int *)&us->ip_wanted == 0)
                        break;
                mdelay(10);
        }
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to