Skip to content

Commit

Permalink
bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()
Browse files Browse the repository at this point in the history
The clocks are not yet parsed and prepared until after a successful
sysc_get_clocks(), so there is no need to unprepare the clocks upon
any failure of any of the prior functions in sysc_probe(). The current
code path would have been a no-op because of the clock validity checks
within sysc_unprepare(), but let's just simplify the cleanup path by
returning the error directly.

While at this, also fix the cleanup path for a sysc_init_resets()
failure which is executed after the clocks are prepared.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Suman Anna authored and Tony Lindgren committed Aug 13, 2019
1 parent 89bbc6f commit a304f48
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/bus/ti-sysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2383,27 +2383,27 @@ static int sysc_probe(struct platform_device *pdev)

error = sysc_init_dts_quirks(ddata);
if (error)
goto unprepare;
return error;

error = sysc_map_and_check_registers(ddata);
if (error)
goto unprepare;
return error;

error = sysc_init_sysc_mask(ddata);
if (error)
goto unprepare;
return error;

error = sysc_init_idlemodes(ddata);
if (error)
goto unprepare;
return error;

error = sysc_init_syss_mask(ddata);
if (error)
goto unprepare;
return error;

error = sysc_init_pdata(ddata);
if (error)
goto unprepare;
return error;

sysc_init_early_quirks(ddata);

Expand All @@ -2413,7 +2413,7 @@ static int sysc_probe(struct platform_device *pdev)

error = sysc_init_resets(ddata);
if (error)
return error;
goto unprepare;

error = sysc_init_module(ddata);
if (error)
Expand Down

0 comments on commit a304f48

Please sign in to comment.