Skip to content

Commit

Permalink
ASoC: Replace list_empty(&card->codec_dev_list) with !card->instantiated
Browse files Browse the repository at this point in the history
With componentization we no longer necessarily need a snd_soc_codec struct for a
card. Instead of checking if the card's CODEC list is empty just use
card->instantiated to check if the card has been instantiated yet.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Aug 19, 2014
1 parent 75af7c0 commit c5599b8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,8 @@ int snd_soc_suspend(struct device *dev)
struct snd_soc_codec *codec;
int i, j;

/* If the initialization of this soc device failed, there is no codec
* associated with it. Just bail out in this case.
*/
if (list_empty(&card->codec_dev_list))
/* If the card is not initialized yet there is nothing to do */
if (!card->instantiated)
return 0;

/* Due to the resume being scheduled into a workqueue we could
Expand Down Expand Up @@ -808,10 +806,8 @@ int snd_soc_resume(struct device *dev)
struct snd_soc_card *card = dev_get_drvdata(dev);
int i, ac97_control = 0;

/* If the initialization of this soc device failed, there is no codec
* associated with it. Just bail out in this case.
*/
if (list_empty(&card->codec_dev_list))
/* If the card is not initialized yet there is nothing to do */
if (!card->instantiated)
return 0;

/* activate pins from sleep state */
Expand Down

0 comments on commit c5599b8

Please sign in to comment.