]> www.infradead.org Git - users/dwmw2/linux.git/commit
usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align
authorFelipe F. Tonello <eu@felipetonello.com>
Mon, 8 Aug 2016 20:30:04 +0000 (21:30 +0100)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:33:55 +0000 (21:33 -0400)
commit8dac950563d9d0c503c247069d42baf41331f19b
tree1a3e509c9b81b6adc35d7b9ca86cc086f58bfd43
parentdeea56aad578ab5a9c00c8c25fec483d32e6e7cc
usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align

[ Upstream commit 16b114a6d7973cf027e4c2b23eae1076eaf98c25 ]

USB spec specifies wMaxPacketSize to be little endian (as other properties),
so when using this variable in the driver we should convert to the current
CPU endianness if necessary.

This patch also introduces usb_ep_align() which does always returns the
aligned buffer size for an endpoint. This is useful to be used by USB requests
allocator functions.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
include/linux/usb/gadget.h