linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3] ASoC: simple-card: Fix bug of wrong decrement DT node's refcount
@ 2014-09-01  6:46 Xiubo Li
  2014-09-01 16:48 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Xiubo Li @ 2014-09-01  6:46 UTC (permalink / raw)
  To: broonie, moinejf, lgirdwood, perex, tiwai, kuninori.morimoto.gx,
	jsarha, alsa-devel
  Cc: linux-kernel, Xiubo Li

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>
Cc: Jean-Francois Moine <moinejf@free.fr>
---

Change in v3:
- Follow Jean-Francois Moine's advice.
- Remove the following patch:
  "ASoC: simple-card: Fix bug of forgetting decrement DT node's refcount"




 sound/soc/generic/simple-card.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fd8b045..986d2c7 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)
 	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", },
 	{},
@@ -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);
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv3] ASoC: simple-card: Fix bug of wrong decrement DT node's refcount
  2014-09-01  6:46 [PATCHv3] ASoC: simple-card: Fix bug of wrong decrement DT node's refcount Xiubo Li
@ 2014-09-01 16:48 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-09-01 16:48 UTC (permalink / raw)
  To: Xiubo Li
  Cc: moinejf, lgirdwood, perex, tiwai, kuninori.morimoto.gx, jsarha,
	alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

On Mon, Sep 01, 2014 at 02:46:52PM +0800, Xiubo Li wrote:
> 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.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-01 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01  6:46 [PATCHv3] ASoC: simple-card: Fix bug of wrong decrement DT node's refcount Xiubo Li
2014-09-01 16:48 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).