Skip to content

Commit 48175e2

Browse files
Chen Nigregkh
authored andcommitted
usb: dwc2: gadget: Use USB API functions rather than constants
Use the function usb_endpoint_type() rather than constants. The Coccinelle semantic patch is as follows: @@ struct usb_endpoint_descriptor *epd; @@ - (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) + usb_endpoint_type(epd) Signed-off-by: Chen Ni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eb25dcf commit 48175e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/dwc2/gadget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4049,7 +4049,7 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
40494049
return -EINVAL;
40504050
}
40514051

4052-
ep_type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
4052+
ep_type = usb_endpoint_type(desc);
40534053
mps = usb_endpoint_maxp(desc);
40544054
mc = usb_endpoint_maxp_mult(desc);
40554055

0 commit comments

Comments
 (0)