Re: [GIT PULL] voltage regulator updates for 2.6.31-rc1

From: Mark Brown
Date: Mon Jun 15 2009 - 13:17:33 EST


On Mon, Jun 15, 2009 at 09:29:54AM -0700, Linus Torvalds wrote:
> On Mon, 15 Jun 2009, Liam Girdwood wrote:

> > include/linux/regulator/lp3971.h | 51 +++

> Why the heck would "lp3971.h" be under "include/linux"? That makes no
> sense what-so-ever.

> Why isn't it just

> drivers/regulator/lp3971.c
> drivers/regulator/lp3971.h

It defines a platform data structure for the architecture code which
instantiates the driver to use to pass configuration to the driver. If
the header were in drivers/regulator then any system using one of these
regulators would need to peer into drivers/regulator in order to set up
the driver.

> instead? There is never any reason for anything but the lp3971 driver to
> include its own header file, they should _not_ be split up to be in two
> different places.

All the driver-internal definitions are included in the driver itself,
the regulator drivers have been good about not exposing this.

> In fact, why do we have a "include/linux/regulator/" at all? Does anybody
> else ever care? I doubt it.

At the minute the regulator API makes at least some platform data
mandatory for regulators (in order to tell the API what configuration
can safely be done on the regulator on a given board). This could be
changed but it seems to be working well at the minute and provides a
fairly simple and direct way of matching the configuration to the
correct regulator.

Even if the regulator API were reorganised to not require this a
noticable proportion of regulators require some tuning for things like
the passive components surrounding the regulator which would need
platform data.
--
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/