ALSA: usb - fix race in creation of M-Audio Fast track pro driver

A patch in the 3.2 kernel caused regression with hotplugging the
M-Audio Fast track pro, or sound after suspend. I don't have the
device so I haven't done a full analysis, but it seems userspace
(both udev and pulseaudio) got confused when a card was created,
immediately destroyed, and then created again.

However, at least one person in the bug report (martin djfun)
reports that this patch resolves the issue for him. It also leaves
a message in the log:
"snd-usb-audio: probe of 1-1.1:1.1 failed with error -5" which is
a bit misleading. It is better than non-working audio, but maybe
there's a more elegant solution?

BugLink: https://bugs.launchpad.net/bugs/1095315
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by David Henningsson and committed by Takashi Iwai b98ae272 31be5425

+5 -3
+5 -3
sound/usb/quirks.c
··· 387 * rules 388 */ 389 err = usb_driver_set_configuration(dev, 2); 390 - if (err < 0) { 391 snd_printdd("error usb_driver_set_configuration: %d\n", 392 err); 393 - return -ENODEV; 394 - } 395 } else 396 snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); 397
··· 387 * rules 388 */ 389 err = usb_driver_set_configuration(dev, 2); 390 + if (err < 0) 391 snd_printdd("error usb_driver_set_configuration: %d\n", 392 err); 393 + /* Always return an error, so that we stop creating a device 394 + that will just be destroyed and recreated with a new 395 + configuration */ 396 + return -ENODEV; 397 } else 398 snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); 399