summaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-11-06 19:12:30 +0100
committerTony Lindgren <tony@atomide.com>2019-11-14 09:07:03 -0800
commitcb6cfe2eaed171b5a2e575fa3f0cf0924b5bd1d2 (patch)
tree140437acab589e8948de018e944ad4c340317f3f /drivers/bus
parent020003f763e24e4ed0bb3d8909f3940891536d5d (diff)
downloadlinux-cb6cfe2eaed171b5a2e575fa3f0cf0924b5bd1d2.tar.bz2
bus: ti-sysc: Adjust exception handling in sysc_child_add_named_clock()
Add a jump target so that a call of the function “clk_put” can be better reused at the end of this function. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/ti-sysc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 99d7356e245b..56887c6877a7 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -1778,9 +1778,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);
@@ -1790,7 +1789,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;