usb: gadget: f_ecm/f_ncm: check quirk instead of UDC name
authorRobert Baldyga <r.baldyga@samsung.com>
Tue, 28 Jul 2015 05:20:02 +0000 (07:20 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 30 Jul 2015 16:43:36 +0000 (11:43 -0500)
Use generic mechanism to check if UDC controller supports zlp.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_ecm.c
drivers/usb/gadget/function/f_ncm.c

index 798760fa7e702b73285d21d6a2d69c55c351a44a..7b7424f10dddce479fca8945cd238293a2f02cc6 100644 (file)
@@ -585,8 +585,8 @@ static int ecm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
                        /* Enable zlps by default for ECM conformance;
                         * override for musb_hdrc (avoids txdma ovhead).
                         */
-                       ecm->port.is_zlp_ok = !(gadget_is_musbhdrc(cdev->gadget)
-                               );
+                       ecm->port.is_zlp_ok =
+                               gadget_is_zlp_supported(cdev->gadget);
                        ecm->port.cdc_filter = DEFAULT_FILTER;
                        DBG(cdev, "activate ecm\n");
                        net = gether_connect(&ecm->port);
index bdcda9f5148e5c42d2217fcae87be5f266c263f2..3f05c6bd57f0c3353b5a2973a3e344593834b5b5 100644 (file)
@@ -853,9 +853,8 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
                        /* Enable zlps by default for NCM conformance;
                         * override for musb_hdrc (avoids txdma ovhead)
                         */
-                       ncm->port.is_zlp_ok = !(
-                               gadget_is_musbhdrc(cdev->gadget)
-                               );
+                       ncm->port.is_zlp_ok =
+                               gadget_is_zlp_supported(cdev->gadget);
                        ncm->port.cdc_filter = DEFAULT_FILTER;
                        DBG(cdev, "activate ncm\n");
                        net = gether_connect(&ncm->port);