aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/midi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-03-18 02:39:08 -0400
committerTakashi Iwai <tiwai@suse.de>2011-03-18 02:39:08 -0400
commitd351cf4603edb2a5bfa9a48d06c425511c63f2a3 (patch)
treeb03ea3cfd3ca3974237563cf87328386c3d49ff1 /sound/usb/midi.c
parent433e8327caf9f7c0432b2f2f6684a5b79cfe18e9 (diff)
parent4a122c10fbfe9020df469f0f669da129c5757671 (diff)
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/usb/midi.c')
-rw-r--r--sound/usb/midi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index db2dc5ffe6dd..b4b39c0b6c9e 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -54,6 +54,7 @@
54#include <sound/asequencer.h> 54#include <sound/asequencer.h>
55#include "usbaudio.h" 55#include "usbaudio.h"
56#include "midi.h" 56#include "midi.h"
57#include "power.h"
57#include "helper.h" 58#include "helper.h"
58 59
59/* 60/*
@@ -1044,6 +1045,7 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1044 struct snd_usb_midi* umidi = substream->rmidi->private_data; 1045 struct snd_usb_midi* umidi = substream->rmidi->private_data;
1045 struct usbmidi_out_port* port = NULL; 1046 struct usbmidi_out_port* port = NULL;
1046 int i, j; 1047 int i, j;
1048 int err;
1047 1049
1048 for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) 1050 for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
1049 if (umidi->endpoints[i].out) 1051 if (umidi->endpoints[i].out)
@@ -1056,6 +1058,9 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1056 snd_BUG(); 1058 snd_BUG();
1057 return -ENXIO; 1059 return -ENXIO;
1058 } 1060 }
1061 err = usb_autopm_get_interface(umidi->iface);
1062 if (err < 0)
1063 return -EIO;
1059 substream->runtime->private_data = port; 1064 substream->runtime->private_data = port;
1060 port->state = STATE_UNKNOWN; 1065 port->state = STATE_UNKNOWN;
1061 substream_open(substream, 1); 1066 substream_open(substream, 1);
@@ -1064,7 +1069,10 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1064 1069
1065static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) 1070static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream)
1066{ 1071{
1072 struct snd_usb_midi* umidi = substream->rmidi->private_data;
1073
1067 substream_open(substream, 0); 1074 substream_open(substream, 0);
1075 usb_autopm_put_interface(umidi->iface);
1068 return 0; 1076 return 0;
1069} 1077}
1070 1078