ALSA: usb-audio: Fix kernel panic of Digidesign Mbox2 quirk

This patch is based on 3.8-rc1. It fixes two things:
1) A kernel panic caused by incorrect allocation of a u8 variable
   "bootresponse".
2) A noisy dmesg (urb status -32) caused by broken pipe to an
   invalid midi endpoint.

It is also a little cleaner because there is no need for a new
QUIRK_MIDI type as suggested by kernel developers, since the device
follows exactly the MIDIMAN protocol.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index f104c68..acc12f0 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -306,7 +306,6 @@
 		[QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
 		[QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
 		[QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
-		[QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
 		[QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
 		[QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
 		[QUIRK_MIDI_CME] = create_any_midi_quirk,
@@ -528,11 +527,11 @@
 #define MBOX2_BOOT_LOADING     0x01 /* Hard coded into the device */
 #define MBOX2_BOOT_READY       0x02 /* Hard coded into the device */
 
-int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
+static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
 {
 	struct usb_host_config *config = dev->actconfig;
 	int err;
-	u8 bootresponse;
+	u8 bootresponse[12];
 	int fwsize;
 	int count;
 
@@ -546,20 +545,20 @@
 	snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
 
 	count = 0;
-	bootresponse = MBOX2_BOOT_LOADING;
-	while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) {
+	bootresponse[0] = MBOX2_BOOT_LOADING;
+	while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
 		msleep(500); /* 0.5 second delay */
 		snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
 			/* Control magic - load onboard firmware */
 			0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
-		if (bootresponse == MBOX2_BOOT_READY)
+		if (bootresponse[0] == MBOX2_BOOT_READY)
 			break;
 		snd_printd("usb-audio: device not ready, resending boot sequence...\n");
 		count++;
 	}
 
-	if (bootresponse != MBOX2_BOOT_READY) {
-		snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse);
+	if (bootresponse[0] != MBOX2_BOOT_READY) {
+		snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
 		return -ENODEV;
 	}
 
@@ -660,7 +659,6 @@
 	return 0; /* keep this altsetting */
 }
 
-
 static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
 					   int iface, int altno)
 {