From c444ff7b6a6cd3efaa983e51c1c8f9d3735fe384 Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Wed, 18 Oct 2017 10:52:07 +0800 Subject: [PATCH] audio-lnx: asoc: sdm660: fix rmmod issue with audio notifier Deregister sound card with audio notifier when removing driver to avoid crash. Change-Id: I4f22fefce519e8dab25901337fdf2e62044090ed Signed-off-by: Meng Wang --- asoc/sdm660-common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/asoc/sdm660-common.c b/asoc/sdm660-common.c index e6b82dfda7a2..7142de513e95 100644 --- a/asoc/sdm660-common.c +++ b/asoc/sdm660-common.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "msm-pcm-routing-v2.h" #include "sdm660-common.h" #include "sdm660-internal.h" @@ -3370,6 +3371,10 @@ static int msm_asoc_machine_remove(struct platform_device *pdev) gpio_free(pdata->us_euro_gpio); gpio_free(pdata->hph_en1_gpio); gpio_free(pdata->hph_en0_gpio); + + if (pdata->snd_card_val != INT_SND_CARD) + audio_notifier_deregister("sdm660"); + snd_soc_unregister_card(card); return 0; }