diff options
author | Tony Lindgren <tony@atomide.com> | 2024-04-11 07:44:30 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2024-04-25 07:29:41 +0300 |
commit | f2bd276193c92d7987b6246e6dd0a7e42ac9d56a (patch) | |
tree | 8d4e885c04323cfd3ab0143439c9960c5f600729 /drivers/bus/ti-sysc.c | |
parent | 4cece764965020c22cff7665b18a012006359095 (diff) | |
download | linux-f2bd276193c92d7987b6246e6dd0a7e42ac9d56a.tar.xz |
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 <tony@atomide.com>
Diffstat (limited to 'drivers/bus/ti-sysc.c')
-rw-r--r-- | drivers/bus/ti-sysc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 41d33f39efe5..a9d2aaae68b2 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -2145,8 +2145,7 @@ static int sysc_reset(struct sysc *ddata) sysc_offset = ddata->offsets[SYSC_SYSCONFIG]; if (ddata->legacy_mode || - ddata->cap->regbits->srst_shift < 0 || - ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) + ddata->cap->regbits->srst_shift < 0) return 0; sysc_mask = BIT(ddata->cap->regbits->srst_shift); @@ -2240,12 +2239,14 @@ static int sysc_init_module(struct sysc *ddata) goto err_main_clocks; } - error = sysc_reset(ddata); - if (error) - dev_err(ddata->dev, "Reset failed with %d\n", error); + if (!(ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)) { + error = sysc_reset(ddata); + if (error) + dev_err(ddata->dev, "Reset failed with %d\n", error); - if (error && !ddata->legacy_mode) - sysc_disable_module(ddata->dev); + if (error && !ddata->legacy_mode) + sysc_disable_module(ddata->dev); + } err_main_clocks: if (error) |