From: Ralf Baechle <ralf@linux-mips.org>
To: Namhyung Kim <namhyung@gmail.com>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: Define dummy MAX_DMA_CHANNELS to fix build failure
Date: Fri, 20 May 2011 00:02:02 +0100 [thread overview]
Message-ID: <20110519230202.GA10628@linux-mips.org> (raw)
In-Reply-To: <1287673079-15065-1-git-send-email-namhyung@gmail.com>
On Thu, Oct 21, 2010 at 11:57:59PM +0900, Namhyung Kim wrote:
> Date: Thu, 21 Oct 2010 23:57:59 +0900
> From: Namhyung Kim <namhyung@gmail.com>
> To: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
> Subject: [PATCH] MIPS: Define dummy MAX_DMA_CHANNELS to fix build failure
>
> allmodconfig build failes like following:
>
> CC [M] sound/oss/soundcard.o
> sound/oss/soundcard.c:68: error: 'MAX_DMA_CHANNELS' undeclared here (not in a function)
> make[3]: *** [sound/oss/soundcard.o] Error 1
> make[2]: *** [sound/oss] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [all] Error 2
With your patch applied I get this:
CC kernel/dma.o
kernel/dma.c:61:2: error: array index in initializer exceeds array bounds
kernel/dma.c:61:2: error: (near initialization for ‘dma_chan_busy’)
kernel/dma.c:61:2: warning: excess elements in array initializer [enabled by default]
kernel/dma.c:61:2: warning: (near initialization for ‘dma_chan_busy’) [enabled by default]
make[1]: *** [kernel/dma.o] Error 1
make: *** [kernel] Error 2
MAX_DMA_CHANNELS is left undefined so kernel/dma.c builds only the dummy
versions but sound/oss/soundcard.c doesn't support the same thing except
with a rather crude patch following what kernel/dma.c already does such
as below. It gets everything to build for the affected systems but I
doubt much (if anything) will be working.
At this stage I just wanna get rid of OSS for MIPS entirely; it has very
little life if any left.
Ralf
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
sound/oss/soundcard.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index 7c7793a..78ef95a 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -66,7 +66,9 @@ int sound_dmap_flag = 1;
int sound_dmap_flag = 0;
#endif
+#ifdef MAX_DMA_CHANNELS
static char dma_alloc_map[MAX_DMA_CHANNELS];
+#endif
#define DMA_MAP_UNAVAIL 0
#define DMA_MAP_FREE 1
@@ -594,11 +596,13 @@ static void __exit oss_cleanup(void)
sequencer_unload();
+#ifdef MAX_DMA_CHANNELS
for (i = 0; i < MAX_DMA_CHANNELS; i++)
if (dma_alloc_map[i] != DMA_MAP_UNAVAIL) {
printk(KERN_ERR "Sound: Hmm, DMA%d was left allocated - fixed\n", i);
sound_free_dma(i);
}
+#endif
for (i = 0; i < sound_nblocks; i++)
vfree(sound_mem_blocks[i]);
@@ -619,7 +623,9 @@ int sound_alloc_dma(int chn, char *deviceID)
if ((err = request_dma(chn, deviceID)) != 0)
return err;
+#ifdef MAX_DMA_CHANNELS
dma_alloc_map[chn] = DMA_MAP_FREE;
+#endif
return 0;
}
@@ -627,6 +633,7 @@ EXPORT_SYMBOL(sound_alloc_dma);
int sound_open_dma(int chn, char *deviceID)
{
+#ifdef MAX_DMA_CHANNELS
if (!valid_dma(chn)) {
printk(KERN_ERR "sound_open_dma: Invalid DMA channel %d\n", chn);
return 1;
@@ -638,27 +645,34 @@ int sound_open_dma(int chn, char *deviceID)
}
dma_alloc_map[chn] = DMA_MAP_BUSY;
return 0;
+#else
+ return 1; /* No ISA DMA supported */
+#endif
}
EXPORT_SYMBOL(sound_open_dma);
void sound_free_dma(int chn)
{
+#ifdef MAX_DMA_CHANNELS
if (dma_alloc_map[chn] == DMA_MAP_UNAVAIL) {
/* printk( "sound_free_dma: Bad access to DMA channel %d\n", chn); */
return;
}
free_dma(chn);
dma_alloc_map[chn] = DMA_MAP_UNAVAIL;
+#endif
}
EXPORT_SYMBOL(sound_free_dma);
void sound_close_dma(int chn)
{
+#ifdef MAX_DMA_CHANNELS
if (dma_alloc_map[chn] != DMA_MAP_BUSY) {
printk(KERN_ERR "sound_close_dma: Bad access to DMA channel %d\n", chn);
return;
}
dma_alloc_map[chn] = DMA_MAP_FREE;
+#endif
}
EXPORT_SYMBOL(sound_close_dma);
prev parent reply other threads:[~2011-05-19 23:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-21 14:57 [PATCH] MIPS: Define dummy MAX_DMA_CHANNELS to fix build failure Namhyung Kim
2011-05-19 23:02 ` Ralf Baechle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110519230202.GA10628@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=namhyung@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox