Skip to contentSkip to conversation

ALSA: caiaq: Don't abort when no input device is available

PATCH New Takashi Iwai 1 participant 1 message Apr 27

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: caiaq: Don't abort when no input device is available

The previous fix to handle the error from setup_card() caused a regression for the models that have no dedicated input device; snd_usb_caiaq_input_init() just returns -EINVAL, and we treat it as a fatal error although it should be ignored.

As a regression fix, change the error code to -ENODEV, and ignore this error in the callee, to continue probing.

Fixes 28abd224db4a ("ALSA: caiaq: Handle probe errors properly")
---
 sound/usb/caiaq/device.c | 2 +-
 sound/usb/caiaq/input.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/usb/caiaq/device.c +1 -1
index ad9f744b496b..b8ddd124e905 100644
@@ -366,7 +366,7 @@ static int setup_card(struct snd_usb_caiaqdev *cdev)
 
 #ifdef CONFIG_SND_USB_CAIAQ_INPUT
 	ret = snd_usb_caiaq_input_init(cdev);
-	if (ret < 0) {
+	if (ret < 0 && ret != -ENODEV) {
 		dev_err(dev, "Unable to set up input system (ret=%d)\n", ret);
 		return ret;
 	}
sound/usb/caiaq/input.c +1 -1
index a9130891bb69..5c70fdf61cc1 100644
@@ -804,7 +804,7 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev)
 
 	default:
 		/* no input methods supported on this device */
-		ret = -EINVAL;
+		ret = -ENODEV;
 		goto exit_free_idev;
 	}
 
Signature · 1 line
2.54.0