]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/gadget/mass_storage.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[karo-tx-linux.git] / drivers / usb / gadget / mass_storage.c
index 705cc1f76327c6cc953f4b2efcc6788a77ef760d..585f2559484dfe3dc1ece40d0643d2b422dc7945 100644 (file)
@@ -141,9 +141,14 @@ static int msg_thread_exits(struct fsg_common *common)
        return 0;
 }
 
-static int __init msg_do_config(struct usb_configuration *c)
+static int __ref msg_do_config(struct usb_configuration *c)
 {
-       struct fsg_common *common;
+       static const struct fsg_operations ops = {
+               .thread_exits = msg_thread_exits,
+       };
+       static struct fsg_common common;
+
+       struct fsg_common *retp;
        struct fsg_config config;
        int ret;
 
@@ -153,13 +158,14 @@ static int __init msg_do_config(struct usb_configuration *c)
        }
 
        fsg_config_from_params(&config, &mod_data);
-       config.thread_exits = msg_thread_exits;
-       common = fsg_common_init(0, c->cdev, &config);
-       if (IS_ERR(common))
-               return PTR_ERR(common);
+       config.ops = &ops;
+
+       retp = fsg_common_init(&common, c->cdev, &config);
+       if (IS_ERR(retp))
+               return PTR_ERR(retp);
 
-       ret = fsg_add(c->cdev, c, common);
-       fsg_common_put(common);
+       ret = fsg_bind_config(c->cdev, c, &common);
+       fsg_common_put(&common);
        return ret;
 }
 
@@ -176,7 +182,7 @@ static struct usb_configuration msg_config_driver = {
 /****************************** Gadget Bind ******************************/
 
 
-static int __init msg_bind(struct usb_composite_dev *cdev)
+static int __ref msg_bind(struct usb_composite_dev *cdev)
 {
        struct usb_gadget *gadget = cdev->gadget;
        int status;