]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: gadget: m66592-udc: Use USB API functions rather than constants
authorChen Ni <nichen@iscas.ac.cn>
Wed, 18 Jun 2025 07:07:14 +0000 (15:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 10:23:59 +0000 (12:23 +0200)
commita4e668fd49997a1bee92af413f2f19b1471ef623
tree217ccff5c05284d1fc5f9c4c54a5c25d4343b905
parentd9e496a9fb4021a9e6b11e7ba221a41a2597ac27
usb: gadget: m66592-udc: Use USB API functions rather than constants

Use the function usb_endpoint_num() and usb_endpoint_type()
rather than constants.

The Coccinelle semantic patch is as follows:

@@ struct usb_endpoint_descriptor *epd; @@

- (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\))
+ usb_endpoint_num(epd)

@@ 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/20250618070714.817146-1-nichen@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/m66592-udc.c