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:
Jiasheng Jiang 2022-09-02 09:30:30 +08:00 committed by Mark Brown
parent 55e2bd9c41
commit 376be51caf
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
5 changed files with 22 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);