Unverified Commit 45ea97d7 authored by 蒋家盛's avatar 蒋家盛 Committed by Mark Brown
Browse files

ASoC: dwc-i2s: Handle errors for clk_enable



As the potential failure of the clk_enable(),
it should be better to check it, as same as clk_prepare_enable().

Fixes: c9afc183 ("ASoC: dwc: Disallow building designware_pcm as a module")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220301084742.3751939-1-jiasheng@iscas.ac.cn


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a2253ec7
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -403,9 +403,13 @@ static int dw_i2s_runtime_suspend(struct device *dev)
static int dw_i2s_runtime_resume(struct device *dev)
{
	struct dw_i2s_dev *dw_dev = dev_get_drvdata(dev);
	int ret;

	if (dw_dev->capability & DW_I2S_MASTER)
		clk_enable(dw_dev->clk);
	if (dw_dev->capability & DW_I2S_MASTER) {
		ret = clk_enable(dw_dev->clk);
		if (ret)
			return ret;
	}
	return 0;
}

@@ -422,10 +426,13 @@ static int dw_i2s_resume(struct snd_soc_component *component)
{
	struct dw_i2s_dev *dev = snd_soc_component_get_drvdata(component);
	struct snd_soc_dai *dai;
	int stream;
	int stream, ret;

	if (dev->capability & DW_I2S_MASTER)
		clk_enable(dev->clk);
	if (dev->capability & DW_I2S_MASTER) {
		ret = clk_enable(dev->clk);
		if (ret)
			return ret;
	}

	for_each_component_dais(component, dai) {
		for_each_pcm_streams(stream)