]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
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)
committerMarek Vasut <marex@denx.de>
Tue, 24 Sep 2013 15:51:36 +0000 (17:51 +0200)
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 34a4dde5aa7e3bdad1a3e5398da479b659de4e8e..cc2c45567b6cb2e0830d1275b144a75186bd2dfa 100644 (file)
@@ -82,7 +82,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 29d08a3a227304c62bd977a881610c9f8f46e7e2..40868c034e42fcde8416d407552e38e2e2daf75b 100644 (file)
@@ -15,7 +15,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 6f4bba455b131016c1d5c0de213106101002e85a..b2ecf1bebea99178e70466a23c7d64e13096d568 100644 (file)
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <linux/list.h>
 #include <mmc.h>
+#include <linux/usb/composite.h>
 
 enum dfu_device_type {
        DFU_DEV_MMC = 1,
@@ -161,4 +162,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_ */