Browse Source

ASoC: atmel: sam9x5_wm8731: fix oops when unload module

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>
Bo Shen 11 years ago
parent
commit
46bec25da6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      sound/soc/atmel/sam9x5_wm8731.c

+ 2 - 0
sound/soc/atmel/sam9x5_wm8731.c

@@ -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;