[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090227141212.a2bc4a01.akpm@linux-foundation.org>
Date: Fri, 27 Feb 2009 14:12:12 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: David Brownell <david-b@...bell.net>
Cc: me@...ipebalbi.com, linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org, felipe.balbi@...ia.com,
sameo@...nedhand.com
Subject: Re: [PATCH 2/2] mfd: twl4030: add twl4030-pwrbutton as our child
On Fri, 27 Feb 2009 13:58:46 -0800
David Brownell <david-b@...bell.net> wrote:
> On Friday 27 February 2009, Andrew Morton wrote:
> > > --- a/drivers/mfd/twl4030-core.c
> > > +++ b/drivers/mfd/twl4030-core.c
> > > @@ -101,6 +101,12 @@
> > > __#define twl_has_usb()________________false
> > > __#endif
> > > __
> > > +#if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \
> > > +__________|| defined(CONFIG_INPUT_TWL4030_PWBUTTON_MODULE)
> >
> > OK, this is "wrong". __The core shouldn't need to know about specific
> > clients.
>
> This is a pretty standard idiom:
That doesn't make it right.
> only create the device
> nodes a system actually uses.
That happens automatically if the nodes are made when the client
registers itself with the core.
> >
> > What has gone wrong here?
>
> Not much I can see. It's registering a platform_device,
> but only if it could be used on this system.
Again, that all gets fixed if this is done the right way around. Run
your probe function. If the hardware is there, register with the core
and all the nodes appear. If the hardware is not present: bale.
The design of the whole subsystem appears to be upside down :(
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists