“2771dc34ddaa313127d6431f23ae4cea26b869b0”上不存在“drivers/i2c/i2c-core-base.c”
提交 7de7c7d2 编写于 作者: S Sebastian Andrzej Siewior 提交者: Sarah Sharp

usb/config: use proper endian access for wMaxPacketSize

wMaxPacketSize is __le16 and should be accessed as such. Also fix the
wBytesPerInterval assignment while here.

v2: also fix the wBytesPerInterval assigment, noticed by Matt Evans

This patch should be backported to the 3.0 kernel.
Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: NMatt Evans <matt@ozlabs.org>
Cc: stable@kernel.org
上级 6768458b
...@@ -123,10 +123,11 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, ...@@ -123,10 +123,11 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
} }
if (usb_endpoint_xfer_isoc(&ep->desc)) if (usb_endpoint_xfer_isoc(&ep->desc))
max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1) * max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) *
(desc->bmAttributes + 1); le16_to_cpu(ep->desc.wMaxPacketSize);
else if (usb_endpoint_xfer_int(&ep->desc)) else if (usb_endpoint_xfer_int(&ep->desc))
max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1); max_tx = le16_to_cpu(ep->desc.wMaxPacketSize) *
(desc->bMaxBurst + 1);
else else
max_tx = 999999; max_tx = 999999;
if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) { if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) {
...@@ -134,10 +135,10 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, ...@@ -134,10 +135,10 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
"config %d interface %d altsetting %d ep %d: " "config %d interface %d altsetting %d ep %d: "
"setting to %d\n", "setting to %d\n",
usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int", usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int",
desc->wBytesPerInterval, le16_to_cpu(desc->wBytesPerInterval),
cfgno, inum, asnum, ep->desc.bEndpointAddress, cfgno, inum, asnum, ep->desc.bEndpointAddress,
max_tx); max_tx);
ep->ss_ep_comp.wBytesPerInterval = max_tx; ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册