From: HyeongJun An <sammiee5311@gmail.com>
To: tiwai@suse.com
Cc: ivan.orlov0322@gmail.com, perex@perex.cz,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
HyeongJun An <sammiee5311@gmail.com>
Subject: [PATCH] ALSA: pcmtest: Honor the enable parameter
Date: Tue, 27 Oct 2026 10:22:27 +0900 [thread overview]
Message-ID: <20261027012228.3797565-1-sammiee5311@gmail.com> (raw)
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 <sammiee5311@gmail.com>
---
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(+)
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;
--
2.43.0
next reply other threads:[~2026-10-27 1:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 1:22 HyeongJun An [this message]
2026-10-27 6:38 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027012228.3797565-1-sammiee5311@gmail.com \
--to=sammiee5311@gmail.com \
--cc=ivan.orlov0322@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®