Skip to content

Commit

Permalink
regulator: tps6586x: Add missing bit mask generation
Browse files Browse the repository at this point in the history
Change-Id: I76eaceb31b56264f6978af15db1e6fc7e2e01b5a
Signed-off-by: Danny Huang <dahuang@nvidia.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  (Split into separate patches)
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Danny Huang authored and Liam Girdwood committed Dec 9, 2010
1 parent 6313e3c commit 4f58670
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/tps6586x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ static inline int tps6586x_regulator_preinit(struct device *parent,
if (ret)
return ret;

if (!(val2 & ri->enable_bit[1]))
if (!(val2 & (1 << ri->enable_bit[1])))
return 0;

/*
* The regulator is on, but it's enabled with the bit we don't
* want to use, so we switch the enable bits
*/
if (!(val1 & ri->enable_bit[0])) {
if (!(val1 & (1 << ri->enable_bit[0]))) {
ret = tps6586x_set_bits(parent, ri->enable_reg[0],
1 << ri->enable_bit[0]);
if (ret)
Expand Down

0 comments on commit 4f58670

Please sign in to comment.