pinctrl: at91: initialize config parameter to 0
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 7 Dec 2013 13:08:53 +0000 (14:08 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 12 Dec 2013 14:43:36 +0000 (15:43 +0100)
When passing a not initialized config parameter, at91_pinconf_get() would return
a bogus value. Fix that by initializing it to zero before using it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-at91.c

index 6446dc804aa733799d5a1ab9b75050d1d52ddb18..b0b78f3468aee33f28b5071b98da58baa490a2ec 100644 (file)
@@ -722,7 +722,8 @@ static int at91_pinconf_get(struct pinctrl_dev *pctldev,
        unsigned pin;
        int div;
 
-       dev_dbg(info->dev, "%s:%d, pin_id=%d, config=0x%lx", __func__, __LINE__, pin_id, *config);
+       *config = 0;
+       dev_dbg(info->dev, "%s:%d, pin_id=%d", __func__, __LINE__, pin_id);
        pio = pin_to_controller(info, pin_to_bank(pin_id));
        pin = pin_id % MAX_NB_GPIO_PER_BANK;