[PATCH v3 2/5] usb: core: make usb_set_maxpacket_ep public
Fabian Pflug <[email protected]>
| Newsgroups | org.infradead.lists.barebox |
|---|---|
| Message-ID | <20260820-v2026-06-0-topic-efi_usb-v3-2-faf0b9267966@pengutronix.de> |
The function will be used by the efi usb driver to set the maxpackets per endpoint. Reviewed-by: Ahmad Fatoum <[email protected]> Signed-off-by: Fabian Pflug <[email protected]> --- drivers/usb/core/usb.c | 12 ++---------- drivers/usb/core/usb.h | 2 ++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index ae87137447..ce10b71f40 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -127,16 +127,8 @@ static int usb_set_configuration(struct usb_device *dev, int configuration) return res; } -/* The routine usb_set_maxpacket_ep() is extracted from the loop of routine - * usb_set_maxpacket(), because the optimizer of GCC 4.x chokes on this routine - * when it is inlined in 1 single routine. What happens is that the register r3 - * is used as loop-count 'i', but gets overwritten later on. - * This is clearly a compiler bug, but it is easier to workaround it here than - * to update the compiler (Occurs with at least several GCC 4.{1,2},x - * CodeSourcery compilers like e.g. 2007q3, 2008q1, 2008q3 lite editions on ARM) - */ -static void noinline -usb_set_maxpacket_ep(struct usb_device *dev, struct usb_endpoint_descriptor *ep) +void usb_set_maxpacket_ep(struct usb_device *dev, + struct usb_endpoint_descriptor *ep) { int b; diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 0d4f80c21d..b503e5b4a8 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -6,5 +6,7 @@ struct usb_device *usb_alloc_new_device(void); void usb_free_device(struct usb_device *dev); int usb_new_device(struct usb_device *dev); void usb_remove_device(struct usb_device *dev); +void usb_set_maxpacket_ep(struct usb_device *dev, + struct usb_endpoint_descriptor *ep); #endif /* __CORE_USB_H */ -- 2.47.3