aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-03-12 06:09:15 -0400
committerLinus Walleij <linus.walleij@linaro.org>2015-03-17 21:14:45 -0400
commit17c7cbb0e7b7a877f1ce2063d7f869801b24cd6a (patch)
tree7406be08e11a14e9cdc6c315262ffec6cd7c8353
parentcef28a289482175b26f7a5ae4a1337c792cea9c5 (diff)
pinctrl: sh-pfc: Use reg_width instead of reg as sentinel
All other loops over sh_pfc_soc_info.data_regs[] use pinmux_data_reg.regwidth as the sentinel, which is safer as zero is never a valid regwidth value (reg could be zero if we start using it to store an offset). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/sh-pfc/gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c
index aa2fc77a1925..5d3a35ce0912 100644
--- a/drivers/pinctrl/sh-pfc/gpio.c
+++ b/drivers/pinctrl/sh-pfc/gpio.c
@@ -84,7 +84,7 @@ static void gpio_setup_data_reg(struct sh_pfc_chip *chip, unsigned idx)
84 unsigned int bit; 84 unsigned int bit;
85 unsigned int i; 85 unsigned int i;
86 86
87 for (i = 0, dreg = pfc->info->data_regs; dreg->reg; ++i, ++dreg) { 87 for (i = 0, dreg = pfc->info->data_regs; dreg->reg_width; ++i, ++dreg) {
88 for (bit = 0; bit < dreg->reg_width; bit++) { 88 for (bit = 0; bit < dreg->reg_width; bit++) {
89 if (dreg->enum_ids[bit] == pin->enum_id) { 89 if (dreg->enum_ids[bit] == pin->enum_id) {
90 gpio_pin->dreg = i; 90 gpio_pin->dreg = i;