lkml.org 
[lkml]   [2015]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: of: removing two variables min_uV and max_uV
On Sat, Oct 31, 2015 at 08:31:31PM +0530, Saurabh Sengar wrote:

> - min_uV = of_get_property(np, "regulator-min-microvolt", NULL);
> - if (min_uV)
> - constraints->min_uV = be32_to_cpu(*min_uV);

> + if (!of_property_read_u32(np, "regulator-max-microvolt", &pval))
> + constraints->max_uV = pval;

> /* Only one voltage? Then make sure it's set. */
> - if (min_uV && max_uV && constraints->min_uV == constraints->max_uV)
> + if (constraints->min_uV == constraints->max_uV)
> constraints->apply_uV = true;

Your new code is not equivalent to the existing code. The new code will
set apply_uV even if the DT properties are not present which will in
turn mean that we will end up attempting to apply a setting of 0V if
that happens which is not desirable.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2015-11-02 10:01    [W:0.036 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site