[patch] Compilation problem with the ACI-driver

Arjan van de Ven (arjan@stack.nl)
Sun, 29 Nov 1998 14:01:13 +0100 (CET)


Kernel Compilation Project
patch

Kernel : 2.1.130
Architecture : i386/gcc
Files affected : drivers/sound/lowlevel/miroaci.h

Description of the problem
==========================
The user could select the miro-pcm20 radio-card without selecting the "aci"
function in the lowlevel-sound section. This resulted in "unresolved
symbols" during compilation.

Proposed solution
=================
The following patch is to the header-file that declares the ACI-functions.
Any driver including this header is assumed to use the ACI-functions.
The #ifdef defines substitutes in case CONFIG_ACI_MIXER isn't set. A
#warning is generated in compile-time and a KERN_DEBUG message is printed
during runtime.

diff -r -u linux/drivers/sound/lowlevel/miroaci.h /usr/src/linux/drivers/sound/lowlevel/miroaci.h
--- linux/drivers/sound/lowlevel/miroaci.h Sun Aug 23 22:32:25 1998
+++ /usr/src/linux/drivers/sound/lowlevel/miroaci.h Sun Nov 29 12:13:21 1998
@@ -1,6 +1,44 @@
+#ifdef CONFIG_ACI_MIXER
extern int aci_implied_cmd(unsigned char opcode);
extern int aci_write_cmd(unsigned char opcode, unsigned char parameter);
extern int aci_write_cmd_d(unsigned char opcode, unsigned char parameter, unsigned char parameter2);
extern int aci_read_cmd(unsigned char opcode, int length, unsigned char *parameter);
extern int aci_indexed_cmd(unsigned char opcode, unsigned char index, unsigned char *parameter);
+#else
+static int WARNINGS_ISSUED = 0;

+#warning Compiling a driver that needs the ACI-mixer but without ACI-mixer support
+
+inline int aci_implied_cmd(unsigned char opcode)
+{
+ if (WARNINGS_ISSUED++<5)
+ printk(KERN_DEBUG "Tried to use the lowlevel ACI function, not compiled in.");
+ return 0;
+};
+
+inline int aci_write_cmd(unsigned char opcode, unsigned char parameter)
+{
+ if (WARNINGS_ISSUED++<5)
+ printk(KERN_DEBUG "Tried to use the lowlevel ACI function, not compiled in.");
+ return 0;
+};
+inline int aci_write_cmd_d(unsigned char opcode, unsigned char parameter, unsigned char parameter2)
+{
+ if (WARNINGS_ISSUED++<5)
+ printk(KERN_DEBUG "Tried to use the lowlevel ACI function, not compiled in.");
+ return 0;
+};
+inline int aci_read_cmd(unsigned char opcode, int length, unsigned char *parameter)
+{
+ if (WARNINGS_ISSUED++<5)
+ printk(KERN_DEBUG "Tried to use the lowlevel ACI function, not compiled in.");
+ return 0;
+};
+inline int aci_indexed_cmd(unsigned char opcode, unsigned char index, unsigned char *parameter)
+{
+ if (WARNINGS_ISSUED++<5)
+ printk(KERN_DEBUG "Tried to use the lowlevel ACI function, not compiled in.");
+ return 0;
+};
+
+#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/