ALSA: pcmtest: Honor the enable parameter
Subsystems (2)
PATCH 1/1 ALSA: pcmtest: Honor the enable parameter
The enable module parameter is declared and documented as "Enable pcmtest soundcard.", but nothing reads it. Loading the module with enable=0 still creates the card.
Return -ENODEV from mod_init() when enable is false, as the pcsp driver does.
Fixes 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")
Signed-off-by HyeongJun An <[email protected]>
---
Prepared with Claude Code (Claude Opus 5.5). Tested on x86_64: enable=0 now fails with -ENODEV and creates no card, and the pcmtest selftest still passes.
sound/drivers/pcmtest.c | 3 +++ 1 file changed, 3 insertions(+)
sound/drivers/pcmtest.c +3 -0
@@ -712,6 +712,9 @@ static int __init mod_init(void) {int err =0 ; +if (!enable) +return -ENODEV ; + buf_allocated =setup_patt_bufs ();if (!buf_allocated)return -ENOMEM ;
Signature · 1 line
2.43.0
Quoted 10 lines · HyeongJun An
The enable module parameter is declared and documented as "Enable pcmtest soundcard.", but nothing reads it. Loading the module with enable=0 still creates the card.
Return
-ENODEVfrommod_init()when enable is false, as the pcsp driver does.Fixes 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")Signed-off-by HyeongJun An <[email protected]>
Applied now. Thanks.
Takashi