ALSA: x86: Call snd_card_register() at the end
The card registration should be done at the last stage of the probe procedure. Otherwise user-space may access to the device before the whole initialization is done. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
301cf8a955
commit
36ec0d99bb
|
@ -1586,6 +1586,7 @@ int hdmi_audio_probe(struct platform_device *devptr,
|
||||||
pr_debug("%s @ %d:DEBUG PLUG/UNPLUG : HAD_DRV_DISCONNECTED\n",
|
pr_debug("%s @ %d:DEBUG PLUG/UNPLUG : HAD_DRV_DISCONNECTED\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
|
|
||||||
|
intelhaddata->dev = &devptr->dev;
|
||||||
intelhaddata->card = card;
|
intelhaddata->card = card;
|
||||||
intelhaddata->card_id = hdmi_card_id;
|
intelhaddata->card_id = hdmi_card_id;
|
||||||
intelhaddata->card_index = card->number;
|
intelhaddata->card_index = card->number;
|
||||||
|
@ -1617,10 +1618,6 @@ int hdmi_audio_probe(struct platform_device *devptr,
|
||||||
if (retval)
|
if (retval)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
retval = snd_card_register(card);
|
|
||||||
if (retval)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
/* IEC958 controls */
|
/* IEC958 controls */
|
||||||
retval = snd_ctl_add(card, snd_ctl_new1(&had_control_iec958_mask,
|
retval = snd_ctl_add(card, snd_ctl_new1(&had_control_iec958_mask,
|
||||||
intelhaddata));
|
intelhaddata));
|
||||||
|
@ -1638,7 +1635,10 @@ int hdmi_audio_probe(struct platform_device *devptr,
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
intelhaddata->dev = &devptr->dev;
|
retval = snd_card_register(card);
|
||||||
|
if (retval)
|
||||||
|
goto err;
|
||||||
|
|
||||||
pm_runtime_set_active(intelhaddata->dev);
|
pm_runtime_set_active(intelhaddata->dev);
|
||||||
pm_runtime_enable(intelhaddata->dev);
|
pm_runtime_enable(intelhaddata->dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue