Skip to content

Commit

Permalink
pinctrl: iterate over u300_pmx_mask's in u300_pmx_endisable
Browse files Browse the repository at this point in the history
Fix u300_pmx_endisable() to iterate over the list of 'bits' and
'mask' populated as part of u300_pmx_functions.mask[]

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Rajendra Nayak authored and Linus Walleij committed Jan 3, 2012
1 parent 07f29ba commit b84e673
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/pinctrl/pinmux-u300.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,20 +940,23 @@ static void u300_pmx_endisable(struct u300_pmx *upmx, unsigned selector,
{
u16 regval, val, mask;
int i;
const struct u300_pmx_mask *upmx_mask;

upmx_mask = u300_pmx_functions[selector].mask;
for (i = 0; i < ARRAY_SIZE(u300_pmx_registers); i++) {
if (enable)
val = u300_pmx_functions[selector].mask->bits;
val = upmx_mask->bits;
else
val = 0;

mask = u300_pmx_functions[selector].mask->mask;
mask = upmx_mask->mask;
if (mask != 0) {
regval = readw(upmx->virtbase + u300_pmx_registers[i]);
regval &= ~mask;
regval |= val;
writew(regval, upmx->virtbase + u300_pmx_registers[i]);
}
upmx_mask++;
}
}

Expand Down

0 comments on commit b84e673

Please sign in to comment.