Commit 31dea738 authored by Lu Guanqun's avatar Lu Guanqun Committed by Greg Kroah-Hartman

sst: make register_sst_card more self-contained

register_sst_card is used in ASoC code with field `scard_ops` being NULL.
Without this patch, there will be NULL dereference.
Signed-off-by: default avatarLu Guanqun <guanqun.lu@intel.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb03d4fc
...@@ -508,7 +508,6 @@ int register_sst_card(struct intel_sst_card_ops *card) ...@@ -508,7 +508,6 @@ int register_sst_card(struct intel_sst_card_ops *card)
sst_drv_ctx->pmic_state = SND_MAD_INIT_DONE; sst_drv_ctx->pmic_state = SND_MAD_INIT_DONE;
sst_drv_ctx->rx_time_slot_status = 0; /*default AMIC*/ sst_drv_ctx->rx_time_slot_status = 0; /*default AMIC*/
card->pcm_control = sst_pmic_ops.pcm_control; card->pcm_control = sst_pmic_ops.pcm_control;
sst_drv_ctx->scard_ops->card_status = SND_CARD_UN_INIT;
return 0; return 0;
} else { } else {
pr_err("strcmp fail %s\n", card->module_name); pr_err("strcmp fail %s\n", card->module_name);
......
...@@ -802,6 +802,7 @@ static int __devinit snd_intelmad_sst_register( ...@@ -802,6 +802,7 @@ static int __devinit snd_intelmad_sst_register(
pr_err("sst card registration failed\n"); pr_err("sst card registration failed\n");
return ret_val; return ret_val;
} }
sst_drv_ctx->scard_ops->card_status = SND_CARD_UN_INIT;
sst_card_vendor_id = intelmaddata->sstdrv_ops->vendor_id; sst_card_vendor_id = intelmaddata->sstdrv_ops->vendor_id;
intelmaddata->pmic_status = PMIC_UNINIT; intelmaddata->pmic_status = PMIC_UNINIT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment