aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-10-09 04:06:01 -0400
committerFelipe Balbi <balbi@ti.com>2013-10-10 11:24:04 -0400
commite5eaa0dc4866181aff655ef3f94cd990172b751f (patch)
tree4209782f1dd0deef8cdd1da46eee9fca1441c672
parent5de862d73b2c1b3fbb0ac8b45eb496d77347d1b8 (diff)
usb: gadget: f_mass_storage: convert to new function interface with backward compatibility
Converting mass storage to the new function interface requires converting the USB mass storage's function code and its users. This patch converts the f_mass_storage.c to the new function interface. The file is now compiled into a separate usb_f_mass_storage.ko module. The old function interface is provided by means of a preprocessor conditional directives. After all users are converted, the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/Kconfig3
-rw-r--r--drivers/usb/gadget/Makefile2
-rw-r--r--drivers/usb/gadget/acm_ms.c1
-rw-r--r--drivers/usb/gadget/f_mass_storage.c178
-rw-r--r--drivers/usb/gadget/f_mass_storage.h15
-rw-r--r--drivers/usb/gadget/mass_storage.c1
-rw-r--r--drivers/usb/gadget/multi.c1
7 files changed, 179 insertions, 22 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 98220dcca315..40adaf08d3a5 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -528,6 +528,9 @@ config USB_F_RNDIS
528config USB_U_MS 528config USB_U_MS
529 tristate 529 tristate
530 530
531config USB_F_MASS_STORAGE
532 tristate
533
531choice 534choice
532 tristate "USB Gadget Drivers" 535 tristate "USB Gadget Drivers"
533 default USB_ETH 536 default USB_ETH
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index d90a0b079182..4a86b0c06676 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -62,6 +62,8 @@ usb_f_rndis-y := f_rndis.o
62obj-$(CONFIG_USB_F_RNDIS) += usb_f_rndis.o 62obj-$(CONFIG_USB_F_RNDIS) += usb_f_rndis.o
63u_ms-y := storage_common.o 63u_ms-y := storage_common.o
64obj-$(CONFIG_USB_U_MS) += u_ms.o 64obj-$(CONFIG_USB_U_MS) += u_ms.o
65usb_f_mass_storage-y := f_mass_storage.o
66obj-$(CONFIG_USB_F_MASS_STORAGE)+= usb_f_mass_storage.o
65 67
66# 68#
67# USB gadget drivers 69# USB gadget drivers
diff --git a/drivers/usb/gadget/acm_ms.c b/drivers/usb/gadget/acm_ms.c
index 992ffb00272f..31aae8fce426 100644
--- a/drivers/usb/gadget/acm_ms.c
+++ b/drivers/usb/gadget/acm_ms.c
@@ -40,6 +40,7 @@
40 * the runtime footprint, and giving us at least some parts of what 40 * the runtime footprint, and giving us at least some parts of what
41 * a "gcc --combine ... part1.c part2.c part3.c ... " build would. 41 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
42 */ 42 */
43#define USB_FMS_INCLUDED
43#include "f_mass_storage.c" 44#include "f_mass_storage.c"
44 45
45/*-------------------------------------------------------------------------*/ 46/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 5b99aa1846c3..a063cd5e5533 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -213,6 +213,7 @@
213#include <linux/spinlock.h> 213#include <linux/spinlock.h>
214#include <linux/string.h> 214#include <linux/string.h>
215#include <linux/freezer.h> 215#include <linux/freezer.h>
216#include <linux/module.h>
216 217
217#include <linux/usb/ch9.h> 218#include <linux/usb/ch9.h>
218#include <linux/usb/gadget.h> 219#include <linux/usb/gadget.h>
@@ -226,6 +227,13 @@
226#define FSG_DRIVER_DESC "Mass Storage Function" 227#define FSG_DRIVER_DESC "Mass Storage Function"
227#define FSG_DRIVER_VERSION "2009/09/11" 228#define FSG_DRIVER_VERSION "2009/09/11"
228 229
230/* to avoid a lot of #ifndef-#endif in the temporary compatibility layer */
231#ifndef USB_FMS_INCLUDED
232#define EXPORT_SYMBOL_GPL_IF_MODULE(m) EXPORT_SYMBOL_GPL(m);
233#else
234#define EXPORT_SYMBOL_GPL_IF_MODULE(m)
235#endif
236
229static const char fsg_string_interface[] = "Mass Storage"; 237static const char fsg_string_interface[] = "Mass Storage";
230 238
231#include "storage_common.h" 239#include "storage_common.h"
@@ -2627,11 +2635,13 @@ void fsg_common_get(struct fsg_common *common)
2627{ 2635{
2628 kref_get(&common->ref); 2636 kref_get(&common->ref);
2629} 2637}
2638EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_get);
2630 2639
2631void fsg_common_put(struct fsg_common *common) 2640void fsg_common_put(struct fsg_common *common)
2632{ 2641{
2633 kref_put(&common->ref, fsg_common_release); 2642 kref_put(&common->ref, fsg_common_release);
2634} 2643}
2644EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_put);
2635 2645
2636/* check if fsg_num_buffers is within a valid range */ 2646/* check if fsg_num_buffers is within a valid range */
2637static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers) 2647static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers)
@@ -2643,7 +2653,7 @@ static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers)
2643 return -EINVAL; 2653 return -EINVAL;
2644} 2654}
2645 2655
2646static struct fsg_common *fsg_common_setup(struct fsg_common *common) 2656static struct fsg_common *fsg_common_setup(struct fsg_common *common, bool zero)
2647{ 2657{
2648 if (!common) { 2658 if (!common) {
2649 common = kzalloc(sizeof(*common), GFP_KERNEL); 2659 common = kzalloc(sizeof(*common), GFP_KERNEL);
@@ -2651,7 +2661,8 @@ static struct fsg_common *fsg_common_setup(struct fsg_common *common)
2651 return ERR_PTR(-ENOMEM); 2661 return ERR_PTR(-ENOMEM);
2652 common->free_storage_on_release = 1; 2662 common->free_storage_on_release = 1;
2653 } else { 2663 } else {
2654 memset(common, 0, sizeof(*common)); 2664 if (zero)
2665 memset(common, 0, sizeof(*common));
2655 common->free_storage_on_release = 0; 2666 common->free_storage_on_release = 0;
2656 } 2667 }
2657 init_rwsem(&common->filesem); 2668 init_rwsem(&common->filesem);
@@ -2668,6 +2679,7 @@ void fsg_common_set_sysfs(struct fsg_common *common, bool sysfs)
2668{ 2679{
2669 common->sysfs = sysfs; 2680 common->sysfs = sysfs;
2670} 2681}
2682EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_sysfs);
2671 2683
2672static void _fsg_common_free_buffers(struct fsg_buffhd *buffhds, unsigned n) 2684static void _fsg_common_free_buffers(struct fsg_buffhd *buffhds, unsigned n)
2673{ 2685{
@@ -2723,6 +2735,7 @@ error_release:
2723 2735
2724 return -ENOMEM; 2736 return -ENOMEM;
2725} 2737}
2738EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_num_buffers);
2726 2739
2727static inline void fsg_common_remove_sysfs(struct fsg_lun *lun) 2740static inline void fsg_common_remove_sysfs(struct fsg_lun *lun)
2728{ 2741{
@@ -2761,6 +2774,7 @@ void fsg_common_remove_lun(struct fsg_lun *lun, bool sysfs)
2761 fsg_lun_close(lun); 2774 fsg_lun_close(lun);
2762 kfree(lun); 2775 kfree(lun);
2763} 2776}
2777EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_remove_lun);
2764 2778
2765static void _fsg_common_remove_luns(struct fsg_common *common, int n) 2779static void _fsg_common_remove_luns(struct fsg_common *common, int n)
2766{ 2780{
@@ -2772,6 +2786,7 @@ static void _fsg_common_remove_luns(struct fsg_common *common, int n)
2772 common->luns[i] = NULL; 2786 common->luns[i] = NULL;
2773 } 2787 }
2774} 2788}
2789EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_remove_luns);
2775 2790
2776void fsg_common_remove_luns(struct fsg_common *common) 2791void fsg_common_remove_luns(struct fsg_common *common)
2777{ 2792{
@@ -2784,6 +2799,7 @@ void fsg_common_free_luns(struct fsg_common *common)
2784 kfree(common->luns); 2799 kfree(common->luns);
2785 common->luns = NULL; 2800 common->luns = NULL;
2786} 2801}
2802EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_free_luns);
2787 2803
2788int fsg_common_set_nluns(struct fsg_common *common, int nluns) 2804int fsg_common_set_nluns(struct fsg_common *common, int nluns)
2789{ 2805{
@@ -2809,6 +2825,14 @@ int fsg_common_set_nluns(struct fsg_common *common, int nluns)
2809 2825
2810 return 0; 2826 return 0;
2811} 2827}
2828EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_nluns);
2829
2830void fsg_common_free_buffers(struct fsg_common *common)
2831{
2832 _fsg_common_free_buffers(common->buffhds, common->fsg_num_buffers);
2833 common->buffhds = NULL;
2834}
2835EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_free_buffers);
2812 2836
2813int fsg_common_set_cdev(struct fsg_common *common, 2837int fsg_common_set_cdev(struct fsg_common *common,
2814 struct usb_composite_dev *cdev, bool can_stall) 2838 struct usb_composite_dev *cdev, bool can_stall)
@@ -2836,6 +2860,7 @@ int fsg_common_set_cdev(struct fsg_common *common,
2836 2860
2837 return 0; 2861 return 0;
2838} 2862}
2863EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_cdev);
2839 2864
2840static inline int fsg_common_add_sysfs(struct fsg_common *common, 2865static inline int fsg_common_add_sysfs(struct fsg_common *common,
2841 struct fsg_lun *lun) 2866 struct fsg_lun *lun)
@@ -2958,6 +2983,7 @@ error_sysfs:
2958 kfree(lun); 2983 kfree(lun);
2959 return rc; 2984 return rc;
2960} 2985}
2986EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_create_lun);
2961 2987
2962int fsg_common_create_luns(struct fsg_common *common, struct fsg_config *cfg) 2988int fsg_common_create_luns(struct fsg_common *common, struct fsg_config *cfg)
2963{ 2989{
@@ -2979,6 +3005,7 @@ fail:
2979 _fsg_common_remove_luns(common, i); 3005 _fsg_common_remove_luns(common, i);
2980 return rc; 3006 return rc;
2981} 3007}
3008EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_create_luns);
2982 3009
2983void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn, 3010void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn,
2984 const char *pn) 3011 const char *pn)
@@ -2995,6 +3022,7 @@ void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn,
2995 : "File-Stor Gadget"), 3022 : "File-Stor Gadget"),
2996 i); 3023 i);
2997} 3024}
3025EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_inquiry_string);
2998 3026
2999int fsg_common_run_thread(struct fsg_common *common) 3027int fsg_common_run_thread(struct fsg_common *common)
3000{ 3028{
@@ -3013,6 +3041,7 @@ int fsg_common_run_thread(struct fsg_common *common)
3013 3041
3014 return 0; 3042 return 0;
3015} 3043}
3044EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_run_thread);
3016 3045
3017struct fsg_common *fsg_common_init(struct fsg_common *common, 3046struct fsg_common *fsg_common_init(struct fsg_common *common,
3018 struct usb_composite_dev *cdev, 3047 struct usb_composite_dev *cdev,
@@ -3020,7 +3049,7 @@ struct fsg_common *fsg_common_init(struct fsg_common *common,
3020{ 3049{
3021 int rc; 3050 int rc;
3022 3051
3023 common = fsg_common_setup(common); 3052 common = fsg_common_setup(common, !!common);
3024 if (IS_ERR(common)) 3053 if (IS_ERR(common))
3025 return common; 3054 return common;
3026 fsg_common_set_sysfs(common, true); 3055 fsg_common_set_sysfs(common, true);
@@ -3066,6 +3095,7 @@ error_release:
3066 fsg_common_release(&common->ref); 3095 fsg_common_release(&common->ref);
3067 return ERR_PTR(rc); 3096 return ERR_PTR(rc);
3068} 3097}
3098EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_init);
3069 3099
3070static void fsg_common_release(struct kref *ref) 3100static void fsg_common_release(struct kref *ref)
3071{ 3101{
@@ -3105,24 +3135,6 @@ static void fsg_common_release(struct kref *ref)
3105 3135
3106/*-------------------------------------------------------------------------*/ 3136/*-------------------------------------------------------------------------*/
3107 3137
3108static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
3109{
3110 struct fsg_dev *fsg = fsg_from_func(f);
3111 struct fsg_common *common = fsg->common;
3112
3113 DBG(fsg, "unbind\n");
3114 if (fsg->common->fsg == fsg) {
3115 fsg->common->new_fsg = NULL;
3116 raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
3117 /* FIXME: make interruptible or killable somehow? */
3118 wait_event(common->fsg_wait, common->fsg != fsg);
3119 }
3120
3121 fsg_common_put(common);
3122 usb_free_all_descriptors(&fsg->function);
3123 kfree(fsg);
3124}
3125
3126static int fsg_bind(struct usb_configuration *c, struct usb_function *f) 3138static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
3127{ 3139{
3128 struct fsg_dev *fsg = fsg_from_func(f); 3140 struct fsg_dev *fsg = fsg_from_func(f);
@@ -3132,6 +3144,21 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
3132 unsigned max_burst; 3144 unsigned max_burst;
3133 int ret; 3145 int ret;
3134 3146
3147#ifndef USB_FMS_INCLUDED
3148 struct fsg_opts *opts;
3149 opts = fsg_opts_from_func_inst(f->fi);
3150 if (!opts->no_configfs) {
3151 ret = fsg_common_set_cdev(fsg->common, c->cdev,
3152 fsg->common->can_stall);
3153 if (ret)
3154 return ret;
3155 fsg_common_set_inquiry_string(fsg->common, 0, 0);
3156 ret = fsg_common_run_thread(fsg->common);
3157 if (ret)
3158 return ret;
3159 }
3160#endif
3161
3135 fsg->gadget = gadget; 3162 fsg->gadget = gadget;
3136 3163
3137 /* New interface */ 3164 /* New interface */
@@ -3183,7 +3210,31 @@ autoconf_fail:
3183 return -ENOTSUPP; 3210 return -ENOTSUPP;
3184} 3211}
3185 3212
3186/****************************** ADD FUNCTION ******************************/ 3213/****************************** ALLOCATE FUNCTION *************************/
3214
3215static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
3216{
3217 struct fsg_dev *fsg = fsg_from_func(f);
3218 struct fsg_common *common = fsg->common;
3219
3220 DBG(fsg, "unbind\n");
3221 if (fsg->common->fsg == fsg) {
3222 fsg->common->new_fsg = NULL;
3223 raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
3224 /* FIXME: make interruptible or killable somehow? */
3225 wait_event(common->fsg_wait, common->fsg != fsg);
3226 }
3227
3228#ifdef USB_FMS_INCLUDED
3229 fsg_common_put(common);
3230#endif
3231 usb_free_all_descriptors(&fsg->function);
3232#ifdef USB_FMS_INCLUDED
3233 kfree(fsg);
3234#endif
3235}
3236
3237#ifdef USB_FMS_INCLUDED
3187 3238
3188static int fsg_bind_config(struct usb_composite_dev *cdev, 3239static int fsg_bind_config(struct usb_composite_dev *cdev,
3189 struct usb_configuration *c, 3240 struct usb_configuration *c,
@@ -3220,6 +3271,88 @@ static int fsg_bind_config(struct usb_composite_dev *cdev,
3220 return rc; 3271 return rc;
3221} 3272}
3222 3273
3274#else
3275
3276static void fsg_free_inst(struct usb_function_instance *fi)
3277{
3278 struct fsg_opts *opts;
3279
3280 opts = fsg_opts_from_func_inst(fi);
3281 fsg_common_put(opts->common);
3282 kfree(opts);
3283}
3284
3285static struct usb_function_instance *fsg_alloc_inst(void)
3286{
3287 struct fsg_opts *opts;
3288 int rc;
3289
3290 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
3291 if (!opts)
3292 return ERR_PTR(-ENOMEM);
3293 opts->func_inst.free_func_inst = fsg_free_inst;
3294 opts->common = fsg_common_setup(opts->common, false);
3295 if (IS_ERR(opts->common)) {
3296 rc = PTR_ERR(opts->common);
3297 goto release_opts;
3298 }
3299 rc = fsg_common_set_nluns(opts->common, FSG_MAX_LUNS);
3300 if (rc)
3301 goto release_opts;
3302
3303 rc = fsg_common_set_num_buffers(opts->common,
3304 CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS);
3305 if (rc)
3306 goto release_luns;
3307
3308 pr_info(FSG_DRIVER_DESC ", version: " FSG_DRIVER_VERSION "\n");
3309
3310 return &opts->func_inst;
3311
3312release_luns:
3313 kfree(opts->common->luns);
3314release_opts:
3315 kfree(opts);
3316 return ERR_PTR(rc);
3317}
3318
3319static void fsg_free(struct usb_function *f)
3320{
3321 struct fsg_dev *fsg;
3322
3323 fsg = container_of(f, struct fsg_dev, function);
3324
3325 kfree(fsg);
3326}
3327
3328static struct usb_function *fsg_alloc(struct usb_function_instance *fi)
3329{
3330 struct fsg_opts *opts = fsg_opts_from_func_inst(fi);
3331 struct fsg_common *common = opts->common;
3332 struct fsg_dev *fsg;
3333
3334 fsg = kzalloc(sizeof(*fsg), GFP_KERNEL);
3335 if (unlikely(!fsg))
3336 return ERR_PTR(-ENOMEM);
3337
3338 fsg->function.name = FSG_DRIVER_DESC;
3339 fsg->function.bind = fsg_bind;
3340 fsg->function.unbind = fsg_unbind;
3341 fsg->function.setup = fsg_setup;
3342 fsg->function.set_alt = fsg_set_alt;
3343 fsg->function.disable = fsg_disable;
3344 fsg->function.free_func = fsg_free;
3345
3346 fsg->common = common;
3347
3348 return &fsg->function;
3349}
3350
3351DECLARE_USB_FUNCTION_INIT(mass_storage, fsg_alloc_inst, fsg_alloc);
3352MODULE_LICENSE("GPL");
3353MODULE_AUTHOR("Michal Nazarewicz");
3354
3355#endif
3223 3356
3224/************************* Module parameters *************************/ 3357/************************* Module parameters *************************/
3225 3358
@@ -3256,4 +3389,5 @@ void fsg_config_from_params(struct fsg_config *cfg,
3256 cfg->can_stall = params->stall; 3389 cfg->can_stall = params->stall;
3257 cfg->fsg_num_buffers = fsg_num_buffers; 3390 cfg->fsg_num_buffers = fsg_num_buffers;
3258} 3391}
3392EXPORT_SYMBOL_GPL_IF_MODULE(fsg_config_from_params);
3259 3393
diff --git a/drivers/usb/gadget/f_mass_storage.h b/drivers/usb/gadget/f_mass_storage.h
index 7d9e0bc1cbf1..42f7db408478 100644
--- a/drivers/usb/gadget/f_mass_storage.h
+++ b/drivers/usb/gadget/f_mass_storage.h
@@ -1,6 +1,7 @@
1#ifndef USB_F_MASS_STORAGE_H 1#ifndef USB_F_MASS_STORAGE_H
2#define USB_F_MASS_STORAGE_H 2#define USB_F_MASS_STORAGE_H
3 3
4#include <linux/usb/composite.h>
4#include "storage_common.h" 5#include "storage_common.h"
5 6
6struct fsg_module_parameters { 7struct fsg_module_parameters {
@@ -70,6 +71,12 @@ struct fsg_operations {
70 int (*thread_exits)(struct fsg_common *common); 71 int (*thread_exits)(struct fsg_common *common);
71}; 72};
72 73
74struct fsg_opts {
75 struct fsg_common *common;
76 struct usb_function_instance func_inst;
77 bool no_configfs; /* for legacy gadgets */
78};
79
73struct fsg_lun_config { 80struct fsg_lun_config {
74 const char *filename; 81 const char *filename;
75 char ro; 82 char ro;
@@ -94,6 +101,12 @@ struct fsg_config {
94 unsigned int fsg_num_buffers; 101 unsigned int fsg_num_buffers;
95}; 102};
96 103
104static inline struct fsg_opts *
105fsg_opts_from_func_inst(const struct usb_function_instance *fi)
106{
107 return container_of(fi, struct fsg_opts, func_inst);
108}
109
97void fsg_common_get(struct fsg_common *common); 110void fsg_common_get(struct fsg_common *common);
98 111
99void fsg_common_put(struct fsg_common *common); 112void fsg_common_put(struct fsg_common *common);
@@ -106,6 +119,8 @@ void fsg_common_set_sysfs(struct fsg_common *common, bool sysfs);
106 119
107int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n); 120int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n);
108 121
122void fsg_common_free_buffers(struct fsg_common *common);
123
109int fsg_common_set_cdev(struct fsg_common *common, 124int fsg_common_set_cdev(struct fsg_common *common,
110 struct usb_composite_dev *cdev, bool can_stall); 125 struct usb_composite_dev *cdev, bool can_stall);
111 126
diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c
index 4723d1b04cff..f6702514f5d7 100644
--- a/drivers/usb/gadget/mass_storage.c
+++ b/drivers/usb/gadget/mass_storage.c
@@ -55,6 +55,7 @@
55 * the runtime footprint, and giving us at least some parts of what 55 * the runtime footprint, and giving us at least some parts of what
56 * a "gcc --combine ... part1.c part2.c part3.c ... " build would. 56 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
57 */ 57 */
58#define USB_FMS_INCLUDED
58#include "f_mass_storage.c" 59#include "f_mass_storage.c"
59 60
60/*-------------------------------------------------------------------------*/ 61/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index 6867d9dbbca4..42a5bed75388 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -41,6 +41,7 @@ MODULE_LICENSE("GPL");
41 * the runtime footprint, and giving us at least some parts of what 41 * the runtime footprint, and giving us at least some parts of what
42 * a "gcc --combine ... part1.c part2.c part3.c ... " build would. 42 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
43 */ 43 */
44#define USB_FMS_INCLUDED
44#include "f_mass_storage.c" 45#include "f_mass_storage.c"
45 46
46#define USBF_ECM_INCLUDED 47#define USBF_ECM_INCLUDED