Skip to contentSkip to conversation

usb: chipidea: udc: Use usb_endpoint_is_isoc_in() rather than duplicating its implementation

PATCH In review Markus Elfring 3 participants 3 messages Jun 24, 2025 – Jun 30, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: chipidea: udc: Use usb_endpoint_is_isoc_in() rather than duplicating its implementation

From: Markus Elfring <[email protected]>
Date: Tue, 24 Jun 2025 17:30:52 +0200

Reuse existing functionality from usb_endpoint_is_isoc_in() instead of keeping duplicate source code.

The source code was transformed by using the Coccinelle software.

---
 drivers/usb/chipidea/udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/udc.c +1 -1
index 64a421ae0f05..75705089136c 100644
@@ -1992,7 +1992,7 @@ static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget,
 	struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
 	struct usb_ep *ep;
 
-	if (usb_endpoint_xfer_isoc(desc) && usb_endpoint_dir_in(desc)) {
+	if (usb_endpoint_is_isoc_in(desc)) {
 		list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
 			if (ep->caps.dir_in && !ep->claimed)
 				return ep;
Signature · 1 line
2.50.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Tue, 24 Jun 2025 17:30:52 +0200

Reuse existing functionality from usb_endpoint_is_isoc_in() instead of keeping duplicate source code.

The source code was transformed by using the Coccinelle software.

---
 drivers/usb/chipidea/udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/udc.c +0 -0
index 64a421ae0f05..75705089136c 100644

drivers/usb/chipidea/udc.c static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget, · line 1998

Quoted 8 lines
drivers/usb/chipidea/udc.c +1 -1
@@ -1992,7 +1992,7 @@ static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget,
 	struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
 	struct usb_ep *ep;
 
-	if (usb_endpoint_xfer_isoc(desc) && usb_endpoint_dir_in(desc)) {
+	if (usb_endpoint_is_isoc_in(desc)) {
 		list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
 			if (ep->caps.dir_in && !ep->claimed)
 				return ep;

Ok for me.

Quoted 3 lines
Signature · 1 line
2.50.0
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Markus Elfring
Quoted 9 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Tue, 24 Jun 2025 17:30:52 +0200

Reuse existing functionality from usb_endpoint_is_isoc_in() instead of keeping duplicate source code.

The source code was transformed by using the Coccinelle software.

Peter

Quoted 20 lines
---
 drivers/usb/chipidea/udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/udc.c +1 -1
index 64a421ae0f05..75705089136c 100644
@@ -1992,7 +1992,7 @@ static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget,
 	struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
 	struct usb_ep *ep;
 
-	if (usb_endpoint_xfer_isoc(desc) && usb_endpoint_dir_in(desc)) {
+	if (usb_endpoint_is_isoc_in(desc)) {
 		list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
 			if (ep->caps.dir_in && !ep->claimed)
 				return ep;
Signature · 1 line
2.50.0
Signature · 2 lines
Best regards,
Peter