Commit 376be51c authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by Mark Brown

ASoC: rsnd: Add check for rsnd_mod_power_on

As rsnd_mod_power_on() can return negative numbers,
it should be better to check the return value and
deal with the exception.

Fixes: e7d850dd ("ASoC: rsnd: use mod base common method on SSI-parent")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20220902013030.3691266-1-jiasheng@iscas.ac.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 55e2bd9c
...@@ -171,7 +171,11 @@ static int rsnd_ctu_init(struct rsnd_mod *mod, ...@@ -171,7 +171,11 @@ static int rsnd_ctu_init(struct rsnd_mod *mod,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_priv *priv) struct rsnd_priv *priv)
{ {
rsnd_mod_power_on(mod); int ret;
ret = rsnd_mod_power_on(mod);
if (ret < 0)
return ret;
rsnd_ctu_activation(mod); rsnd_ctu_activation(mod);
......
...@@ -186,7 +186,11 @@ static int rsnd_dvc_init(struct rsnd_mod *mod, ...@@ -186,7 +186,11 @@ static int rsnd_dvc_init(struct rsnd_mod *mod,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_priv *priv) struct rsnd_priv *priv)
{ {
rsnd_mod_power_on(mod); int ret;
ret = rsnd_mod_power_on(mod);
if (ret < 0)
return ret;
rsnd_dvc_activation(mod); rsnd_dvc_activation(mod);
......
...@@ -146,7 +146,11 @@ static int rsnd_mix_init(struct rsnd_mod *mod, ...@@ -146,7 +146,11 @@ static int rsnd_mix_init(struct rsnd_mod *mod,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
struct rsnd_priv *priv) struct rsnd_priv *priv)
{ {
rsnd_mod_power_on(mod); int ret;
ret = rsnd_mod_power_on(mod);
if (ret < 0)
return ret;
rsnd_mix_activation(mod); rsnd_mix_activation(mod);
......
...@@ -463,11 +463,14 @@ static int rsnd_src_init(struct rsnd_mod *mod, ...@@ -463,11 +463,14 @@ static int rsnd_src_init(struct rsnd_mod *mod,
struct rsnd_priv *priv) struct rsnd_priv *priv)
{ {
struct rsnd_src *src = rsnd_mod_to_src(mod); struct rsnd_src *src = rsnd_mod_to_src(mod);
int ret;
/* reset sync convert_rate */ /* reset sync convert_rate */
src->sync.val = 0; src->sync.val = 0;
rsnd_mod_power_on(mod); ret = rsnd_mod_power_on(mod);
if (ret < 0)
return ret;
rsnd_src_activation(mod); rsnd_src_activation(mod);
......
...@@ -480,7 +480,9 @@ static int rsnd_ssi_init(struct rsnd_mod *mod, ...@@ -480,7 +480,9 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
ssi->usrcnt++; ssi->usrcnt++;
rsnd_mod_power_on(mod); ret = rsnd_mod_power_on(mod);
if (ret < 0)
return ret;
rsnd_ssi_config_init(mod, io); rsnd_ssi_config_init(mod, io);
......
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