Commit 2d4172c9 authored by Heiko Stübner's avatar Heiko Stübner Committed by Felipe Balbi

usb: s3c-hsudc: Use helper functions instead of generic container_of

The helper functions were definied but never used until now.
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 5ea43994
...@@ -759,7 +759,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep, ...@@ -759,7 +759,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep,
unsigned long flags; unsigned long flags;
u32 ecr = 0; u32 ecr = 0;
hsep = container_of(_ep, struct s3c_hsudc_ep, ep); hsep = our_ep(_ep);
if (!_ep || !desc || hsep->desc || _ep->name == ep0name if (!_ep || !desc || hsep->desc || _ep->name == ep0name
|| desc->bDescriptorType != USB_DT_ENDPOINT || desc->bDescriptorType != USB_DT_ENDPOINT
|| hsep->bEndpointAddress != desc->bEndpointAddress || hsep->bEndpointAddress != desc->bEndpointAddress
...@@ -853,7 +853,7 @@ static void s3c_hsudc_free_request(struct usb_ep *ep, struct usb_request *_req) ...@@ -853,7 +853,7 @@ static void s3c_hsudc_free_request(struct usb_ep *ep, struct usb_request *_req)
{ {
struct s3c_hsudc_req *hsreq; struct s3c_hsudc_req *hsreq;
hsreq = container_of(_req, struct s3c_hsudc_req, req); hsreq = our_req(_req);
WARN_ON(!list_empty(&hsreq->queue)); WARN_ON(!list_empty(&hsreq->queue));
kfree(hsreq); kfree(hsreq);
} }
...@@ -876,12 +876,12 @@ static int s3c_hsudc_queue(struct usb_ep *_ep, struct usb_request *_req, ...@@ -876,12 +876,12 @@ static int s3c_hsudc_queue(struct usb_ep *_ep, struct usb_request *_req,
u32 offset; u32 offset;
u32 csr; u32 csr;
hsreq = container_of(_req, struct s3c_hsudc_req, req); hsreq = our_req(_req);
if ((!_req || !_req->complete || !_req->buf || if ((!_req || !_req->complete || !_req->buf ||
!list_empty(&hsreq->queue))) !list_empty(&hsreq->queue)))
return -EINVAL; return -EINVAL;
hsep = container_of(_ep, struct s3c_hsudc_ep, ep); hsep = our_ep(_ep);
hsudc = hsep->dev; hsudc = hsep->dev;
if (!hsudc->driver || hsudc->gadget.speed == USB_SPEED_UNKNOWN) if (!hsudc->driver || hsudc->gadget.speed == USB_SPEED_UNKNOWN)
return -ESHUTDOWN; return -ESHUTDOWN;
...@@ -935,7 +935,7 @@ static int s3c_hsudc_dequeue(struct usb_ep *_ep, struct usb_request *_req) ...@@ -935,7 +935,7 @@ static int s3c_hsudc_dequeue(struct usb_ep *_ep, struct usb_request *_req)
struct s3c_hsudc_req *hsreq; struct s3c_hsudc_req *hsreq;
unsigned long flags; unsigned long flags;
hsep = container_of(_ep, struct s3c_hsudc_ep, ep); hsep = our_ep(_ep);
if (!_ep || hsep->ep.name == ep0name) if (!_ep || hsep->ep.name == ep0name)
return -EINVAL; return -EINVAL;
......
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