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/gadget/s3c-hsudc.c | |
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/gadget/s3c-hsudc.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsudc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 3e96cc5bb77f..25829b4398da 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -761,11 +761,11 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep, | |||
761 | if (!_ep || !desc || hsep->desc || _ep->name == ep0name | 761 | if (!_ep || !desc || hsep->desc || _ep->name == ep0name |
762 | || desc->bDescriptorType != USB_DT_ENDPOINT | 762 | || desc->bDescriptorType != USB_DT_ENDPOINT |
763 | || hsep->bEndpointAddress != desc->bEndpointAddress | 763 | || hsep->bEndpointAddress != desc->bEndpointAddress |
764 | || ep_maxpacket(hsep) < le16_to_cpu(desc->wMaxPacketSize)) | 764 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) |
765 | return -EINVAL; | 765 | return -EINVAL; |
766 | 766 | ||
767 | if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK | 767 | if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK |
768 | && le16_to_cpu(desc->wMaxPacketSize) != ep_maxpacket(hsep)) | 768 | && usb_endpoint_maxp(desc) != ep_maxpacket(hsep)) |
769 | || !desc->wMaxPacketSize) | 769 | || !desc->wMaxPacketSize) |
770 | return -ERANGE; | 770 | return -ERANGE; |
771 | 771 | ||
@@ -781,7 +781,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep, | |||
781 | 781 | ||
782 | hsep->stopped = hsep->wedge = 0; | 782 | hsep->stopped = hsep->wedge = 0; |
783 | hsep->desc = desc; | 783 | hsep->desc = desc; |
784 | hsep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize); | 784 | hsep->ep.maxpacket = usb_endpoint_maxp(desc); |
785 | 785 | ||
786 | s3c_hsudc_set_halt(_ep, 0); | 786 | s3c_hsudc_set_halt(_ep, 0); |
787 | __set_bit(ep_index(hsep), hsudc->regs + S3C_EIER); | 787 | __set_bit(ep_index(hsep), hsudc->regs + S3C_EIER); |