linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: julia@diku.dk (Julia Lawall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
Date: Mon, 2 Aug 2010 14:51:36 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1008021446470.10662@ask.diku.dk> (raw)
In-Reply-To: <1280752803-11441-1-git-send-email-u.kleine-koenig@pengutronix.de>

> diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
> index 731150d..c266c1e 100644
> --- a/drivers/usb/gadget/amd5536udc.c
> +++ b/drivers/usb/gadget/amd5536udc.c
> @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
>  }
>  
>  /* Called by gadget driver to register itself */
> -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> +		int (*bind)(struct usb_gadget *))
>  {
>  	struct udc		*dev = udc;
>  	int			retval;
>  	u32 tmp;
>  
> -	if (!driver || !driver->bind || !driver->setup
> +	if (!driver || bind || !driver->setup

I have the impression that this should be !bind rather than bind.  
That would be like what is done in the patch for 
drivers/usb/gadget/fsl_udc_core.c below


> diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
> index 08a9a62..c16b402 100644
> --- a/drivers/usb/gadget/fsl_udc_core.c
> +++ b/drivers/usb/gadget/fsl_udc_core.c
> @@ -1765,7 +1765,8 @@ static irqreturn_t fsl_udc_irq(int irq, void *_udc)
>   * Hook to gadget drivers
>   * Called by initialization code of gadget drivers
>  *----------------------------------------------------------------*/
> -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> +		int (*bind)(struct usb_gadget *))
>  {
>  	int retval = -ENODEV;
>  	unsigned long flags = 0;
> @@ -1775,8 +1776,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
>  
>  	if (!driver || (driver->speed != USB_SPEED_FULL
>  				&& driver->speed != USB_SPEED_HIGH)
> -			|| !driver->bind || !driver->disconnect
> -			|| !driver->setup)
> +			|| !bind || !driver->disconnect || !driver->setup)
>  		return -EINVAL;

Here !driver->bind is converted to !bind.

julia

  reply	other threads:[~2010-08-02 12:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 14:49 [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver Uwe Kleine-König
2010-07-30 15:14 ` Julia Lawall
2010-07-30 15:28   ` Uwe Kleine-König
2010-07-30 15:16 ` Michał Nazarewicz
2010-07-30 15:26   ` Uwe Kleine-König
2010-07-30 16:08     ` Michał Nazarewicz
2010-07-30 18:57       ` Uwe Kleine-König
2010-07-30 18:46     ` David Brownell
2010-08-02  9:39 ` Michał Nazarewicz
2010-08-02 12:39   ` [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver Uwe Kleine-König
2010-08-02 12:51     ` Julia Lawall [this message]
2010-08-02 13:12       ` Uwe Kleine-König
2010-08-02 22:54         ` Greg KH
2010-08-02 14:25     ` Michał Nazarewicz

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=Pine.LNX.4.64.1008021446470.10662@ask.diku.dk \
    --to=julia@diku.dk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).