Re: [RFC PATCH] regulator: core: Add ability to create a lookupalias for supply

From: Mark Brown
Date: Wed Oct 02 2013 - 15:50:40 EST


On Wed, Oct 02, 2013 at 01:16:59PM +0100, Charles Keepax wrote:

> Following our discussions around the Arizona regulator
> bindings here is an effort at putting a mechanism into the
> regulator core to alias registering of a supply from one
> device to another.

This seems basically fine, though I do have a few comments below.

Bulk versions of the API would also make sense - it's likely that more
than one supply will need to be mapped - and please also add managed
versions so people don't have to write cleanup code.

> I have a couple of patches that update the Arizona driver to
> use this that I will send in if you think this looks along
> the lines of what you were suggesting.

This seems like someting that should be in the MFD core, or at least
that there should be helpers in the core. Something like a set of
mappings in the mfd_cell so it's all data to the drivers.

> + struct device *dev;
> + const char *supply;
> + struct device *alias;

Please use a more meaningful name for dev. It might also be worth
allowing rewriting of the supply name since we'll probably find other
applications for things like modular board designs where name rewriting
is useful; since it's a function call with a parameter list it's harder
to add later than it would be with a struct.

Attachment: signature.asc
Description: Digital signature