All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: linus.walleij@linaro.org
Cc: shawnguo@kernel.org, s.hauer@pengutronix.de,
	linux-gpio@vger.kernel.org, linux-imx@nxp.com,
	Fabio Estevam <festevam@gmail.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH] pinctrl: imx8ulp: Initialize pin_reg
Date: Fri, 23 Jul 2021 17:32:42 -0300	[thread overview]
Message-ID: <20210723203242.88845-1-festevam@gmail.com> (raw)

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@intel.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 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


             reply	other threads:[~2021-07-23 20:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 20:32 Fabio Estevam [this message]
2021-07-23 20:53 ` [PATCH] pinctrl: imx8ulp: Initialize pin_reg Linus Walleij
2021-07-26  1:59   ` Jacky Bai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210723203242.88845-1-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=lkp@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.