Commit f1bb0235 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown

ASoC: SOF: HDA: (cosmetic) simplify hda_dsp_d0i3_work()

Simplify hda_dsp_d0i3_work() by returning immediately from it
if D0i3 cannot be set.
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarLibin Yang <libin.yang@intel.com>
Reviewed-by: default avatarKeyon Jie <yang.jie@intel.com>
Signed-off-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210208232149.58899-5-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3be46fa2
......@@ -934,19 +934,15 @@ void hda_dsp_d0i3_work(struct work_struct *work)
d0i3_work.work);
struct hdac_bus *bus = &hdev->hbus.core;
struct snd_sof_dev *sdev = dev_get_drvdata(bus->dev);
struct sof_dsp_power_state target_state;
struct sof_dsp_power_state target_state = {
.state = SOF_DSP_PM_D0,
.substate = SOF_HDA_DSP_PM_D0I3,
};
int ret;
target_state.state = SOF_DSP_PM_D0;
/* DSP can enter D0I3 iff only D0I3-compatible streams are active */
if (snd_sof_dsp_only_d0i3_compatible_stream_active(sdev))
target_state.substate = SOF_HDA_DSP_PM_D0I3;
else
target_state.substate = SOF_HDA_DSP_PM_D0I0;
/* remain in D0I0 */
if (target_state.substate == SOF_HDA_DSP_PM_D0I0)
if (!snd_sof_dsp_only_d0i3_compatible_stream_active(sdev))
/* remain in D0I0 */
return;
/* This can fail but error cannot be propagated */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment