From: Takashi Iwai Date: Thu, 14 Oct 2021 13:06:35 +0000 (+0200) Subject: ALSA: usb-audio: Drop superfluous error message after disconnection X-Git-Tag: v5.16-rc1~134^2~5^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=509975c7789f84b4d98e06fe2db51ee4ec02eef5;p=thirdparty%2Fkernel%2Flinux.git ALSA: usb-audio: Drop superfluous error message after disconnection The error from snd_usb_lock_shutdown() indicates that the device is disconnected, hence it makes no sense to show any further control message error in get_ctl_value_v2(). Return the error directly instead. Tested-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211014130636.17860-3-tiwai@suse.de Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index a20af9243155a..60d394361a436 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -361,9 +361,8 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, memset(buf, 0, sizeof(buf)); - ret = snd_usb_lock_shutdown(chip) ? -EIO : 0; - if (ret) - goto error; + if (snd_usb_lock_shutdown(chip)) + return -EIO; idx = mixer_ctrl_intf(cval->head.mixer) | (cval->head.id << 8); ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest, @@ -372,7 +371,6 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, snd_usb_unlock_shutdown(chip); if (ret < 0) { -error: usb_audio_dbg(chip, "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", request, validx, idx, cval->val_type);