diff options
Diffstat (limited to 'drivers/usb/gadget/pch_udc.c')
-rw-r--r-- | drivers/usb/gadget/pch_udc.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c index f96615ab6b77..550d6dcdf104 100644 --- a/drivers/usb/gadget/pch_udc.c +++ b/drivers/usb/gadget/pch_udc.c | |||
@@ -4,15 +4,6 @@ | |||
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; version 2 of the License. | 6 | * the Free Software Foundation; version 2 of the License. |
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | ||
16 | */ | 7 | */ |
17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
18 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
@@ -947,7 +938,7 @@ static void pch_udc_ep_enable(struct pch_udc_ep *ep, | |||
947 | else | 938 | else |
948 | buff_size = UDC_EPOUT_BUFF_SIZE; | 939 | buff_size = UDC_EPOUT_BUFF_SIZE; |
949 | pch_udc_ep_set_bufsz(ep, buff_size, ep->in); | 940 | pch_udc_ep_set_bufsz(ep, buff_size, ep->in); |
950 | pch_udc_ep_set_maxpkt(ep, le16_to_cpu(desc->wMaxPacketSize)); | 941 | pch_udc_ep_set_maxpkt(ep, usb_endpoint_maxp(desc)); |
951 | pch_udc_ep_set_nak(ep); | 942 | pch_udc_ep_set_nak(ep); |
952 | pch_udc_ep_fifo_flush(ep, ep->in); | 943 | pch_udc_ep_fifo_flush(ep, ep->in); |
953 | /* Configure the endpoint */ | 944 | /* Configure the endpoint */ |
@@ -957,7 +948,7 @@ static void pch_udc_ep_enable(struct pch_udc_ep *ep, | |||
957 | (cfg->cur_cfg << UDC_CSR_NE_CFG_SHIFT) | | 948 | (cfg->cur_cfg << UDC_CSR_NE_CFG_SHIFT) | |
958 | (cfg->cur_intf << UDC_CSR_NE_INTF_SHIFT) | | 949 | (cfg->cur_intf << UDC_CSR_NE_INTF_SHIFT) | |
959 | (cfg->cur_alt << UDC_CSR_NE_ALT_SHIFT) | | 950 | (cfg->cur_alt << UDC_CSR_NE_ALT_SHIFT) | |
960 | le16_to_cpu(desc->wMaxPacketSize) << UDC_CSR_NE_MAX_PKT_SHIFT; | 951 | usb_endpoint_maxp(desc) << UDC_CSR_NE_MAX_PKT_SHIFT; |
961 | 952 | ||
962 | if (ep->in) | 953 | if (ep->in) |
963 | pch_udc_write_csr(ep->dev, val, UDC_EPIN_IDX(ep->num)); | 954 | pch_udc_write_csr(ep->dev, val, UDC_EPIN_IDX(ep->num)); |
@@ -1466,7 +1457,7 @@ static int pch_udc_pcd_ep_enable(struct usb_ep *usbep, | |||
1466 | ep->desc = desc; | 1457 | ep->desc = desc; |
1467 | ep->halted = 0; | 1458 | ep->halted = 0; |
1468 | pch_udc_ep_enable(ep, &ep->dev->cfg_data, desc); | 1459 | pch_udc_ep_enable(ep, &ep->dev->cfg_data, desc); |
1469 | ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize); | 1460 | ep->ep.maxpacket = usb_endpoint_maxp(desc); |
1470 | pch_udc_enable_ep_interrupts(ep->dev, PCH_UDC_EPINT(ep->in, ep->num)); | 1461 | pch_udc_enable_ep_interrupts(ep->dev, PCH_UDC_EPINT(ep->in, ep->num)); |
1471 | spin_unlock_irqrestore(&dev->lock, iflags); | 1462 | spin_unlock_irqrestore(&dev->lock, iflags); |
1472 | return 0; | 1463 | return 0; |