Re: [PATCH] regulator: of: simplifing the parsing code

From: Mark Brown
Date: Sat Nov 21 2015 - 08:22:44 EST


On Fri, Nov 20, 2015 at 01:27:27PM +0530, Saurabh Sengar wrote:

> in case of_property_read_u32 fails, it keeps the parameter unchanged
> so no need to test if its success and then assign the value

On the other hand the current code doesn't require us to know that
detail... it's really not entirely clear to me that this is a great
win.

> I also have concern related to how we are passing 'regulator-mode' and
> 'regulator-initial-mode'. Currently this require a extra function to be
> set in 'of_map_mode', which can be avoided.
> These two parameters can be set directly from the device tree as in below patch:
> https://lkml.org/lkml/2014/1/16/263

No, they can't - the values we set for modes in the DT are defined per
regulator and we need to translate these into the regulator API
definitions.

> + of_property_read_u32(np, "regulator-microvolt-offset",
> + &constraints->uV_offset);

The indentation for these is very strange - the second line is indented
a really long way.

Attachment: signature.asc
Description: PGP signature