diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2016-03-31 08:47:03 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-31 15:36:17 +0200 |
commit | 0eced45ca60666aff4c12f31fef4005ae37e859e (patch) | |
tree | 860302d4605f1d2528ae2fdc0b2cf220fa9c4319 /sound/firewire/dice | |
parent | 44c376b9596ca00d1bdee37e716d1bd4dd36c955 (diff) | |
download | linux-0eced45ca60666aff4c12f31fef4005ae37e859e.tar.bz2 |
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: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/dice')
-rw-r--r-- | sound/firewire/dice/dice.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c index 8b64aef31a86..53ca441ea9b9 100644 --- a/sound/firewire/dice/dice.c +++ b/sound/firewire/dice/dice.c @@ -201,6 +201,10 @@ static void do_registration(struct work_struct *work) dice_card_strings(dice); + err = snd_dice_stream_init_duplex(dice); + if (err < 0) + goto error; + snd_dice_create_proc(dice); err = snd_dice_create_pcm(dice); @@ -229,6 +233,7 @@ static void do_registration(struct work_struct *work) return; error: + snd_dice_stream_destroy_duplex(dice); snd_dice_transaction_destroy(dice); snd_card_free(dice->card); dev_info(&dice->unit->device, @@ -273,12 +278,6 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) init_completion(&dice->clock_accepted); 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. */ INIT_DEFERRABLE_WORK(&dice->dwork, do_registration); schedule_registration(dice); |