From: 邱建斌 Date: Fri, 24 Aug 2012 03:01:58 +0000 (+0800) Subject: rk610 : X-Git-Tag: firefly_0821_release~8847 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=954138eee29d8d089744e1910f8c1f7f48ad0329;p=firefly-linux-kernel-4.4.55.git rk610 : [ 53.538667] PC is at spk_ctrl_fun+0x10/0x34 [ 53.542848] LR is at rk610_codec_i2c_shutdown+0x14/0x30 [ 53.548070] pc : [] lr : [] psr: a0000013 [ 53.548075] sp : e571be58 ip : 00000000 fp : 6bea8c74 [ 53.559543] r10: 00000000 r9 : e571a000 r8 : c04f4d84 [ 53.564761] r7 : 00000000 r6 : ee9bea2c r5 : c0c1e714 r4 : 00000000 [ 53.571280] r3 : 00000000 r2 : c0ae3710 r1 : c0ae3710 r0 : 00000000 [ 53.577801] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 53.584928] Control: 10c53c7d Table: 8c4a404a DAC: 00000015 --- diff --git a/sound/soc/codecs/rk610_codec.c b/sound/soc/codecs/rk610_codec.c index 5820a788e99d..5c01474d36d5 100755 --- a/sound/soc/codecs/rk610_codec.c +++ b/sound/soc/codecs/rk610_codec.c @@ -92,7 +92,7 @@ static const u16 rk610_codec_reg[] = { 0x0000, 0x00ff, 0x00ff, 0x00ff, /* 28 */ }; -static struct snd_soc_codec *rk610_codec_codec; +static struct snd_soc_codec *rk610_codec_codec=NULL; /* codec private data */ struct rk610_codec_priv { enum snd_soc_control_type control_type; @@ -207,8 +207,13 @@ void rk610_codec_reg_read(void) static void spk_ctrl_fun(int status) { - struct rk610_codec_priv *rk610_codec =snd_soc_codec_get_drvdata(rk610_codec_codec); - + struct rk610_codec_priv *rk610_codec = NULL; + if(rk610_codec_codec == NULL) + return; + rk610_codec = snd_soc_codec_get_drvdata(rk610_codec_codec); + if(rk610_codec == NULL) + return; + if(rk610_codec->spk_ctrl_io) { DBG("--------%s----------status = %d\n",__FUNCTION__,status);