diff options
Diffstat (limited to 'sound/oss')
-rw-r--r-- | sound/oss/.gitignore | 4 | ||||
-rw-r--r-- | sound/oss/au1000.c | 2 | ||||
-rw-r--r-- | sound/oss/au1550_ac97.c | 2 | ||||
-rw-r--r-- | sound/oss/awe_wave.c | 6 | ||||
-rw-r--r-- | sound/oss/cmpci.c | 2 | ||||
-rw-r--r-- | sound/oss/cs4232.c | 15 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_awacs.c | 4 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_core.c | 10 | ||||
-rw-r--r-- | sound/oss/emu10k1/midi.c | 9 | ||||
-rw-r--r-- | sound/oss/esssolo1.c | 2 | ||||
-rw-r--r-- | sound/oss/ite8172.c | 4 | ||||
-rw-r--r-- | sound/oss/maestro3.c | 10 | ||||
-rw-r--r-- | sound/oss/msnd.c | 6 | ||||
-rw-r--r-- | sound/oss/sb_card.c | 35 | ||||
-rw-r--r-- | sound/oss/sb_mixer.c | 6 | ||||
-rw-r--r-- | sound/oss/sequencer.c | 17 | ||||
-rw-r--r-- | sound/oss/sh_dac_audio.c | 2 | ||||
-rw-r--r-- | sound/oss/sonicvibes.c | 21 | ||||
-rw-r--r-- | sound/oss/swarm_cs4297a.c | 4 | ||||
-rw-r--r-- | sound/oss/vwsnd.c | 40 | ||||
-rw-r--r-- | sound/oss/waveartist.c | 8 |
21 files changed, 99 insertions, 110 deletions
diff --git a/sound/oss/.gitignore b/sound/oss/.gitignore new file mode 100644 index 00000000000..7efb12b4550 --- /dev/null +++ b/sound/oss/.gitignore @@ -0,0 +1,4 @@ +#Ignore generated files +maui_boot.h +pss_boot.h +trix_boot.h diff --git a/sound/oss/au1000.c b/sound/oss/au1000.c index fe54de25aaf..eacb0aef21e 100644 --- a/sound/oss/au1000.c +++ b/sound/oss/au1000.c @@ -100,7 +100,7 @@ /* Boot options */ static int vra = 0; // 0 = no VRA, 1 = use VRA if codec supports it -MODULE_PARM(vra, "i"); +module_param(vra, bool, 0); MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it"); diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c index 6a4956b8025..c1168fae6be 100644 --- a/sound/oss/au1550_ac97.c +++ b/sound/oss/au1550_ac97.c @@ -79,7 +79,7 @@ * 0 = no VRA, 1 = use VRA if codec supports it */ static int vra = 1; -MODULE_PARM(vra, "i"); +module_param(vra, bool, 0); MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it"); static struct au1550_state { diff --git a/sound/oss/awe_wave.c b/sound/oss/awe_wave.c index b3ea719d33d..d1a0eb294d6 100644 --- a/sound/oss/awe_wave.c +++ b/sound/oss/awe_wave.c @@ -2944,7 +2944,7 @@ alloc_new_info(void) { awe_voice_list *newlist; - newlist = (awe_voice_list *)kmalloc(sizeof(*newlist), GFP_KERNEL); + newlist = kmalloc(sizeof(*newlist), GFP_KERNEL); if (newlist == NULL) { printk(KERN_ERR "AWE32: can't alloc info table\n"); return NULL; @@ -3547,8 +3547,10 @@ awe_load_guspatch(const char __user *addr, int offs, int size, int pmgr_flag) smp->checksum_flag = 0; smp->checksum = 0; - if ((rc = awe_write_wave_data(addr, sizeof_patch, smprec, -1)) < 0) + if ((rc = awe_write_wave_data(addr, sizeof_patch, smprec, -1)) < 0) { + kfree(vrec); return rc; + } sf->mem_ptr += rc; add_sf_sample(sf, smprec); diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c index 1fbd5137f6d..de60a059ff5 100644 --- a/sound/oss/cmpci.c +++ b/sound/oss/cmpci.c @@ -1713,7 +1713,7 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg) case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */ if (get_user(val, p)) return -EFAULT; - i = generic_hweight32(val); + i = hweight32(val); for (j = i = 0; i < SOUND_MIXER_NRDEVICES; i++) { if (!(val & (1 << i))) continue; diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c index 7c59e2d4003..c7f86f09c28 100644 --- a/sound/oss/cs4232.c +++ b/sound/oss/cs4232.c @@ -360,6 +360,8 @@ static int __initdata synthio = -1; static int __initdata synthirq = -1; static int __initdata isapnp = 1; +static unsigned int cs4232_devices; + MODULE_DESCRIPTION("CS4232 based soundcard driver"); MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis"); MODULE_LICENSE("GPL"); @@ -421,6 +423,7 @@ static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev return -ENODEV; } pnp_set_drvdata(dev,isapnpcfg); + cs4232_devices++; return 0; } @@ -455,10 +458,11 @@ static int __init init_cs4232(void) #endif cfg.irq = -1; - if (isapnp && - (pnp_register_driver(&cs4232_driver) > 0) - ) - return 0; + if (isapnp) { + pnp_register_driver(&cs4232_driver); + if (cs4232_devices) + return 0; + } if(io==-1||irq==-1||dma==-1) { @@ -503,7 +507,8 @@ static int __init setup_cs4232(char *str) int ints[7]; /* If we have isapnp cards, no need for options */ - if (pnp_register_driver(&cs4232_driver) > 0) + pnp_register_driver(&cs4232_driver); + if (cs4232_devices) return 1; str = get_options(str, ARRAY_SIZE(ints), ints); diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index 6ba8d6f45fe..c8e21032689 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -2798,7 +2798,7 @@ __init setup_beep(void) DBDMA_ALIGN(beep_dbdma_cmd_space); /* set up emergency dbdma cmd */ emergency_dbdma_cmd = beep_dbdma_cmd+1 ; - beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); + beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); if (beep_buf == NULL) { printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n"); kfree(beep_dbdma_cmd_space) ; @@ -2814,7 +2814,7 @@ int __init dmasound_awacs_init(void) struct device_node *io = NULL, *info = NULL; int vol, res; - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return -ENODEV; awacs_subframe = 0; diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c index c9302a1e515..87bd3100aef 100644 --- a/sound/oss/dmasound/dmasound_core.c +++ b/sound/oss/dmasound/dmasound_core.c @@ -195,18 +195,18 @@ */ int dmasound_catchRadius = 0; -MODULE_PARM(dmasound_catchRadius, "i"); +module_param(dmasound_catchRadius, int, 0); static unsigned int numWriteBufs = DEFAULT_N_BUFFERS; -MODULE_PARM(numWriteBufs, "i"); +module_param(numWriteBufs, int, 0); static unsigned int writeBufSize = DEFAULT_BUFF_SIZE ; /* in bytes */ -MODULE_PARM(writeBufSize, "i"); +module_param(writeBufSize, int, 0); #ifdef HAS_RECORD static unsigned int numReadBufs = DEFAULT_N_BUFFERS; -MODULE_PARM(numReadBufs, "i"); +module_param(numReadBufs, int, 0); static unsigned int readBufSize = DEFAULT_BUFF_SIZE; /* in bytes */ -MODULE_PARM(readBufSize, "i"); +module_param(readBufSize, int, 0); #endif MODULE_LICENSE("GPL"); diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c index 959a96794db..25ae8e4a488 100644 --- a/sound/oss/emu10k1/midi.c +++ b/sound/oss/emu10k1/midi.c @@ -65,7 +65,8 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd init_midi_hdr(midihdr); - if ((midihdr->data = (u8 *) kmalloc(MIDIIN_BUFLEN, GFP_KERNEL)) == NULL) { + midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL); + if (!midihdr->data) { ERROR(); kfree(midihdr); return -1; @@ -334,7 +335,8 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer, midihdr->bytesrecorded = 0; midihdr->flags = 0; - if ((midihdr->data = (u8 *) kmalloc(count, GFP_KERNEL)) == NULL) { + midihdr->data = kmalloc(count, GFP_KERNEL); + if (!midihdr->data) { ERROR(); kfree(midihdr); return -EINVAL; @@ -545,7 +547,8 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte) midihdr->bytesrecorded = 0; midihdr->flags = 0; - if ((midihdr->data = (u8 *) kmalloc(1, GFP_KERNEL)) == NULL) { + midihdr->data = kmalloc(1, GFP_KERNEL); + if (!midihdr->data) { ERROR(); kfree(midihdr); return -EINVAL; diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c index 78d3e29ce96..6861563d752 100644 --- a/sound/oss/esssolo1.c +++ b/sound/oss/esssolo1.c @@ -2348,7 +2348,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device /* Recording requires 24-bit DMA, so attempt to set dma mask * to 24 bits first, then 32 bits (playback only) if that fails. */ - if (pci_set_dma_mask(pcidev, 0x00ffffff) && + if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK) && pci_set_dma_mask(pcidev, DMA_32BIT_MASK)) { printk(KERN_WARNING "solo1: architecture does not support 24bit or 32bit PCI busmaster DMA\n"); return -ENODEV; diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c index ffcb910f5c3..00ac1c95a42 100644 --- a/sound/oss/ite8172.c +++ b/sound/oss/ite8172.c @@ -1968,9 +1968,9 @@ static int i2s_fmt[NR_DEVICE]; static unsigned int devindex; -MODULE_PARM(spdif, "1-" __MODULE_STRING(NR_DEVICE) "i"); +module_param_array(spdif, int, NULL, 0); MODULE_PARM_DESC(spdif, "if 1 the S/PDIF digital output is enabled"); -MODULE_PARM(i2s_fmt, "1-" __MODULE_STRING(NR_DEVICE) "i"); +module_param_array(i2s_fmt, int, NULL, 0); MODULE_PARM_DESC(i2s_fmt, "the format of I2S"); MODULE_AUTHOR("Monta Vista Software, stevel@mvista.com"); diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c index 66044aff258..4a5e4237a11 100644 --- a/sound/oss/maestro3.c +++ b/sound/oss/maestro3.c @@ -2582,15 +2582,9 @@ static int alloc_dsp_suspendmem(struct m3_card *card) return 0; } -static void free_dsp_suspendmem(struct m3_card *card) -{ - if(card->suspend_mem) - vfree(card->suspend_mem); -} #else #define alloc_dsp_suspendmem(args...) 0 -#define free_dsp_suspendmem(args...) #endif /* @@ -2717,7 +2711,7 @@ out: if(ret) { if(card->iobase) release_region(pci_resource_start(pci_dev, 0), pci_resource_len(pci_dev, 0)); - free_dsp_suspendmem(card); + vfree(card->suspend_mem); if(card->ac97) { unregister_sound_mixer(card->ac97->dev_mixer); kfree(card->ac97); @@ -2760,7 +2754,7 @@ static void m3_remove(struct pci_dev *pci_dev) } release_region(card->iobase, 256); - free_dsp_suspendmem(card); + vfree(card->suspend_mem); kfree(card); } devs = NULL; diff --git a/sound/oss/msnd.c b/sound/oss/msnd.c index a7ad2b0a2ac..5dbfc0f9c3c 100644 --- a/sound/oss/msnd.c +++ b/sound/oss/msnd.c @@ -95,10 +95,8 @@ void msnd_fifo_init(msnd_fifo *f) void msnd_fifo_free(msnd_fifo *f) { - if (f->data) { - vfree(f->data); - f->data = NULL; - } + vfree(f->data); + f->data = NULL; } int msnd_fifo_alloc(msnd_fifo *f, size_t n) diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c index 680b82e1529..4708cbdc314 100644 --- a/sound/oss/sb_card.c +++ b/sound/oss/sb_card.c @@ -52,6 +52,7 @@ static int __initdata sm_games = 0; /* Logitech soundman games? */ static struct sb_card_config *legacy = NULL; #ifdef CONFIG_PNP +static int pnp_registered; static int __initdata pnp = 1; /* static int __initdata uart401 = 0; @@ -133,7 +134,7 @@ static void sb_unload(struct sb_card_config *scc) } /* Register legacy card with OSS subsystem */ -static int sb_init_legacy(void) +static int __init sb_init_legacy(void) { struct sb_module_options sbmo = {0}; @@ -234,6 +235,8 @@ static void sb_dev2cfg(struct pnp_dev *dev, struct sb_card_config *scc) } } +static unsigned int sb_pnp_devices; + /* Probe callback function for the PnP API */ static int sb_pnp_probe(struct pnp_card_link *card, const struct pnp_card_device_id *card_id) { @@ -264,6 +267,7 @@ static int sb_pnp_probe(struct pnp_card_link *card, const struct pnp_card_device scc->conf.dma, scc->conf.dma2); pnp_set_card_drvdata(card, scc); + sb_pnp_devices++; return sb_register_oss(scc, &sbmo); } @@ -289,6 +293,14 @@ static struct pnp_card_driver sb_pnp_driver = { MODULE_DEVICE_TABLE(pnp_card, sb_pnp_card_table); #endif /* CONFIG_PNP */ +static void __init_or_module sb_unregister_all(void) +{ +#ifdef CONFIG_PNP + if (pnp_registered) + pnp_unregister_card_driver(&sb_pnp_driver); +#endif +} + static int __init sb_init(void) { int lres = 0; @@ -307,17 +319,18 @@ static int __init sb_init(void) #ifdef CONFIG_PNP if(pnp) { - pres = pnp_register_card_driver(&sb_pnp_driver); + int err = pnp_register_card_driver(&sb_pnp_driver); + if (!err) + pnp_registered = 1; + pres = sb_pnp_devices; } #endif printk(KERN_INFO "sb: Init: Done\n"); /* If either PnP or Legacy registered a card then return * success */ - if (pres <= 0 && lres <= 0) { -#ifdef CONFIG_PNP - pnp_unregister_card_driver(&sb_pnp_driver); -#endif + if (pres == 0 && lres <= 0) { + sb_unregister_all(); return -ENODEV; } return 0; @@ -333,14 +346,10 @@ static void __exit sb_exit(void) sb_unload(legacy); } -#ifdef CONFIG_PNP - pnp_unregister_card_driver(&sb_pnp_driver); -#endif + sb_unregister_all(); - if (smw_free) { - vfree(smw_free); - smw_free = NULL; - } + vfree(smw_free); + smw_free = NULL; } module_init(sb_init); diff --git a/sound/oss/sb_mixer.c b/sound/oss/sb_mixer.c index f56898c3981..ccb21d48d42 100644 --- a/sound/oss/sb_mixer.c +++ b/sound/oss/sb_mixer.c @@ -273,14 +273,14 @@ int sb_common_mixer_set(sb_devc * devc, int dev, int left, int right) int regoffs; unsigned char val; + if ((dev < 0) || (dev >= devc->iomap_sz)) + return -EINVAL; + regoffs = (*devc->iomap)[dev][LEFT_CHN].regno; if (regoffs == 0) return -EINVAL; - if ((dev < 0) || (dev >= devc->iomap_sz)) - return -EINVAL; - val = sb_getmixer(devc, regoffs); change_bits(devc, &val, dev, LEFT_CHN, left); diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c index 698614226c9..6815c30e0bc 100644 --- a/sound/oss/sequencer.c +++ b/sound/oss/sequencer.c @@ -709,11 +709,11 @@ static void seq_local_event(unsigned char *event_rec) static void seq_sysex_message(unsigned char *event_rec) { - int dev = event_rec[1]; + unsigned int dev = event_rec[1]; int i, l = 0; unsigned char *buf = &event_rec[2]; - if ((int) dev > max_synthdev) + if (dev > max_synthdev) return; if (!(synth_open_mask & (1 << dev))) return; @@ -1671,14 +1671,7 @@ void sequencer_init(void) void sequencer_unload(void) { - if(queue) - { - vfree(queue); - queue=NULL; - } - if(iqueue) - { - vfree(iqueue); - iqueue=NULL; - } + vfree(queue); + vfree(iqueue); + queue = iqueue = NULL; } diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c index 8a9917c919c..3f7427cd195 100644 --- a/sound/oss/sh_dac_audio.c +++ b/sound/oss/sh_dac_audio.c @@ -289,7 +289,7 @@ static int __init dac_audio_init(void) in_use = 0; - data_buffer = (char *)kmalloc(BUFFER_SIZE, GFP_KERNEL); + data_buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL); if (data_buffer == NULL) return -ENOMEM; diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c index 69a4b8778b5..42bd276cfc3 100644 --- a/sound/oss/sonicvibes.c +++ b/sound/oss/sonicvibes.c @@ -116,6 +116,7 @@ #include <linux/spinlock.h> #include <linux/smp_lock.h> #include <linux/gameport.h> +#include <linux/dma-mapping.h> #include <linux/mutex.h> @@ -407,24 +408,6 @@ static inline unsigned ld2(unsigned int x) return r; } -/* - * hweightN: returns the hamming weight (i.e. the number - * of bits set) of a N-bit word - */ - -#ifdef hweight32 -#undef hweight32 -#endif - -static inline unsigned int hweight32(unsigned int w) -{ - unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); - res = (res & 0x33333333) + ((res >> 2) & 0x33333333); - res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); - res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); - return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); -} - /* --------------------------------------------------------------------- */ /* @@ -2553,7 +2536,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id return -ENODEV; if (pcidev->irq == 0) return -ENODEV; - if (pci_set_dma_mask(pcidev, 0x00ffffff)) { + if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK)) { printk(KERN_WARNING "sonicvibes: architecture does not support 24bit PCI busmaster DMA\n"); return -ENODEV; } diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c index dce9016cbcf..eb5ea32fd1b 100644 --- a/sound/oss/swarm_cs4297a.c +++ b/sound/oss/swarm_cs4297a.c @@ -154,8 +154,8 @@ static void start_adc(struct cs4297a_state *s); #if CSDEBUG static unsigned long cs_debuglevel = 4; // levels range from 1-9 static unsigned long cs_debugmask = CS_INIT /*| CS_IOCTL*/; -MODULE_PARM(cs_debuglevel, "i"); -MODULE_PARM(cs_debugmask, "i"); +module_param(cs_debuglevel, int, 0); +module_param(cs_debugmask, int, 0); #endif #define CS_TRUE 1 #define CS_FALSE 0 diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c index b372e88e857..5f140c7586b 100644 --- a/sound/oss/vwsnd.c +++ b/sound/oss/vwsnd.c @@ -248,27 +248,6 @@ typedef struct lithium { } lithium_t; /* - * li_create initializes the lithium_t structure and sets up vm mappings - * to access the registers. - * Returns 0 on success, -errno on failure. - */ - -static int __init li_create(lithium_t *lith, unsigned long baseaddr) -{ - static void li_destroy(lithium_t *); - - spin_lock_init(&lith->lock); - lith->page0 = ioremap_nocache(baseaddr + LI_PAGE0_OFFSET, PAGE_SIZE); - lith->page1 = ioremap_nocache(baseaddr + LI_PAGE1_OFFSET, PAGE_SIZE); - lith->page2 = ioremap_nocache(baseaddr + LI_PAGE2_OFFSET, PAGE_SIZE); - if (!lith->page0 || !lith->page1 || !lith->page2) { - li_destroy(lith); - return -ENOMEM; - } - return 0; -} - -/* * li_destroy destroys the lithium_t structure and vm mappings. */ @@ -289,6 +268,25 @@ static void li_destroy(lithium_t *lith) } /* + * li_create initializes the lithium_t structure and sets up vm mappings + * to access the registers. + * Returns 0 on success, -errno on failure. + */ + +static int __init li_create(lithium_t *lith, unsigned long baseaddr) +{ + spin_lock_init(&lith->lock); + lith->page0 = ioremap_nocache(baseaddr + LI_PAGE0_OFFSET, PAGE_SIZE); + lith->page1 = ioremap_nocache(baseaddr + LI_PAGE1_OFFSET, PAGE_SIZE); + lith->page2 = ioremap_nocache(baseaddr + LI_PAGE2_OFFSET, PAGE_SIZE); + if (!lith->page0 || !lith->page1 || !lith->page2) { + li_destroy(lith); + return -ENOMEM; + } + return 0; +} + +/* * basic register accessors - read/write long/byte */ diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c index 99d04ad3ca1..afcb524a40e 100644 --- a/sound/oss/waveartist.c +++ b/sound/oss/waveartist.c @@ -2028,8 +2028,8 @@ __setup("waveartist=", setup_waveartist); #endif MODULE_DESCRIPTION("Rockwell WaveArtist RWA-010 sound driver"); -MODULE_PARM(io, "i"); /* IO base */ -MODULE_PARM(irq, "i"); /* IRQ */ -MODULE_PARM(dma, "i"); /* DMA */ -MODULE_PARM(dma2, "i"); /* DMA2 */ +module_param(io, int, 0); /* IO base */ +module_param(irq, int, 0); /* IRQ */ +module_param(dma, int, 0); /* DMA */ +module_param(dma2, int, 0); /* DMA2 */ MODULE_LICENSE("GPL"); |