Bug 17477

Summary: Driver for maestro sound chip causes errors during compile of kernel
Product: [Retired] Red Hat Linux Reporter: John C. Norton <jnorton>
Component: kernelAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 6.2CC: jnorton
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-15 01:46:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John C. Norton 2000-09-13 19:34:07 UTC
When recompiling the 6.2 kernel:

    % cd /usr/src/linux
    % make xconfig
    % make dep
    % make clean
    % make bzImage

the maestro sound chip driver (maestro.c) causes the build to break with the following error & warning messages:

gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce 
-m486 -malign-loops=0 -malign-jumps=0 -malign-functions=0 -DCPU=686   -c -o maestro.o maestro.c
maestro.c: In function `ess_open_mixdev':
maestro.c:2106: `MOD_INC_USE_COUNT' undeclared (first use in this function)
maestro.c:2106: (Each undeclared identifier is reported only once
maestro.c:2106: for each function it appears in.)
maestro.c: In function `ess_release_mixdev':
maestro.c:2116: `MOD_DEC_USE_COUNT' undeclared (first use in this function)
maestro.c: In function `ess_open':
maestro.c:3003: `MOD_INC_USE_COUNT' undeclared (first use in this function)
maestro.c: In function `ess_release':
maestro.c:3034: `MOD_DEC_USE_COUNT' undeclared (first use in this function)
maestro.c: At top level:
maestro.c:3479: warning: return-type defaults to `int'

Comment 1 John C. Norton 2000-09-14 16:48:17 UTC
Actually, I think I now know the fix for this.  After more investigation, I found that the MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT were
simply macros which are defined in /usr/src/linux/linux/module.h, for use with modules (but NOT when the maestro driver is built into the kernel).

So I think the appropriate fix is simply to wrap each occurrence of MOD_INC_USE_COUNT and MOD_USE_DEC_COUNT with #ifdef statments
in /usr/src/linux/drivers/sound/maestro.c, that is:

    #ifdef MODULE
        MOD_INC_USE_COUNT;
    #endif  /* MODULE */

When I made these changes and recompiled the kernel, I got the sound support I needed.

Thanks,
John C. Norton
9/14/00



Comment 2 Alan Cox 2000-09-15 17:12:27 UTC
Thanks. I believe the current 2.2. development code is correct on this one
already. Your fix
is quite sane


Comment 3 Alan Cox 2002-12-15 01:46:50 UTC
Forgot to close it way back when