* [PATCH] ALSA: aoa: Return ENODEV when no sound card is available
@ 2026-11-30 12:34 Sreeraj S Kurup
0 siblings, 0 replies; only message in thread
From: Sreeraj S Kurup @ 2026-11-30 12:34 UTC (permalink / raw)
To: tiwai, perex, johannes
Cc: linuxppc-dev, linux-sound, linux-kernel, Sreeraj S Kurup
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 <sreekuttan2156239@gmail.com>
---
sound/aoa/core/alsa.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/aoa/core/alsa.c b/sound/aoa/core/alsa.c
index aad7dfe089c7..bc7e576ab279 100644
--- a/sound/aoa/core/alsa.c
+++ b/sound/aoa/core/alsa.c
@@ -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) {
--
2.55.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-30 12:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 12:34 [PATCH] ALSA: aoa: Return ENODEV when no sound card is available Sreeraj S Kurup
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox