]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pinctrl: iterate over u300_pmx_mask's in u300_pmx_endisable
authorRajendra Nayak <rnayak@ti.com>
Tue, 15 Nov 2011 06:40:26 +0000 (12:10 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 30 Nov 2011 15:18:47 +0000 (16:18 +0100)
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>
drivers/pinctrl/pinmux-u300.c

index 4858a64131f8e06f743c946ded0af19adeaec1bd..145a84dc16e6dccc0986c7bec7e7b77bc0d98ac8 100644 (file)
@@ -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++;
        }
 }