Skip to content

Commit a304f48

Browse files
sumanannatmlind
authored andcommitted
bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()
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 <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 89bbc6f commit a304f48

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/bus/ti-sysc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,27 +2383,27 @@ static int sysc_probe(struct platform_device *pdev)
23832383

23842384
error = sysc_init_dts_quirks(ddata);
23852385
if (error)
2386-
goto unprepare;
2386+
return error;
23872387

23882388
error = sysc_map_and_check_registers(ddata);
23892389
if (error)
2390-
goto unprepare;
2390+
return error;
23912391

23922392
error = sysc_init_sysc_mask(ddata);
23932393
if (error)
2394-
goto unprepare;
2394+
return error;
23952395

23962396
error = sysc_init_idlemodes(ddata);
23972397
if (error)
2398-
goto unprepare;
2398+
return error;
23992399

24002400
error = sysc_init_syss_mask(ddata);
24012401
if (error)
2402-
goto unprepare;
2402+
return error;
24032403

24042404
error = sysc_init_pdata(ddata);
24052405
if (error)
2406-
goto unprepare;
2406+
return error;
24072407

24082408
sysc_init_early_quirks(ddata);
24092409

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

24142414
error = sysc_init_resets(ddata);
24152415
if (error)
2416-
return error;
2416+
goto unprepare;
24172417

24182418
error = sysc_init_module(ddata);
24192419
if (error)

0 commit comments

Comments
 (0)