summaryrefslogtreecommitdiff
path: root/drivers/soc/imx
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2020-03-17 04:37:33 +0300
committerShawn Guo <shawnguo@kernel.org>2020-04-14 16:51:58 +0300
commit04df45fba52177f796a20642b92fdc44e489e174 (patch)
tree98fc592388c08229ae9de1f30898fa093f267ba5 /drivers/soc/imx
parent8f3d9f354286745c751374f5f1fcafee6b3f3136 (diff)
downloadlinux-04df45fba52177f796a20642b92fdc44e489e174.tar.xz
soc: imx8m: No need to put node when of_find_compatible_node() failed
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> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/soc/imx')
-rw-r--r--drivers/soc/imx/soc-imx8m.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index 719e1f189ebf..7b0759adb47d 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;
}