提交 0eced45c 编写于 作者: T Takashi Sakamoto 提交者: Takashi Iwai

ALSA: dice: simplify unit probe processing

In former commit, ALSA dice driver doesn't generate kernel warnings
when unplugging units before initializing stream data.

This commit moves the initialization to delayed registration of sound
card, to simplify unit probe processing.
Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 44c376b9
...@@ -201,6 +201,10 @@ static void do_registration(struct work_struct *work) ...@@ -201,6 +201,10 @@ static void do_registration(struct work_struct *work)
dice_card_strings(dice); dice_card_strings(dice);
err = snd_dice_stream_init_duplex(dice);
if (err < 0)
goto error;
snd_dice_create_proc(dice); snd_dice_create_proc(dice);
err = snd_dice_create_pcm(dice); err = snd_dice_create_pcm(dice);
...@@ -229,6 +233,7 @@ static void do_registration(struct work_struct *work) ...@@ -229,6 +233,7 @@ static void do_registration(struct work_struct *work)
return; return;
error: error:
snd_dice_stream_destroy_duplex(dice);
snd_dice_transaction_destroy(dice); snd_dice_transaction_destroy(dice);
snd_card_free(dice->card); snd_card_free(dice->card);
dev_info(&dice->unit->device, dev_info(&dice->unit->device,
...@@ -273,12 +278,6 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) ...@@ -273,12 +278,6 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
init_completion(&dice->clock_accepted); init_completion(&dice->clock_accepted);
init_waitqueue_head(&dice->hwdep_wait); init_waitqueue_head(&dice->hwdep_wait);
err = snd_dice_stream_init_duplex(dice);
if (err < 0) {
dice_free(dice);
return err;
}
/* Allocate and register this sound card later. */ /* Allocate and register this sound card later. */
INIT_DEFERRABLE_WORK(&dice->dwork, do_registration); INIT_DEFERRABLE_WORK(&dice->dwork, do_registration);
schedule_registration(dice); schedule_registration(dice);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册