Skip to contentSkip to conversation

bus: ti-sysc: Adjust exception handling in sysc_child_add_named_clock()

PATCH In review Markus Elfring 2 participants 2 messages Nov 6, 2019 – Nov 14, 2019

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

PATCH 1/1 bus: ti-sysc: Adjust exception handling in sysc_child_add_named_clock()

From: Markus Elfring <[email protected]>
Date: Wed, 6 Nov 2019 19:12:30 +0100

Add a jump target so that a call of the function “clk_put” can be better reused at the end of this function.

---
 drivers/bus/ti-sysc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/bus/ti-sysc.c +3 -4
index 97b85493aa43..2042f6e45163 100644
@@ -1766,9 +1766,8 @@ static int sysc_child_add_named_clock(struct sysc *ddata,
 
 	clk = clk_get(child, name);
 	if (!IS_ERR(clk)) {
-		clk_put(clk);
-
-		return -EEXIST;
+		error = -EEXIST;
+		goto put_clk;
 	}
 
 	clk = clk_get(ddata->dev, name);
@@ -1778,7 +1777,7 @@ static int sysc_child_add_named_clock(struct sysc *ddata,
 	l = clkdev_create(clk, name, dev_name(child));
 	if (!l)
 		error = -ENOMEM;
-
+put_clk:
 	clk_put(clk);
 
 	return error;

--
2.24.0

maintainer
#1 lore raw
Quoted 5 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Wed, 6 Nov 2019 19:12:30 +0100

Add a jump target so that a call of the function “clk_put” can be better reused at the end of this function.

Thanks applying into omap-for-v5.5/ti-sysc.

Regards,

Tony