summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2025-05-19 14:22:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-21 13:13:20 +0200
commit48175e2e6eaf8642fbd9d36746fc094099ee65cf (patch)
treea9586bdcf879ead52e99174f173cf4e9f3a7a491 /drivers
parenteb25dcf0c5946b4c167d5a9b049f0c1fec80ff80 (diff)
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 <nichen@iscas.ac.cn> Link: https://lore.kernel.org/r/20250519062229.724664-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc2/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index f323fb5597b3..d5b622f78cf3 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -4049,7 +4049,7 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
return -EINVAL;
}
- ep_type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
+ ep_type = usb_endpoint_type(desc);
mps = usb_endpoint_maxp(desc);
mc = usb_endpoint_maxp_mult(desc);