ALSA: ua101, usx2y: fix broken MIDI output
authorClemens Ladisch <clemens@ladisch.de>
Wed, 31 Oct 2012 15:35:30 +0000 (16:35 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Dec 2012 11:20:26 +0000 (11:20 +0000)
commitad271ac21223b34db8b05091b66f1758c7e5df4a
tree5f5c04eaaeca47b23023bb7fa55cbdd7b757e12f
parentf72ba897949f861cc95267c215ec4f8b5e9d6599
ALSA: ua101, usx2y: fix broken MIDI output

commit e99ddfde6ae0dd2662bb40435696002b590e4057 upstream.

Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend) added
autosuspend code to all files making up the snd-usb-audio driver.
However, midi.c is part of snd-usb-lib and is also used by other
drivers, not all of which support autosuspend.  Thus, calls to
usb_autopm_get_interface() could fail, and this unexpected error would
result in the MIDI output being completely unusable.

Make it work by ignoring the error that is expected with drivers that do
not support autosuspend.

Reported-by: Colin Fletcher <colin.m.fletcher@googlemail.com>
Reported-by: Devin Venable <venable.devin@gmail.com>
Reported-by: Dr Nick Bailey <nicholas.bailey@glasgow.ac.uk>
Reported-by: Jannis Achstetter <jannis_achstetter@web.de>
Reported-by: Rui Nuno Capela <rncbc@rncbc.org>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/usb/midi.c