[UPSTREAM - RFC] pcf50633_use_regulator_api.patch

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Oct 9 11:49:43 CEST 2008

On Thu, Oct 09, 2008 at 02:07:10AM -0200, Werner Almesberger wrote:

> I think his reason is probably that, if there are any API changes or
> if he wants to look for how people use the API, he has all the code
> in question in one place, not scattered all over the tree, making it
> easier for him to find things, and also for others to see what his
> changes are doing. (I.e., "he updated the users of his API" vs. "he
> made changes seemingly all over the kernel".)

Yes, that's pretty much it.  I also find it makes it much easier when
grovelling around for examples of how to do something but YMMV on that.

> Properly hiding "internal" symbols may a bit tricky, I agree. On the
> other hand, it seems pretty unlikely that anyone else would invade
> the pcf50633_* namespace, or feel invaded by it.

Yeah, the namespacing seems to cover it fairly well.  For the WM8400
drivers I've created a separate header file for use by machine drivers -
any driver that isn't specifically for the WM8400 and is including a
header other than that header is setting a red flag.

Separate drivers also let you build separate modules for the different
bits of the chip so you can avoid pulling in APIs for components you
don't want without ifdefs.

> There is precedent for this, e.g.,
> drivers/mmc/host/tmio_mmc.c uses tmio_io* defined in
> include/linux/mfd/tmio.h and shared with
> drivers/mfd/{t7l66xb,tc6387xb}.c

There's others on the way doing the same thing.

More information about the openmoko-kernel mailing list