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

Merge branch 'usb-midi-fix-3.7' of git://git.alsa-project.org/alsa-kprivate into for-linus

Merge a regression fix for USB MIDI on non-standard usb-audio drivers
by Clemens.
...@@ -148,6 +148,7 @@ struct snd_usb_midi_out_endpoint { ...@@ -148,6 +148,7 @@ struct snd_usb_midi_out_endpoint {
struct snd_usb_midi_out_endpoint* ep; struct snd_usb_midi_out_endpoint* ep;
struct snd_rawmidi_substream *substream; struct snd_rawmidi_substream *substream;
int active; int active;
bool autopm_reference;
uint8_t cable; /* cable number << 4 */ uint8_t cable; /* cable number << 4 */
uint8_t state; uint8_t state;
#define STATE_UNKNOWN 0 #define STATE_UNKNOWN 0
...@@ -1076,7 +1077,8 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) ...@@ -1076,7 +1077,8 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
return -ENXIO; return -ENXIO;
} }
err = usb_autopm_get_interface(umidi->iface); err = usb_autopm_get_interface(umidi->iface);
if (err < 0) port->autopm_reference = err >= 0;
if (err < 0 && err != -EACCES)
return -EIO; return -EIO;
substream->runtime->private_data = port; substream->runtime->private_data = port;
port->state = STATE_UNKNOWN; port->state = STATE_UNKNOWN;
...@@ -1087,9 +1089,11 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) ...@@ -1087,9 +1089,11 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream)
{ {
struct snd_usb_midi* umidi = substream->rmidi->private_data; struct snd_usb_midi* umidi = substream->rmidi->private_data;
struct usbmidi_out_port *port = substream->runtime->private_data;
substream_open(substream, 0); substream_open(substream, 0);
usb_autopm_put_interface(umidi->iface); if (port->autopm_reference)
usb_autopm_put_interface(umidi->iface);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册