Skip to contentSkip to conversation

ARM: mach-imx6q: Do not run error code path in success case

PATCH New Fabio Estevam 3 participants 3 messages Dec 17, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mach-imx6q: Do not run error code path in success case

The 'put_clk' path should only run in the case of failure, so provide a 'return' to avoid it running in the success case.

---
 arch/arm/mach-imx/mach-imx6q.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/mach-imx6q.c +2 -0
index 4eb1b3a..61f50aa 100644
@@ -134,6 +134,8 @@ static void __init imx6q_sabrelite_cko1_setup(void)
 	clk_set_parent(cko1_sel, ahb);
 	rate = clk_round_rate(cko1, 16000000);
 	clk_set_rate(cko1, rate);
+
+	return;
 put_clk:
 	if (!IS_ERR(cko1_sel))
 		clk_put(cko1_sel);
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

PATCH 1/1 ARM: mach-imx6q: Do not run error code path in success case

Quoted 2 lines · Fabio Estevam

The 'put_clk' path should only run in the case of failure, so provide a 'return' to avoid it running in the success case.

Are you sure? It looks to me like it was intentional. The purpose of this function is to set the parent/rate correctly. The references to the clock are not needed later.

Sascha

Quoted 24 lines
---
 arch/arm/mach-imx/mach-imx6q.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/mach-imx6q.c +2 -0
index 4eb1b3a..61f50aa 100644
@@ -134,6 +134,8 @@ static void __init imx6q_sabrelite_cko1_setup(void)
 	clk_set_parent(cko1_sel, ahb);
 	rate = clk_round_rate(cko1, 16000000);
 	clk_set_rate(cko1, rate);
+
+	return;
 put_clk:
 	if (!IS_ERR(cko1_sel))
 		clk_put(cko1_sel);
Signature · 1 line
1.7.9.5
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
reviewer
#2 lore raw

PATCH 1/1 ARM: mach-imx6q: Do not run error code path in success case

Quoted 3 lines · Sascha Hauer

Are you sure? It looks to me like it was intentional. The purpose of this function is to set the parent/rate correctly. The references to the clock are not needed later.

You are right, please disregard this patch.