summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Neri <ricardo.neri@ti.com>2012-09-27 16:51:34 -0500
committerAndy Green <andy.green@linaro.org>2012-11-27 11:42:44 +0800
commit3c9412cc64b8dae938e2940cf5243230181f287b (patch)
treeae172b7f12a60bc26e2b0792714961901f319854
parent25eba81ff77a0fac1029309878e967ea4fb5a78a (diff)
ASoC: HDMI: Unregister codec platform device on card remove
If booting from device tree, a platform device is created for the codec driver. This devices has to be unregistered upon card driver remove. Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
-rw-r--r--sound/soc/omap/omap-hdmi-card.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c
index 0180ee59518..759a17fc4ab 100644
--- a/sound/soc/omap/omap-hdmi-card.c
+++ b/sound/soc/omap/omap-hdmi-card.c
@@ -117,7 +117,11 @@ err_register_card:
static int __devexit omap_hdmi_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
+ struct hdmi_card_data *card_data;
+ card_data = snd_soc_card_get_drvdata(card);
+ if (!IS_ERR(card_data->codec_pdev))
+ platform_device_unregister(card_data->codec_pdev);
snd_soc_unregister_card(card);
card->dev = NULL;
return 0;