[alsa-devel] [PATCH] ASoC: fsl: set correct platform drvdata in pcm030_fabric_probe()
From: Wei Yongjun yongjun_wei@trendmicro.com.cn
platform_set_drvdata(op, pdata) in pcm030_fabric_probe() will be overwrited when calling snd_soc_register_card(card), but cm030_fabric_remove() use drvdata as a type of struct pcm030_audio_data, so we should move platform_set_drvdata() below snd_soc_register_card() call.
Signed-off-by: Wei Yongjun yongjun_wei@trendmicro.com.cn --- sound/soc/fsl/pcm030-audio-fabric.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index eb43738..3665f61 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -69,7 +69,6 @@ static int pcm030_fabric_probe(struct platform_device *op) return -ENOMEM;
card->dev = &op->dev; - platform_set_drvdata(op, pdata);
pdata->card = card;
@@ -98,6 +97,8 @@ static int pcm030_fabric_probe(struct platform_device *op) if (ret) dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret);
+ platform_set_drvdata(op, pdata); + return ret; }
On Sat, Nov 09, 2013 at 08:41:14AM +0800, Wei Yongjun wrote:
From: Wei Yongjun yongjun_wei@trendmicro.com.cn
platform_set_drvdata(op, pdata) in pcm030_fabric_probe() will be overwrited when calling snd_soc_register_card(card),
Applied, thanks.
participants (2)
-
Mark Brown
-
Wei Yongjun