X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fsonicvibes.c;h=694a967bad007b4e9db6aa47a369bbeaf8f2e97e;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=bb6802714fce33f77b19e5046a3149e18fb4a262;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index bb6802714..694a967ba 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c @@ -59,17 +59,16 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card * static int reverb[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; static int mge[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; static unsigned int dmaio = 0x7a00; /* DDMA i/o address */ -static int boot_devs; -module_param_array(index, int, boot_devs, 0444); +module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for S3 SonicVibes soundcard."); -module_param_array(id, charp, boot_devs, 0444); +module_param_array(id, charp, NULL, 0444); MODULE_PARM_DESC(id, "ID string for S3 SonicVibes soundcard."); -module_param_array(enable, bool, boot_devs, 0444); +module_param_array(enable, bool, NULL, 0444); MODULE_PARM_DESC(enable, "Enable S3 SonicVibes soundcard."); -module_param_array(reverb, bool, boot_devs, 0444); +module_param_array(reverb, bool, NULL, 0444); MODULE_PARM_DESC(reverb, "Enable reverb (SRAM is present) for S3 SonicVibes soundcard."); -module_param_array(mge, bool, boot_devs, 0444); +module_param_array(mge, bool, NULL, 0444); MODULE_PARM_DESC(mge, "MIC Gain Enable for S3 SonicVibes soundcard."); module_param(dmaio, uint, 0444); MODULE_PARM_DESC(dmaio, "DDMA i/o base address for S3 SonicVibes soundcard."); @@ -358,8 +357,8 @@ static unsigned char snd_sonicvibes_in(sonicvibes_t * sonic, unsigned char reg) return value; } -#ifdef CONFIG_SND_DEBUG -void snd_sonicvibes_debug(sonicvibes_t * sonic) +#if 0 +static void snd_sonicvibes_debug(sonicvibes_t * sonic) { printk("SV REGS: INDEX = 0x%02x ", inb(SV_REG(sonic, INDEX))); printk(" STATUS = 0x%02x\n", inb(SV_REG(sonic, STATUS))); @@ -1186,6 +1185,7 @@ static int snd_sonicvibes_free(sonicvibes_t *sonic) kfree_nocheck(sonic->res_dmac); } pci_release_regions(sonic->pci); + pci_disable_device(sonic->pci); kfree(sonic); return 0; } @@ -1217,12 +1217,15 @@ static int __devinit snd_sonicvibes_create(snd_card_t * card, if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { snd_printk("architecture does not support 24bit PCI busmaster DMA\n"); + pci_disable_device(pci); return -ENXIO; } sonic = kcalloc(1, sizeof(*sonic), GFP_KERNEL); - if (sonic == NULL) + if (sonic == NULL) { + pci_disable_device(pci); return -ENOMEM; + } spin_lock_init(&sonic->reg_lock); sonic->card = card; sonic->pci = pci; @@ -1230,6 +1233,7 @@ static int __devinit snd_sonicvibes_create(snd_card_t * card, if ((err = pci_request_regions(pci, "S3 SonicVibes")) < 0) { kfree(sonic); + pci_disable_device(pci); return err; } @@ -1329,13 +1333,14 @@ static int __devinit snd_sonicvibes_create(snd_card_t * card, #endif sonic->revision = snd_sonicvibes_in(sonic, SV_IREG_REVISION); snd_ctl_add(card, snd_ctl_new1(&snd_sonicvibes_game_control, sonic)); - snd_sonicvibes_proc_init(sonic); if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, sonic, &ops)) < 0) { snd_sonicvibes_free(sonic); return err; } + snd_sonicvibes_proc_init(sonic); + snd_card_set_dev(card, &pci->dev); *rsonic = sonic;