Skip to content

Commit 87b30c4

Browse files
passgatShawn Guo
authored andcommitted
ARM: imx: add missing of_node_put()
Calling of_find_compatible_node() returns a node pointer with refcount incremented. Use of_node_put() on it when done. The patch fixes the same problem on different i.MX platforms. Fixes: 8b88f7e ("ARM: mx25: Retrieve IIM base from dt") Fixes: 94b2bec ("ARM: imx27: Retrieve the SYSCTRL base address from devicetree") Fixes: 3172225 ("ARM: imx31: Retrieve the IIM base address from devicetree") Fixes: f68ea68 ("ARM: imx35: Retrieve the IIM base address from devicetree") Fixes: ee18a71 ("ARM: imx5: retrieve iim base from device tree") Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Reviewed-by: Martin Kaiser <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 62f0147 commit 87b30c4

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

arch/arm/mach-imx/cpu-imx25.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ static int mx25_read_cpu_rev(void)
2323

2424
np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim");
2525
iim_base = of_iomap(np, 0);
26+
of_node_put(np);
2627
BUG_ON(!iim_base);
2728
rev = readl(iim_base + MXC_IIMSREV);
2829
iounmap(iim_base);

arch/arm/mach-imx/cpu-imx27.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static int mx27_read_cpu_rev(void)
2828

2929
np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
3030
ccm_base = of_iomap(np, 0);
31+
of_node_put(np);
3132
BUG_ON(!ccm_base);
3233
/*
3334
* now we have access to the IO registers. As we need

arch/arm/mach-imx/cpu-imx31.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ static int mx31_read_cpu_rev(void)
3939

4040
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
4141
iim_base = of_iomap(np, 0);
42+
of_node_put(np);
4243
BUG_ON(!iim_base);
4344

4445
/* read SREV register from IIM module */

arch/arm/mach-imx/cpu-imx35.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static int mx35_read_cpu_rev(void)
2121

2222
np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
2323
iim_base = of_iomap(np, 0);
24+
of_node_put(np);
2425
BUG_ON(!iim_base);
2526

2627
rev = imx_readl(iim_base + MXC_IIMSREV);

arch/arm/mach-imx/cpu-imx5.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static u32 imx5_read_srev_reg(const char *compat)
2828

2929
np = of_find_compatible_node(NULL, NULL, compat);
3030
iim_base = of_iomap(np, 0);
31+
of_node_put(np);
3132
WARN_ON(!iim_base);
3233

3334
srev = readl(iim_base + IIM_SREV) & 0xff;

0 commit comments

Comments
 (0)