public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc dmasound compilation fix (TRIVIAL), kernel 2.6.11
@ 2005-03-21 23:47 Per Christian Henden
  0 siblings, 0 replies; only message in thread
From: Per Christian Henden @ 2005-03-21 23:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: benh

The patch below fixes the following problem: 
Compile error when compiling with CONFIG_DMASOUND_PMAC defined
and CONFIG_NVRAM not defined.

The 2.6 kernel has had this problem since 2.6.8 [1], possibly longer.

Details:

The error is 

  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
sound/built-in.o(.init.text+0xb68): In function `dmasound_awacs_init':
: undefined reference to `pmac_xpram_read'
make[1]: *** [.tmp_vmlinux1] Error 1

sound/oss/dmasound/dmasound_awacs.c calls the function pmac_xpram_read(int) in 
the function dmasound_awacs_init() without making sure that CONFIG_NVRAM (the 
"provider" of this function) is defined. Other users of pmac_xpram_read(int) 
checks for this. 

The specific call is 

vol = ((pmac_xpram_read( 8 ) & 7 ) << 1 );
 -- it just sets the volume, so we don't need to force users of 
CONFIG_DMASOUND_PMAC to use CONFIG_NVRAM, IMHO.


Patch against 2.6.11.5:

--- linux-2.6.11.5-orig/sound/oss/dmasound/dmasound_awacs.c     2005-03-22 
00:32:10.000000000 +0100
+++ linux-2.6.11.5-new/sound/oss/dmasound/dmasound_awacs.c      2005-03-22 
00:30:50.000000000 +0100
@@ -2987,10 +2987,13 @@

        set_hw_byteswap(io) ; /* figure out if the h/w can do it */

-       /* get default volume from nvram
-        * vol = (~nvram_read_byte(0x1308) & 7) << 1;
-       */
+#ifdef CONFIG_NVRAM
+       /* get default volume from nvram */
        vol = ((pmac_xpram_read( 8 ) & 7 ) << 1 );
+#else
+       vol = 0;
+#endif
+
        /* set up tracking values */
        spk_vol = vol * 100 ;
        spk_vol /= 7 ; /* get set value to a percentage */


-----------

I've tested the new case when vol gets set to 0, and it has no ill effects. 
It's how it's done in dmasound_atari.c:TTMixerInit(). 
The test was limited to compile and boot the patched kernel, test 
that sound and boot-up worked as normal (as it did earlier without the patch 
applied).


[1] see http://lists.debian.org/debian-powerpc/2005/03/msg00482.html


PS: Please CC me if replying, as I'm not subscribed to the lkml.


Cheers, 

Per Christian Henden

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-21 23:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-21 23:47 [PATCH] powerpc dmasound compilation fix (TRIVIAL), kernel 2.6.11 Per Christian Henden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox