aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-09-01 02:46:52 -0400
committerMark Brown <broonie@kernel.org>2014-09-01 12:48:07 -0400
commite3c4a28b611b03d69bfbdffda985ef0dd94c2794 (patch)
treeafcd63e086b61b3e7f1cd91dac29479c7df4acee /sound
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
ASoC: simple-card: Fix bug of wrong decrement DT node's refcount
DAI links's cpu_of_node's and codec_of_node's refcounts shouldn't be decremented immediately at the end of the probe() fucntion. Because we will still use them before the audio card is removed. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/generic/simple-card.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 159e517fa09a..cef7776b712c 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -481,12 +481,19 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
481 snd_soc_card_set_drvdata(&priv->snd_card, priv); 481 snd_soc_card_set_drvdata(&priv->snd_card, priv);
482 482
483 ret = devm_snd_soc_register_card(&pdev->dev, &priv->snd_card); 483 ret = devm_snd_soc_register_card(&pdev->dev, &priv->snd_card);
484 if (ret >= 0)
485 return ret;
484 486
485err: 487err:
486 asoc_simple_card_unref(pdev); 488 asoc_simple_card_unref(pdev);
487 return ret; 489 return ret;
488} 490}
489 491
492static int asoc_simple_card_remove(struct platform_device *pdev)
493{
494 return asoc_simple_card_unref(pdev);
495}
496
490static const struct of_device_id asoc_simple_of_match[] = { 497static const struct of_device_id asoc_simple_of_match[] = {
491 { .compatible = "simple-audio-card", }, 498 { .compatible = "simple-audio-card", },
492 {}, 499 {},
@@ -500,6 +507,7 @@ static struct platform_driver asoc_simple_card = {
500 .of_match_table = asoc_simple_of_match, 507 .of_match_table = asoc_simple_of_match,
501 }, 508 },
502 .probe = asoc_simple_card_probe, 509 .probe = asoc_simple_card_probe,
510 .remove = asoc_simple_card_remove,
503}; 511};
504 512
505module_platform_driver(asoc_simple_card); 513module_platform_driver(asoc_simple_card);