diff options
author | Tony Lindgren <tony@atomide.com> | 2021-07-27 12:02:24 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2021-07-27 12:02:24 +0300 |
commit | fdc07ca0724dd8ad00c22909a1464dc73ed6783e (patch) | |
tree | 7e8eaa3da8b553a81397a0ca7e4b59de2152ba00 /drivers/bus/ti-sysc.c | |
parent | 8122dc58cb3e3ea1ee10d44e37bf1cd0a4374116 (diff) | |
parent | cea08169ad4ce46c222a223d8f71db6d9c3f1385 (diff) | |
download | linux-fdc07ca0724dd8ad00c22909a1464dc73ed6783e.tar.gz linux-fdc07ca0724dd8ad00c22909a1464dc73ed6783e.tar.bz2 linux-fdc07ca0724dd8ad00c22909a1464dc73ed6783e.zip |
Merge branch 'omap-for-v5.14/ti-sysc' into omap-for-v5.15/ti-sysc
Diffstat (limited to 'drivers/bus/ti-sysc.c')
-rw-r--r-- | drivers/bus/ti-sysc.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index d43221f236a2..9faae119774e 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -100,6 +100,7 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = { * @cookie: data used by legacy platform callbacks * @name: name if available * @revision: interconnect target module revision + * @reserved: target module is reserved and already in use * @enabled: sysc runtime enabled status * @needs_resume: runtime resume needed on resume from suspend * @child_needs_resume: runtime resume needed for child on resume from suspend @@ -130,6 +131,7 @@ struct sysc { struct ti_sysc_cookie cookie; const char *name; u32 revision; + unsigned int reserved:1; unsigned int enabled:1; unsigned int needs_resume:1; unsigned int child_needs_resume:1; @@ -853,7 +855,7 @@ static int sysc_check_registers(struct sysc *ddata) } /** - * syc_ioremap - ioremap register space for the interconnect target module + * sysc_ioremap - ioremap register space for the interconnect target module * @ddata: device driver data * * Note that the interconnect target module registers can be anywhere @@ -3094,8 +3096,8 @@ static int sysc_probe(struct platform_device *pdev) return error; error = sysc_check_active_timer(ddata); - if (error) - return error; + if (error == -EBUSY) + ddata->reserved = true; error = sysc_get_clocks(ddata); if (error) @@ -3110,9 +3112,8 @@ static int sysc_probe(struct platform_device *pdev) goto unprepare; pm_runtime_enable(ddata->dev); - error = pm_runtime_get_sync(ddata->dev); + error = pm_runtime_resume_and_get(ddata->dev); if (error < 0) { - pm_runtime_put_noidle(ddata->dev); pm_runtime_disable(ddata->dev); goto unprepare; } @@ -3131,11 +3132,15 @@ static int sysc_probe(struct platform_device *pdev) sysc_show_registers(ddata); ddata->dev->type = &sysc_device_type; - error = of_platform_populate(ddata->dev->of_node, sysc_match_table, - pdata ? pdata->auxdata : NULL, - ddata->dev); - if (error) - goto err; + + if (!ddata->reserved) { + error = of_platform_populate(ddata->dev->of_node, + sysc_match_table, + pdata ? pdata->auxdata : NULL, + ddata->dev); + if (error) + goto err; + } INIT_DELAYED_WORK(&ddata->idle_work, ti_sysc_idle); @@ -3166,9 +3171,8 @@ static int sysc_remove(struct platform_device *pdev) cancel_delayed_work_sync(&ddata->idle_work); - error = pm_runtime_get_sync(ddata->dev); + error = pm_runtime_resume_and_get(ddata->dev); if (error < 0) { - pm_runtime_put_noidle(ddata->dev); pm_runtime_disable(ddata->dev); goto unprepare; } |