Re: [PATCH 2/2] mfd: twl4030: add twl4030-pwrbutton as our child

David Brownell
2009-07-22T22:25:56Z

On Wednesday 22 July 2009, Trilok Soni wrote:
> > That doesn't address the problem at all.  A function called
> > "add_children" just shouldn't exist.  The general kernel design is for
> > client drivers to register themselves with the core, so the core does
> > not have any hard-wired knowledge of any client drivers.

The general kernel design also involves bus drivers
(consider PCI or USB) enumerating their child devices
and then *adding* those children ... that's what is
done here. The devices supported by that system get
added, and then the driver model code can bind each
device to its driver.

> > IOW, twl4030_pwrbutton_probe() should call into twl4030-core,
> > registering the powerbutton driver.

It calls to the driver model to register that driver,
which then sees that the device is registered.

- Dave

>
> Reviving this very old thread.
>