aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/mass_storage.c
diff options
context:
space:
mode:
authorMichal Nazarewicz <m.nazarewicz@samsung.com>2010-06-21 07:57:09 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:37 -0400
commit8876f5e7d3b2a320777dd4f6f5301d474c97a06c (patch)
tree7203196be21e46bef900a2f89e30a769730083f1 /drivers/usb/gadget/mass_storage.c
parent3f3e12d050052032a51f75e72e540322e2a7da2b (diff)
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)
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 static const struct fsg_operations ops = {
147 .thread_exits = msg_thread_exits,
148 };
146 static struct fsg_common common; 149 static struct fsg_common common;
147 150
148 struct fsg_common *retp; 151 struct fsg_common *retp;
@@ -155,7 +158,7 @@ static int __init msg_do_config(struct usb_configuration *c)
155 } 158 }
156 159
157 fsg_config_from_params(&config, &mod_data); 160 fsg_config_from_params(&config, &mod_data);
158 config.thread_exits = msg_thread_exits; 161 config.ops = &ops;
159 162
160 retp = fsg_common_init(&common, c->cdev, &config); 163 retp = fsg_common_init(&common, c->cdev, &config);
161 if (IS_ERR(retp)) 164 if (IS_ERR(retp))