usb: gadget: f_mass_storage: convert to new function interface with backward compatib...
[deliverable/linux.git] / drivers / usb / gadget / multi.c
index 23393254a8a35593526062cc09880f50c809dced..42a5bed75388f02f86ed9b238f75ed4191ece318 100644 (file)
@@ -41,6 +41,7 @@ MODULE_LICENSE("GPL");
  * the runtime footprint, and giving us at least some parts of what
  * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
  */
+#define USB_FMS_INCLUDED
 #include "f_mass_storage.c"
 
 #define USBF_ECM_INCLUDED
@@ -132,6 +133,20 @@ static struct usb_gadget_strings *dev_strings[] = {
 /****************************** Configurations ******************************/
 
 static struct fsg_module_parameters fsg_mod_data = { .stall = 1 };
+#ifdef CONFIG_USB_GADGET_DEBUG_FILES
+
+static unsigned int fsg_num_buffers = CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS;
+
+#else
+
+/*
+ * Number of buffers we will use.
+ * 2 is usually enough for good buffering pipeline
+ */
+#define fsg_num_buffers        CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS
+
+#endif /* CONFIG_USB_DEBUG */
+
 FSG_MODULE_PARAMETERS(/* no prefix */, fsg_mod_data);
 
 static struct fsg_common fsg_common;
@@ -294,7 +309,8 @@ static int __ref multi_bind(struct usb_composite_dev *cdev)
        /* set up mass storage function */
        {
                void *retp;
-               retp = fsg_common_from_params(&fsg_common, cdev, &fsg_mod_data);
+               retp = fsg_common_from_params(&fsg_common, cdev, &fsg_mod_data,
+                                             fsg_num_buffers);
                if (IS_ERR(retp)) {
                        status = PTR_ERR(retp);
                        goto fail1;
This page took 0.0255 seconds and 5 git commands to generate.