From: Robert Baldyga Date: Tue, 28 Jul 2015 05:20:02 +0000 (+0200) Subject: usb: gadget: f_ecm/f_ncm: check quirk instead of UDC name X-Git-Tag: firefly_0821_release~176^2~1219^2~35^2~76 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7a896d40525349e7d52307fb957882696e09466c;p=firefly-linux-kernel-4.4.55.git usb: gadget: f_ecm/f_ncm: check quirk instead of UDC name Use generic mechanism to check if UDC controller supports zlp. Signed-off-by: Robert Baldyga Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/function/f_ecm.c b/drivers/usb/gadget/function/f_ecm.c index 798760fa7e70..7b7424f10ddd 100644 --- a/drivers/usb/gadget/function/f_ecm.c +++ b/drivers/usb/gadget/function/f_ecm.c @@ -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); diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index bdcda9f5148e..3f05c6bd57f0 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -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);