Commit 60af3d037eb8c670dcce31401501d1271e7c5d95

Authored by Takashi Iwai
1 parent ebfc594c02

ALSA: usb-audio: Fix autopm error during probing

We've got strange errors in get_ctl_value() in mixer.c during
probing, e.g. on Hercules RMX2 DJ Controller:

  ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4
  ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
  ....

It turned out that the culprit is autopm: snd_usb_autoresume() returns
-ENODEV when called during card->probing = 1.

Since the call itself during card->probing = 1 is valid, let's fix the
return value of snd_usb_autoresume() as success.

Reported-and-tested-by: Daniel Schürmann <daschuer@mixxx.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -631,7 +631,9 @@
631 631 int err = -ENODEV;
632 632  
633 633 down_read(&chip->shutdown_rwsem);
634   - if (!chip->shutdown && !chip->probing)
  634 + if (chip->probing)
  635 + err = 0;
  636 + else if (!chip->shutdown)
635 637 err = usb_autopm_get_interface(chip->pm_intf);
636 638 up_read(&chip->shutdown_rwsem);
637 639