Re: [RFC PATCH] mfd: arizona: Update device tree regulator bindings

From: Mark Brown
Date: Wed Sep 25 2013 - 14:32:32 EST

On Wed, Sep 25, 2013 at 06:47:52PM +0100, Charles Keepax wrote:

> This patch creates a sub-node for the codec and attaches the required
> regulators here using the of_compatible field on the mfd_cell.

> Another issue with the Arizona bindings, I am not sure
> exactly what the best approach is this patch seems like the
> "correct" fix, but it does require a change to the binding,
> although the current binding is non-functional.

No, this is not sensible - what you're doing here is clearly a Linux
implementation detail.

> Alternatively I could simply set the codec of_node to match
> the mfd one manually in the codec driver which wouldn't need
> the binding changing but feels a bit like a work around.

That's not clever either, fiddling around with the data structures like
that is bound to cause referencing problems ("I just freed the device,
let's clean up all the memory") and general fragility.

> Any thoughts would be greatly appreciated?

You need to do something like arrange for the regulator API to resolve
attempts to look up regulators on the subnode using the parent, the
device is virtual after all.

Attachment: signature.asc
Description: Digital signature