X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fmaestro.c;h=52d2db4bc312fadeddff95c9f1d8d0f3fba80823;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=4a670f4e4d3ae14e705d994951c171a9aac9e4e5;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c index 4a670f4e4..52d2db4bc 100644 --- a/sound/oss/maestro.c +++ b/sound/oss/maestro.c @@ -262,11 +262,11 @@ MODULE_DESCRIPTION("ESS Maestro Driver"); MODULE_LICENSE("GPL"); #ifdef M_DEBUG -MODULE_PARM(debug,"i"); +module_param(debug, bool, 0644); #endif -MODULE_PARM(dsps_order,"i"); -MODULE_PARM(use_pm,"i"); -MODULE_PARM(clocking, "i"); +module_param(dsps_order, int, 0); +module_param(use_pm, int, 0); +module_param(clocking, int, 0); /* --------------------------------------------------------------------- */ #define DRIVER_VERSION "0.15" @@ -344,7 +344,7 @@ enum { /* these masks indicate which units we care about at which states */ -u16 acpi_state_mask[] = { +static u16 acpi_state_mask[] = { [ACPI_D0] = ACPI_ALL, [ACPI_D1] = ACPI_SLEEP, [ACPI_D2] = ACPI_SLEEP, @@ -610,7 +610,7 @@ static u16 maestro_ac97_get(struct ess_card *card, u8 cmd) be sure to fill it in if you add oss mixers to anyone's supported mixer defines */ - unsigned int mixer_defaults[SOUND_MIXER_NRDEVICES] = { +static unsigned int mixer_defaults[SOUND_MIXER_NRDEVICES] = { [SOUND_MIXER_VOLUME] = 0x3232, [SOUND_MIXER_BASS] = 0x3232, [SOUND_MIXER_TREBLE] = 0x3232, @@ -2158,7 +2158,7 @@ static int ess_open_mixdev(struct inode *inode, struct file *file) if (!card) return -ENODEV; file->private_data = card; - return 0; + return nonseekable_open(inode, file); } static int ess_release_mixdev(struct inode *inode, struct file *file) @@ -2274,8 +2274,6 @@ ess_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) unsigned char *combbuf = NULL; VALIDATE_STATE(s); - if (ppos != &file->f_pos) - return -ESPIPE; if (s->dma_adc.mapped) return -ENXIO; if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1))) @@ -2372,8 +2370,6 @@ ess_write(struct file *file, const char __user *buffer, size_t count, loff_t *pp int cnt; VALIDATE_STATE(s); - if (ppos != &file->f_pos) - return -ESPIPE; if (s->dma_dac.mapped) return -ENXIO; if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0))) @@ -2524,7 +2520,9 @@ static int ess_mmap(struct file *file, struct vm_area_struct *vma) if (size > (PAGE_SIZE << db->buforder)) goto out; ret = -EAGAIN; - if (remap_page_range(vma, vma->vm_start, virt_to_phys(db->rawbuf), size, vma->vm_page_prot)) + if (remap_pfn_range(vma, vma->vm_start, + virt_to_phys(db->rawbuf) >> PAGE_SHIFT, + size, vma->vm_page_prot)) goto out; db->mapped = 1; ret = 0; @@ -2957,7 +2955,7 @@ allocate_buffers(struct ess_state *s) } - /* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */ + /* now mark the pages as reserved; otherwise remap_pfn_range doesn't do what we want */ pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1); for (page = virt_to_page(rawbuf); page <= pend; page++) SetPageReserved(page); @@ -3082,7 +3080,7 @@ ess_open(struct inode *inode, struct file *file) s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE); up(&s->open_sem); - return 0; + return nonseekable_open(inode, file); } static int @@ -3365,7 +3363,7 @@ maestro_config(struct ess_card *card) /* this guy tries to find the pci power management * register bank. this should really be in core * code somewhere. 1 on success. */ -int +static int parse_power(struct ess_card *card, struct pci_dev *pcidev) { u32 n; @@ -3631,7 +3629,7 @@ static struct pci_driver maestro_pci_driver = { .remove = maestro_remove, }; -int __init init_maestro(void) +static int __init init_maestro(void) { int rc; @@ -3668,7 +3666,7 @@ static int maestro_notifier(struct notifier_block *nb, unsigned long event, void /* --------------------------------------------------------------------- */ -void cleanup_maestro(void) { +static void cleanup_maestro(void) { M_printk("maestro: unloading\n"); pci_unregister_driver(&maestro_pci_driver); pm_unregister_all(maestro_pm_callback);