Skip to contentSkip to conversation

pinctrl: imx8ulp: Initialize pin_reg

PATCH In review Fabio Estevam 3 participants 3 messages Jul 23, 2021 – Jul 26, 2021

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author maintainer
#0 lore raw

PATCH 1/1 pinctrl: imx8ulp: Initialize pin_reg

The initialization of pin_reg is missing, causing the following build warning:

drivers/pinctrl/freescale/pinctrl-imx8ulp.c:228:35: warning: 'pin_reg' is used uninitialized in this function [-Wuninitialized]

Initialize pin_reg the same way as it is done on vf610 and imx7ulp to fix the problem.

Fixes 16b343e8e0ef ("pinctrl: imx8ulp: Add pinctrl driver support")
---
 drivers/pinctrl/freescale/pinctrl-imx8ulp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pinctrl/freescale/pinctrl-imx8ulp.c +4 -0
index c5db5dfcfcce..f8572597a54e 100644
@@ -225,6 +225,10 @@ static int imx8ulp_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
 	const struct imx_pin_reg *pin_reg;
 	u32 reg;
 
+	pin_reg = &ipctl->pin_regs[offset];
+	if (pin_reg->mux_reg == -1)
+		return -EINVAL;
+
 	reg = readl(ipctl->base + pin_reg->mux_reg);
 	if (input)
 		reg = (reg & ~BM_OBE_ENABLED) | BM_IBE_ENABLED;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 11 lines · Fabio Estevam

The initialization of pin_reg is missing, causing the following build warning:

drivers/pinctrl/freescale/pinctrl-imx8ulp.c:228:35: warning: 'pin_reg' is used uninitialized in this function [-Wuninitialized]

Initialize pin_reg the same way as it is done on vf610 and imx7ulp to fix the problem.

Fixes 16b343e8e0ef ("pinctrl: imx8ulp: Add pinctrl driver support")

Wow how fast!
Patch applied.
Thanks for fixing Fabio, excellent work as always.

Yours,
Linus Walleij

maintainer
#2 lore raw
Quoted 14 lines

Subject: Re: [PATCH] pinctrl: imx8ulp: Initialize pin_reg

Quoted 9 lines · Fabio Estevam

The initialization of pin_reg is missing, causing the following build warning:

drivers/pinctrl/freescale/pinctrl-imx8ulp.c:228:35: warning: 'pin_reg' is used uninitialized in this function [-Wuninitialized]

Initialize pin_reg the same way as it is done on vf610 and imx7ulp to fix the problem.

Quoted 8 lines
Quoted 3 lines
Fixes 16b343e8e0ef ("pinctrl: imx8ulp: Add pinctrl driver support")

Wow how fast!
Patch applied.
Thanks for fixing Fabio, excellent work as always.

It's my fault. when I did a change in V2, one additional line was removed wrongly, sorry for inconvenience.

BR
Jacky Bai

Quoted 2 lines

Yours,
Linus Walleij