From 8876f5e7d3b2a320777dd4f6f5301d474c97a06c Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Mon, 21 Jun 2010 13:57:09 +0200 Subject: USB: gadget: f_mass_storage: added eject callback Added pre_eject() and post_eject() callbacks which are called before and after removable logical unit is ejected. The first can prevent logical unit from being ejected. This commit also changes the way callbacks are passed to the function from gadget. A fsg_operations structure has been created which lists all callbacks -- this is passed to the fsg_config. This is important because it changes the way thread_exits() callback is passed. Signed-off-by: Michal Nazarewicz Signed-off-by: Kyungmin Park Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/mass_storage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/usb/gadget/mass_storage.c') diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c index 2b11e2079823..306098f2d924 100644 --- a/drivers/usb/gadget/mass_storage.c +++ b/drivers/usb/gadget/mass_storage.c @@ -143,6 +143,9 @@ static int msg_thread_exits(struct fsg_common *common) static int __init msg_do_config(struct usb_configuration *c) { + static const struct fsg_operations ops = { + .thread_exits = msg_thread_exits, + }; static struct fsg_common common; struct fsg_common *retp; @@ -155,7 +158,7 @@ static int __init msg_do_config(struct usb_configuration *c) } fsg_config_from_params(&config, &mod_data); - config.thread_exits = msg_thread_exits; + config.ops = &ops; retp = fsg_common_init(&common, c->cdev, &config); if (IS_ERR(retp)) -- cgit v1.2.1