Skip to content

Commit

Permalink
bus: ti-sysc: Adjust exception handling in sysc_child_add_named_clock()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
  • Loading branch information
elfring authored and tmlind committed Nov 14, 2019
1 parent 020003f commit cb6cfe2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/bus/ti-sysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit cb6cfe2

Please sign in to comment.