linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: imx8m: No need to put node when of_find_compatible_node() failed
@ 2020-03-17  1:37 Anson Huang
  2020-04-14 13:53 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2020-03-17  1:37 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, leonard.crestez, abel.vesa,
	l.stach, peng.fan, linux-arm-kernel, linux-kernel
  Cc: Linux-imx

No need to put node when of_find_compatible_node() failed, return
immediately to simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/soc/imx/soc-imx8m.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index 719e1f18..7b0759a 100644
--- a/drivers/soc/imx/soc-imx8m.c
+++ b/drivers/soc/imx/soc-imx8m.c
@@ -53,11 +53,11 @@ static u32 __init imx8mq_soc_revision(void)
 	struct device_node *np;
 	void __iomem *ocotp_base;
 	u32 magic;
-	u32 rev = 0;
+	u32 rev;
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp");
 	if (!np)
-		goto out;
+		return 0;
 
 	ocotp_base = of_iomap(np, 0);
 	WARN_ON(!ocotp_base);
@@ -78,9 +78,8 @@ static u32 __init imx8mq_soc_revision(void)
 	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
 
 	iounmap(ocotp_base);
-
-out:
 	of_node_put(np);
+
 	return rev;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc: imx8m: No need to put node when of_find_compatible_node() failed
  2020-03-17  1:37 [PATCH] soc: imx8m: No need to put node when of_find_compatible_node() failed Anson Huang
@ 2020-04-14 13:53 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2020-04-14 13:53 UTC (permalink / raw)
  To: Anson Huang
  Cc: s.hauer, kernel, festevam, leonard.crestez, abel.vesa, l.stach,
	peng.fan, linux-arm-kernel, linux-kernel, Linux-imx

On Tue, Mar 17, 2020 at 09:37:33AM +0800, Anson Huang wrote:
> No need to put node when of_find_compatible_node() failed, return
> immediately to simplify the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-14 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17  1:37 [PATCH] soc: imx8m: No need to put node when of_find_compatible_node() failed Anson Huang
2020-04-14 13:53 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).