[PATCH] pinctrl: imx8ulp: Initialize pin_reg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Fabio Estevam <festevam@xxxxxxxxx>
---
 drivers/pinctrl/freescale/pinctrl-imx8ulp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx8ulp.c b/drivers/pinctrl/freescale/pinctrl-imx8ulp.c
index c5db5dfcfcce..f8572597a54e 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx8ulp.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx8ulp.c
@@ -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;
-- 
2.25.1




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux