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

From: David Brownell
Date: Wed Jul 22 2009 - 18:26:01 EST


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.
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/