mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Roland Stigge <stigge@antcom.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	balbi@ti.com, gregkh@linuxfoundation.org, arnd@arndb.de,
	aletes.xgr@gmail.com, kevin.wells@nxp.com,
	srinivas.bakki@nxp.com
Subject: Re: [PATCH] usb: gadget: lpc32xx_udc: Port to new start/stop interface
Date: Fri, 17 Aug 2012 13:51:04 +0300	[thread overview]
Message-ID: <20120817105103.GE4651@arwen.pp.htv.fi> (raw)
In-Reply-To: <502E0A7B.1040607@antcom.de>

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

On Fri, Aug 17, 2012 at 11:10:19AM +0200, Roland Stigge wrote:
> Hi,
> 
> On 08/16/2012 06:16 PM, Roland Stigge wrote:
> > On 08/16/2012 06:05 PM, Sebastian Andrzej Siewior wrote:
> >>> --- linux-2.6.orig/drivers/usb/gadget/lpc32xx_udc.c
> >>> +++ linux-2.6/drivers/usb/gadget/lpc32xx_udc.c
> >>> @@ -2987,14 +2986,14 @@ static irqreturn_t lpc32xx_usb_vbus_irq(
> >>>       return IRQ_HANDLED;
> >>>   }
> >>>
> >>> -static int lpc32xx_start(struct usb_gadget_driver *driver,
> >>> -             int (*bind)(struct usb_gadget *))
> >>> +static int lpc32xx_start(struct usb_gadget *gadget,
> >>> +             struct usb_gadget_driver *driver)
> >>>   {
> >>> -    struct lpc32xx_udc *udc =&controller;
> >>
> >> I assume controller is a global var created at probe time and could be
> >> removed now, right?
> > 
> > Yes!
> 
> Well ;-) looking more closely into it, I'd like to keep it for now: It
> is a more complex statically pre-initialized struct, finally being used
> in probe() for more dynamic initialization, and it ends up being used by
> many other functions, including lpc32xx_start() where accessing it now
> via container_of() is just a bit more elegant than a direct &controller
> of the global variable.
> 
> Also, since this device is a single controller in the LPC32xx SoC, I
> would keep it until some other silicon uses several of this IP core
> (which I doubt), at which point we would probably still keep the (global
> static) controller and memcpy it to a dynamically allocated struct.
> 
> Sounds reasonable?

no it doesn't. Please remove that static global. Sorry but one of the
goals with udc_start/udc_stop was really to get rid of all those
nonsensical static globals.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2012-08-17 10:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 15:34 Roland Stigge
2012-08-16 16:05 ` Sebastian Andrzej Siewior
2012-08-16 16:16   ` Roland Stigge
2012-08-17  9:10     ` Roland Stigge
2012-08-17  9:42       ` Sebastian Andrzej Siewior
2012-08-17 10:52         ` Felipe Balbi
2012-08-19 12:33         ` Roland Stigge
2012-08-20  7:07           ` Sebastian Andrzej Siewior
2012-08-20  8:11             ` Roland Stigge
2012-08-17 10:51       ` Felipe Balbi [this message]
2012-08-17 11:01         ` Sebastian Andrzej Siewior
2012-08-17 11:02           ` Felipe Balbi
2012-08-17 11:28             ` Sebastian Andrzej Siewior
2012-08-17 11:32             ` Roland Stigge
2012-08-17 11:39               ` Sebastian Andrzej Siewior
2012-08-19 12:48                 ` Roland Stigge

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=20120817105103.GE4651@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=aletes.xgr@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kevin.wells@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=srinivas.bakki@nxp.com \
    --cc=stigge@antcom.de \
    /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

Powered by JetHome