Skip to content

Commit 43836fd

Browse files
RanderWanggregkh
authored andcommitted
ASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work
[ Upstream commit 6c63c95 ] When hda_codec_probe() doesn't initialize audio component, we disable the codec and keep going. However,the resources are not released. The child_count of SOF device is increased in snd_hdac_ext_bus_device_init but is not decrease in error case, so SOF can't get suspended. snd_hdac_ext_bus_device_exit will be invoked in HDA framework if it gets a error. Now copy this behavior to release resources and decrease SOF device child_count to release SOF device. Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200825235040.1586478-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent dc689cd commit 43836fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/sof/intel/hda-codec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
151151
if (!hdev->bus->audio_component) {
152152
dev_dbg(sdev->dev,
153153
"iDisp hw present but no driver\n");
154-
return -ENOENT;
154+
goto error;
155155
}
156156
hda_priv->need_display_power = true;
157157
}
@@ -174,7 +174,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
174174
* other return codes without modification
175175
*/
176176
if (ret == 0)
177-
ret = -ENOENT;
177+
goto error;
178178
}
179179

180180
return ret;

0 commit comments

Comments
 (0)