Bug 17477 - Driver for maestro sound chip causes errors during compile of kernel
Summary: Driver for maestro sound chip causes errors during compile of kernel
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 6.2
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Michael K. Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-09-13 19:34 UTC by John C. Norton
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-12-15 01:46:50 UTC
Embargoed:


Attachments (Terms of Use)

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



Note You need to log in before you can comment on or make changes to this bug.