summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/mass_storage.c
diff options
context:
space:
mode:
authorMichal Nazarewicz <m.nazarewicz@samsung.com>2010-06-21 13:57:09 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 23:35:37 +0200
commit8876f5e7d3b2a320777dd4f6f5301d474c97a06c (patch)
tree7203196be21e46bef900a2f89e30a769730083f1 /drivers/usb/gadget/mass_storage.c
parentUSB: gadget: composite: added disconnect callback (diff)
downloadlinux-8876f5e7d3b2a320777dd4f6f5301d474c97a06c.tar.xz
linux-8876f5e7d3b2a320777dd4f6f5301d474c97a06c.zip
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 <m.nazarewicz@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@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.c5
1 files changed, 4 insertions, 1 deletions
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))