[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b90c0690908030215j3f0fb6a6u322a079795193652@mail.gmail.com>
Date: Mon, 3 Aug 2009 12:15:57 +0300
From: Roger Quadros <quadros.roger@...il.com>
To: pHilipp Zabel <philipp.zabel@...il.com>
Cc: broonie@...ena.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] regulator: Add GPIO enable control to fixed voltage
regulator driver
On Sun, Aug 2, 2009 at 8:49 PM, pHilipp Zabel<philipp.zabel@...il.com> wrote:
> On Sun, Aug 2, 2009 at 6:56 PM, Roger Quadros<quadros.roger@...il.com> wrote:
>> From: Roger Quadros <ext-roger.quadros@...ia.com>
>>
>> +
>> + /* set output direction without changing state
>> + * to prevent glitch
>> + */
>> + drvdata->is_enabled = config->enabled_at_boot;
>> + if (!config->enable_high)
>> + drvdata->is_enabled = !drvdata->is_enabled;
>
> Assume .enabled_at_boot = 1, .enable_high = 0. In this case we end up
> with .is_enabled = 0, which does not represent the real state after
> the following call:
>
>> + ret = gpio_direction_output(config->gpio, drvdata->is_enabled);
>
> Maybe use a local variable here or (drvdata->is_enabled ?
> config->enable_high : !config->enable_high).
>
> regards
> Philipp
>
Yes you are right.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists