ALSA: aoa: Return ENODEV when no sound card is available
Subsystems (2)
PATCH 1/1 ALSA: aoa: Return ENODEV when no sound card is available
aoa_snd_device_new() returns -ENOMEM when aoa_get_card() returns NULL.
This is misleading because the failure indicates that no ALSA card is available, not that memory allocation failed.
Return -ENODEV instead to report the missing device correctly.
Signed-off-by Sreeraj S Kurup <[email protected]>
--- sound/aoa/core/alsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/aoa/core/alsa.c +2 -1
@@ -64,7 +64,8 @@ int aoa_snd_device_new(enum snd_device_type type,struct snd_card *card =aoa_get_card ();int err; -if (!card)return -ENOMEM ; +if (!card) +return -ENODEV ; err =snd_device_new (card, type, device_data, ops);if (err) {
Signature · 1 line
2.55.0
Takashi Iwai
AppliedQuoted 10 lines · Sreeraj S Kurup
aoa_snd_device_new()returns-ENOMEMwhenaoa_get_card()returns NULL.This is misleading because the failure indicates that no ALSA card is available, not that memory allocation failed.
Return
-ENODEVinstead to report the missing device correctly.Signed-off-by Sreeraj S Kurup <[email protected]>
Applied to for-next branch. Thanks.
Takashi
Hi,
Thanks for applying the patch!
Best regards,
Sreeraj