Commit f3bb8e63 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi

usb: gadget: at91udc: Don't check for ep->ep.desc

Earlier we used to check for ep->ep.desc to figure out if this ep has
already been enabled and if so, abort.
Ido Shayevitz removed the usb_endpoint_descriptor from private udc
structure 5a6506f0 ("usb: gadget: Update at91_udc to use
usb_endpoint_descriptor	inside the struct usb_ep") but did not fix up
the ep_enable condition because _now_ the member is always true and we
can't check if this ep is enabled twice.

Cc: Ido Shayevitz <idos@codeaurora.org>
Tested-by: default avatarFabio Porcedda <fabio.porcedda@gmail.com>
Tested-by: default avatarMario Isidoro <Mario.Isidoro@tecmic.pt>
Cc: <stable@kernel.org> # v3.5
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 8b7dda55
...@@ -475,8 +475,7 @@ static int at91_ep_enable(struct usb_ep *_ep, ...@@ -475,8 +475,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
unsigned long flags; unsigned long flags;
if (!_ep || !ep if (!_ep || !ep
|| !desc || ep->ep.desc || !desc || _ep->name == ep0name
|| _ep->name == ep0name
|| desc->bDescriptorType != USB_DT_ENDPOINT || desc->bDescriptorType != USB_DT_ENDPOINT
|| (maxpacket = usb_endpoint_maxp(desc)) == 0 || (maxpacket = usb_endpoint_maxp(desc)) == 0
|| maxpacket > ep->maxpacket) { || maxpacket > ep->maxpacket) {
...@@ -530,7 +529,6 @@ static int at91_ep_enable(struct usb_ep *_ep, ...@@ -530,7 +529,6 @@ static int at91_ep_enable(struct usb_ep *_ep,
tmp |= AT91_UDP_EPEDS; tmp |= AT91_UDP_EPEDS;
__raw_writel(tmp, ep->creg); __raw_writel(tmp, ep->creg);
ep->ep.desc = desc;
ep->ep.maxpacket = maxpacket; ep->ep.maxpacket = maxpacket;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment