X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fusb%2Fgadget%2Fmass_storage.c;h=585f2559484dfe3dc1ece40d0643d2b422dc7945;hb=d2ecad9faca2221ae6f664f146f0dcae661bf39d;hp=705cc1f76327c6cc953f4b2efcc6788a77ef760d;hpb=62052be3a797f26f6f0fe30fc8d7f40ab54e08fd;p=karo-tx-linux.git diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c index 705cc1f76327..585f2559484d 100644 --- a/drivers/usb/gadget/mass_storage.c +++ b/drivers/usb/gadget/mass_storage.c @@ -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;