summaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2010-02-16 11:19:18 +0100
committerJaroslav Kysela <perex@perex.cz>2010-02-16 11:19:18 +0100
commitba9341dfef6b0201cd30e3904dcd0a47d3dc35e0 (patch)
treed83637979db83bb9d5a23e190148b90b60c976d2 /sound/isa
parentd39e82db73eb876c60d00f00219d767b3be30307 (diff)
parentf167e1d073278fe231bbdd5d6c24fb9d091aa544 (diff)
downloadop-kernel-dev-ba9341dfef6b0201cd30e3904dcd0a47d3dc35e0.zip
op-kernel-dev-ba9341dfef6b0201cd30e3904dcd0a47d3dc35e0.tar.gz
Merge branch 'fixes' into devel
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/sb/emu8000.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index 751762f..0c40951 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -377,12 +377,13 @@ init_arrays(struct snd_emu8000 *emu)
static void __devinit
size_dram(struct snd_emu8000 *emu)
{
- int i, size;
+ int i, size, detected_size;
if (emu->dram_checked)
return;
size = 0;
+ detected_size = 0;
/* write out a magic number */
snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE);
@@ -393,6 +394,8 @@ size_dram(struct snd_emu8000 *emu)
while (size < EMU8000_MAX_DRAM) {
+ size += 512 * 1024; /* increment 512kbytes */
+
/* Write a unique data on the test address.
* if the address is out of range, the data is written on
* 0x200000(=EMU8000_DRAM_OFFSET). Then the id word is
@@ -414,7 +417,7 @@ size_dram(struct snd_emu8000 *emu)
if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)
break; /* no memory at this address */
- size += 512 * 1024; /* increment 512kbytes */
+ detected_size = size;
snd_emu8000_read_wait(emu);
@@ -442,9 +445,9 @@ size_dram(struct snd_emu8000 *emu)
snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE);
snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n",
- emu->port1, size/1024);
+ emu->port1, detected_size/1024);
- emu->mem_size = size;
+ emu->mem_size = detected_size;
emu->dram_checked = 1;
}
OpenPOWER on IntegriCloud