Skip to content

Commit f2bd276

Browse files
committed
bus: ti-sysc: Move check for no-reset-on-init
We are wrongly checking SYSC_QUIRK_NO_RESET_ON_INIT flag in sysc_reset(), it can be called also after init from sysc_reinit_module(). Let's move the check to the init code in preparation for adding reset control support in the future. Note that this change is not needed as a fix as there are no known issues caused by it currently. Signed-off-by: Tony Lindgren <[email protected]>
1 parent 4cece76 commit f2bd276

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/bus/ti-sysc.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,8 +2145,7 @@ static int sysc_reset(struct sysc *ddata)
21452145
sysc_offset = ddata->offsets[SYSC_SYSCONFIG];
21462146

21472147
if (ddata->legacy_mode ||
2148-
ddata->cap->regbits->srst_shift < 0 ||
2149-
ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)
2148+
ddata->cap->regbits->srst_shift < 0)
21502149
return 0;
21512150

21522151
sysc_mask = BIT(ddata->cap->regbits->srst_shift);
@@ -2240,12 +2239,14 @@ static int sysc_init_module(struct sysc *ddata)
22402239
goto err_main_clocks;
22412240
}
22422241

2243-
error = sysc_reset(ddata);
2244-
if (error)
2245-
dev_err(ddata->dev, "Reset failed with %d\n", error);
2242+
if (!(ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)) {
2243+
error = sysc_reset(ddata);
2244+
if (error)
2245+
dev_err(ddata->dev, "Reset failed with %d\n", error);
22462246

2247-
if (error && !ddata->legacy_mode)
2248-
sysc_disable_module(ddata->dev);
2247+
if (error && !ddata->legacy_mode)
2248+
sysc_disable_module(ddata->dev);
2249+
}
22492250

22502251
err_main_clocks:
22512252
if (error)

0 commit comments

Comments
 (0)