lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/5] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()
Date
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>
---
drivers/bus/ti-sysc.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index ccdd1f0871f9..a7e704e0840d 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -2384,27 +2384,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);

@@ -2414,7 +2414,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)
--
2.21.0
\
 
 \ /
  Last update: 2019-06-26 01:33    [W:0.082 / U:36.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site