Skip to content

Commit

Permalink
ASoC: simple-card: Fix bug of wrong decrement DT node's refcount
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiubo Li authored and Mark Brown committed Sep 1, 2014
1 parent 7d1311b commit e3c4a28
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/soc/generic/simple-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,19 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(&priv->snd_card, priv);

ret = devm_snd_soc_register_card(&pdev->dev, &priv->snd_card);
if (ret >= 0)
return ret;

err:
asoc_simple_card_unref(pdev);
return ret;
}

static int asoc_simple_card_remove(struct platform_device *pdev)
{
return asoc_simple_card_unref(pdev);
}

static const struct of_device_id asoc_simple_of_match[] = {
{ .compatible = "simple-audio-card", },
{},
Expand All @@ -500,6 +507,7 @@ static struct platform_driver asoc_simple_card = {
.of_match_table = asoc_simple_of_match,
},
.probe = asoc_simple_card_probe,
.remove = asoc_simple_card_remove,
};

module_platform_driver(asoc_simple_card);
Expand Down

0 comments on commit e3c4a28

Please sign in to comment.