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

Commit 82891b95 authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: gadget: udc: s3c-hsudc: do not rely on 'driver' argument



future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.

Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c3d84dfb
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1199,11 +1199,7 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget,
	if (!hsudc)
		return -ENODEV;

	if (!driver || driver != hsudc->driver)
		return -EINVAL;

	spin_lock_irqsave(&hsudc->lock, flags);
	hsudc->driver = NULL;
	hsudc->gadget.speed = USB_SPEED_UNKNOWN;
	s3c_hsudc_uninit_phy();

@@ -1222,7 +1218,9 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget,
	regulator_bulk_disable(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);

	dev_info(hsudc->dev, "unregistered gadget driver '%s'\n",
			driver->driver.name);
			hsudc->driver->driver.name);
	hsudc->driver = NULL;

	return 0;
}