diff options
Diffstat (limited to 'sound/oss')
-rw-r--r-- | sound/oss/ad1889.c | 2 | ||||
-rw-r--r-- | sound/oss/btaudio.c | 2 | ||||
-rw-r--r-- | sound/oss/cmpci.c | 2 | ||||
-rw-r--r-- | sound/oss/cs4281/cs4281m.c | 2 | ||||
-rw-r--r-- | sound/oss/cs46xx.c | 2 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound.h | 1 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_atari.c | 112 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_awacs.c | 81 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_paula.c | 14 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_q40.c | 18 | ||||
-rw-r--r-- | sound/oss/dmasound/trans_16.c | 1 | ||||
-rw-r--r-- | sound/oss/emu10k1/main.c | 2 | ||||
-rw-r--r-- | sound/oss/es1370.c | 2 | ||||
-rw-r--r-- | sound/oss/es1371.c | 2 | ||||
-rw-r--r-- | sound/oss/esssolo1.c | 2 | ||||
-rw-r--r-- | sound/oss/harmony.c | 4 | ||||
-rw-r--r-- | sound/oss/i810_audio.c | 22 | ||||
-rw-r--r-- | sound/oss/ite8172.c | 2 | ||||
-rw-r--r-- | sound/oss/kahlua.c | 2 | ||||
-rw-r--r-- | sound/oss/maestro.c | 2 | ||||
-rw-r--r-- | sound/oss/nec_vrc5477.c | 2 | ||||
-rw-r--r-- | sound/oss/nm256_audio.c | 2 | ||||
-rw-r--r-- | sound/oss/opl3sa2.c | 2 | ||||
-rw-r--r-- | sound/oss/rme96xx.c | 2 | ||||
-rw-r--r-- | sound/oss/sonicvibes.c | 2 | ||||
-rw-r--r-- | sound/oss/trident.c | 18 | ||||
-rw-r--r-- | sound/oss/ymfpci.c | 2 |
27 files changed, 170 insertions, 137 deletions
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c index 2cfd214e4c2..a0d73f34310 100644 --- a/sound/oss/ad1889.c +++ b/sound/oss/ad1889.c @@ -1089,7 +1089,7 @@ static struct pci_driver ad1889_driver = { static int __init ad1889_init_module(void) { - return pci_module_init(&ad1889_driver); + return pci_register_driver(&ad1889_driver); } static void ad1889_exit_module(void) diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c index a85093fec7b..4007a5680ac 100644 --- a/sound/oss/btaudio.c +++ b/sound/oss/btaudio.c @@ -1101,7 +1101,7 @@ static int btaudio_init_module(void) digital ? "digital" : "", analog && digital ? "+" : "", analog ? "analog" : ""); - return pci_module_init(&btaudio_pci_driver); + return pci_register_driver(&btaudio_pci_driver); } static void btaudio_cleanup_module(void) diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c index 74dcca78c6c..7cfbb08db53 100644 --- a/sound/oss/cmpci.c +++ b/sound/oss/cmpci.c @@ -3366,7 +3366,7 @@ static struct pci_driver cm_driver = { static int __init init_cmpci(void) { printk(KERN_INFO "cmpci: version $Revision: 6.82 $ time " __TIME__ " " __DATE__ "\n"); - return pci_module_init(&cm_driver); + return pci_register_driver(&cm_driver); } static void __exit cleanup_cmpci(void) diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c index 46dd41dc2a3..0720365f643 100644 --- a/sound/oss/cs4281/cs4281m.c +++ b/sound/oss/cs4281/cs4281m.c @@ -4461,7 +4461,7 @@ static int __init cs4281_init_module(void) printk(KERN_INFO "cs4281: version v%d.%02d.%d time " __TIME__ " " __DATE__ "\n", CS4281_MAJOR_VERSION, CS4281_MINOR_VERSION, CS4281_ARCH); - rtn = pci_module_init(&cs4281_pci_driver); + rtn = pci_register_driver(&cs4281_pci_driver); CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO "cs4281: cs4281_init_module()- (%d)\n",rtn)); diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 0da4d93f04a..58e25c82eaf 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -5690,7 +5690,7 @@ static int __init cs46xx_init_module(void) int rtn = 0; CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: cs46xx_init_module()+ \n")); - rtn = pci_module_init(&cs46xx_pci_driver); + rtn = pci_register_driver(&cs46xx_pci_driver); if(rtn == -ENODEV) { diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h index 222014cafc1..a1b0b92af4b 100644 --- a/sound/oss/dmasound/dmasound.h +++ b/sound/oss/dmasound/dmasound.h @@ -270,7 +270,6 @@ extern int dmasound_catchRadius; #define SW_INPUT_VOLUME_SCALE 4 #define SW_INPUT_VOLUME_DEFAULT (128 / SW_INPUT_VOLUME_SCALE) -extern int expand_bal; /* Balance factor for expanding (not volume!) */ extern int expand_read_bal; /* Balance factor for reading */ extern uint software_input_volume; /* software implemented recording volume! */ diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c index 59eb53f8931..dc31373069a 100644 --- a/sound/oss/dmasound/dmasound_atari.c +++ b/sound/oss/dmasound/dmasound_atari.c @@ -67,46 +67,46 @@ static int expand_data; /* Data for expanding */ * ++geert: split in even more functions (one per format) */ -static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); @@ -151,7 +151,7 @@ static int FalconStateInfo(char *buffer, size_t space); /*** Translations ************************************************************/ -static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -176,7 +176,7 @@ static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -194,7 +194,7 @@ static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -217,8 +217,9 @@ static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; *p++ = data ^ 0x8080; count--; } @@ -228,7 +229,7 @@ static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -240,8 +241,9 @@ static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; *p++ = data; *p++ = data; count--; @@ -259,7 +261,7 @@ static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -271,8 +273,9 @@ static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data ^= 0x8000; *p++ = data; *p++ = data; @@ -284,9 +287,10 @@ static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, count = min_t(unsigned long, userCount, frameLeft)>>2; used = count*4; while (count > 0) { - u_long data; - if (get_user(data, ((u_int *)userPtr)++)) + u_int data; + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; *p++ = data ^ 0x80008000; count--; } @@ -296,7 +300,7 @@ static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -309,8 +313,9 @@ static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data); *p++ = data; *p++ = data; @@ -323,8 +328,9 @@ static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, used = count*4; while (count > 0) { u_long data; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data); *p++ = data; count--; @@ -335,7 +341,7 @@ static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -348,8 +354,9 @@ static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data) ^ 0x8000; *p++ = data; *p++ = data; @@ -361,8 +368,9 @@ static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, used = count; while (count > 0) { u_long data; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data) ^ 0x80008000; *p++ = data; count--; @@ -373,7 +381,7 @@ static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -435,7 +443,7 @@ static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -470,8 +478,9 @@ static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; userCount -= 2; bal += hSpeed; } @@ -488,7 +497,7 @@ static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -524,8 +533,9 @@ static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data ^= 0x8080; userCount -= 2; bal += hSpeed; @@ -543,7 +553,7 @@ static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -561,8 +571,9 @@ static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; userCount -= 2; bal += hSpeed; } @@ -579,8 +590,9 @@ static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; userCount -= 4; bal += hSpeed; } @@ -597,7 +609,7 @@ static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -615,8 +627,9 @@ static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data ^= 0x8000; userCount -= 2; bal += hSpeed; @@ -634,8 +647,9 @@ static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; data ^= 0x80008000; userCount -= 4; bal += hSpeed; @@ -653,7 +667,7 @@ static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -671,8 +685,9 @@ static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data); userCount -= 2; bal += hSpeed; @@ -690,8 +705,9 @@ static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data); userCount -= 4; bal += hSpeed; @@ -709,7 +725,7 @@ static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, } -static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -727,8 +743,9 @@ static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data) ^ 0x8000; userCount -= 2; bal += hSpeed; @@ -746,8 +763,9 @@ static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data) ^ 0x80008000; userCount -= 4; bal += hSpeed; diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index cebd881b91a..74f975676cc 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -125,6 +125,7 @@ static int awacs_rate_index; static int awacs_subframe; static struct device_node* awacs_node; static struct device_node* i2s_node; +static struct resource awacs_rsrc[3]; static char awacs_name[64]; static int awacs_revision; @@ -667,9 +668,12 @@ static void PMacIrqCleanup(void) iounmap(awacs_txdma); iounmap(awacs_rxdma); - release_OF_resource(awacs_node, 0); - release_OF_resource(awacs_node, 1); - release_OF_resource(awacs_node, 2); + release_mem_region(awacs_rsrc[0].start, + awacs_rsrc[0].end - awacs_rsrc[0].start + 1); + release_mem_region(awacs_rsrc[1].start, + awacs_rsrc[1].end - awacs_rsrc[1].start + 1); + release_mem_region(awacs_rsrc[2].start, + awacs_rsrc[2].end - awacs_rsrc[2].start + 1); kfree(awacs_tx_cmd_space); kfree(awacs_rx_cmd_space); @@ -2863,46 +2867,58 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n"); * other info if necessary (early AWACS we want to read chip ids) */ - if (io->n_addrs < 3 || io->n_intrs < 3) { + if (of_get_address(io, 2, NULL, NULL) == NULL || io->n_intrs < 3) { /* OK - maybe we need to use the 'awacs' node (on earlier * machines). - */ + */ if (awacs_node) { io = awacs_node ; - if (io->n_addrs < 3 || io->n_intrs < 3) { - printk("dmasound_pmac: can't use %s" - " (%d addrs, %d intrs)\n", - io->full_name, io->n_addrs, io->n_intrs); + if (of_get_address(io, 2, NULL, NULL) == NULL || + io->n_intrs < 3) { + printk("dmasound_pmac: can't use %s\n", + io->full_name); return -ENODEV; } - } else { - printk("dmasound_pmac: can't use %s (%d addrs, %d intrs)\n", - io->full_name, io->n_addrs, io->n_intrs); - } + } else + printk("dmasound_pmac: can't use %s\n", io->full_name); } - if (!request_OF_resource(io, 0, NULL)) { + if (of_address_to_resource(io, 0, &awacs_rsrc[0]) || + request_mem_region(awacs_rsrc[0].start, + awacs_rsrc[0].end - awacs_rsrc[0].start + 1, + " (IO)") == NULL) { printk(KERN_ERR "dmasound: can't request IO resource !\n"); return -ENODEV; } - if (!request_OF_resource(io, 1, " (tx dma)")) { - release_OF_resource(io, 0); - printk(KERN_ERR "dmasound: can't request TX DMA resource !\n"); + if (of_address_to_resource(io, 1, &awacs_rsrc[1]) || + request_mem_region(awacs_rsrc[1].start, + awacs_rsrc[1].end - awacs_rsrc[1].start + 1, + " (tx dma)") == NULL) { + release_mem_region(awacs_rsrc[0].start, + awacs_rsrc[0].end - awacs_rsrc[0].start + 1); + printk(KERN_ERR "dmasound: can't request Tx DMA resource !\n"); return -ENODEV; } - - if (!request_OF_resource(io, 2, " (rx dma)")) { - release_OF_resource(io, 0); - release_OF_resource(io, 1); - printk(KERN_ERR "dmasound: can't request RX DMA resource !\n"); + if (of_address_to_resource(io, 2, &awacs_rsrc[2]) || + request_mem_region(awacs_rsrc[2].start, + awacs_rsrc[2].end - awacs_rsrc[2].start + 1, + " (rx dma)") == NULL) { + release_mem_region(awacs_rsrc[0].start, + awacs_rsrc[0].end - awacs_rsrc[0].start + 1); + release_mem_region(awacs_rsrc[1].start, + awacs_rsrc[1].end - awacs_rsrc[1].start + 1); + printk(KERN_ERR "dmasound: can't request Rx DMA resource !\n"); return -ENODEV; } awacs_beep_dev = input_allocate_device(); if (!awacs_beep_dev) { - release_OF_resource(io, 0); - release_OF_resource(io, 1); - release_OF_resource(io, 2); + release_mem_region(awacs_rsrc[0].start, + awacs_rsrc[0].end - awacs_rsrc[0].start + 1); + release_mem_region(awacs_rsrc[1].start, + awacs_rsrc[1].end - awacs_rsrc[1].start + 1); + release_mem_region(awacs_rsrc[2].start, + awacs_rsrc[2].end - awacs_rsrc[2].start + 1); printk(KERN_ERR "dmasound: can't allocate input device !\n"); return -ENOMEM; } @@ -2916,11 +2932,11 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n"); /* all OF versions I've seen use this value */ if (i2s_node) - i2s = ioremap(io->addrs[0].address, 0x1000); + i2s = ioremap(awacs_rsrc[0].start, 0x1000); else - awacs = ioremap(io->addrs[0].address, 0x1000); - awacs_txdma = ioremap(io->addrs[1].address, 0x100); - awacs_rxdma = ioremap(io->addrs[2].address, 0x100); + awacs = ioremap(awacs_rsrc[0].start, 0x1000); + awacs_txdma = ioremap(awacs_rsrc[1].start, 0x100); + awacs_rxdma = ioremap(awacs_rsrc[2].start, 0x100); /* first of all make sure that the chip is powered up....*/ pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, io, 0, 1); @@ -3083,9 +3099,10 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); struct device_node* mio; macio_base = NULL; for (mio = io->parent; mio; mio = mio->parent) { - if (strcmp(mio->name, "mac-io") == 0 - && mio->n_addrs > 0) { - macio_base = ioremap(mio->addrs[0].address, 0x40); + if (strcmp(mio->name, "mac-io") == 0) { + struct resource r; + if (of_address_to_resource(mio, 0, &r) == 0) + macio_base = ioremap(r.start, 0x40); break; } } diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c index d59f60b2641..494070a3f87 100644 --- a/sound/oss/dmasound/dmasound_paula.c +++ b/sound/oss/dmasound/dmasound_paula.c @@ -34,6 +34,7 @@ #define DMASOUND_PAULA_REVISION 0 #define DMASOUND_PAULA_EDITION 4 +#define custom amiga_custom /* * The minimum period for audio depends on htotal (for OCS/ECS/AGA) * (Imported from arch/m68k/amiga/amisound.c) @@ -156,7 +157,7 @@ static int AmiStateInfo(char *buffer, size_t space); * Native format */ -static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t ami_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { ssize_t count, used; @@ -189,7 +190,7 @@ static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount, */ #define GENERATE_AMI_CT8(funcname, convsample) \ -static ssize_t funcname(const u_char *userPtr, size_t userCount, \ +static ssize_t funcname(const u_char __user *userPtr, size_t userCount, \ u_char frame[], ssize_t *frameUsed, \ ssize_t frameLeft) \ { \ @@ -240,10 +241,11 @@ GENERATE_AMI_CT8(ami_ct_u8, AMI_CT_U8) */ #define GENERATE_AMI_CT_16(funcname, convsample) \ -static ssize_t funcname(const u_char *userPtr, size_t userCount, \ +static ssize_t funcname(const u_char __user *userPtr, size_t userCount, \ u_char frame[], ssize_t *frameUsed, \ ssize_t frameLeft) \ { \ + const u_short __user *ptr = (const u_short __user *)userPtr; \ ssize_t count, used; \ u_short data; \ \ @@ -253,7 +255,7 @@ static ssize_t funcname(const u_char *userPtr, size_t userCount, \ count = min_t(size_t, userCount, frameLeft)>>1 & ~1; \ used = count*2; \ while (count > 0) { \ - if (get_user(data, ((u_short *)userPtr)++)) \ + if (get_user(data, ptr++)) \ return -EFAULT; \ data = convsample(data); \ *high++ = data>>8; \ @@ -268,12 +270,12 @@ static ssize_t funcname(const u_char *userPtr, size_t userCount, \ count = min_t(size_t, userCount, frameLeft)>>2 & ~1; \ used = count*4; \ while (count > 0) { \ - if (get_user(data, ((u_short *)userPtr)++)) \ + if (get_user(data, ptr++)) \ return -EFAULT; \ data = convsample(data); \ *lefth++ = data>>8; \ *leftl++ = (data>>2) & 0x3f; \ - if (get_user(data, ((u_short *)userPtr)++)) \ + if (get_user(data, ptr++)) \ return -EFAULT; \ data = convsample(data); \ *righth++ = data>>8; \ diff --git a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c index 1ddaa6284b0..e2081f32b0c 100644 --- a/sound/oss/dmasound/dmasound_q40.c +++ b/sound/oss/dmasound/dmasound_q40.c @@ -58,7 +58,7 @@ static void Q40Interrupt(void); /* userCount, frameUsed, frameLeft == byte counts */ -static ssize_t q40_ct_law(const u_char *userPtr, size_t userCount, +static ssize_t q40_ct_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -79,7 +79,7 @@ static ssize_t q40_ct_law(const u_char *userPtr, size_t userCount, } -static ssize_t q40_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -98,7 +98,7 @@ static ssize_t q40_ct_s8(const u_char *userPtr, size_t userCount, return used; } -static ssize_t q40_ct_u8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ct_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -114,7 +114,7 @@ static ssize_t q40_ct_u8(const u_char *userPtr, size_t userCount, /* a bit too complicated to optimise right now ..*/ -static ssize_t q40_ctx_law(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctx_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -152,7 +152,7 @@ static ssize_t q40_ctx_law(const u_char *userPtr, size_t userCount, } -static ssize_t q40_ctx_s8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctx_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -189,7 +189,7 @@ static ssize_t q40_ctx_s8(const u_char *userPtr, size_t userCount, } -static ssize_t q40_ctx_u8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctx_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -224,7 +224,7 @@ static ssize_t q40_ctx_u8(const u_char *userPtr, size_t userCount, } /* compressing versions */ -static ssize_t q40_ctc_law(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctc_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -265,7 +265,7 @@ static ssize_t q40_ctc_law(const u_char *userPtr, size_t userCount, } -static ssize_t q40_ctc_s8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctc_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -304,7 +304,7 @@ static ssize_t q40_ctc_s8(const u_char *userPtr, size_t userCount, } -static ssize_t q40_ctc_u8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctc_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { diff --git a/sound/oss/dmasound/trans_16.c b/sound/oss/dmasound/trans_16.c index 23562e94780..ca973ac2a30 100644 --- a/sound/oss/dmasound/trans_16.c +++ b/sound/oss/dmasound/trans_16.c @@ -17,6 +17,7 @@ #include <asm/uaccess.h> #include "dmasound.h" +extern int expand_bal; /* Balance factor for expanding (not volume!) */ static short dmasound_alaw2dma16[] ; static short dmasound_ulaw2dma16[] ; diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c index 9b905bae423..23241cbdd90 100644 --- a/sound/oss/emu10k1/main.c +++ b/sound/oss/emu10k1/main.c @@ -1428,7 +1428,7 @@ static int __init emu10k1_init_module(void) { printk(KERN_INFO "Creative EMU10K1 PCI Audio Driver, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n"); - return pci_module_init(&emu10k1_pci_driver); + return pci_register_driver(&emu10k1_pci_driver); } static void __exit emu10k1_cleanup_module(void) diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c index 8538085086e..ae55c536613 100644 --- a/sound/oss/es1370.c +++ b/sound/oss/es1370.c @@ -2779,7 +2779,7 @@ static struct pci_driver es1370_driver = { static int __init init_es1370(void) { printk(KERN_INFO "es1370: version v0.38 time " __TIME__ " " __DATE__ "\n"); - return pci_module_init(&es1370_driver); + return pci_register_driver(&es1370_driver); } static void __exit cleanup_es1370(void) diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index 12a56d5ab49..5c697f16257 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c @@ -3090,7 +3090,7 @@ static struct pci_driver es1371_driver = { static int __init init_es1371(void) { printk(KERN_INFO PFX "version v0.32 time " __TIME__ " " __DATE__ "\n"); - return pci_module_init(&es1371_driver); + return pci_register_driver(&es1371_driver); } static void __exit cleanup_es1371(void) diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c index a4ecab2f052..849b59f67ef 100644 --- a/sound/oss/esssolo1.c +++ b/sound/oss/esssolo1.c @@ -515,7 +515,7 @@ static inline int prog_dmabuf_adc(struct solo1_state *s) return 0; } -static inline int prog_dmabuf_dac(struct solo1_state *s) +static int prog_dmabuf_dac(struct solo1_state *s) { unsigned long va; int c; diff --git a/sound/oss/harmony.c b/sound/oss/harmony.c index bee9d344cd2..591683c55f2 100644 --- a/sound/oss/harmony.c +++ b/sound/oss/harmony.c @@ -1236,7 +1236,7 @@ harmony_driver_probe(struct parisc_device *dev) } /* Set the HPA of harmony */ - harmony.hpa = (struct harmony_hpa *)dev->hpa; + harmony.hpa = (struct harmony_hpa *)dev->hpa.start; harmony.dev = dev; /* Grab the ID and revision from the device */ @@ -1250,7 +1250,7 @@ harmony_driver_probe(struct parisc_device *dev) printk(KERN_INFO "Lasi Harmony Audio driver " HARMONY_VERSION ", " "h/w id %i, rev. %i at 0x%lx, IRQ %i\n", - id, rev, dev->hpa, harmony.dev->irq); + id, rev, dev->hpa.start, harmony.dev->irq); /* Make sure the control bit isn't set, although I don't think it ever is. */ diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c index b9a640fe48b..abc242abd5b 100644 --- a/sound/oss/i810_audio.c +++ b/sound/oss/i810_audio.c @@ -312,7 +312,8 @@ static struct pci_device_id i810_pci_tbl [] = { PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4}, {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_18, PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4}, - + {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_AUDIO, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, NVIDIA_NFORCE}, {0,} }; @@ -3359,12 +3360,6 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device goto out_region2; } - if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ, - card_names[pci_id->driver_data], card)) { - printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq); - goto out_pio; - } - if (card->use_mmio) { if (request_mem_region(card->ac97base_mmio_phys, 512, "ich_audio MMBAR")) { if ((card->ac97base_mmio = ioremap(card->ac97base_mmio_phys, 512))) { /*@FIXME can ioremap fail? don't know (jsaw) */ @@ -3395,10 +3390,8 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device } /* initialize AC97 codec and register /dev/mixer */ - if (i810_ac97_init(card) <= 0) { - free_irq(card->irq, card); + if (i810_ac97_init(card) <= 0) goto out_iospace; - } pci_set_drvdata(pci_dev, card); if(clocking == 0) { @@ -3410,7 +3403,6 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device if ((card->dev_audio = register_sound_dsp(&i810_audio_fops, -1)) < 0) { int i; printk(KERN_ERR "i810_audio: couldn't register DSP device!\n"); - free_irq(card->irq, card); for (i = 0; i < NR_AC97; i++) if (card->ac97_codec[i] != NULL) { unregister_sound_mixer(card->ac97_codec[i]->dev_mixer); @@ -3419,6 +3411,13 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device goto out_iospace; } + if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ, + card_names[pci_id->driver_data], card)) { + printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq); + goto out_iospace; + } + + card->initializing = 0; return 0; @@ -3429,7 +3428,6 @@ out_iospace: release_mem_region(card->ac97base_mmio_phys, 512); release_mem_region(card->iobase_mmio_phys, 256); } -out_pio: release_region(card->ac97base, 256); out_region2: release_region(card->iobase, 64); diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c index 26e5944b6ba..8fd2f9a9e66 100644 --- a/sound/oss/ite8172.c +++ b/sound/oss/ite8172.c @@ -2206,7 +2206,7 @@ static struct pci_driver it8172_driver = { static int __init init_it8172(void) { info("version v0.5 time " __TIME__ " " __DATE__); - return pci_module_init(&it8172_driver); + return pci_register_driver(&it8172_driver); } static void __exit cleanup_it8172(void) diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c index 808c5ef969b..2835a7c038e 100644 --- a/sound/oss/kahlua.c +++ b/sound/oss/kahlua.c @@ -218,7 +218,7 @@ static struct pci_driver kahlua_driver = { static int __init kahlua_init_module(void) { printk(KERN_INFO "Cyrix Kahlua VSA1 XpressAudio support (c) Copyright 2003 Red Hat Inc\n"); - return pci_module_init(&kahlua_driver); + return pci_register_driver(&kahlua_driver); } static void __devexit kahlua_cleanup_module(void) diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c index f9ac5b16f61..d4b569acf76 100644 --- a/sound/oss/maestro.c +++ b/sound/oss/maestro.c @@ -3624,7 +3624,7 @@ static int __init init_maestro(void) { int rc; - rc = pci_module_init(&maestro_pci_driver); + rc = pci_register_driver(&maestro_pci_driver); if (rc < 0) return rc; diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c index 9ac4bf7e1e8..fbb9170e8e0 100644 --- a/sound/oss/nec_vrc5477.c +++ b/sound/oss/nec_vrc5477.c @@ -2045,7 +2045,7 @@ static struct pci_driver vrc5477_ac97_driver = { static int __init init_vrc5477_ac97(void) { printk("Vrc5477 AC97 driver: version v0.2 time " __TIME__ " " __DATE__ " by Jun Sun\n"); - return pci_module_init(&vrc5477_ac97_driver); + return pci_register_driver(&vrc5477_ac97_driver); } static void __exit cleanup_vrc5477_ac97(void) diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c index 42d8f05689c..7de079b202f 100644 --- a/sound/oss/nm256_audio.c +++ b/sound/oss/nm256_audio.c @@ -1644,7 +1644,7 @@ module_param(force_load, bool, 0); static int __init do_init_nm256(void) { printk (KERN_INFO "NeoMagic 256AV/256ZX audio driver, version 1.1p\n"); - return pci_module_init(&nm256_pci_driver); + return pci_register_driver(&nm256_pci_driver); } static void __exit cleanup_nm256 (void) diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c index 5cecdbcbea9..0e161c6a047 100644 --- a/sound/oss/opl3sa2.c +++ b/sound/oss/opl3sa2.c @@ -530,7 +530,7 @@ static void __init attach_opl3sa2_mss(struct address_info* hw_config, struct res if (hw_config->slots[0] != -1) { /* Did the MSS driver install? */ if(num_mixers == (initial_mixers + 1)) { - /* The MSS mixer is installed, reroute mixers appropiately */ + /* The MSS mixer is installed, reroute mixers appropriately */ AD1848_REROUTE(SOUND_MIXER_LINE1, SOUND_MIXER_CD); AD1848_REROUTE(SOUND_MIXER_LINE2, SOUND_MIXER_SYNTH); AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE); diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c index 318dc51009f..faa0b7919b6 100644 --- a/sound/oss/rme96xx.c +++ b/sound/oss/rme96xx.c @@ -1095,7 +1095,7 @@ static int __init init_rme96xx(void) devices = ((devices-1) & RME96xx_MASK_DEVS) + 1; printk(KERN_INFO RME_MESS" reserving %d dsp device(s)\n",devices); numcards = 0; - return pci_module_init(&rme96xx_driver); + return pci_register_driver(&rme96xx_driver); } static void __exit cleanup_rme96xx(void) diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c index 17d0e461f8d..71b05e2f697 100644 --- a/sound/oss/sonicvibes.c +++ b/sound/oss/sonicvibes.c @@ -2765,7 +2765,7 @@ static int __init init_sonicvibes(void) if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT))) printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n"); #endif - return pci_module_init(&sv_driver); + return pci_register_driver(&sv_driver); } static void __exit cleanup_sonicvibes(void) diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 5f0ad6bb43b..a21c663e7e1 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c @@ -278,16 +278,14 @@ static char *card_names[] = { }; static struct pci_device_id trident_pci_tbl[] = { - {PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_DX}, - {PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_NX}, - {PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018}, - {PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_ALI_5451, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, ALI_5451}, - {PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5050, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, CYBER5050}, + {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), + PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TRIDENT_4D_DX}, + {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), + 0, 0, TRIDENT_4D_NX}, + {PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018), 0, 0, SIS_7018}, + {PCI_DEVICE(PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_ALI_5451), 0, 0, ALI_5451}, + {PCI_DEVICE(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5050), + 0, 0, CYBER5050}, {0,} }; diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c index 8dae59bd05a..f8bd72e46f5 100644 --- a/sound/oss/ymfpci.c +++ b/sound/oss/ymfpci.c @@ -2680,7 +2680,7 @@ static struct pci_driver ymfpci_driver = { static int __init ymf_init_module(void) { - return pci_module_init(&ymfpci_driver); + return pci_register_driver(&ymfpci_driver); } static void __exit ymf_cleanup_module (void) |