Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[pandora-kernel.git] / drivers / usb / gadget / amd5536udc.c
index 70f2b37..45f422a 100644 (file)
@@ -8,15 +8,6 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /*
@@ -354,7 +345,7 @@ udc_ep_enable(struct usb_ep *usbep, const struct usb_endpoint_descriptor *desc)
        writel(tmp, &dev->ep[ep->num].regs->ctl);
 
        /* set max packet size */
-       maxpacket = le16_to_cpu(desc->wMaxPacketSize);
+       maxpacket = usb_endpoint_maxp(desc);
        tmp = readl(&dev->ep[ep->num].regs->bufout_maxpkt);
        tmp = AMD_ADDBITS(tmp, maxpacket, UDC_EP_MAX_PKT_SIZE);
        ep->ep.maxpacket = maxpacket;
@@ -1968,7 +1959,7 @@ static int amd5536_start(struct usb_gadget_driver *driver,
        u32 tmp;
 
        if (!driver || !bind || !driver->setup
-                       || driver->speed != USB_SPEED_HIGH)
+                       || driver->speed < USB_SPEED_HIGH)
                return -EINVAL;
        if (!dev)
                return -ENODEV;
@@ -3014,13 +3005,8 @@ __acquires(dev->lock)
 
                /* link up all endpoints */
                udc_setup_endpoints(dev);
-               if (dev->gadget.speed == USB_SPEED_HIGH) {
-                       dev_info(&dev->pdev->dev, "Connect: speed = %s\n",
-                               "high");
-               } else if (dev->gadget.speed == USB_SPEED_FULL) {
-                       dev_info(&dev->pdev->dev, "Connect: speed = %s\n",
-                               "full");
-               }
+               dev_info(&dev->pdev->dev, "Connect: %s\n",
+                        usb_speed_string(dev->gadget.speed));
 
                /* init ep 0 */
                activate_control_endpoints(dev);