Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7177aed4 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Felipe Balbi
Browse files

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: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d327ab5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1959,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->max_speed < USB_SPEED_HIGH)
		return -EINVAL;
	if (!dev)
		return -ENODEV;
+1 −1
Original line number Diff line number Diff line
@@ -1633,7 +1633,7 @@ static int at91_start(struct usb_gadget_driver *driver,
	unsigned long	flags;

	if (!driver
			|| driver->speed < USB_SPEED_FULL
			|| driver->max_speed < USB_SPEED_FULL
			|| !bind
			|| !driver->setup) {
		DBG("bad parameter.\n");
+1 −1
Original line number Diff line number Diff line
@@ -813,7 +813,7 @@ static ssize_t show_driver(struct device *dev, struct device_attribute *attr,
	n += scnprintf(buf + n, PAGE_SIZE - n, "function  = %s\n",
		       (driver->function ? driver->function : ""));
	n += scnprintf(buf + n, PAGE_SIZE - n, "max speed = %d\n",
		       driver->speed);
		       driver->max_speed);

	return n;
}
+4 −4
Original line number Diff line number Diff line
@@ -1535,9 +1535,9 @@ composite_resume(struct usb_gadget *gadget)

static struct usb_gadget_driver composite_driver = {
#ifdef CONFIG_USB_GADGET_SUPERSPEED
	.speed		= USB_SPEED_SUPER,
	.max_speed	= USB_SPEED_SUPER,
#else
	.speed		= USB_SPEED_HIGH,
	.max_speed	= USB_SPEED_HIGH,
#endif

	.unbind		= composite_unbind,
@@ -1584,8 +1584,8 @@ int usb_composite_probe(struct usb_composite_driver *driver,
		driver->iProduct = driver->name;
	composite_driver.function =  (char *) driver->name;
	composite_driver.driver.name = driver->name;
	composite_driver.speed = min((u8)composite_driver.speed,
				     (u8)driver->max_speed);
	composite_driver.max_speed =
		min_t(u8, composite_driver.max_speed, driver->max_speed);
	composite = driver;
	composite_gadget_bind = bind;

+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static int dbgp_setup(struct usb_gadget *gadget,

static struct usb_gadget_driver dbgp_driver = {
	.function = "dbgp",
	.speed = USB_SPEED_HIGH,
	.max_speed = USB_SPEED_HIGH,
	.unbind = dbgp_unbind,
	.setup = dbgp_setup,
	.disconnect = dbgp_disconnect,
Loading