From: Keyon Jie Date: Mon, 11 Nov 2019 22:33:41 +0000 (-0600) Subject: ASoC: SOF: PM: add check before setting d0_substate X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=58a972efd21bb5adadd97f2546693ec64bfc99b9;p=linux.git ASoC: SOF: PM: add check before setting d0_substate Add check before seeting d0_substate and return success if Audio DSP is already in the target substate. Signed-off-by: Keyon Jie Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20191111223343.19986-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index 3204c92f0e7db..b89810bf32303 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -416,6 +416,9 @@ int snd_sof_set_d0_substate(struct snd_sof_dev *sdev, { int ret; + if (sdev->d0_substate == d0_substate) + return 0; + /* do platform specific set_state */ ret = snd_sof_dsp_set_power_state(sdev, d0_substate); if (ret < 0)