Re: Regulator supplies when using Device Tree

From: Mark Brown
Date: Wed Mar 28 2012 - 15:33:52 EST

On Wed, Mar 28, 2012 at 12:19:45PM -0700, Michael Bohan wrote:
> On 3/28/2012 3:09 AM, Mark Brown wrote:
> >On Tue, Mar 27, 2012 at 06:38:30PM -0700, Michael Bohan wrote:

> >Absolutely not, that would be broken. The whole point here is that
> >supplies of all kinds are always requested with the name the chip uses
> >for the supply.

> Within the regulator driver, we currently have to do an
> of_get_property(of_node, "foo-supply", NULL) to determine whether
> the device has a supply, and thus whether we should assign
> rdesc->supply_name to "foo" or not when calling

No, this would be completely idiotic. Please think about what I'm
saying here. To repeat, supplies of all kinds are always requested with
the name the chip uses for the supply. This means that any machine
binding is *totally* irrelevant to the regulator driver.

> regulator_register(). Is there a better way to do this? If we don't
> do this check for the case where a device does not have a supply
> specified in the Device Tree, then regulator_register() will fail.

Obviously there's a better way to do this. For one thing as soon as we
find ourselves saying "let's open code this in every single driver"
we've got a clear abstraction problem...

Attachment: signature.asc
Description: Digital signature