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: 315a3d57c6 ("ALSA: Implement the new Virtual PCM Test Driver")
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261027012228.3797565-1-sammiee5311@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
HyeongJun An 2026-10-27 10:22:27 +09:00 committed by Takashi Iwai
parent 493a77a9f2
commit fe3b45a087

View File

@ -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;