]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/linux/usb/ch9.h
usb: Use get_unaligned() in usb_endpoint_maxp() for wMaxPacketSize
[karo-tx-uboot.git] / include / linux / usb / ch9.h
index d1d732c2838d3a48788c16fe87bd9552a8558ab8..bd48704c870daee4eb860586bade83995abd720c 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <linux/types.h>       /* __u8 etc */
 #include <asm/byteorder.h>     /* le16_to_cpu */
+#include <asm/unaligned.h>     /* get_unaligned() */
 
 /*-------------------------------------------------------------------------*/
 
@@ -596,7 +597,7 @@ static inline int usb_endpoint_is_isoc_out(
  */
 static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
 {
-       return __le16_to_cpu(epd->wMaxPacketSize);
+       return __le16_to_cpu(get_unaligned(&epd->wMaxPacketSize));
 }
 
 static inline int usb_endpoint_interrupt_type(