aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/mass_storage.c
diff options
context:
space:
mode:
authorMichal Nazarewicz <m.nazarewicz@samsung.com>2009-11-09 08:15:21 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:22 -0500
commit481e49296ae6979891af30c9858511d4347a5393 (patch)
tree9c78e22db74134e4ccd96df62d92295b7c88da31 /drivers/usb/gadget/mass_storage.c
parentd23b0f08d18fc42f26f6a0776c6d827eb35143a9 (diff)
USB: g_mass_storage: fsg_config added & module params handlig changed
Removed all references to mod_data in f_mass_storage.c and instead created fsg_config structure fsg_common_init() takes as an argument -- it stores all configuration options that were previously taken from mod_data. Moreover, The fsg_config structure allows per-LUN configuration of removable and CD-ROM emulation. Module parameters are handled by defining an object of fsg_module_parameters structure and then declaring module parameters via FSG_MODULE_PARAMETERS() macro. It adds proper declarations to the code making specified object be populated from module parameters. To use values stored there one may use either fsg_config_from_params() which will will a fsg_config structure with values taken from fsg_module_parameters structure or fsg_common_from_params() which will initialise fsg_common structure directly. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/mass_storage.c')
-rw-r--r--drivers/usb/gadget/mass_storage.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c
index 27339f04bc1b..00396a36d011 100644
--- a/drivers/usb/gadget/mass_storage.c
+++ b/drivers/usb/gadget/mass_storage.c
@@ -127,6 +127,11 @@ static struct usb_gadget_strings *dev_strings[] = {
127 127
128/****************************** Configurations ******************************/ 128/****************************** Configurations ******************************/
129 129
130static struct fsg_module_parameters mod_data = {
131 .stall = 1
132};
133FSG_MODULE_PARAMETERS(/* no prefix */, mod_data);
134
130static int __init msg_do_config(struct usb_configuration *c) 135static int __init msg_do_config(struct usb_configuration *c)
131{ 136{
132 struct fsg_common *common; 137 struct fsg_common *common;
@@ -137,7 +142,7 @@ static int __init msg_do_config(struct usb_configuration *c)
137 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 142 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
138 } 143 }
139 144
140 common = fsg_common_init(0, c->cdev); 145 common = fsg_common_from_params(0, c->cdev, &mod_data);
141 if (IS_ERR(common)) 146 if (IS_ERR(common))
142 return PTR_ERR(common); 147 return PTR_ERR(common);
143 148