From 93011f0fda88e7296fdc3971c386b9f8a0484204 Mon Sep 17 00:00:00 2001 From: yj Date: Thu, 27 Mar 2014 16:06:05 +0800 Subject: [PATCH] rt5631: mod shutdown error --- sound/soc/codecs/rt5631.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 35e829400efe..b86647bdf223 100755 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c @@ -64,7 +64,7 @@ struct work_struct spk_work; static int last_is_spk = -1; //bard 9-13 #endif -static struct snd_soc_codec *rt5631_codec; +static struct snd_soc_codec *rt5631_codec = NULL; struct delayed_work rt5631_delay_cap; //bard 7-16 EXPORT_SYMBOL(rt5631_delay_cap); //bard 7-16 static const u16 rt5631_reg[0x80]; @@ -2141,7 +2141,9 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5631 = { void rt5631_shutdown(struct i2c_client *client) { - rt5631_set_bias_level(rt5631_codec, SND_SOC_BIAS_OFF); + + if (rt5631_codec != NULL) + rt5631_set_bias_level(rt5631_codec, SND_SOC_BIAS_OFF); } -- 2.34.1