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: e7d850dd10
("ASoC: rsnd: use mod base common method on SSI-parent")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20220902013030.3691266-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
55e2bd9c41
commit
376be51caf
|
@ -171,7 +171,11 @@ static int rsnd_ctu_init(struct rsnd_mod *mod,
|
|||
struct rsnd_dai_stream *io,
|
||||
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);
|
||||
|
||||
|
|
|
@ -186,7 +186,11 @@ static int rsnd_dvc_init(struct rsnd_mod *mod,
|
|||
struct rsnd_dai_stream *io,
|
||||
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);
|
||||
|
||||
|
|
|
@ -146,7 +146,11 @@ static int rsnd_mix_init(struct rsnd_mod *mod,
|
|||
struct rsnd_dai_stream *io,
|
||||
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);
|
||||
|
||||
|
|
|
@ -463,11 +463,14 @@ static int rsnd_src_init(struct rsnd_mod *mod,
|
|||
struct rsnd_priv *priv)
|
||||
{
|
||||
struct rsnd_src *src = rsnd_mod_to_src(mod);
|
||||
int ret;
|
||||
|
||||
/* reset sync convert_rate */
|
||||
src->sync.val = 0;
|
||||
|
||||
rsnd_mod_power_on(mod);
|
||||
ret = rsnd_mod_power_on(mod);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
rsnd_src_activation(mod);
|
||||
|
||||
|
|
|
@ -480,7 +480,9 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
|
|||
|
||||
ssi->usrcnt++;
|
||||
|
||||
rsnd_mod_power_on(mod);
|
||||
ret = rsnd_mod_power_on(mod);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
rsnd_ssi_config_init(mod, io);
|
||||
|
||||
|
|
Loading…
Reference in New Issue