git: 0187bc8a472e - main - sound: Include snd_cmi only for i386 and amd64

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Mon, 04 Nov 2024 19:59:21 UTC
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=0187bc8a472ef21ddb901f797d46075fc0d5eb14

commit 0187bc8a472ef21ddb901f797d46075fc0d5eb14
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2024-11-04 19:57:25 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2024-11-04 19:57:25 +0000

    sound: Include snd_cmi only for i386 and amd64
    
    When running FreeBSD on an arm64/aarch64 QEMU virtual machine, using the
    Intel HD Audio Controller (ich6) (intel-hda), for example, and by
    following the procedure in the handbook ("Setting Up the Sound Card"):
    
        kldload snd_driver
    
    The following error is shown:
    
        KLD snd_driver.ko: depends on snd_cmi - not available or version mismatch
    
    This is because the CMedia sound driver (snd_cmi) is only built for i386
    and amd64.
    
    Add the same guards to the snd_driver metadriver.
    
    Reviewed by:    christos, emaste
    Approved by:    emaste (mentor)
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D47399
---
 sys/dev/sound/driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c
index 6bfe6c51fa3e..13218f419a28 100644
--- a/sys/dev/sound/driver.c
+++ b/sys/dev/sound/driver.c
@@ -57,7 +57,9 @@ MODULE_VERSION(snd_driver, 1);
 
 MODULE_DEPEND(snd_driver, snd_als4000, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_atiixp, 1, 1, 1);
+#if defined(__i386__) || defined(__amd64__)
 MODULE_DEPEND(snd_driver, snd_cmi, 1, 1, 1);
+#endif
 MODULE_DEPEND(snd_driver, snd_cs4281, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_csa, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_csapcm, 1, 1, 1);