Re: [PATCH 2/2] usb: dwc3: gadget: use num_(in|out)_eps from HW params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 06-03-2013 21:47, Felipe Balbi wrote:

that way we will only tell gadget framework about
the endpoints we actually have.

Signed-off-by: Felipe Balbi <balbi@xxxxxx>
---
  drivers/usb/dwc3/gadget.c | 39 +++++++++++++++++++++++++++++++++++----
  1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8e53acc..aad941f 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1623,14 +1623,15 @@ static const struct usb_gadget_ops dwc3_gadget_ops = {

  /* -------------------------------------------------------------------------- */

-static int dwc3_gadget_init_endpoints(struct dwc3 *dwc)
+static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc,
+		u32 num, u32 direction)

   Why not 'bool direction'?

  {
  	struct dwc3_ep			*dep;
-	u8				epnum;
+	u8				i;

   Why not 'u32 i' if the loop is for 'u32 num'?


-	INIT_LIST_HEAD(&dwc->gadget.ep_list);
+	for (i = 0; i < num; i++) {
+		int		epnum = (i << 1) | (!!direction);

   () around !!x are superfluous I think.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux