summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-10-28 00:18:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-06 11:22:35 +0100
commit0dd17ab1bb2d573cc73c618589f7062b6e6c7c59 (patch)
treef91e8ecf142003b9db99fd7cbf3a8acf93335f2e /drivers
parentce99d0c86b32ecc2946e36456695a8aad83ea15e (diff)
downloadbarebox-0dd17ab1bb2d573cc73c618589f7062b6e6c7c59.tar.gz
barebox-0dd17ab1bb2d573cc73c618589f7062b6e6c7c59.tar.xz
pinctrl: stm32: fix debug print of uninitialized variable
mode and alt are printed with the dev_dbg before they are initialized. Remedy this by moving the dev_dbg after them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/pinctrl-stm32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-stm32.c b/drivers/pinctrl/pinctrl-stm32.c
index 7f04cea50b..ab121998a3 100644
--- a/drivers/pinctrl/pinctrl-stm32.c
+++ b/drivers/pinctrl/pinctrl-stm32.c
@@ -157,13 +157,13 @@ static int stm32_pinctrl_set_state(struct pinctrl_device *pdev, struct device_no
if (offset < 0)
return -ENODEV;
+ mode = stm32_gpio_get_mode(func);
+ alt = stm32_gpio_get_alt(func);
+
dev_dbg(pdev->dev, "configuring port %s pin %u with:\n\t"
"fn %u, mode %u, alt %u\n",
bank->name, offset, func, mode, alt);
- mode = stm32_gpio_get_mode(func);
- alt = stm32_gpio_get_alt(func);
-
clk_enable(bank->clk);
__stm32_pmx_set_mode(bank->base, offset, mode, alt);