Skip to content

Commit 3999614

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: pm: Remove duplicated code in sof_suspend
Over time the function has changed and now there is no need to have the duplicated sof_fw_trace_suspend() and sof_suspend_clients() in the if (target_state == SOF_DSP_PM_D0) branch. Remove it and add a simple check with a single goto statement. Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Paul Olaru <olarupaulstelian97@gmail.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230616100039.378150-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c3d275e commit 3999614

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

sound/soc/sof/pm.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,20 +234,16 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
234234

235235
pm_state.event = target_state;
236236

237-
/* Skip to platform-specific suspend if DSP is entering D0 */
238-
if (target_state == SOF_DSP_PM_D0) {
239-
sof_fw_trace_suspend(sdev, pm_state);
240-
/* Notify clients not managed by pm framework about core suspend */
241-
sof_suspend_clients(sdev, pm_state);
242-
goto suspend;
243-
}
244-
245237
/* suspend DMA trace */
246238
sof_fw_trace_suspend(sdev, pm_state);
247239

248240
/* Notify clients not managed by pm framework about core suspend */
249241
sof_suspend_clients(sdev, pm_state);
250242

243+
/* Skip to platform-specific suspend if DSP is entering D0 */
244+
if (target_state == SOF_DSP_PM_D0)
245+
goto suspend;
246+
251247
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE)
252248
/* cache debugfs contents during runtime suspend */
253249
if (runtime_suspend)

0 commit comments

Comments
 (0)