From: Felipe Balbi <balbi@ti.com>
To: Michal Nazarewicz <mnazarewicz@google.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Yang Rui Rui <ruirui.r.yang@tieto.com>,
Dave Young <hidave.darkstar@gmail.com>,
Felipe Balbi <balbi@ti.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv3 3/4] usb: gadget: rename usb_gadget_driver::speed to max_speed
Date: Sat, 20 Aug 2011 02:31:34 +0300 [thread overview]
Message-ID: <20110819233133.GD13317@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <70e4e8e289439688e5abbd8b0bb15fcc94415bd9.1313791722.git.mina86@mina86.com>
[-- Attachment #1: Type: text/plain, Size: 3588 bytes --]
On Sat, Aug 20, 2011 at 12:33:01AM +0200, Michal Nazarewicz wrote:
> From: Michal Nazarewicz <mina86@mina86.com>
>
> 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,
this will be handled inside the UDC itself, so why do you need to expose
it ?
> * 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>
> ---
> drivers/usb/gadget/amd5536udc.c | 2 +-
> drivers/usb/gadget/ci13xxx_udc.c | 2 +-
> drivers/usb/gadget/composite.c | 8 ++++----
> drivers/usb/gadget/dbgp.c | 2 +-
> drivers/usb/gadget/dummy_hcd.c | 13 ++++++-------
> drivers/usb/gadget/file_storage.c | 4 ++--
> drivers/usb/gadget/gmidi.c | 2 +-
> drivers/usb/gadget/goku_udc.c | 2 +-
> drivers/usb/gadget/inode.c | 6 +++---
> drivers/usb/gadget/m66592-udc.c | 2 +-
> drivers/usb/gadget/net2272.c | 2 +-
> drivers/usb/gadget/net2280.c | 2 +-
> drivers/usb/gadget/pch_udc.c | 2 +-
> drivers/usb/gadget/printer.c | 2 +-
> drivers/usb/gadget/r8a66597-udc.c | 2 +-
> include/linux/usb/gadget.h | 4 ++--
> 16 files changed, 28 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
> index 80ae808..7b48ed2 100644
> --- a/drivers/usb/gadget/amd5536udc.c
> +++ b/drivers/usb/gadget/amd5536udc.c
> @@ -1968,7 +1968,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;
> diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
> index b877464..6c13174 100644
> --- a/drivers/usb/gadget/ci13xxx_udc.c
> +++ b/drivers/usb/gadget/ci13xxx_udc.c
> @@ -798,7 +798,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;
> }
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 5a3461e..851b5da 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1560,9 +1560,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,
by doing this based on what the function drivers tell you, you could
drop this ifdeferry.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2011-08-19 23:31 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4E4B9D9C.2010607@linutronix.de>
2011-08-17 13:03 ` [PATCH] usb: gadget: get rid of USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED Michal Nazarewicz
2011-08-17 14:20 ` Alan Stern
2011-08-17 14:27 ` Michal Nazarewicz
2011-08-17 14:47 ` Alan Stern
2011-08-17 15:07 ` Michal Nazarewicz
2011-08-17 16:25 ` Alan Stern
2011-08-17 14:36 ` Sergei Shtylyov
2011-08-17 14:45 ` Michal Nazarewicz
2011-08-17 15:33 ` [PATCHv2] " Michal Nazarewicz
2011-08-17 21:09 ` Alan Stern
2011-08-18 13:19 ` Michal Nazarewicz
2011-08-18 14:59 ` Alan Stern
2011-08-18 17:05 ` Michal Nazarewicz
2011-08-18 17:27 ` Alan Stern
2011-08-18 20:13 ` Michal Nazarewicz
2011-08-18 20:30 ` Alan Stern
2011-08-18 20:44 ` Michal Nazarewicz
2011-08-19 10:53 ` Michal Nazarewicz
2011-08-19 11:13 ` Sebastian Andrzej Siewior
2011-08-19 12:14 ` Michal Nazarewicz
2011-08-19 14:29 ` Alan Stern
2011-08-19 14:38 ` Michal Nazarewicz
2011-08-19 14:57 ` Alan Stern
2011-08-19 2:02 ` Yang Rui Rui
2011-08-19 12:17 ` Michal Nazarewicz
2011-08-18 3:01 ` Yang Rui Rui
2011-08-18 11:57 ` Michal Nazarewicz
2011-08-18 13:24 ` Dave Young
2011-08-18 13:41 ` Michal Nazarewicz
2011-08-19 22:32 ` [PATCHv3 0/4] Figuring out speed refactorisation Michal Nazarewicz
2011-08-19 22:32 ` [PATCHv3 1/4] usb: Provide usb_device_speed_name() function Michal Nazarewicz
2011-08-19 23:15 ` Felipe Balbi
2011-08-22 14:53 ` Michal Nazarewicz
2011-08-19 22:33 ` [PATCHv3 2/4] usb: gadget: replace "is_dualspeed" with "max_speed" Michal Nazarewicz
2011-08-19 23:28 ` Felipe Balbi
2011-08-23 13:48 ` Michal Nazarewicz
2011-08-23 13:58 ` Felipe Balbi
2011-08-23 14:15 ` Michal Nazarewicz
2011-08-23 14:37 ` Alan Stern
2011-08-23 14:58 ` Felipe Balbi
2011-08-23 15:07 ` Michal Nazarewicz
2011-08-23 15:11 ` Felipe Balbi
2011-08-23 15:26 ` Michal Nazarewicz
2011-08-23 17:19 ` Felipe Balbi
2011-08-23 18:44 ` Michal Nazarewicz
2011-08-23 15:43 ` Alan Stern
2011-08-23 17:21 ` Felipe Balbi
2011-08-23 18:00 ` Alan Stern
2011-08-23 19:05 ` Michal Nazarewicz
2011-08-23 20:49 ` Alan Stern
2011-08-24 8:56 ` Felipe Balbi
2011-08-24 13:10 ` Michal Nazarewicz
2011-08-24 14:31 ` Alan Stern
2011-08-24 14:53 ` Michal Nazarewicz
2011-08-24 15:15 ` Alan Stern
2011-08-24 15:25 ` Michal Nazarewicz
2011-08-24 23:04 ` Felipe Balbi
2011-08-25 12:46 ` Michal Nazarewicz
2011-08-25 12:53 ` Felipe Balbi
2011-08-24 22:57 ` Felipe Balbi
2011-08-23 15:05 ` Felipe Balbi
2011-08-23 15:30 ` Michal Nazarewicz
2011-08-19 22:33 ` [PATCHv3 3/4] usb: gadget: rename usb_gadget_driver::speed to max_speed Michal Nazarewicz
2011-08-19 23:31 ` Felipe Balbi [this message]
2011-08-20 2:34 ` Alan Stern
2011-08-22 10:42 ` Felipe Balbi
2011-08-19 22:33 ` [PATCHv3 4/4] usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED Michal Nazarewicz
2011-08-20 13:41 ` Alan Stern
2011-08-22 14:51 ` Michal Nazarewicz
2011-08-22 15:03 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110819233133.GD13317@legolas.emea.dhcp.ti.com \
--to=balbi@ti.com \
--cc=bigeasy@linutronix.de \
--cc=hidave.darkstar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mnazarewicz@google.com \
--cc=ruirui.r.yang@tieto.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®