Skip to content

Commit

Permalink
ASoC: fsl: set correct platform drvdata in pcm030_fabric_probe()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Wei Yongjun authored and Mark Brown committed Dec 2, 2013
1 parent 23d8bb3 commit 6c7ef41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/fsl/pcm030-audio-fabric.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6c7ef41

Please sign in to comment.