Skip to content

Commit 17b5d3e

Browse files
ujfalusiplbossart
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. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 8c24dda commit 17b5d3e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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)