]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
usb:g_dnl:ums: Conditional compilation for mass storage function (f_mass_storage)
authorLukasz Majewski <l.majewski@samsung.com>
Tue, 17 Sep 2013 13:58:21 +0000 (15:58 +0200)
committerMarek Vasut <marex@denx.de>
Tue, 24 Sep 2013 15:51:35 +0000 (17:51 +0200)
The mass storage composite function is now compiled in only when
CONFIG_USB_GADGET_MASS_STORAGE is defined.
Such change provides binary size reduction for boards which use USB
download gadget (like am335x_evm) with DFU, but don't use UMS.

For example at am335x_evm board reduction is more than 2KiB for
text and around 120B for data.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
drivers/usb/gadget/Makefile
drivers/usb/gadget/g_dnl.c
include/usb_mass_storage.h

index 4d51f5991be040d76fe816b2b0818a14462fb058..1590c4a7508f0976adac0dc5ece2f2a1ca616fb0 100644 (file)
@@ -23,6 +23,7 @@ COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 COBJS-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
+COBJS-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
 endif
 ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o
index a3e05a872a7bdd157ddcad653a32cc9f97f391d5..19011bf9fc268ae274b534173b1443a242c7be23 100644 (file)
 #include <part.h>
 
 #include <g_dnl.h>
+#include <usb_mass_storage.h>
 #include "f_dfu.h"
 
 #include "gadget_chips.h"
 #include "composite.c"
-#include "f_mass_storage.c"
 
 /*
  * One needs to define the following:
index 35cdcc3d8c7ae77d500f4ca7de85f2a2993a08d4..e08deb4ddf179c31914add65c078ff6f0ed3f083 100644 (file)
@@ -11,6 +11,7 @@
 #define SECTOR_SIZE            0x200
 
 #include <mmc.h>
+#include <linux/usb/composite.h>
 
 struct ums_device {
        struct mmc *mmc;
@@ -39,4 +40,12 @@ extern struct ums_board_info *board_ums_init(unsigned int,
 extern int usb_gadget_handle_interrupts(void);
 extern int fsg_main_thread(void *);
 
+#ifdef CONFIG_USB_GADGET_MASS_STORAGE
+int fsg_add(struct usb_configuration *c);
+#else
+int fsg_add(struct usb_configuration *c)
+{
+       return 0;
+}
+#endif
 #endif /* __USB_MASS_STORAGE_H__ */