ASoC: es8316: fix null pointer error
due to function will be called from rk_headset_irq_hook_adc.c when es8316 configured in defconfig file but not in device tree Change-Id: Ie0294fff2c05b9f77c6740d81dc9445007c1b62b Signed-off-by: zhangjun <zhangjun@rock-chips.com>
This commit is contained in:
@@ -1003,7 +1003,12 @@ static irqreturn_t es8316_irq_handler(int irq, void *data)
|
||||
*/
|
||||
int es8316_headset_detect(int jack_insert)
|
||||
{
|
||||
struct es8316_priv *es8316 = snd_soc_codec_get_drvdata(es8316_codec);
|
||||
struct es8316_priv *es8316;
|
||||
|
||||
if (!es8316_codec)
|
||||
return -1;
|
||||
|
||||
es8316 = snd_soc_codec_get_drvdata(es8316_codec);
|
||||
|
||||
es8316->hp_inserted = jack_insert;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user