From: Andrzej Pietrasiewicz Date: Thu, 26 Sep 2013 12:38:15 +0000 (+0200) Subject: usb: gadget: configfs: add a method to unregister the gadget X-Git-Tag: accepted/tizen/common/20141203.182822~1210^2~22^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=092a4bd069fcca09f345a79c8abdc945cf6b1b57;p=platform%2Fkernel%2Flinux-arm64.git usb: gadget: configfs: add a method to unregister the gadget Add a method to unregister the gadget using its config_item. There can be functions (e.g. mass storage), which in some circumstances need the gadget stopped. Add a method of stopping the gadget. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Kyungmin Park Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 1bfacbf..2588511 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -991,6 +991,14 @@ static struct configfs_subsystem gadget_subsys = { .su_mutex = __MUTEX_INITIALIZER(gadget_subsys.su_mutex), }; +void unregister_gadget_item(struct config_item *item) +{ + struct gadget_info *gi = to_gadget_info(item); + + unregister_gadget(gi); +} +EXPORT_SYMBOL(unregister_gadget_item); + static int __init gadget_cfs_init(void) { int ret; diff --git a/drivers/usb/gadget/configfs.h b/drivers/usb/gadget/configfs.h new file mode 100644 index 0000000..a7b564a --- /dev/null +++ b/drivers/usb/gadget/configfs.h @@ -0,0 +1,6 @@ +#ifndef USB__GADGET__CONFIGFS__H +#define USB__GADGET__CONFIGFS__H + +void unregister_gadget_item(struct config_item *item); + +#endif /* USB__GADGET__CONFIGFS__H */