control: namehint - do not support 'card' devices

The card: devices do not exist. Do not return -ENOENT,
but -EINVAL in this case.

Fixes: https://github.com/alsa-project/alsa-lib/issues/277
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2022-10-24 10:02:51 +02:00
parent 3bb9c44375
commit 7e678d70c2

View file

@ -602,9 +602,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
list.siface = iface;
list.show_all = 0;
list.cardname = NULL;
if (strcmp(iface, "card") == 0)
list.iface = SND_CTL_ELEM_IFACE_CARD;
else if (strcmp(iface, "pcm") == 0)
if (strcmp(iface, "pcm") == 0)
list.iface = SND_CTL_ELEM_IFACE_PCM;
else if (strcmp(iface, "rawmidi") == 0)
list.iface = SND_CTL_ELEM_IFACE_RAWMIDI;