aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/mass_storage.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c
index 705cc1f76327..e68c00e08765 100644
--- a/drivers/usb/gadget/mass_storage.c
+++ b/drivers/usb/gadget/mass_storage.c
@@ -143,7 +143,9 @@ static int msg_thread_exits(struct fsg_common *common)
143 143
144static int __init msg_do_config(struct usb_configuration *c) 144static int __init msg_do_config(struct usb_configuration *c)
145{ 145{
146 struct fsg_common *common; 146 static struct fsg_common common;
147
148 struct fsg_common *retp;
147 struct fsg_config config; 149 struct fsg_config config;
148 int ret; 150 int ret;
149 151
@@ -154,12 +156,13 @@ static int __init msg_do_config(struct usb_configuration *c)
154 156
155 fsg_config_from_params(&config, &mod_data); 157 fsg_config_from_params(&config, &mod_data);
156 config.thread_exits = msg_thread_exits; 158 config.thread_exits = msg_thread_exits;
157 common = fsg_common_init(0, c->cdev, &config);
158 if (IS_ERR(common))
159 return PTR_ERR(common);
160 159
161 ret = fsg_add(c->cdev, c, common); 160 retp = fsg_common_init(&common, c->cdev, &config);
162 fsg_common_put(common); 161 if (IS_ERR(retp))
162 return PTR_ERR(retp);
163
164 ret = fsg_add(c->cdev, c, &common);
165 fsg_common_put(&common);
163 return ret; 166 return ret;
164} 167}
165 168