Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22835b80 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: gadget: remove unnecessary 'driver' argument

now that no UDC driver relies on the extra
'driver' argument to ->udc_stop(), we can
safely remove it.

This commit is based on previous work by
Robert Baldyga <r.baldyga@samsung.com> which
can be found at [1]; however that patch turned
out to have a high probability of regressing
many UDC drivers because of a blind search & replace
s/driver/$udc->driver/ which caused the 'driver'
argument to stop_activity() to be a valid non-NULL
pointer when it should be NULL, thus causing UDCs
to mistakenly call gadget driver's ->disconnect()
callback.

[1] http://markmail.org/message/x5zneg4xea4zntab



Acked-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 8da9fe8a
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1544,8 +1544,7 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)

static int ci_udc_start(struct usb_gadget *gadget,
			 struct usb_gadget_driver *driver);
static int ci_udc_stop(struct usb_gadget *gadget,
			struct usb_gadget_driver *driver);
static int ci_udc_stop(struct usb_gadget *gadget);
/**
 * Device operations part of the API to the USB controller hardware,
 * which don't involve endpoints (or i/o)
@@ -1682,8 +1681,7 @@ static int ci_udc_start(struct usb_gadget *gadget,
/**
 * ci_udc_stop: unregister a gadget driver
 */
static int ci_udc_stop(struct usb_gadget *gadget,
			struct usb_gadget_driver *driver)
static int ci_udc_stop(struct usb_gadget *gadget)
{
	struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
	unsigned long flags;
+1 −2
Original line number Diff line number Diff line
@@ -2921,8 +2921,7 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget,
 *
 * Stop udc hw block and stay tunned for future transmissions
 */
static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
			  struct usb_gadget_driver *driver)
static int s3c_hsotg_udc_stop(struct usb_gadget *gadget)
{
	struct s3c_hsotg *hsotg = to_hsotg(gadget);
	unsigned long flags = 0;
+1 −2
Original line number Diff line number Diff line
@@ -1630,8 +1630,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
	return ret;
}

static int dwc3_gadget_stop(struct usb_gadget *g,
		struct usb_gadget_driver *driver)
static int dwc3_gadget_stop(struct usb_gadget *g)
{
	struct dwc3		*dwc = gadget_to_dwc(g);
	unsigned long		flags;
+3 −5
Original line number Diff line number Diff line
@@ -1401,9 +1401,8 @@ static int udc_wakeup(struct usb_gadget *gadget)

static int amd5536_udc_start(struct usb_gadget *g,
		struct usb_gadget_driver *driver);
static int amd5536_udc_stop(struct usb_gadget *g,
		struct usb_gadget_driver *driver);
/* gadget operations */
static int amd5536_udc_stop(struct usb_gadget *g);

static const struct usb_gadget_ops udc_ops = {
	.wakeup		= udc_wakeup,
	.get_frame	= udc_get_frame,
@@ -1962,8 +1961,7 @@ __acquires(dev->lock)
}

/* Called by gadget driver to unregister itself */
static int amd5536_udc_stop(struct usb_gadget *g,
		struct usb_gadget_driver *driver)
static int amd5536_udc_stop(struct usb_gadget *g)
{
	struct udc *dev = to_amd5536_udc(g);
	unsigned long flags;
+3 −4
Original line number Diff line number Diff line
@@ -984,8 +984,8 @@ static int at91_set_selfpowered(struct usb_gadget *gadget, int is_on)

static int at91_start(struct usb_gadget *gadget,
		struct usb_gadget_driver *driver);
static int at91_stop(struct usb_gadget *gadget,
		struct usb_gadget_driver *driver);
static int at91_stop(struct usb_gadget *gadget);

static const struct usb_gadget_ops at91_udc_ops = {
	.get_frame		= at91_get_frame,
	.wakeup			= at91_wakeup,
@@ -1644,8 +1644,7 @@ static int at91_start(struct usb_gadget *gadget,
	return 0;
}

static int at91_stop(struct usb_gadget *gadget,
		struct usb_gadget_driver *driver)
static int at91_stop(struct usb_gadget *gadget)
{
	struct at91_udc *udc;
	unsigned long	flags;
Loading