]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/f_mass_storage.c
Merge branch 'master' of git://git.denx.de/u-boot-usb
[u-boot] / drivers / usb / gadget / f_mass_storage.c
index b1fe8bd3a805df4a1d97d50395a128a30ad21eaa..6374bb953a94478bbf469b09b52756e18796fac4 100644 (file)
 #include <config.h>
 #include <malloc.h>
 #include <common.h>
-#include <usb.h>
+#include <g_dnl.h>
 
 #include <linux/err.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/composite.h>
 #include <usb/lin_gadget_compat.h>
+#include <g_dnl.h>
 
 /*------------------------------------------------------------------------*/
 
@@ -680,11 +681,11 @@ static int sleep_thread(struct fsg_common *common)
                        /* Handle CTRL+C */
                        if (ctrlc())
                                return -EPIPE;
-#ifdef CONFIG_USB_CABLE_CHECK
+
                        /* Check cable connection */
-                       if (!usb_cable_connected())
+                       if (!g_dnl_board_usb_cable_connected())
                                return -EIO;
-#endif
+
                        k = 0;
                }
 
@@ -2515,7 +2516,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 +2623,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;
 
@@ -2778,3 +2779,5 @@ int fsg_init(struct ums *ums_dev)
 
        return 0;
 }
+
+DECLARE_GADGET_BIND_CALLBACK(usb_dnl_ums, fsg_add);