From fe3b45a0875a8b0944d2adee3ca62283d876edc0 Mon Sep 17 00:00:00 2001 From: HyeongJun An Date: Tue, 27 Oct 2026 10:22:27 +0900 Subject: [PATCH] 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 Link: https://patch.msgid.link/20261027012228.3797565-1-sammiee5311@gmail.com Signed-off-by: Takashi Iwai --- sound/drivers/pcmtest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c index 422fdb10f237..66bee8a2ce34 100644 --- a/sound/drivers/pcmtest.c +++ b/sound/drivers/pcmtest.c @@ -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;