Commit 405afed8 authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by Mark Brown

ASoC: fsi: Add check for clk_enable

As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: ab6f6d85 ("ASoC: fsi: add master clock control functions")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220302062844.46869-1-jiasheng@iscas.ac.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6ed5dbba
...@@ -816,14 +816,27 @@ static int fsi_clk_enable(struct device *dev, ...@@ -816,14 +816,27 @@ static int fsi_clk_enable(struct device *dev,
return ret; return ret;
} }
clk_enable(clock->xck); ret = clk_enable(clock->xck);
clk_enable(clock->ick); if (ret)
clk_enable(clock->div); goto err;
ret = clk_enable(clock->ick);
if (ret)
goto disable_xck;
ret = clk_enable(clock->div);
if (ret)
goto disable_ick;
clock->count++; clock->count++;
} }
return ret; return ret;
disable_ick:
clk_disable(clock->ick);
disable_xck:
clk_disable(clock->xck);
err:
return ret;
} }
static int fsi_clk_disable(struct device *dev, static int fsi_clk_disable(struct device *dev,
......
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