]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
usb: gadget: zynq: Fix usb ethernet gadget probe error
authorPunnaiah Choudary Kalluri <punnaiah.choudary.kalluri@xilinx.com>
Tue, 13 May 2014 04:42:35 +0000 (10:12 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 13 May 2014 12:41:40 +0000 (14:41 +0200)
This patch is based on the below commit
"usb: gadget: add "maxpacket_limit" field to struct usb_ep"
(sha1:e117e742d310683b410951faeab4b13b6c3c609f)

Value of "maxpacket_limit" should be set in UDC driver probe function, using
usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function
set choosen value to both "maxpacket_limit" and "maxpacket" fields.

Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
Tested-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/usb/gadget/zynq_udc.c

index 23d4c10c389b63c311aac62323b60c1b36fe8d32..4fbcdd60a14e5be5df25703549e00812b9c97ef5 100644 (file)
@@ -2698,7 +2698,7 @@ static int struct_ep_setup(struct zynq_udc *udc,
        /* for ep0: maxP defined in desc
         * for other eps, maxP is set by epautoconfig() called by gadget layer
         */
-       ep->ep.maxpacket = (unsigned short) ~0;
+       usb_ep_set_maxpacket_limit(&ep->ep, (unsigned short) ~0);
 
        /* the queue lists any req for this ep */
        INIT_LIST_HEAD(&ep->queue);
@@ -2825,7 +2825,8 @@ static int zynq_udc_probe(struct platform_device *pdev)
         * for other eps, gadget layer called ep_enable with defined desc
         */
        udc_controller->eps[0].ep.desc = &zynq_ep0_desc;
-       udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD;
+       usb_ep_set_maxpacket_limit(&udc_controller->eps[0].ep,
+                                  USB_MAX_CTRL_PAYLOAD);
 
        /* setup the udc->eps[] for non-control endpoints and link
         * to gadget.ep_list */