[PATCH 09/10] MCDE: Add build files and bus

Greg KH greg at kroah.com
Tue Nov 30 08:24:13 PST 2010

On Tue, Nov 30, 2010 at 04:21:47PM +0100, Arnd Bergmann wrote:
> On Tuesday 30 November 2010, Linus Walleij wrote:
> > 2010/11/26 Arnd Bergmann <arnd at arndb.de>:
> > 
> > > * When you say that the devices are static, I hope you do not mean
> > >  static in the C language sense. We used to allow devices to be
> > >  declared as "static struct" and registered using
> > >  platform_device_register (or other bus specific functions). This
> > >  is no longer valid and we are removing the existing users, do not
> > >  add new ones. When creating a platform device, use
> > >  platform_device_register_simple or platform_device_register_resndata.
> > 
> > Is this part of the generic ARM runtime multi-platform kernel
> > and device trees shebang?
> > 
> > The Ux500 still isn't in that sector, it needs extensive rewriting
> > of arch/arm/mach-ux500 to be done first, so as to support e.g.
> > U8500 and U5500 with a single kernel image.
> > 
> > Trying to skin that cat that as part of this review is a bit too
> > much to ask IMO, I'd rather have the author of this driver
> > adapt to whatever platform data registration mechanism is
> > in place for the merge window. Else it needs fixing as part
> > of a bigger endavour to root out compile-time platform
> > configuration.
> The 'no static devices' rule is something that Greg brought up
> at the embedded developer session during PlumbersConf this year,
> I wasn't aware of the problem before that either.
> It is not related to the multi-platform kernel work and it's
> not ARM specific.
> Maybe Greg can give a short explanation of the impact of this.
> AFAIR, static device definitions still work, but there are
> plans to remove that capability in the future.

That is exactly correct.

A struct device is a dynamically referenced thing, and as such, should
be dynamically created and it will be automatically destroyed when it
needs to when everyone is finished with it.  By making a struct device
static, that kind of defeats the whole purpose of reference counting the
thing, not to mention making freeing the object when finished a bit
difficult :)


greg k-h

More information about the dri-devel mailing list