Skip to content

Commit 04df45f

Browse files
Anson-HuangShawn Guo
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 8f3d9f3 commit 04df45f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/soc/imx/soc-imx8m.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ static u32 __init imx8mq_soc_revision(void)
5353
struct device_node *np;
5454
void __iomem *ocotp_base;
5555
u32 magic;
56-
u32 rev = 0;
56+
u32 rev;
5757

5858
np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp");
5959
if (!np)
60-
goto out;
60+
return 0;
6161

6262
ocotp_base = of_iomap(np, 0);
6363
WARN_ON(!ocotp_base);
@@ -78,9 +78,8 @@ static u32 __init imx8mq_soc_revision(void)
7878
soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
7979

8080
iounmap(ocotp_base);
81-
82-
out:
8381
of_node_put(np);
82+
8483
return rev;
8584
}
8685

0 commit comments

Comments
 (0)