lkml.org 
[lkml]   [2011]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 3/4] usb: gadget: rename usb_gadget_driver::speed to max_speed
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-08-20 01:33    [W:0.128 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site