ASoC: atmel: sam9x5_wm8731: fix oops when unload module
authorBo Shen <voice.shen@atmel.com>
Wed, 27 Nov 2013 10:05:09 +0000 (18:05 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 27 Nov 2013 15:50:05 +0000 (15:50 +0000)
As the priv is not assigned to card->drvdata, it is NULL, so when
unload module, it will cause NULL pointer oops.
Assign priv to card->drvdata to fix this issue.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/atmel/sam9x5_wm8731.c

index 992ae38d5a15afda177080da1032300bcffd18ac..1b372283bd01a947c26dc4da302f9b077adfe74a 100644 (file)
@@ -97,6 +97,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
                goto out;
        }
 
+       snd_soc_card_set_drvdata(card, priv);
+
        card->dev = &pdev->dev;
        card->owner = THIS_MODULE;
        card->dai_link = dai;