Re: [PATCH] usb: chipidea: udc: Use usb_endpoint_is_isoc_in() rather than duplicating its implementation

Xu Yang
2025-06-25T02:18:40Z

On Tue, Jun 24, 2025 at 05:40:17PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/usb/chipidea/udc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 64a421ae0f05..75705089136c 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -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.
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>

> --
> 2.50.0
>