From: Sebastian Andrzej Siewior Date: Sun, 23 Dec 2012 20:10:21 +0000 (+0100) Subject: usb: gadget: export composite's setup & disconnect function X-Git-Tag: v3.9-rc1~126^2~43^2~22 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2d5a88990260d226a69acddf22c04f47c267b33a;p=~emulex%2Finfiniband.git usb: gadget: export composite's setup & disconnect function The configfs can't use all of composite's hooks because ->bind() and ->unbind() has to be done a little differently. ->disconnect() and ->setup() on the hand can be recycled. This patch exports them both so configfs can use them. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 9083ec93f38..8a1c3752f75 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1077,7 +1077,7 @@ static void composite_setup_complete(struct usb_ep *ep, struct usb_request *req) * housekeeping for the gadget function we're implementing. Most of * the work is in config and function specific setup. */ -static int +int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) { struct usb_composite_dev *cdev = get_gadget_data(gadget); @@ -1344,7 +1344,7 @@ done: return value; } -static void composite_disconnect(struct usb_gadget *gadget) +void composite_disconnect(struct usb_gadget *gadget) { struct usb_composite_dev *cdev = get_gadget_data(gadget); unsigned long flags; diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index bd6d857c12f..a212ec3e9d6 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -398,6 +398,10 @@ extern int usb_string_ids_tab(struct usb_composite_dev *c, struct usb_string *str); extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); +extern void composite_disconnect(struct usb_gadget *gadget); +extern int composite_setup(struct usb_gadget *gadget, + const struct usb_ctrlrequest *ctrl); + /* * Some systems will need runtime overrides for the product identifiers * published in the device descriptor, either numbers or strings or both.