lkml.org 
[lkml]   [2010]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: Update consumer state only after set voltage succeeds.
On Mon, Dec 20, 2010 at 02:27:40PM -0800, Saravana Kannan wrote:

> I agree it looks a bit odd and I'm willing to do the code reorg if
> there is a better way. But I definitely wouldn't call this as

See the suggestion I made in the previous mail - try doing it by making
the change, then backing it out again if the attempt fails.

> randomly ignoring a consumer. We are just avoiding the consumer
> that's changing the range from "voting twice". We already send the
> new request thru min/max params.

It's a code clarity issue rather than a correctness issue. When you're
in the code doing the check it's not terribly obvious why you're
ignoring it, and if you make any changes to the structure here or check
from other places you need to worry about which consumer to ignore. If
we ever end up wanting to ignore two it'd be fun also...

> Do you have any suggestions for a better way to compute the min/max
> while leaving out a single consumer? I'm very much open to do that.

It seems better to arrange things so we don't ignore a consumer so the
check function doesn't need to worry about what it's checking, it just
goes and does it.


\
 
 \ /
  Last update: 2010-12-21 17:37    [W:0.154 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site