aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2011-11-19 12:27:38 -0500
committerFelipe Balbi <balbi@ti.com>2011-12-12 04:45:12 -0500
commit7177aed44f515d949f587170e0e177ce17e74793 (patch)
tree07cc5c1d077fb9748fbe5966d440612c1b9497ce
parentd327ab5b6d660d6fe22b073b743fde1668e593bb (diff)
usb: gadget: rename usb_gadget_driver::speed to max_speed
This commit renames the “speed” field of the usb_gadget_driver structure to “max_speed”. This is so that to make it more apparent that the field represents the maximum speed gadget driver can support. This also make the field look more like fields with the same name in usb_gadget and usb_composite_driver structures. All of those represent the *maximal* speed given entity supports. After this commit, there are the following fields in various structures: * usb_gadget::speed - the current connection speed, * usb_gadget::max_speed - maximal speed UDC supports, * usb_gadget_driver::max_speed - maximal speed gadget driver supports, and * usb_composite_driver::max_speed - maximal speed composite gadget supports. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/amd5536udc.c2
-rw-r--r--drivers/usb/gadget/at91_udc.c2
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.c2
-rw-r--r--drivers/usb/gadget/composite.c8
-rw-r--r--drivers/usb/gadget/dbgp.c2
-rw-r--r--drivers/usb/gadget/dummy_hcd.c13
-rw-r--r--drivers/usb/gadget/file_storage.c2
-rw-r--r--drivers/usb/gadget/fsl_qe_udc.c4
-rw-r--r--drivers/usb/gadget/fsl_udc_core.c2
-rw-r--r--drivers/usb/gadget/fusb300_udc.c2
-rw-r--r--drivers/usb/gadget/goku_udc.c2
-rw-r--r--drivers/usb/gadget/imx_udc.c2
-rw-r--r--drivers/usb/gadget/inode.c6
-rw-r--r--drivers/usb/gadget/m66592-udc.c2
-rw-r--r--drivers/usb/gadget/net2272.c2
-rw-r--r--drivers/usb/gadget/net2280.c2
-rw-r--r--drivers/usb/gadget/omap_udc.c2
-rw-r--r--drivers/usb/gadget/pch_udc.c2
-rw-r--r--drivers/usb/gadget/printer.c2
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c2
-rw-r--r--drivers/usb/gadget/pxa27x_udc.c2
-rw-r--r--drivers/usb/gadget/r8a66597-udc.c2
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c2
-rw-r--r--drivers/usb/gadget/s3c-hsudc.c2
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c4
-rw-r--r--drivers/usb/musb/musb_gadget.c2
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c2
-rw-r--r--include/linux/usb/gadget.h4
28 files changed, 41 insertions, 42 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index e69cdbca8017..e9a2c5c44454 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1959,7 +1959,7 @@ static int amd5536_start(struct usb_gadget_driver *driver,
1959 u32 tmp; 1959 u32 tmp;
1960 1960
1961 if (!driver || !bind || !driver->setup 1961 if (!driver || !bind || !driver->setup
1962 || driver->speed < USB_SPEED_HIGH) 1962 || driver->max_speed < USB_SPEED_HIGH)
1963 return -EINVAL; 1963 return -EINVAL;
1964 if (!dev) 1964 if (!dev)
1965 return -ENODEV; 1965 return -ENODEV;
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 8efe0fa9228d..ac41f71bf9ca 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1633,7 +1633,7 @@ static int at91_start(struct usb_gadget_driver *driver,
1633 unsigned long flags; 1633 unsigned long flags;
1634 1634
1635 if (!driver 1635 if (!driver
1636 || driver->speed < USB_SPEED_FULL 1636 || driver->max_speed < USB_SPEED_FULL
1637 || !bind 1637 || !bind
1638 || !driver->setup) { 1638 || !driver->setup) {
1639 DBG("bad parameter.\n"); 1639 DBG("bad parameter.\n");
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 9767d9170fbd..27e313718422 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -813,7 +813,7 @@ static ssize_t show_driver(struct device *dev, struct device_attribute *attr,
813 n += scnprintf(buf + n, PAGE_SIZE - n, "function = %s\n", 813 n += scnprintf(buf + n, PAGE_SIZE - n, "function = %s\n",
814 (driver->function ? driver->function : "")); 814 (driver->function ? driver->function : ""));
815 n += scnprintf(buf + n, PAGE_SIZE - n, "max speed = %d\n", 815 n += scnprintf(buf + n, PAGE_SIZE - n, "max speed = %d\n",
816 driver->speed); 816 driver->max_speed);
817 817
818 return n; 818 return n;
819} 819}
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index f71b0787983f..a95de6a4a134 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1535,9 +1535,9 @@ composite_resume(struct usb_gadget *gadget)
1535 1535
1536static struct usb_gadget_driver composite_driver = { 1536static struct usb_gadget_driver composite_driver = {
1537#ifdef CONFIG_USB_GADGET_SUPERSPEED 1537#ifdef CONFIG_USB_GADGET_SUPERSPEED
1538 .speed = USB_SPEED_SUPER, 1538 .max_speed = USB_SPEED_SUPER,
1539#else 1539#else
1540 .speed = USB_SPEED_HIGH, 1540 .max_speed = USB_SPEED_HIGH,
1541#endif 1541#endif
1542 1542
1543 .unbind = composite_unbind, 1543 .unbind = composite_unbind,
@@ -1584,8 +1584,8 @@ int usb_composite_probe(struct usb_composite_driver *driver,
1584 driver->iProduct = driver->name; 1584 driver->iProduct = driver->name;
1585 composite_driver.function = (char *) driver->name; 1585 composite_driver.function = (char *) driver->name;
1586 composite_driver.driver.name = driver->name; 1586 composite_driver.driver.name = driver->name;
1587 composite_driver.speed = min((u8)composite_driver.speed, 1587 composite_driver.max_speed =
1588 (u8)driver->max_speed); 1588 min_t(u8, composite_driver.max_speed, driver->max_speed);
1589 composite = driver; 1589 composite = driver;
1590 composite_gadget_bind = bind; 1590 composite_gadget_bind = bind;
1591 1591
diff --git a/drivers/usb/gadget/dbgp.c b/drivers/usb/gadget/dbgp.c
index 6256420089f3..19d7bb0df75a 100644
--- a/drivers/usb/gadget/dbgp.c
+++ b/drivers/usb/gadget/dbgp.c
@@ -404,7 +404,7 @@ fail:
404 404
405static struct usb_gadget_driver dbgp_driver = { 405static struct usb_gadget_driver dbgp_driver = {
406 .function = "dbgp", 406 .function = "dbgp",
407 .speed = USB_SPEED_HIGH, 407 .max_speed = USB_SPEED_HIGH,
408 .unbind = dbgp_unbind, 408 .unbind = dbgp_unbind,
409 .setup = dbgp_setup, 409 .setup = dbgp_setup,
410 .disconnect = dbgp_disconnect, 410 .disconnect = dbgp_disconnect,
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index cf235d84d8b7..db815c2da7ed 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -823,19 +823,18 @@ static int dummy_pullup (struct usb_gadget *_gadget, int value)
823 823
824 if (value && dum->driver) { 824 if (value && dum->driver) {
825 if (mod_data.is_super_speed) 825 if (mod_data.is_super_speed)
826 dum->gadget.speed = dum->driver->speed; 826 dum->gadget.speed = dum->driver->max_speed;
827 else if (mod_data.is_high_speed) 827 else if (mod_data.is_high_speed)
828 dum->gadget.speed = min_t(u8, USB_SPEED_HIGH, 828 dum->gadget.speed = min_t(u8, USB_SPEED_HIGH,
829 dum->driver->speed); 829 dum->driver->max_speed);
830 else 830 else
831 dum->gadget.speed = USB_SPEED_FULL; 831 dum->gadget.speed = USB_SPEED_FULL;
832 dummy_udc_udpate_ep0(dum); 832 dummy_udc_udpate_ep0(dum);
833 833
834 if (dum->gadget.speed < dum->driver->speed) 834 if (dum->gadget.speed < dum->driver->max_speed)
835 dev_dbg(udc_dev(dum), "This device can perform faster" 835 dev_dbg(udc_dev(dum), "This device can perform faster"
836 " if you connect it to a %s port...\n", 836 " if you connect it to a %s port...\n",
837 (dum->driver->speed == USB_SPEED_SUPER ? 837 usb_speed_string(dum->driver->max_speed));
838 "SuperSpeed" : "HighSpeed"));
839 } 838 }
840 dum_hcd = gadget_to_dummy_hcd(_gadget); 839 dum_hcd = gadget_to_dummy_hcd(_gadget);
841 840
@@ -898,7 +897,7 @@ static int dummy_udc_start(struct usb_gadget *g,
898 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); 897 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g);
899 struct dummy *dum = dum_hcd->dum; 898 struct dummy *dum = dum_hcd->dum;
900 899
901 if (driver->speed == USB_SPEED_UNKNOWN) 900 if (driver->max_speed == USB_SPEED_UNKNOWN)
902 return -EINVAL; 901 return -EINVAL;
903 902
904 /* 903 /*
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index e8ff2f1c06cc..e0f30fc70e45 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3604,7 +3604,7 @@ static void fsg_resume(struct usb_gadget *gadget)
3604/*-------------------------------------------------------------------------*/ 3604/*-------------------------------------------------------------------------*/
3605 3605
3606static struct usb_gadget_driver fsg_driver = { 3606static struct usb_gadget_driver fsg_driver = {
3607 .speed = USB_SPEED_SUPER, 3607 .max_speed = USB_SPEED_SUPER,
3608 .function = (char *) fsg_string_product, 3608 .function = (char *) fsg_string_product,
3609 .unbind = fsg_unbind, 3609 .unbind = fsg_unbind,
3610 .disconnect = fsg_disconnect, 3610 .disconnect = fsg_disconnect,
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index e00cf92409ce..b7a1efef938d 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -2336,7 +2336,7 @@ static int fsl_qe_start(struct usb_gadget_driver *driver,
2336 if (!udc_controller) 2336 if (!udc_controller)
2337 return -ENODEV; 2337 return -ENODEV;
2338 2338
2339 if (!driver || driver->speed < USB_SPEED_FULL 2339 if (!driver || driver->max_speed < USB_SPEED_FULL
2340 || !bind || !driver->disconnect || !driver->setup) 2340 || !bind || !driver->disconnect || !driver->setup)
2341 return -EINVAL; 2341 return -EINVAL;
2342 2342
@@ -2350,7 +2350,7 @@ static int fsl_qe_start(struct usb_gadget_driver *driver,
2350 /* hook up the driver */ 2350 /* hook up the driver */
2351 udc_controller->driver = driver; 2351 udc_controller->driver = driver;
2352 udc_controller->gadget.dev.driver = &driver->driver; 2352 udc_controller->gadget.dev.driver = &driver->driver;
2353 udc_controller->gadget.speed = (enum usb_device_speed)(driver->speed); 2353 udc_controller->gadget.speed = driver->max_speed;
2354 spin_unlock_irqrestore(&udc_controller->lock, flags); 2354 spin_unlock_irqrestore(&udc_controller->lock, flags);
2355 2355
2356 retval = bind(&udc_controller->gadget); 2356 retval = bind(&udc_controller->gadget);
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 6de8ec753818..d7ea6c076ce9 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1934,7 +1934,7 @@ static int fsl_start(struct usb_gadget_driver *driver,
1934 if (!udc_controller) 1934 if (!udc_controller)
1935 return -ENODEV; 1935 return -ENODEV;
1936 1936
1937 if (!driver || driver->speed < USB_SPEED_FULL 1937 if (!driver || driver->max_speed < USB_SPEED_FULL
1938 || !bind || !driver->disconnect || !driver->setup) 1938 || !bind || !driver->disconnect || !driver->setup)
1939 return -EINVAL; 1939 return -EINVAL;
1940 1940
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c
index 6e32a60ab3b7..5831cb4a0b35 100644
--- a/drivers/usb/gadget/fusb300_udc.c
+++ b/drivers/usb/gadget/fusb300_udc.c
@@ -1317,7 +1317,7 @@ static int fusb300_udc_start(struct usb_gadget_driver *driver,
1317 int retval; 1317 int retval;
1318 1318
1319 if (!driver 1319 if (!driver
1320 || driver->speed < USB_SPEED_FULL 1320 || driver->max_speed < USB_SPEED_FULL
1321 || !bind 1321 || !bind
1322 || !driver->setup) 1322 || !driver->setup)
1323 return -EINVAL; 1323 return -EINVAL;
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index ab9c924eee76..5af70fcce139 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1357,7 +1357,7 @@ static int goku_start(struct usb_gadget_driver *driver,
1357 int retval; 1357 int retval;
1358 1358
1359 if (!driver 1359 if (!driver
1360 || driver->speed < USB_SPEED_FULL 1360 || driver->max_speed < USB_SPEED_FULL
1361 || !bind 1361 || !bind
1362 || !driver->disconnect 1362 || !driver->disconnect
1363 || !driver->setup) 1363 || !driver->setup)
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index 2d978c0e7ced..8d1c75abd73d 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -1336,7 +1336,7 @@ static int imx_udc_start(struct usb_gadget_driver *driver,
1336 int retval; 1336 int retval;
1337 1337
1338 if (!driver 1338 if (!driver
1339 || driver->speed < USB_SPEED_FULL 1339 || driver->max_speed < USB_SPEED_FULL
1340 || !bind 1340 || !bind
1341 || !driver->disconnect 1341 || !driver->disconnect
1342 || !driver->setup) 1342 || !driver->setup)
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 6ccae2707e59..93612519b53a 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1766,9 +1766,9 @@ gadgetfs_suspend (struct usb_gadget *gadget)
1766 1766
1767static struct usb_gadget_driver gadgetfs_driver = { 1767static struct usb_gadget_driver gadgetfs_driver = {
1768#ifdef CONFIG_USB_GADGET_DUALSPEED 1768#ifdef CONFIG_USB_GADGET_DUALSPEED
1769 .speed = USB_SPEED_HIGH, 1769 .max_speed = USB_SPEED_HIGH,
1770#else 1770#else
1771 .speed = USB_SPEED_FULL, 1771 .max_speed = USB_SPEED_FULL,
1772#endif 1772#endif
1773 .function = (char *) driver_desc, 1773 .function = (char *) driver_desc,
1774 .unbind = gadgetfs_unbind, 1774 .unbind = gadgetfs_unbind,
@@ -1792,7 +1792,7 @@ static int gadgetfs_probe (struct usb_gadget *gadget)
1792} 1792}
1793 1793
1794static struct usb_gadget_driver probe_driver = { 1794static struct usb_gadget_driver probe_driver = {
1795 .speed = USB_SPEED_HIGH, 1795 .max_speed = USB_SPEED_HIGH,
1796 .unbind = gadgetfs_nop, 1796 .unbind = gadgetfs_nop,
1797 .setup = (void *)gadgetfs_nop, 1797 .setup = (void *)gadgetfs_nop,
1798 .disconnect = gadgetfs_nop, 1798 .disconnect = gadgetfs_nop,
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index a7692c208ea7..3608b3bd5732 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1472,7 +1472,7 @@ static int m66592_start(struct usb_gadget_driver *driver,
1472 int retval; 1472 int retval;
1473 1473
1474 if (!driver 1474 if (!driver
1475 || driver->speed < USB_SPEED_HIGH 1475 || driver->max_speed < USB_SPEED_HIGH
1476 || !bind 1476 || !bind
1477 || !driver->setup) 1477 || !driver->setup)
1478 return -EINVAL; 1478 return -EINVAL;
diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index d5050f4e8449..4c81d540bc26 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -1459,7 +1459,7 @@ static int net2272_start(struct usb_gadget *_gadget,
1459 unsigned i; 1459 unsigned i;
1460 1460
1461 if (!driver || !driver->unbind || !driver->setup || 1461 if (!driver || !driver->unbind || !driver->setup ||
1462 driver->speed != USB_SPEED_HIGH) 1462 driver->max_speed != USB_SPEED_HIGH)
1463 return -EINVAL; 1463 return -EINVAL;
1464 1464
1465 dev = container_of(_gadget, struct net2272, gadget); 1465 dev = container_of(_gadget, struct net2272, gadget);
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 9ee36fd5adae..cf1f36454d08 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1881,7 +1881,7 @@ static int net2280_start(struct usb_gadget *_gadget,
1881 * (dev->usb->xcvrdiag & FORCE_FULL_SPEED_MODE) 1881 * (dev->usb->xcvrdiag & FORCE_FULL_SPEED_MODE)
1882 * "must not be used in normal operation" 1882 * "must not be used in normal operation"
1883 */ 1883 */
1884 if (!driver || driver->speed < USB_SPEED_HIGH 1884 if (!driver || driver->max_speed < USB_SPEED_HIGH
1885 || !driver->setup) 1885 || !driver->setup)
1886 return -EINVAL; 1886 return -EINVAL;
1887 1887
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index ed01a0f5f119..7db5bbe6251b 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2110,7 +2110,7 @@ static int omap_udc_start(struct usb_gadget_driver *driver,
2110 return -ENODEV; 2110 return -ENODEV;
2111 if (!driver 2111 if (!driver
2112 // FIXME if otg, check: driver->is_otg 2112 // FIXME if otg, check: driver->is_otg
2113 || driver->speed < USB_SPEED_FULL 2113 || driver->max_speed < USB_SPEED_FULL
2114 || !bind || !driver->setup) 2114 || !bind || !driver->setup)
2115 return -EINVAL; 2115 return -EINVAL;
2116 2116
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 7f97b4adba3e..dd2313cce1d3 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -2693,7 +2693,7 @@ static int pch_udc_start(struct usb_gadget_driver *driver,
2693 struct pch_udc_dev *dev = pch_udc; 2693 struct pch_udc_dev *dev = pch_udc;
2694 int retval; 2694 int retval;
2695 2695
2696 if (!driver || (driver->speed == USB_SPEED_UNKNOWN) || !bind || 2696 if (!driver || (driver->max_speed == USB_SPEED_UNKNOWN) || !bind ||
2697 !driver->setup || !driver->unbind || !driver->disconnect) { 2697 !driver->setup || !driver->unbind || !driver->disconnect) {
2698 dev_err(&dev->pdev->dev, 2698 dev_err(&dev->pdev->dev,
2699 "%s: invalid driver parameter\n", __func__); 2699 "%s: invalid driver parameter\n", __func__);
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index b74f49ac95e5..d83134b0f78a 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1535,7 +1535,7 @@ fail:
1535/*-------------------------------------------------------------------------*/ 1535/*-------------------------------------------------------------------------*/
1536 1536
1537static struct usb_gadget_driver printer_driver = { 1537static struct usb_gadget_driver printer_driver = {
1538 .speed = DEVSPEED, 1538 .max_speed = DEVSPEED,
1539 1539
1540 .function = (char *) driver_desc, 1540 .function = (char *) driver_desc,
1541 .unbind = printer_unbind, 1541 .unbind = printer_unbind,
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index c090a7e3ecf8..dd470635f4f7 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -1264,7 +1264,7 @@ static int pxa25x_start(struct usb_gadget_driver *driver,
1264 int retval; 1264 int retval;
1265 1265
1266 if (!driver 1266 if (!driver
1267 || driver->speed < USB_SPEED_FULL 1267 || driver->max_speed < USB_SPEED_FULL
1268 || !bind 1268 || !bind
1269 || !driver->disconnect 1269 || !driver->disconnect
1270 || !driver->setup) 1270 || !driver->setup)
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 18b6b091f2a6..f4c44eb806c3 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1807,7 +1807,7 @@ static int pxa27x_udc_start(struct usb_gadget_driver *driver,
1807 struct pxa_udc *udc = the_controller; 1807 struct pxa_udc *udc = the_controller;
1808 int retval; 1808 int retval;
1809 1809
1810 if (!driver || driver->speed < USB_SPEED_FULL || !bind 1810 if (!driver || driver->max_speed < USB_SPEED_FULL || !bind
1811 || !driver->disconnect || !driver->setup) 1811 || !driver->disconnect || !driver->setup)
1812 return -EINVAL; 1812 return -EINVAL;
1813 if (!udc) 1813 if (!udc)
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c
index 3666d7c54e24..f5b8d215e1d5 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -1746,7 +1746,7 @@ static int r8a66597_start(struct usb_gadget *gadget,
1746 struct r8a66597 *r8a66597 = gadget_to_r8a66597(gadget); 1746 struct r8a66597 *r8a66597 = gadget_to_r8a66597(gadget);
1747 1747
1748 if (!driver 1748 if (!driver
1749 || driver->speed < USB_SPEED_HIGH 1749 || driver->max_speed < USB_SPEED_HIGH
1750 || !driver->setup) 1750 || !driver->setup)
1751 return -EINVAL; 1751 return -EINVAL;
1752 if (!r8a66597) 1752 if (!r8a66597)
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 6bc7ad87c306..d098c36cb587 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2586,7 +2586,7 @@ static int s3c_hsotg_start(struct usb_gadget_driver *driver,
2586 return -EINVAL; 2586 return -EINVAL;
2587 } 2587 }
2588 2588
2589 if (driver->speed < USB_SPEED_FULL) 2589 if (driver->max_speed < USB_SPEED_FULL)
2590 dev_err(hsotg->dev, "%s: bad speed\n", __func__); 2590 dev_err(hsotg->dev, "%s: bad speed\n", __func__);
2591 2591
2592 if (!bind || !driver->setup) { 2592 if (!bind || !driver->setup) {
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 09ea96558b91..f398b8590f9c 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -1142,7 +1142,7 @@ static int s3c_hsudc_start(struct usb_gadget_driver *driver,
1142 int ret; 1142 int ret;
1143 1143
1144 if (!driver 1144 if (!driver
1145 || driver->speed < USB_SPEED_FULL 1145 || driver->max_speed < USB_SPEED_FULL
1146 || !bind 1146 || !bind
1147 || !driver->unbind || !driver->disconnect || !driver->setup) 1147 || !driver->unbind || !driver->disconnect || !driver->setup)
1148 return -EINVAL; 1148 return -EINVAL;
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index b8643771fa80..4d860e9460a4 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1683,9 +1683,9 @@ static int s3c2410_udc_start(struct usb_gadget_driver *driver,
1683 if (udc->driver) 1683 if (udc->driver)
1684 return -EBUSY; 1684 return -EBUSY;
1685 1685
1686 if (!bind || !driver->setup || driver->speed < USB_SPEED_FULL) { 1686 if (!bind || !driver->setup || driver->max_speed < USB_SPEED_FULL) {
1687 printk(KERN_ERR "Invalid driver: bind %p setup %p speed %d\n", 1687 printk(KERN_ERR "Invalid driver: bind %p setup %p speed %d\n",
1688 bind, driver->setup, driver->speed); 1688 bind, driver->setup, driver->max_speed);
1689 return -EINVAL; 1689 return -EINVAL;
1690 } 1690 }
1691#if defined(MODULE) 1691#if defined(MODULE)
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 47a3d1e5b28b..3148461287b1 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1903,7 +1903,7 @@ static int musb_gadget_start(struct usb_gadget *g,
1903 unsigned long flags; 1903 unsigned long flags;
1904 int retval = -EINVAL; 1904 int retval = -EINVAL;
1905 1905
1906 if (driver->speed < USB_SPEED_HIGH) 1906 if (driver->max_speed < USB_SPEED_HIGH)
1907 goto err0; 1907 goto err0;
1908 1908
1909 pm_runtime_get_sync(musb->controller); 1909 pm_runtime_get_sync(musb->controller);
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 43c67e5cde26..c307c8f5bd3a 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -751,7 +751,7 @@ static int usbhsg_gadget_start(struct usb_gadget *gadget,
751 751
752 if (!driver || 752 if (!driver ||
753 !driver->setup || 753 !driver->setup ||
754 driver->speed < USB_SPEED_FULL) 754 driver->max_speed < USB_SPEED_FULL)
755 return -EINVAL; 755 return -EINVAL;
756 756
757 /* first hook up the driver ... */ 757 /* first hook up the driver ... */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 98dc306898b5..317d8925387c 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -760,7 +760,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
760/** 760/**
761 * struct usb_gadget_driver - driver for usb 'slave' devices 761 * struct usb_gadget_driver - driver for usb 'slave' devices
762 * @function: String describing the gadget's function 762 * @function: String describing the gadget's function
763 * @speed: Highest speed the driver handles. 763 * @max_speed: Highest speed the driver handles.
764 * @setup: Invoked for ep0 control requests that aren't handled by 764 * @setup: Invoked for ep0 control requests that aren't handled by
765 * the hardware level driver. Most calls must be handled by 765 * the hardware level driver. Most calls must be handled by
766 * the gadget driver, including descriptor and configuration 766 * the gadget driver, including descriptor and configuration
@@ -824,7 +824,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
824 */ 824 */
825struct usb_gadget_driver { 825struct usb_gadget_driver {
826 char *function; 826 char *function;
827 enum usb_device_speed speed; 827 enum usb_device_speed max_speed;
828 void (*unbind)(struct usb_gadget *); 828 void (*unbind)(struct usb_gadget *);
829 int (*setup)(struct usb_gadget *, 829 int (*setup)(struct usb_gadget *,
830 const struct usb_ctrlrequest *); 830 const struct usb_ctrlrequest *);