diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-08-23 06:12:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-23 12:47:40 -0400 |
commit | 29cc88979a8818cd8c5019426e945aed118b400e (patch) | |
tree | 849401ad869d09ce45dd7a3fadd7eb71b1e9fcbd /drivers/usb/class | |
parent | 46a57283e86c68351377ac3349f1465aee938fbd (diff) |
USB: use usb_endpoint_maxp() instead of le16_to_cpu()
Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
instead of le16_to_cpu(desc->wMaxPacketSize).
This patch fix it up
Cc: Armin Fuerst <fuerst@in.tum.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Johannes Erdfelt <johannes@erdfelt.com>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: David Kubicek <dave@awk.cz>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Brad Hards <bhards@bigpond.net.au>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
Cc: David Brownell <david-b@pacbell.net>
Cc: David Lopo <dlopo@chipidea.mips.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Xie Xiaobo <X.Xie@freescale.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Jiang Bo <tanya.jiang@freescale.com>
Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Ben Dooks <ben@simtec.co.uk>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Herbert Pƶtzl <herbert@13thfloor.at>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Roman Weissgaerber <weissg@vienna.at>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: Florian Floe Echtler <echtler@fs.tum.de>
Cc: Christian Lucht <lucht@codemercs.com>
Cc: Juergen Stuber <starblue@sourceforge.net>
Cc: Georges Toth <g.toth@e-biz.lu>
Cc: Bill Ryder <bryder@sgi.com>
Cc: Kuba Ober <kuba@mareimbrium.org>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 6 | ||||
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 2 | ||||
-rw-r--r-- | drivers/usb/class/usbtmc.c | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index dac7676ce21b..f69a1854a59c 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1058,11 +1058,11 @@ made_compressed_probe: | |||
1058 | goto alloc_fail; | 1058 | goto alloc_fail; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | ctrlsize = le16_to_cpu(epctrl->wMaxPacketSize); | 1061 | ctrlsize = usb_endpoint_maxp(epctrl); |
1062 | readsize = le16_to_cpu(epread->wMaxPacketSize) * | 1062 | readsize = usb_endpoint_maxp(epread) * |
1063 | (quirks == SINGLE_RX_URB ? 1 : 2); | 1063 | (quirks == SINGLE_RX_URB ? 1 : 2); |
1064 | acm->combined_interfaces = combined_interfaces; | 1064 | acm->combined_interfaces = combined_interfaces; |
1065 | acm->writesize = le16_to_cpu(epwrite->wMaxPacketSize) * 20; | 1065 | acm->writesize = usb_endpoint_maxp(epwrite) * 20; |
1066 | acm->control = control_interface; | 1066 | acm->control = control_interface; |
1067 | acm->data = data_interface; | 1067 | acm->data = data_interface; |
1068 | acm->minor = minor; | 1068 | acm->minor = minor; |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 2b9ff518b509..1d26a7135dd9 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -682,7 +682,7 @@ next_desc: | |||
682 | if (!ep || !usb_endpoint_is_int_in(ep)) | 682 | if (!ep || !usb_endpoint_is_int_in(ep)) |
683 | goto err; | 683 | goto err; |
684 | 684 | ||
685 | desc->wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize); | 685 | desc->wMaxPacketSize = usb_endpoint_maxp(ep); |
686 | desc->bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0; | 686 | desc->bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0; |
687 | 687 | ||
688 | desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); | 688 | desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 3f94ac34dce3..12cf5e7395a8 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -186,8 +186,7 @@ static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data) | |||
186 | for (n = 0; n < current_setting->desc.bNumEndpoints; n++) | 186 | for (n = 0; n < current_setting->desc.bNumEndpoints; n++) |
187 | if (current_setting->endpoint[n].desc.bEndpointAddress == | 187 | if (current_setting->endpoint[n].desc.bEndpointAddress == |
188 | data->bulk_in) | 188 | data->bulk_in) |
189 | max_size = le16_to_cpu(current_setting->endpoint[n]. | 189 | max_size = usb_endpoint_maxp(¤t_setting->endpoint[n].desc); |
190 | desc.wMaxPacketSize); | ||
191 | 190 | ||
192 | if (max_size == 0) { | 191 | if (max_size == 0) { |
193 | dev_err(dev, "Couldn't get wMaxPacketSize\n"); | 192 | dev_err(dev, "Couldn't get wMaxPacketSize\n"); |
@@ -636,7 +635,7 @@ static int usbtmc_ioctl_clear(struct usbtmc_device_data *data) | |||
636 | for (n = 0; n < current_setting->desc.bNumEndpoints; n++) { | 635 | for (n = 0; n < current_setting->desc.bNumEndpoints; n++) { |
637 | desc = ¤t_setting->endpoint[n].desc; | 636 | desc = ¤t_setting->endpoint[n].desc; |
638 | if (desc->bEndpointAddress == data->bulk_in) | 637 | if (desc->bEndpointAddress == data->bulk_in) |
639 | max_size = le16_to_cpu(desc->wMaxPacketSize); | 638 | max_size = usb_endpoint_maxp(desc); |
640 | } | 639 | } |
641 | 640 | ||
642 | if (max_size == 0) { | 641 | if (max_size == 0) { |