usb:g_dnl:dfu: Download gadget and DFU function code clean up
authorLukasz Majewski <l.majewski@samsung.com>
Tue, 17 Sep 2013 13:58:23 +0000 (15:58 +0200)
committerChanho Park <chanho61.park@samsung.com>
Wed, 22 Jul 2015 12:00:43 +0000 (21:00 +0900)
The download gadget code and DFU function lacks of proper declarations
for the case when a target board wants to use only one of available usb
functions.

Moreover the relevant declarations have been moved to consistent
localization (like <dfu.h>).

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

index 023e1adacc3c321b5816ab612169f6344d5d7d43..bc457f4deac6db28cbcbe03cf3ff1f9189d21579 100644 (file)
@@ -94,7 +94,4 @@ struct dfu_function_descriptor {
        __le16                          wTransferSize;
        __le16                          bcdDFUVersion;
 } __packed;
-
-/* configuration-specific linkup */
-int dfu_add(struct usb_configuration *c);
 #endif /* __F_DFU_H_ */
index 65e616626a59aaddfa44c150bfe23f12fbe0f16d..9d4bca873ec34faba6872e9fcc59ce4b17b25dd2 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <g_dnl.h>
 #include <usb_mass_storage.h>
-#include "f_dfu.h"
+#include <dfu.h>
 
 #include "gadget_chips.h"
 #include "composite.c"
index 0fc4007c1583727a362231e84b94348d6f1240b6..edc791effc90a77e5d68d6d9710ae570bea1d128 100644 (file)
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <linux/list.h>
 #include <mmc.h>
+#include <linux/usb/composite.h>
 
 enum dfu_device_type {
        DFU_DEV_MMC = 1,
@@ -173,4 +174,12 @@ static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s)
 }
 #endif
 
+#ifdef CONFIG_DFU_FUNCTION
+int dfu_add(struct usb_configuration *c);
+#else
+int dfu_add(struct usb_configuration *c)
+{
+       return 0;
+}
+#endif
 #endif /* __DFU_ENTITY_H_ */