aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-01-27 17:18:29 -0500
committerLen Brown <len.brown@intel.com>2006-01-27 17:18:29 -0500
commit292dd876ee765c478b27c93cc51e93a558ed58bf (patch)
tree5b740e93253295baee2a9c414a6c66d03d44a9ef /sound
parentd4ec6c7cc9a15a7a529719bc3b84f46812f9842e (diff)
parent9fdb62af92c741addbea15545f214a6e89460865 (diff)
Pull release into acpica branch
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/aaci.c2
-rw-r--r--sound/core/oss/pcm_oss.c2
-rw-r--r--sound/core/seq/seq_memory.c4
-rw-r--r--sound/isa/wavefront/wavefront_synth.c7
-rw-r--r--sound/oss/ad1889.c2
-rw-r--r--sound/oss/btaudio.c2
-rw-r--r--sound/oss/cmpci.c2
-rw-r--r--sound/oss/cs4281/cs4281m.c2
-rw-r--r--sound/oss/cs46xx.c2
-rw-r--r--sound/oss/dmasound/dmasound.h1
-rw-r--r--sound/oss/dmasound/dmasound_atari.c112
-rw-r--r--sound/oss/dmasound/dmasound_awacs.c81
-rw-r--r--sound/oss/dmasound/dmasound_paula.c14
-rw-r--r--sound/oss/dmasound/dmasound_q40.c18
-rw-r--r--sound/oss/dmasound/trans_16.c1
-rw-r--r--sound/oss/emu10k1/main.c2
-rw-r--r--sound/oss/es1370.c2
-rw-r--r--sound/oss/es1371.c2
-rw-r--r--sound/oss/esssolo1.c2
-rw-r--r--sound/oss/harmony.c4
-rw-r--r--sound/oss/i810_audio.c22
-rw-r--r--sound/oss/ite8172.c2
-rw-r--r--sound/oss/kahlua.c2
-rw-r--r--sound/oss/maestro.c2
-rw-r--r--sound/oss/nec_vrc5477.c2
-rw-r--r--sound/oss/nm256_audio.c2
-rw-r--r--sound/oss/opl3sa2.c2
-rw-r--r--sound/oss/rme96xx.c2
-rw-r--r--sound/oss/sonicvibes.c2
-rw-r--r--sound/oss/trident.c18
-rw-r--r--sound/oss/ymfpci.c2
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c2
-rw-r--r--sound/pci/emu10k1/emufx.c1
-rw-r--r--sound/pci/es1968.c4
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c2
-rw-r--r--sound/ppc/pmac.c100
-rw-r--r--sound/ppc/pmac.h3
-rw-r--r--sound/sparc/cs4231.c3
38 files changed, 243 insertions, 194 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index 5e9a81ab990b..54147c1f6361 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -17,11 +17,11 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/amba/bus.h>
20 21
21#include <asm/io.h> 22#include <asm/io.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <asm/sizes.h> 24#include <asm/sizes.h>
24#include <asm/hardware/amba.h>
25 25
26#include <sound/driver.h> 26#include <sound/driver.h>
27#include <sound/core.h> 27#include <sound/core.h>
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 16df1246a131..7fd072392c7e 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2135,9 +2135,7 @@ static ssize_t snd_pcm_oss_write(struct file *file, const char __user *buf, size
2135 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; 2135 substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
2136 if (substream == NULL) 2136 if (substream == NULL)
2137 return -ENXIO; 2137 return -ENXIO;
2138 up(&file->f_dentry->d_inode->i_sem);
2139 result = snd_pcm_oss_write1(substream, buf, count); 2138 result = snd_pcm_oss_write1(substream, buf, count);
2140 down(&file->f_dentry->d_inode->i_sem);
2141#ifdef OSS_DEBUG 2139#ifdef OSS_DEBUG
2142 printk("pcm_oss: write %li bytes (wrote %li bytes)\n", (long)count, (long)result); 2140 printk("pcm_oss: write %li bytes (wrote %li bytes)\n", (long)count, (long)result);
2143#endif 2141#endif
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index 9ee6c177db0c..40b4f679c80e 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -32,10 +32,6 @@
32#include "seq_info.h" 32#include "seq_info.h"
33#include "seq_lock.h" 33#include "seq_lock.h"
34 34
35/* semaphore in struct file record */
36#define semaphore_of(fp) ((fp)->f_dentry->d_inode->i_sem)
37
38
39static inline int snd_seq_pool_available(struct snd_seq_pool *pool) 35static inline int snd_seq_pool_available(struct snd_seq_pool *pool)
40{ 36{
41 return pool->total_elements - atomic_read(&pool->counter); 37 return pool->total_elements - atomic_read(&pool->counter);
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 679d0ae97e4f..ed81eec6e732 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -115,18 +115,11 @@ MODULE_PARM_DESC(osrun_time, "how many seconds to wait for the ICS2115 OS");
115 115
116#ifdef WF_DEBUG 116#ifdef WF_DEBUG
117 117
118#if defined(NEW_MACRO_VARARGS) || __GNUC__ >= 3
119#define DPRINT(cond, ...) \ 118#define DPRINT(cond, ...) \
120 if ((dev->debug & (cond)) == (cond)) { \ 119 if ((dev->debug & (cond)) == (cond)) { \
121 snd_printk (__VA_ARGS__); \ 120 snd_printk (__VA_ARGS__); \
122 } 121 }
123#else 122#else
124#define DPRINT(cond, args...) \
125 if ((dev->debug & (cond)) == (cond)) { \
126 snd_printk (args); \
127 }
128#endif
129#else
130#define DPRINT(cond, args...) 123#define DPRINT(cond, args...)
131#endif /* WF_DEBUG */ 124#endif /* WF_DEBUG */
132 125
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 2cfd214e4c2a..a0d73f343100 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -1089,7 +1089,7 @@ static struct pci_driver ad1889_driver = {
1089 1089
1090static int __init ad1889_init_module(void) 1090static int __init ad1889_init_module(void)
1091{ 1091{
1092 return pci_module_init(&ad1889_driver); 1092 return pci_register_driver(&ad1889_driver);
1093} 1093}
1094 1094
1095static void ad1889_exit_module(void) 1095static void ad1889_exit_module(void)
diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c
index a85093fec7be..4007a5680acb 100644
--- a/sound/oss/btaudio.c
+++ b/sound/oss/btaudio.c
@@ -1101,7 +1101,7 @@ static int btaudio_init_module(void)
1101 digital ? "digital" : "", 1101 digital ? "digital" : "",
1102 analog && digital ? "+" : "", 1102 analog && digital ? "+" : "",
1103 analog ? "analog" : ""); 1103 analog ? "analog" : "");
1104 return pci_module_init(&btaudio_pci_driver); 1104 return pci_register_driver(&btaudio_pci_driver);
1105} 1105}
1106 1106
1107static void btaudio_cleanup_module(void) 1107static void btaudio_cleanup_module(void)
diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c
index 74dcca78c6c0..7cfbb08db537 100644
--- a/sound/oss/cmpci.c
+++ b/sound/oss/cmpci.c
@@ -3366,7 +3366,7 @@ static struct pci_driver cm_driver = {
3366static int __init init_cmpci(void) 3366static int __init init_cmpci(void)
3367{ 3367{
3368 printk(KERN_INFO "cmpci: version $Revision: 6.82 $ time " __TIME__ " " __DATE__ "\n"); 3368 printk(KERN_INFO "cmpci: version $Revision: 6.82 $ time " __TIME__ " " __DATE__ "\n");
3369 return pci_module_init(&cm_driver); 3369 return pci_register_driver(&cm_driver);
3370} 3370}
3371 3371
3372static void __exit cleanup_cmpci(void) 3372static void __exit cleanup_cmpci(void)
diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
index 46dd41dc2a34..0720365f6438 100644
--- a/sound/oss/cs4281/cs4281m.c
+++ b/sound/oss/cs4281/cs4281m.c
@@ -4461,7 +4461,7 @@ static int __init cs4281_init_module(void)
4461 printk(KERN_INFO "cs4281: version v%d.%02d.%d time " __TIME__ " " 4461 printk(KERN_INFO "cs4281: version v%d.%02d.%d time " __TIME__ " "
4462 __DATE__ "\n", CS4281_MAJOR_VERSION, CS4281_MINOR_VERSION, 4462 __DATE__ "\n", CS4281_MAJOR_VERSION, CS4281_MINOR_VERSION,
4463 CS4281_ARCH); 4463 CS4281_ARCH);
4464 rtn = pci_module_init(&cs4281_pci_driver); 4464 rtn = pci_register_driver(&cs4281_pci_driver);
4465 4465
4466 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, 4466 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2,
4467 printk(KERN_INFO "cs4281: cs4281_init_module()- (%d)\n",rtn)); 4467 printk(KERN_INFO "cs4281: cs4281_init_module()- (%d)\n",rtn));
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index 0da4d93f04a6..58e25c82eaf2 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -5690,7 +5690,7 @@ static int __init cs46xx_init_module(void)
5690 int rtn = 0; 5690 int rtn = 0;
5691 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO 5691 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO
5692 "cs46xx: cs46xx_init_module()+ \n")); 5692 "cs46xx: cs46xx_init_module()+ \n"));
5693 rtn = pci_module_init(&cs46xx_pci_driver); 5693 rtn = pci_register_driver(&cs46xx_pci_driver);
5694 5694
5695 if(rtn == -ENODEV) 5695 if(rtn == -ENODEV)
5696 { 5696 {
diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
index 222014cafc1a..a1b0b92af4b5 100644
--- a/sound/oss/dmasound/dmasound.h
+++ b/sound/oss/dmasound/dmasound.h
@@ -270,7 +270,6 @@ extern int dmasound_catchRadius;
270#define SW_INPUT_VOLUME_SCALE 4 270#define SW_INPUT_VOLUME_SCALE 4
271#define SW_INPUT_VOLUME_DEFAULT (128 / SW_INPUT_VOLUME_SCALE) 271#define SW_INPUT_VOLUME_DEFAULT (128 / SW_INPUT_VOLUME_SCALE)
272 272
273extern int expand_bal; /* Balance factor for expanding (not volume!) */
274extern int expand_read_bal; /* Balance factor for reading */ 273extern int expand_read_bal; /* Balance factor for reading */
275extern uint software_input_volume; /* software implemented recording volume! */ 274extern uint software_input_volume; /* software implemented recording volume! */
276 275
diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
index 59eb53f89318..dc31373069a5 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 */
67 * ++geert: split in even more functions (one per format) 67 * ++geert: split in even more functions (one per format)
68 */ 68 */
69 69
70static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, 70static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount,
71 u_char frame[], ssize_t *frameUsed, 71 u_char frame[], ssize_t *frameUsed,
72 ssize_t frameLeft); 72 ssize_t frameLeft);
73static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, 73static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount,
74 u_char frame[], ssize_t *frameUsed, 74 u_char frame[], ssize_t *frameUsed,
75 ssize_t frameLeft); 75 ssize_t frameLeft);
76static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, 76static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount,
77 u_char frame[], ssize_t *frameUsed, 77 u_char frame[], ssize_t *frameUsed,
78 ssize_t frameLeft); 78 ssize_t frameLeft);
79static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, 79static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount,
80 u_char frame[], ssize_t *frameUsed, 80 u_char frame[], ssize_t *frameUsed,
81 ssize_t frameLeft); 81 ssize_t frameLeft);
82static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, 82static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount,
83 u_char frame[], ssize_t *frameUsed, 83 u_char frame[], ssize_t *frameUsed,
84 ssize_t frameLeft); 84 ssize_t frameLeft);
85static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, 85static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount,
86 u_char frame[], ssize_t *frameUsed, 86 u_char frame[], ssize_t *frameUsed,
87 ssize_t frameLeft); 87 ssize_t frameLeft);
88static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, 88static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount,
89 u_char frame[], ssize_t *frameUsed, 89 u_char frame[], ssize_t *frameUsed,
90 ssize_t frameLeft); 90 ssize_t frameLeft);
91static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, 91static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount,
92 u_char frame[], ssize_t *frameUsed, 92 u_char frame[], ssize_t *frameUsed,
93 ssize_t frameLeft); 93 ssize_t frameLeft);
94static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, 94static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount,
95 u_char frame[], ssize_t *frameUsed, 95 u_char frame[], ssize_t *frameUsed,
96 ssize_t frameLeft); 96 ssize_t frameLeft);
97static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, 97static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount,
98 u_char frame[], ssize_t *frameUsed, 98 u_char frame[], ssize_t *frameUsed,
99 ssize_t frameLeft); 99 ssize_t frameLeft);
100static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, 100static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount,
101 u_char frame[], ssize_t *frameUsed, 101 u_char frame[], ssize_t *frameUsed,
102 ssize_t frameLeft); 102 ssize_t frameLeft);
103static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, 103static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount,
104 u_char frame[], ssize_t *frameUsed, 104 u_char frame[], ssize_t *frameUsed,
105 ssize_t frameLeft); 105 ssize_t frameLeft);
106static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, 106static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount,
107 u_char frame[], ssize_t *frameUsed, 107 u_char frame[], ssize_t *frameUsed,
108 ssize_t frameLeft); 108 ssize_t frameLeft);
109static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, 109static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount,
110 u_char frame[], ssize_t *frameUsed, 110 u_char frame[], ssize_t *frameUsed,
111 ssize_t frameLeft); 111 ssize_t frameLeft);
112 112
@@ -151,7 +151,7 @@ static int FalconStateInfo(char *buffer, size_t space);
151/*** Translations ************************************************************/ 151/*** Translations ************************************************************/
152 152
153 153
154static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, 154static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount,
155 u_char frame[], ssize_t *frameUsed, 155 u_char frame[], ssize_t *frameUsed,
156 ssize_t frameLeft) 156 ssize_t frameLeft)
157{ 157{
@@ -176,7 +176,7 @@ static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount,
176} 176}
177 177
178 178
179static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, 179static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount,
180 u_char frame[], ssize_t *frameUsed, 180 u_char frame[], ssize_t *frameUsed,
181 ssize_t frameLeft) 181 ssize_t frameLeft)
182{ 182{
@@ -194,7 +194,7 @@ static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount,
194} 194}
195 195
196 196
197static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, 197static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount,
198 u_char frame[], ssize_t *frameUsed, 198 u_char frame[], ssize_t *frameUsed,
199 ssize_t frameLeft) 199 ssize_t frameLeft)
200{ 200{
@@ -217,8 +217,9 @@ static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount,
217 used = count*2; 217 used = count*2;
218 while (count > 0) { 218 while (count > 0) {
219 u_short data; 219 u_short data;
220 if (get_user(data, ((u_short *)userPtr)++)) 220 if (get_user(data, (u_short __user *)userPtr))
221 return -EFAULT; 221 return -EFAULT;
222 userPtr += 2;
222 *p++ = data ^ 0x8080; 223 *p++ = data ^ 0x8080;
223 count--; 224 count--;
224 } 225 }
@@ -228,7 +229,7 @@ static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount,
228} 229}
229 230
230 231
231static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, 232static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount,
232 u_char frame[], ssize_t *frameUsed, 233 u_char frame[], ssize_t *frameUsed,
233 ssize_t frameLeft) 234 ssize_t frameLeft)
234{ 235{
@@ -240,8 +241,9 @@ static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount,
240 used = count*2; 241 used = count*2;
241 while (count > 0) { 242 while (count > 0) {
242 u_short data; 243 u_short data;
243 if (get_user(data, ((u_short *)userPtr)++)) 244 if (get_user(data, (u_short __user *)userPtr))
244 return -EFAULT; 245 return -EFAULT;
246 userPtr += 2;
245 *p++ = data; 247 *p++ = data;
246 *p++ = data; 248 *p++ = data;
247 count--; 249 count--;
@@ -259,7 +261,7 @@ static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount,
259} 261}
260 262
261 263
262static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, 264static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount,
263 u_char frame[], ssize_t *frameUsed, 265 u_char frame[], ssize_t *frameUsed,
264 ssize_t frameLeft) 266 ssize_t frameLeft)
265{ 267{
@@ -271,8 +273,9 @@ static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount,
271 used = count*2; 273 used = count*2;
272 while (count > 0) { 274 while (count > 0) {
273 u_short data; 275 u_short data;
274 if (get_user(data, ((u_short *)userPtr)++)) 276 if (get_user(data, (u_short __user *)userPtr))
275 return -EFAULT; 277 return -EFAULT;
278 userPtr += 2;
276 data ^= 0x8000; 279 data ^= 0x8000;
277 *p++ = data; 280 *p++ = data;
278 *p++ = data; 281 *p++ = data;
@@ -284,9 +287,10 @@ static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount,
284 count = min_t(unsigned long, userCount, frameLeft)>>2; 287 count = min_t(unsigned long, userCount, frameLeft)>>2;
285 used = count*4; 288 used = count*4;
286 while (count > 0) { 289 while (count > 0) {
287 u_long data; 290 u_int data;
288 if (get_user(data, ((u_int *)userPtr)++)) 291 if (get_user(data, (u_int __user *)userPtr))
289 return -EFAULT; 292 return -EFAULT;
293 userPtr += 4;
290 *p++ = data ^ 0x80008000; 294 *p++ = data ^ 0x80008000;
291 count--; 295 count--;
292 } 296 }
@@ -296,7 +300,7 @@ static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount,
296} 300}
297 301
298 302
299static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, 303static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount,
300 u_char frame[], ssize_t *frameUsed, 304 u_char frame[], ssize_t *frameUsed,
301 ssize_t frameLeft) 305 ssize_t frameLeft)
302{ 306{
@@ -309,8 +313,9 @@ static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount,
309 used = count*2; 313 used = count*2;
310 while (count > 0) { 314 while (count > 0) {
311 u_short data; 315 u_short data;
312 if (get_user(data, ((u_short *)userPtr)++)) 316 if (get_user(data, (u_short __user *)userPtr))
313 return -EFAULT; 317 return -EFAULT;
318 userPtr += 2;
314 data = le2be16(data); 319 data = le2be16(data);
315 *p++ = data; 320 *p++ = data;
316 *p++ = data; 321 *p++ = data;
@@ -323,8 +328,9 @@ static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount,
323 used = count*4; 328 used = count*4;
324 while (count > 0) { 329 while (count > 0) {
325 u_long data; 330 u_long data;
326 if (get_user(data, ((u_int *)userPtr)++)) 331 if (get_user(data, (u_int __user *)userPtr))
327 return -EFAULT; 332 return -EFAULT;
333 userPtr += 4;
328 data = le2be16dbl(data); 334 data = le2be16dbl(data);
329 *p++ = data; 335 *p++ = data;
330 count--; 336 count--;
@@ -335,7 +341,7 @@ static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount,
335} 341}
336 342
337 343
338static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, 344static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount,
339 u_char frame[], ssize_t *frameUsed, 345 u_char frame[], ssize_t *frameUsed,
340 ssize_t frameLeft) 346 ssize_t frameLeft)
341{ 347{
@@ -348,8 +354,9 @@ static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount,
348 used = count*2; 354 used = count*2;
349 while (count > 0) { 355 while (count > 0) {
350 u_short data; 356 u_short data;
351 if (get_user(data, ((u_short *)userPtr)++)) 357 if (get_user(data, (u_short __user *)userPtr))
352 return -EFAULT; 358 return -EFAULT;
359 userPtr += 2;
353 data = le2be16(data) ^ 0x8000; 360 data = le2be16(data) ^ 0x8000;
354 *p++ = data; 361 *p++ = data;
355 *p++ = data; 362 *p++ = data;
@@ -361,8 +368,9 @@ static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount,
361 used = count; 368 used = count;
362 while (count > 0) { 369 while (count > 0) {
363 u_long data; 370 u_long data;
364 if (get_user(data, ((u_int *)userPtr)++)) 371 if (get_user(data, (u_int __user *)userPtr))
365 return -EFAULT; 372 return -EFAULT;
373 userPtr += 4;
366 data = le2be16dbl(data) ^ 0x80008000; 374 data = le2be16dbl(data) ^ 0x80008000;
367 *p++ = data; 375 *p++ = data;
368 count--; 376 count--;
@@ -373,7 +381,7 @@ static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount,
373} 381}
374 382
375 383
376static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, 384static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount,
377 u_char frame[], ssize_t *frameUsed, 385 u_char frame[], ssize_t *frameUsed,
378 ssize_t frameLeft) 386 ssize_t frameLeft)
379{ 387{
@@ -435,7 +443,7 @@ static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount,
435} 443}
436 444
437 445
438static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, 446static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount,
439 u_char frame[], ssize_t *frameUsed, 447 u_char frame[], ssize_t *frameUsed,
440 ssize_t frameLeft) 448 ssize_t frameLeft)
441{ 449{
@@ -470,8 +478,9 @@ static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount,
470 if (bal < 0) { 478 if (bal < 0) {
471 if (userCount < 2) 479 if (userCount < 2)
472 break; 480 break;
473 if (get_user(data, ((u_short *)userPtr)++)) 481 if (get_user(data, (u_short __user *)userPtr))
474 return -EFAULT; 482 return -EFAULT;
483 userPtr += 2;
475 userCount -= 2; 484 userCount -= 2;
476 bal += hSpeed; 485 bal += hSpeed;
477 } 486 }
@@ -488,7 +497,7 @@ static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount,
488} 497}
489 498
490 499
491static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, 500static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount,
492 u_char frame[], ssize_t *frameUsed, 501 u_char frame[], ssize_t *frameUsed,
493 ssize_t frameLeft) 502 ssize_t frameLeft)
494{ 503{
@@ -524,8 +533,9 @@ static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount,
524 if (bal < 0) { 533 if (bal < 0) {
525 if (userCount < 2) 534 if (userCount < 2)
526 break; 535 break;
527 if (get_user(data, ((u_short *)userPtr)++)) 536 if (get_user(data, (u_short __user *)userPtr))
528 return -EFAULT; 537 return -EFAULT;
538 userPtr += 2;
529 data ^= 0x8080; 539 data ^= 0x8080;
530 userCount -= 2; 540 userCount -= 2;
531 bal += hSpeed; 541 bal += hSpeed;
@@ -543,7 +553,7 @@ static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount,
543} 553}
544 554
545 555
546static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, 556static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount,
547 u_char frame[], ssize_t *frameUsed, 557 u_char frame[], ssize_t *frameUsed,
548 ssize_t frameLeft) 558 ssize_t frameLeft)
549{ 559{
@@ -561,8 +571,9 @@ static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount,
561 if (bal < 0) { 571 if (bal < 0) {
562 if (userCount < 2) 572 if (userCount < 2)
563 break; 573 break;
564 if (get_user(data, ((u_short *)userPtr)++)) 574 if (get_user(data, (u_short __user *)userPtr))
565 return -EFAULT; 575 return -EFAULT;
576 userPtr += 2;
566 userCount -= 2; 577 userCount -= 2;
567 bal += hSpeed; 578 bal += hSpeed;
568 } 579 }
@@ -579,8 +590,9 @@ static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount,
579 if (bal < 0) { 590 if (bal < 0) {
580 if (userCount < 4) 591 if (userCount < 4)
581 break; 592 break;
582 if (get_user(data, ((u_int *)userPtr)++)) 593 if (get_user(data, (u_int __user *)userPtr))
583 return -EFAULT; 594 return -EFAULT;
595 userPtr += 4;
584 userCount -= 4; 596 userCount -= 4;
585 bal += hSpeed; 597 bal += hSpeed;
586 } 598 }
@@ -597,7 +609,7 @@ static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount,
597} 609}
598 610
599 611
600static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, 612static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount,
601 u_char frame[], ssize_t *frameUsed, 613 u_char frame[], ssize_t *frameUsed,
602 ssize_t frameLeft) 614 ssize_t frameLeft)
603{ 615{
@@ -615,8 +627,9 @@ static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount,
615 if (bal < 0) { 627 if (bal < 0) {
616 if (userCount < 2) 628 if (userCount < 2)
617 break; 629 break;
618 if (get_user(data, ((u_short *)userPtr)++)) 630 if (get_user(data, (u_short __user *)userPtr))
619 return -EFAULT; 631 return -EFAULT;
632 userPtr += 2;
620 data ^= 0x8000; 633 data ^= 0x8000;
621 userCount -= 2; 634 userCount -= 2;
622 bal += hSpeed; 635 bal += hSpeed;
@@ -634,8 +647,9 @@ static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount,
634 if (bal < 0) { 647 if (bal < 0) {
635 if (userCount < 4) 648 if (userCount < 4)
636 break; 649 break;
637 if (get_user(data, ((u_int *)userPtr)++)) 650 if (get_user(data, (u_int __user *)userPtr))
638 return -EFAULT; 651 return -EFAULT;
652 userPtr += 4;
639 data ^= 0x80008000; 653 data ^= 0x80008000;
640 userCount -= 4; 654 userCount -= 4;
641 bal += hSpeed; 655 bal += hSpeed;
@@ -653,7 +667,7 @@ static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount,
653} 667}
654 668
655 669
656static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, 670static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount,
657 u_char frame[], ssize_t *frameUsed, 671 u_char frame[], ssize_t *frameUsed,
658 ssize_t frameLeft) 672 ssize_t frameLeft)
659{ 673{
@@ -671,8 +685,9 @@ static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount,
671 if (bal < 0) { 685 if (bal < 0) {
672 if (userCount < 2) 686 if (userCount < 2)
673 break; 687 break;
674 if (get_user(data, ((u_short *)userPtr)++)) 688 if (get_user(data, (u_short __user *)userPtr))
675 return -EFAULT; 689 return -EFAULT;
690 userPtr += 2;
676 data = le2be16(data); 691 data = le2be16(data);
677 userCount -= 2; 692 userCount -= 2;
678 bal += hSpeed; 693 bal += hSpeed;
@@ -690,8 +705,9 @@ static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount,
690 if (bal < 0) { 705 if (bal < 0) {
691 if (userCount < 4) 706 if (userCount < 4)
692 break; 707 break;
693 if (get_user(data, ((u_int *)userPtr)++)) 708 if (get_user(data, (u_int __user *)userPtr))
694 return -EFAULT; 709 return -EFAULT;
710 userPtr += 4;
695 data = le2be16dbl(data); 711 data = le2be16dbl(data);
696 userCount -= 4; 712 userCount -= 4;
697 bal += hSpeed; 713 bal += hSpeed;
@@ -709,7 +725,7 @@ static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount,
709} 725}
710 726
711 727
712static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, 728static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount,
713 u_char frame[], ssize_t *frameUsed, 729 u_char frame[], ssize_t *frameUsed,
714 ssize_t frameLeft) 730 ssize_t frameLeft)
715{ 731{
@@ -727,8 +743,9 @@ static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount,
727 if (bal < 0) { 743 if (bal < 0) {
728 if (userCount < 2) 744 if (userCount < 2)
729 break; 745 break;
730 if (get_user(data, ((u_short *)userPtr)++)) 746 if (get_user(data, (u_short __user *)userPtr))
731 return -EFAULT; 747 return -EFAULT;
748 userPtr += 2;
732 data = le2be16(data) ^ 0x8000; 749 data = le2be16(data) ^ 0x8000;
733 userCount -= 2; 750 userCount -= 2;
734 bal += hSpeed; 751 bal += hSpeed;
@@ -746,8 +763,9 @@ static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount,
746 if (bal < 0) { 763 if (bal < 0) {
747 if (userCount < 4) 764 if (userCount < 4)
748 break; 765 break;
749 if (get_user(data, ((u_int *)userPtr)++)) 766 if (get_user(data, (u_int __user *)userPtr))
750 return -EFAULT; 767 return -EFAULT;
768 userPtr += 4;
751 data = le2be16dbl(data) ^ 0x80008000; 769 data = le2be16dbl(data) ^ 0x80008000;
752 userCount -= 4; 770 userCount -= 4;
753 bal += hSpeed; 771 bal += hSpeed;
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index cebd881b91ae..74f975676ccb 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -125,6 +125,7 @@ static int awacs_rate_index;
125static int awacs_subframe; 125static int awacs_subframe;
126static struct device_node* awacs_node; 126static struct device_node* awacs_node;
127static struct device_node* i2s_node; 127static struct device_node* i2s_node;
128static struct resource awacs_rsrc[3];
128 129
129static char awacs_name[64]; 130static char awacs_name[64];
130static int awacs_revision; 131static int awacs_revision;
@@ -667,9 +668,12 @@ static void PMacIrqCleanup(void)
667 iounmap(awacs_txdma); 668 iounmap(awacs_txdma);
668 iounmap(awacs_rxdma); 669 iounmap(awacs_rxdma);
669 670
670 release_OF_resource(awacs_node, 0); 671 release_mem_region(awacs_rsrc[0].start,
671 release_OF_resource(awacs_node, 1); 672 awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
672 release_OF_resource(awacs_node, 2); 673 release_mem_region(awacs_rsrc[1].start,
674 awacs_rsrc[1].end - awacs_rsrc[1].start + 1);
675 release_mem_region(awacs_rsrc[2].start,
676 awacs_rsrc[2].end - awacs_rsrc[2].start + 1);
673 677
674 kfree(awacs_tx_cmd_space); 678 kfree(awacs_tx_cmd_space);
675 kfree(awacs_rx_cmd_space); 679 kfree(awacs_rx_cmd_space);
@@ -2863,46 +2867,58 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n");
2863 * other info if necessary (early AWACS we want to read chip ids) 2867 * other info if necessary (early AWACS we want to read chip ids)
2864 */ 2868 */
2865 2869
2866 if (io->n_addrs < 3 || io->n_intrs < 3) { 2870 if (of_get_address(io, 2, NULL, NULL) == NULL || io->n_intrs < 3) {
2867 /* OK - maybe we need to use the 'awacs' node (on earlier 2871 /* OK - maybe we need to use the 'awacs' node (on earlier
2868 * machines). 2872 * machines).
2869 */ 2873 */
2870 if (awacs_node) { 2874 if (awacs_node) {
2871 io = awacs_node ; 2875 io = awacs_node ;
2872 if (io->n_addrs < 3 || io->n_intrs < 3) { 2876 if (of_get_address(io, 2, NULL, NULL) == NULL ||
2873 printk("dmasound_pmac: can't use %s" 2877 io->n_intrs < 3) {
2874 " (%d addrs, %d intrs)\n", 2878 printk("dmasound_pmac: can't use %s\n",
2875 io->full_name, io->n_addrs, io->n_intrs); 2879 io->full_name);
2876 return -ENODEV; 2880 return -ENODEV;
2877 } 2881 }
2878 } else { 2882 } else
2879 printk("dmasound_pmac: can't use %s (%d addrs, %d intrs)\n", 2883 printk("dmasound_pmac: can't use %s\n", io->full_name);
2880 io->full_name, io->n_addrs, io->n_intrs);
2881 }
2882 } 2884 }
2883 2885
2884 if (!request_OF_resource(io, 0, NULL)) { 2886 if (of_address_to_resource(io, 0, &awacs_rsrc[0]) ||
2887 request_mem_region(awacs_rsrc[0].start,
2888 awacs_rsrc[0].end - awacs_rsrc[0].start + 1,
2889 " (IO)") == NULL) {
2885 printk(KERN_ERR "dmasound: can't request IO resource !\n"); 2890 printk(KERN_ERR "dmasound: can't request IO resource !\n");
2886 return -ENODEV; 2891 return -ENODEV;
2887 } 2892 }
2888 if (!request_OF_resource(io, 1, " (tx dma)")) { 2893 if (of_address_to_resource(io, 1, &awacs_rsrc[1]) ||
2889 release_OF_resource(io, 0); 2894 request_mem_region(awacs_rsrc[1].start,
2890 printk(KERN_ERR "dmasound: can't request TX DMA resource !\n"); 2895 awacs_rsrc[1].end - awacs_rsrc[1].start + 1,
2896 " (tx dma)") == NULL) {
2897 release_mem_region(awacs_rsrc[0].start,
2898 awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
2899 printk(KERN_ERR "dmasound: can't request Tx DMA resource !\n");
2891 return -ENODEV; 2900 return -ENODEV;
2892 } 2901 }
2893 2902 if (of_address_to_resource(io, 2, &awacs_rsrc[2]) ||
2894 if (!request_OF_resource(io, 2, " (rx dma)")) { 2903 request_mem_region(awacs_rsrc[2].start,
2895 release_OF_resource(io, 0); 2904 awacs_rsrc[2].end - awacs_rsrc[2].start + 1,
2896 release_OF_resource(io, 1); 2905 " (rx dma)") == NULL) {
2897 printk(KERN_ERR "dmasound: can't request RX DMA resource !\n"); 2906 release_mem_region(awacs_rsrc[0].start,
2907 awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
2908 release_mem_region(awacs_rsrc[1].start,
2909 awacs_rsrc[1].end - awacs_rsrc[1].start + 1);
2910 printk(KERN_ERR "dmasound: can't request Rx DMA resource !\n");
2898 return -ENODEV; 2911 return -ENODEV;
2899 } 2912 }
2900 2913
2901 awacs_beep_dev = input_allocate_device(); 2914 awacs_beep_dev = input_allocate_device();
2902 if (!awacs_beep_dev) { 2915 if (!awacs_beep_dev) {
2903 release_OF_resource(io, 0); 2916 release_mem_region(awacs_rsrc[0].start,
2904 release_OF_resource(io, 1); 2917 awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
2905 release_OF_resource(io, 2); 2918 release_mem_region(awacs_rsrc[1].start,
2919 awacs_rsrc[1].end - awacs_rsrc[1].start + 1);
2920 release_mem_region(awacs_rsrc[2].start,
2921 awacs_rsrc[2].end - awacs_rsrc[2].start + 1);
2906 printk(KERN_ERR "dmasound: can't allocate input device !\n"); 2922 printk(KERN_ERR "dmasound: can't allocate input device !\n");
2907 return -ENOMEM; 2923 return -ENOMEM;
2908 } 2924 }
@@ -2916,11 +2932,11 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n");
2916 2932
2917 /* all OF versions I've seen use this value */ 2933 /* all OF versions I've seen use this value */
2918 if (i2s_node) 2934 if (i2s_node)
2919 i2s = ioremap(io->addrs[0].address, 0x1000); 2935 i2s = ioremap(awacs_rsrc[0].start, 0x1000);
2920 else 2936 else
2921 awacs = ioremap(io->addrs[0].address, 0x1000); 2937 awacs = ioremap(awacs_rsrc[0].start, 0x1000);
2922 awacs_txdma = ioremap(io->addrs[1].address, 0x100); 2938 awacs_txdma = ioremap(awacs_rsrc[1].start, 0x100);
2923 awacs_rxdma = ioremap(io->addrs[2].address, 0x100); 2939 awacs_rxdma = ioremap(awacs_rsrc[2].start, 0x100);
2924 2940
2925 /* first of all make sure that the chip is powered up....*/ 2941 /* first of all make sure that the chip is powered up....*/
2926 pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, io, 0, 1); 2942 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);
3083 struct device_node* mio; 3099 struct device_node* mio;
3084 macio_base = NULL; 3100 macio_base = NULL;
3085 for (mio = io->parent; mio; mio = mio->parent) { 3101 for (mio = io->parent; mio; mio = mio->parent) {
3086 if (strcmp(mio->name, "mac-io") == 0 3102 if (strcmp(mio->name, "mac-io") == 0) {
3087 && mio->n_addrs > 0) { 3103 struct resource r;
3088 macio_base = ioremap(mio->addrs[0].address, 0x40); 3104 if (of_address_to_resource(mio, 0, &r) == 0)
3105 macio_base = ioremap(r.start, 0x40);
3089 break; 3106 break;
3090 } 3107 }
3091 } 3108 }
diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c
index d59f60b26410..494070a3f870 100644
--- a/sound/oss/dmasound/dmasound_paula.c
+++ b/sound/oss/dmasound/dmasound_paula.c
@@ -34,6 +34,7 @@
34#define DMASOUND_PAULA_REVISION 0 34#define DMASOUND_PAULA_REVISION 0
35#define DMASOUND_PAULA_EDITION 4 35#define DMASOUND_PAULA_EDITION 4
36 36
37#define custom amiga_custom
37 /* 38 /*
38 * The minimum period for audio depends on htotal (for OCS/ECS/AGA) 39 * The minimum period for audio depends on htotal (for OCS/ECS/AGA)
39 * (Imported from arch/m68k/amiga/amisound.c) 40 * (Imported from arch/m68k/amiga/amisound.c)
@@ -156,7 +157,7 @@ static int AmiStateInfo(char *buffer, size_t space);
156 * Native format 157 * Native format
157 */ 158 */
158 159
159static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount, 160static ssize_t ami_ct_s8(const u_char __user *userPtr, size_t userCount,
160 u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) 161 u_char frame[], ssize_t *frameUsed, ssize_t frameLeft)
161{ 162{
162 ssize_t count, used; 163 ssize_t count, used;
@@ -189,7 +190,7 @@ static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount,
189 */ 190 */
190 191
191#define GENERATE_AMI_CT8(funcname, convsample) \ 192#define GENERATE_AMI_CT8(funcname, convsample) \
192static ssize_t funcname(const u_char *userPtr, size_t userCount, \ 193static ssize_t funcname(const u_char __user *userPtr, size_t userCount, \
193 u_char frame[], ssize_t *frameUsed, \ 194 u_char frame[], ssize_t *frameUsed, \
194 ssize_t frameLeft) \ 195 ssize_t frameLeft) \
195{ \ 196{ \
@@ -240,10 +241,11 @@ GENERATE_AMI_CT8(ami_ct_u8, AMI_CT_U8)
240 */ 241 */
241 242
242#define GENERATE_AMI_CT_16(funcname, convsample) \ 243#define GENERATE_AMI_CT_16(funcname, convsample) \
243static ssize_t funcname(const u_char *userPtr, size_t userCount, \ 244static ssize_t funcname(const u_char __user *userPtr, size_t userCount, \
244 u_char frame[], ssize_t *frameUsed, \ 245 u_char frame[], ssize_t *frameUsed, \
245 ssize_t frameLeft) \ 246 ssize_t frameLeft) \
246{ \ 247{ \
248 const u_short __user *ptr = (const u_short __user *)userPtr; \
247 ssize_t count, used; \ 249 ssize_t count, used; \
248 u_short data; \ 250 u_short data; \
249 \ 251 \
@@ -253,7 +255,7 @@ static ssize_t funcname(const u_char *userPtr, size_t userCount, \
253 count = min_t(size_t, userCount, frameLeft)>>1 & ~1; \ 255 count = min_t(size_t, userCount, frameLeft)>>1 & ~1; \
254 used = count*2; \ 256 used = count*2; \
255 while (count > 0) { \ 257 while (count > 0) { \
256 if (get_user(data, ((u_short *)userPtr)++)) \ 258 if (get_user(data, ptr++)) \
257 return -EFAULT; \ 259 return -EFAULT; \
258 data = convsample(data); \ 260 data = convsample(data); \
259 *high++ = data>>8; \ 261 *high++ = data>>8; \
@@ -268,12 +270,12 @@ static ssize_t funcname(const u_char *userPtr, size_t userCount, \
268 count = min_t(size_t, userCount, frameLeft)>>2 & ~1; \ 270 count = min_t(size_t, userCount, frameLeft)>>2 & ~1; \
269 used = count*4; \ 271 used = count*4; \
270 while (count > 0) { \ 272 while (count > 0) { \
271 if (get_user(data, ((u_short *)userPtr)++)) \ 273 if (get_user(data, ptr++)) \
272 return -EFAULT; \ 274 return -EFAULT; \
273 data = convsample(data); \ 275 data = convsample(data); \
274 *lefth++ = data>>8; \ 276 *lefth++ = data>>8; \
275 *leftl++ = (data>>2) & 0x3f; \ 277 *leftl++ = (data>>2) & 0x3f; \
276 if (get_user(data, ((u_short *)userPtr)++)) \ 278 if (get_user(data, ptr++)) \
277 return -EFAULT; \ 279 return -EFAULT; \
278 data = convsample(data); \ 280 data = convsample(data); \
279 *righth++ = data>>8; \ 281 *righth++ = data>>8; \
diff --git a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c
index 1ddaa6284b08..e2081f32b0c4 100644
--- a/sound/oss/dmasound/dmasound_q40.c
+++ b/sound/oss/dmasound/dmasound_q40.c
@@ -58,7 +58,7 @@ static void Q40Interrupt(void);
58 58
59 59
60/* userCount, frameUsed, frameLeft == byte counts */ 60/* userCount, frameUsed, frameLeft == byte counts */
61static ssize_t q40_ct_law(const u_char *userPtr, size_t userCount, 61static ssize_t q40_ct_law(const u_char __user *userPtr, size_t userCount,
62 u_char frame[], ssize_t *frameUsed, 62 u_char frame[], ssize_t *frameUsed,
63 ssize_t frameLeft) 63 ssize_t frameLeft)
64{ 64{
@@ -79,7 +79,7 @@ static ssize_t q40_ct_law(const u_char *userPtr, size_t userCount,
79} 79}
80 80
81 81
82static ssize_t q40_ct_s8(const u_char *userPtr, size_t userCount, 82static ssize_t q40_ct_s8(const u_char __user *userPtr, size_t userCount,
83 u_char frame[], ssize_t *frameUsed, 83 u_char frame[], ssize_t *frameUsed,
84 ssize_t frameLeft) 84 ssize_t frameLeft)
85{ 85{
@@ -98,7 +98,7 @@ static ssize_t q40_ct_s8(const u_char *userPtr, size_t userCount,
98 return used; 98 return used;
99} 99}
100 100
101static ssize_t q40_ct_u8(const u_char *userPtr, size_t userCount, 101static ssize_t q40_ct_u8(const u_char __user *userPtr, size_t userCount,
102 u_char frame[], ssize_t *frameUsed, 102 u_char frame[], ssize_t *frameUsed,
103 ssize_t frameLeft) 103 ssize_t frameLeft)
104{ 104{
@@ -114,7 +114,7 @@ static ssize_t q40_ct_u8(const u_char *userPtr, size_t userCount,
114 114
115 115
116/* a bit too complicated to optimise right now ..*/ 116/* a bit too complicated to optimise right now ..*/
117static ssize_t q40_ctx_law(const u_char *userPtr, size_t userCount, 117static ssize_t q40_ctx_law(const u_char __user *userPtr, size_t userCount,
118 u_char frame[], ssize_t *frameUsed, 118 u_char frame[], ssize_t *frameUsed,
119 ssize_t frameLeft) 119 ssize_t frameLeft)
120{ 120{
@@ -152,7 +152,7 @@ static ssize_t q40_ctx_law(const u_char *userPtr, size_t userCount,
152} 152}
153 153
154 154
155static ssize_t q40_ctx_s8(const u_char *userPtr, size_t userCount, 155static ssize_t q40_ctx_s8(const u_char __user *userPtr, size_t userCount,
156 u_char frame[], ssize_t *frameUsed, 156 u_char frame[], ssize_t *frameUsed,
157 ssize_t frameLeft) 157 ssize_t frameLeft)
158{ 158{
@@ -189,7 +189,7 @@ static ssize_t q40_ctx_s8(const u_char *userPtr, size_t userCount,
189} 189}
190 190
191 191
192static ssize_t q40_ctx_u8(const u_char *userPtr, size_t userCount, 192static ssize_t q40_ctx_u8(const u_char __user *userPtr, size_t userCount,
193 u_char frame[], ssize_t *frameUsed, 193 u_char frame[], ssize_t *frameUsed,
194 ssize_t frameLeft) 194 ssize_t frameLeft)
195{ 195{
@@ -224,7 +224,7 @@ static ssize_t q40_ctx_u8(const u_char *userPtr, size_t userCount,
224} 224}
225 225
226/* compressing versions */ 226/* compressing versions */
227static ssize_t q40_ctc_law(const u_char *userPtr, size_t userCount, 227static ssize_t q40_ctc_law(const u_char __user *userPtr, size_t userCount,
228 u_char frame[], ssize_t *frameUsed, 228 u_char frame[], ssize_t *frameUsed,
229 ssize_t frameLeft) 229 ssize_t frameLeft)
230{ 230{
@@ -265,7 +265,7 @@ static ssize_t q40_ctc_law(const u_char *userPtr, size_t userCount,
265} 265}
266 266
267 267
268static ssize_t q40_ctc_s8(const u_char *userPtr, size_t userCount, 268static ssize_t q40_ctc_s8(const u_char __user *userPtr, size_t userCount,
269 u_char frame[], ssize_t *frameUsed, 269 u_char frame[], ssize_t *frameUsed,
270 ssize_t frameLeft) 270 ssize_t frameLeft)
271{ 271{
@@ -304,7 +304,7 @@ static ssize_t q40_ctc_s8(const u_char *userPtr, size_t userCount,
304} 304}
305 305
306 306
307static ssize_t q40_ctc_u8(const u_char *userPtr, size_t userCount, 307static ssize_t q40_ctc_u8(const u_char __user *userPtr, size_t userCount,
308 u_char frame[], ssize_t *frameUsed, 308 u_char frame[], ssize_t *frameUsed,
309 ssize_t frameLeft) 309 ssize_t frameLeft)
310{ 310{
diff --git a/sound/oss/dmasound/trans_16.c b/sound/oss/dmasound/trans_16.c
index 23562e947806..ca973ac2a30a 100644
--- a/sound/oss/dmasound/trans_16.c
+++ b/sound/oss/dmasound/trans_16.c
@@ -17,6 +17,7 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include "dmasound.h" 18#include "dmasound.h"
19 19
20extern int expand_bal; /* Balance factor for expanding (not volume!) */
20static short dmasound_alaw2dma16[] ; 21static short dmasound_alaw2dma16[] ;
21static short dmasound_ulaw2dma16[] ; 22static short dmasound_ulaw2dma16[] ;
22 23
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
index 9b905bae423e..23241cbdd90f 100644
--- a/sound/oss/emu10k1/main.c
+++ b/sound/oss/emu10k1/main.c
@@ -1428,7 +1428,7 @@ static int __init emu10k1_init_module(void)
1428{ 1428{
1429 printk(KERN_INFO "Creative EMU10K1 PCI Audio Driver, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n"); 1429 printk(KERN_INFO "Creative EMU10K1 PCI Audio Driver, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n");
1430 1430
1431 return pci_module_init(&emu10k1_pci_driver); 1431 return pci_register_driver(&emu10k1_pci_driver);
1432} 1432}
1433 1433
1434static void __exit emu10k1_cleanup_module(void) 1434static void __exit emu10k1_cleanup_module(void)
diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c
index 8538085086e7..ae55c536613a 100644
--- a/sound/oss/es1370.c
+++ b/sound/oss/es1370.c
@@ -2779,7 +2779,7 @@ static struct pci_driver es1370_driver = {
2779static int __init init_es1370(void) 2779static int __init init_es1370(void)
2780{ 2780{
2781 printk(KERN_INFO "es1370: version v0.38 time " __TIME__ " " __DATE__ "\n"); 2781 printk(KERN_INFO "es1370: version v0.38 time " __TIME__ " " __DATE__ "\n");
2782 return pci_module_init(&es1370_driver); 2782 return pci_register_driver(&es1370_driver);
2783} 2783}
2784 2784
2785static void __exit cleanup_es1370(void) 2785static void __exit cleanup_es1370(void)
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index 12a56d5ab498..5c697f162579 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -3090,7 +3090,7 @@ static struct pci_driver es1371_driver = {
3090static int __init init_es1371(void) 3090static int __init init_es1371(void)
3091{ 3091{
3092 printk(KERN_INFO PFX "version v0.32 time " __TIME__ " " __DATE__ "\n"); 3092 printk(KERN_INFO PFX "version v0.32 time " __TIME__ " " __DATE__ "\n");
3093 return pci_module_init(&es1371_driver); 3093 return pci_register_driver(&es1371_driver);
3094} 3094}
3095 3095
3096static void __exit cleanup_es1371(void) 3096static void __exit cleanup_es1371(void)
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index a4ecab2f0522..849b59f67ef5 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)
515 return 0; 515 return 0;
516} 516}
517 517
518static inline int prog_dmabuf_dac(struct solo1_state *s) 518static int prog_dmabuf_dac(struct solo1_state *s)
519{ 519{
520 unsigned long va; 520 unsigned long va;
521 int c; 521 int c;
diff --git a/sound/oss/harmony.c b/sound/oss/harmony.c
index bee9d344cd26..591683c55f27 100644
--- a/sound/oss/harmony.c
+++ b/sound/oss/harmony.c
@@ -1236,7 +1236,7 @@ harmony_driver_probe(struct parisc_device *dev)
1236 } 1236 }
1237 1237
1238 /* Set the HPA of harmony */ 1238 /* Set the HPA of harmony */
1239 harmony.hpa = (struct harmony_hpa *)dev->hpa; 1239 harmony.hpa = (struct harmony_hpa *)dev->hpa.start;
1240 harmony.dev = dev; 1240 harmony.dev = dev;
1241 1241
1242 /* Grab the ID and revision from the device */ 1242 /* Grab the ID and revision from the device */
@@ -1250,7 +1250,7 @@ harmony_driver_probe(struct parisc_device *dev)
1250 1250
1251 printk(KERN_INFO "Lasi Harmony Audio driver " HARMONY_VERSION ", " 1251 printk(KERN_INFO "Lasi Harmony Audio driver " HARMONY_VERSION ", "
1252 "h/w id %i, rev. %i at 0x%lx, IRQ %i\n", 1252 "h/w id %i, rev. %i at 0x%lx, IRQ %i\n",
1253 id, rev, dev->hpa, harmony.dev->irq); 1253 id, rev, dev->hpa.start, harmony.dev->irq);
1254 1254
1255 /* Make sure the control bit isn't set, although I don't think it 1255 /* Make sure the control bit isn't set, although I don't think it
1256 ever is. */ 1256 ever is. */
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index b9a640fe48b1..abc242abd5b1 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 [] = {
312 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4}, 312 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4},
313 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_18, 313 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_18,
314 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4}, 314 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4},
315 315 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_AUDIO,
316 PCI_ANY_ID, PCI_ANY_ID, 0, 0, NVIDIA_NFORCE},
316 {0,} 317 {0,}
317}; 318};
318 319
@@ -3359,12 +3360,6 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
3359 goto out_region2; 3360 goto out_region2;
3360 } 3361 }
3361 3362
3362 if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ,
3363 card_names[pci_id->driver_data], card)) {
3364 printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq);
3365 goto out_pio;
3366 }
3367
3368 if (card->use_mmio) { 3363 if (card->use_mmio) {
3369 if (request_mem_region(card->ac97base_mmio_phys, 512, "ich_audio MMBAR")) { 3364 if (request_mem_region(card->ac97base_mmio_phys, 512, "ich_audio MMBAR")) {
3370 if ((card->ac97base_mmio = ioremap(card->ac97base_mmio_phys, 512))) { /*@FIXME can ioremap fail? don't know (jsaw) */ 3365 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
3395 } 3390 }
3396 3391
3397 /* initialize AC97 codec and register /dev/mixer */ 3392 /* initialize AC97 codec and register /dev/mixer */
3398 if (i810_ac97_init(card) <= 0) { 3393 if (i810_ac97_init(card) <= 0)
3399 free_irq(card->irq, card);
3400 goto out_iospace; 3394 goto out_iospace;
3401 }
3402 pci_set_drvdata(pci_dev, card); 3395 pci_set_drvdata(pci_dev, card);
3403 3396
3404 if(clocking == 0) { 3397 if(clocking == 0) {
@@ -3410,7 +3403,6 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
3410 if ((card->dev_audio = register_sound_dsp(&i810_audio_fops, -1)) < 0) { 3403 if ((card->dev_audio = register_sound_dsp(&i810_audio_fops, -1)) < 0) {
3411 int i; 3404 int i;
3412 printk(KERN_ERR "i810_audio: couldn't register DSP device!\n"); 3405 printk(KERN_ERR "i810_audio: couldn't register DSP device!\n");
3413 free_irq(card->irq, card);
3414 for (i = 0; i < NR_AC97; i++) 3406 for (i = 0; i < NR_AC97; i++)
3415 if (card->ac97_codec[i] != NULL) { 3407 if (card->ac97_codec[i] != NULL) {
3416 unregister_sound_mixer(card->ac97_codec[i]->dev_mixer); 3408 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
3419 goto out_iospace; 3411 goto out_iospace;
3420 } 3412 }
3421 3413
3414 if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ,
3415 card_names[pci_id->driver_data], card)) {
3416 printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq);
3417 goto out_iospace;
3418 }
3419
3420
3422 card->initializing = 0; 3421 card->initializing = 0;
3423 return 0; 3422 return 0;
3424 3423
@@ -3429,7 +3428,6 @@ out_iospace:
3429 release_mem_region(card->ac97base_mmio_phys, 512); 3428 release_mem_region(card->ac97base_mmio_phys, 512);
3430 release_mem_region(card->iobase_mmio_phys, 256); 3429 release_mem_region(card->iobase_mmio_phys, 256);
3431 } 3430 }
3432out_pio:
3433 release_region(card->ac97base, 256); 3431 release_region(card->ac97base, 256);
3434out_region2: 3432out_region2:
3435 release_region(card->iobase, 64); 3433 release_region(card->iobase, 64);
diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c
index 26e5944b6ba8..8fd2f9a9e668 100644
--- a/sound/oss/ite8172.c
+++ b/sound/oss/ite8172.c
@@ -2206,7 +2206,7 @@ static struct pci_driver it8172_driver = {
2206static int __init init_it8172(void) 2206static int __init init_it8172(void)
2207{ 2207{
2208 info("version v0.5 time " __TIME__ " " __DATE__); 2208 info("version v0.5 time " __TIME__ " " __DATE__);
2209 return pci_module_init(&it8172_driver); 2209 return pci_register_driver(&it8172_driver);
2210} 2210}
2211 2211
2212static void __exit cleanup_it8172(void) 2212static void __exit cleanup_it8172(void)
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index 808c5ef969be..2835a7c038ef 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -218,7 +218,7 @@ static struct pci_driver kahlua_driver = {
218static int __init kahlua_init_module(void) 218static int __init kahlua_init_module(void)
219{ 219{
220 printk(KERN_INFO "Cyrix Kahlua VSA1 XpressAudio support (c) Copyright 2003 Red Hat Inc\n"); 220 printk(KERN_INFO "Cyrix Kahlua VSA1 XpressAudio support (c) Copyright 2003 Red Hat Inc\n");
221 return pci_module_init(&kahlua_driver); 221 return pci_register_driver(&kahlua_driver);
222} 222}
223 223
224static void __devexit kahlua_cleanup_module(void) 224static void __devexit kahlua_cleanup_module(void)
diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c
index f9ac5b16f61a..d4b569acf764 100644
--- a/sound/oss/maestro.c
+++ b/sound/oss/maestro.c
@@ -3624,7 +3624,7 @@ static int __init init_maestro(void)
3624{ 3624{
3625 int rc; 3625 int rc;
3626 3626
3627 rc = pci_module_init(&maestro_pci_driver); 3627 rc = pci_register_driver(&maestro_pci_driver);
3628 if (rc < 0) 3628 if (rc < 0)
3629 return rc; 3629 return rc;
3630 3630
diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
index 9ac4bf7e1e89..fbb9170e8e0a 100644
--- a/sound/oss/nec_vrc5477.c
+++ b/sound/oss/nec_vrc5477.c
@@ -2045,7 +2045,7 @@ static struct pci_driver vrc5477_ac97_driver = {
2045static int __init init_vrc5477_ac97(void) 2045static int __init init_vrc5477_ac97(void)
2046{ 2046{
2047 printk("Vrc5477 AC97 driver: version v0.2 time " __TIME__ " " __DATE__ " by Jun Sun\n"); 2047 printk("Vrc5477 AC97 driver: version v0.2 time " __TIME__ " " __DATE__ " by Jun Sun\n");
2048 return pci_module_init(&vrc5477_ac97_driver); 2048 return pci_register_driver(&vrc5477_ac97_driver);
2049} 2049}
2050 2050
2051static void __exit cleanup_vrc5477_ac97(void) 2051static void __exit cleanup_vrc5477_ac97(void)
diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c
index 42d8f05689c2..7de079b202f2 100644
--- a/sound/oss/nm256_audio.c
+++ b/sound/oss/nm256_audio.c
@@ -1644,7 +1644,7 @@ module_param(force_load, bool, 0);
1644static int __init do_init_nm256(void) 1644static int __init do_init_nm256(void)
1645{ 1645{
1646 printk (KERN_INFO "NeoMagic 256AV/256ZX audio driver, version 1.1p\n"); 1646 printk (KERN_INFO "NeoMagic 256AV/256ZX audio driver, version 1.1p\n");
1647 return pci_module_init(&nm256_pci_driver); 1647 return pci_register_driver(&nm256_pci_driver);
1648} 1648}
1649 1649
1650static void __exit cleanup_nm256 (void) 1650static void __exit cleanup_nm256 (void)
diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c
index 5cecdbcbea9d..0e161c6a0477 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
530 if (hw_config->slots[0] != -1) { 530 if (hw_config->slots[0] != -1) {
531 /* Did the MSS driver install? */ 531 /* Did the MSS driver install? */
532 if(num_mixers == (initial_mixers + 1)) { 532 if(num_mixers == (initial_mixers + 1)) {
533 /* The MSS mixer is installed, reroute mixers appropiately */ 533 /* The MSS mixer is installed, reroute mixers appropriately */
534 AD1848_REROUTE(SOUND_MIXER_LINE1, SOUND_MIXER_CD); 534 AD1848_REROUTE(SOUND_MIXER_LINE1, SOUND_MIXER_CD);
535 AD1848_REROUTE(SOUND_MIXER_LINE2, SOUND_MIXER_SYNTH); 535 AD1848_REROUTE(SOUND_MIXER_LINE2, SOUND_MIXER_SYNTH);
536 AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE); 536 AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE);
diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
index 318dc51009fe..faa0b7919b65 100644
--- a/sound/oss/rme96xx.c
+++ b/sound/oss/rme96xx.c
@@ -1095,7 +1095,7 @@ static int __init init_rme96xx(void)
1095 devices = ((devices-1) & RME96xx_MASK_DEVS) + 1; 1095 devices = ((devices-1) & RME96xx_MASK_DEVS) + 1;
1096 printk(KERN_INFO RME_MESS" reserving %d dsp device(s)\n",devices); 1096 printk(KERN_INFO RME_MESS" reserving %d dsp device(s)\n",devices);
1097 numcards = 0; 1097 numcards = 0;
1098 return pci_module_init(&rme96xx_driver); 1098 return pci_register_driver(&rme96xx_driver);
1099} 1099}
1100 1100
1101static void __exit cleanup_rme96xx(void) 1101static void __exit cleanup_rme96xx(void)
diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
index 17d0e461f8d8..71b05e2f6977 100644
--- a/sound/oss/sonicvibes.c
+++ b/sound/oss/sonicvibes.c
@@ -2765,7 +2765,7 @@ static int __init init_sonicvibes(void)
2765 if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT))) 2765 if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT)))
2766 printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n"); 2766 printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n");
2767#endif 2767#endif
2768 return pci_module_init(&sv_driver); 2768 return pci_register_driver(&sv_driver);
2769} 2769}
2770 2770
2771static void __exit cleanup_sonicvibes(void) 2771static void __exit cleanup_sonicvibes(void)
diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index 5f0ad6bb43b9..a21c663e7e12 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -278,16 +278,14 @@ static char *card_names[] = {
278}; 278};
279 279
280static struct pci_device_id trident_pci_tbl[] = { 280static struct pci_device_id trident_pci_tbl[] = {
281 {PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX, 281 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
282 PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_DX}, 282 PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TRIDENT_4D_DX},
283 {PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX, 283 {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
284 PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_NX}, 284 0, 0, TRIDENT_4D_NX},
285 {PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018, 285 {PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018), 0, 0, SIS_7018},
286 PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018}, 286 {PCI_DEVICE(PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_ALI_5451), 0, 0, ALI_5451},
287 {PCI_VENDOR_ID_ALI, PCI_DEVICE_ID_ALI_5451, 287 {PCI_DEVICE(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5050),
288 PCI_ANY_ID, PCI_ANY_ID, 0, 0, ALI_5451}, 288 0, 0, CYBER5050},
289 {PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5050,
290 PCI_ANY_ID, PCI_ANY_ID, 0, 0, CYBER5050},
291 {0,} 289 {0,}
292}; 290};
293 291
diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
index 8dae59bd05a2..f8bd72e46f57 100644
--- a/sound/oss/ymfpci.c
+++ b/sound/oss/ymfpci.c
@@ -2680,7 +2680,7 @@ static struct pci_driver ymfpci_driver = {
2680 2680
2681static int __init ymf_init_module(void) 2681static int __init ymf_init_module(void)
2682{ 2682{
2683 return pci_module_init(&ymfpci_driver); 2683 return pci_register_driver(&ymfpci_driver);
2684} 2684}
2685 2685
2686static void __exit ymf_cleanup_module (void) 2686static void __exit ymf_cleanup_module (void)
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 202c7cf3e328..f36ede827479 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -385,7 +385,7 @@ static struct pci_driver driver = {
385 385
386static int __init alsa_card_cs5535audio_init(void) 386static int __init alsa_card_cs5535audio_init(void)
387{ 387{
388 return pci_module_init(&driver); 388 return pci_register_driver(&driver);
389} 389}
390 390
391static void __exit alsa_card_cs5535audio_exit(void) 391static void __exit alsa_card_cs5535audio_exit(void)
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 1a903390ad6d..509837252735 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -27,6 +27,7 @@
27 27
28#include <sound/driver.h> 28#include <sound/driver.h>
29#include <linux/pci.h> 29#include <linux/pci.h>
30#include <linux/capability.h>
30#include <linux/delay.h> 31#include <linux/delay.h>
31#include <linux/slab.h> 32#include <linux/slab.h>
32#include <linux/vmalloc.h> 33#include <linux/vmalloc.h>
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 9ffb600321cb..3747a436f0cd 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -727,7 +727,7 @@ static void __apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 dat
727 apu_data_set(chip, data); 727 apu_data_set(chip, data);
728} 728}
729 729
730static inline void apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data) 730static void apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data)
731{ 731{
732 unsigned long flags; 732 unsigned long flags;
733 spin_lock_irqsave(&chip->reg_lock, flags); 733 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -743,7 +743,7 @@ static u16 __apu_get_register(struct es1968 *chip, u16 channel, u8 reg)
743 return __maestro_read(chip, IDR0_DATA_PORT); 743 return __maestro_read(chip, IDR0_DATA_PORT);
744} 744}
745 745
746static inline u16 apu_get_register(struct es1968 *chip, u16 channel, u8 reg) 746static u16 apu_get_register(struct es1968 *chip, u16 channel, u8 reg)
747{ 747{
748 unsigned long flags; 748 unsigned long flags;
749 u16 v; 749 u16 v;
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
index 09cb250d5827..962e6d525564 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
@@ -209,7 +209,7 @@ static int pdacf_pcm_prepare(struct snd_pcm_substream *subs)
209 case SNDRV_PCM_FORMAT_S24_3LE: 209 case SNDRV_PCM_FORMAT_S24_3LE:
210 case SNDRV_PCM_FORMAT_S24_3BE: 210 case SNDRV_PCM_FORMAT_S24_3BE:
211 chip->pcm_sample = 3; 211 chip->pcm_sample = 3;
212 /* fall trough */ 212 /* fall through */
213 default: /* 24-bit */ 213 default: /* 24-bit */
214 aval = AK4117_DIF_24R; 214 aval = AK4117_DIF_24R;
215 chip->pcm_frame = 3; 215 chip->pcm_frame = 3;
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 9b2b00fdc1ae..a642e4cfcf45 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -803,21 +803,17 @@ static int snd_pmac_free(struct snd_pmac *chip)
803 iounmap(chip->playback.dma); 803 iounmap(chip->playback.dma);
804 if (chip->capture.dma) 804 if (chip->capture.dma)
805 iounmap(chip->capture.dma); 805 iounmap(chip->capture.dma);
806#ifndef CONFIG_PPC64 806
807 if (chip->node) { 807 if (chip->node) {
808 int i; 808 int i;
809
810 for (i = 0; i < 3; i++) { 809 for (i = 0; i < 3; i++) {
811 if (chip->of_requested & (1 << i)) { 810 if (chip->requested & (1 << i))
812 if (chip->is_k2) 811 release_mem_region(chip->rsrc[i].start,
813 release_OF_resource(chip->node->parent, 812 chip->rsrc[i].end -
814 i); 813 chip->rsrc[i].start + 1);
815 else
816 release_OF_resource(chip->node, i);
817 }
818 } 814 }
819 } 815 }
820#endif /* CONFIG_PPC64 */ 816
821 if (chip->pdev) 817 if (chip->pdev)
822 pci_dev_put(chip->pdev); 818 pci_dev_put(chip->pdev);
823 kfree(chip); 819 kfree(chip);
@@ -991,6 +987,11 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
991 chip->can_byte_swap = 0; /* FIXME: check this */ 987 chip->can_byte_swap = 0; /* FIXME: check this */
992 chip->control_mask = MASK_IEPC | 0x11;/* disable IEE */ 988 chip->control_mask = MASK_IEPC | 0x11;/* disable IEE */
993 break; 989 break;
990 default:
991 printk(KERN_ERR "snd: Unknown layout ID 0x%x\n",
992 layout_id);
993 return -ENODEV;
994
994 } 995 }
995 } 996 }
996 prop = (unsigned int *)get_property(sound, "device-id", NULL); 997 prop = (unsigned int *)get_property(sound, "device-id", NULL);
@@ -1175,46 +1176,69 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1175 } 1176 }
1176 1177
1177 np = chip->node; 1178 np = chip->node;
1179 chip->requested = 0;
1178 if (chip->is_k2) { 1180 if (chip->is_k2) {
1179 if (np->parent->n_addrs < 2 || np->n_intrs < 3) { 1181 static char *rnames[] = {
1182 "Sound Control", "Sound DMA" };
1183 if (np->n_intrs < 3) {
1180 err = -ENODEV; 1184 err = -ENODEV;
1181 goto __error; 1185 goto __error;
1182 } 1186 }
1183 for (i = 0; i < 2; i++) { 1187 for (i = 0; i < 2; i ++) {
1184#ifndef CONFIG_PPC64 1188 if (of_address_to_resource(np->parent, i,
1185 static char *name[2] = { "- Control", "- DMA" }; 1189 &chip->rsrc[i])) {
1186 if (! request_OF_resource(np->parent, i, name[i])) { 1190 printk(KERN_ERR "snd: can't translate rsrc "
1187 snd_printk(KERN_ERR "pmac: can't request resource %d!\n", i); 1191 " %d (%s)\n", i, rnames[i]);
1192 err = -ENODEV;
1193 goto __error;
1194 }
1195 if (request_mem_region(chip->rsrc[i].start,
1196 chip->rsrc[i].end -
1197 chip->rsrc[i].start + 1,
1198 rnames[i]) == NULL) {
1199 printk(KERN_ERR "snd: can't request rsrc "
1200 " %d (%s: 0x%08lx:%08lx)\n",
1201 i, rnames[i], chip->rsrc[i].start,
1202 chip->rsrc[i].end);
1188 err = -ENODEV; 1203 err = -ENODEV;
1189 goto __error; 1204 goto __error;
1190 } 1205 }
1191 chip->of_requested |= (1 << i); 1206 chip->requested |= (1 << i);
1192#endif /* CONFIG_PPC64 */
1193 ctrl_addr = np->parent->addrs[0].address;
1194 txdma_addr = np->parent->addrs[1].address;
1195 rxdma_addr = txdma_addr + 0x100;
1196 } 1207 }
1197 1208 ctrl_addr = chip->rsrc[0].start;
1209 txdma_addr = chip->rsrc[1].start;
1210 rxdma_addr = txdma_addr + 0x100;
1198 } else { 1211 } else {
1199 if (np->n_addrs < 3 || np->n_intrs < 3) { 1212 static char *rnames[] = {
1213 "Sound Control", "Sound Tx DMA", "Sound Rx DMA" };
1214 if (np->n_intrs < 3) {
1200 err = -ENODEV; 1215 err = -ENODEV;
1201 goto __error; 1216 goto __error;
1202 } 1217 }
1203 1218 for (i = 0; i < 3; i ++) {
1204 for (i = 0; i < 3; i++) { 1219 if (of_address_to_resource(np->parent, i,
1205#ifndef CONFIG_PPC64 1220 &chip->rsrc[i])) {
1206 static char *name[3] = { "- Control", "- Tx DMA", "- Rx DMA" }; 1221 printk(KERN_ERR "snd: can't translate rsrc "
1207 if (! request_OF_resource(np, i, name[i])) { 1222 " %d (%s)\n", i, rnames[i]);
1208 snd_printk(KERN_ERR "pmac: can't request resource %d!\n", i); 1223 err = -ENODEV;
1224 goto __error;
1225 }
1226 if (request_mem_region(chip->rsrc[i].start,
1227 chip->rsrc[i].end -
1228 chip->rsrc[i].start + 1,
1229 rnames[i]) == NULL) {
1230 printk(KERN_ERR "snd: can't request rsrc "
1231 " %d (%s: 0x%08lx:%08lx)\n",
1232 i, rnames[i], chip->rsrc[i].start,
1233 chip->rsrc[i].end);
1209 err = -ENODEV; 1234 err = -ENODEV;
1210 goto __error; 1235 goto __error;
1211 } 1236 }
1212 chip->of_requested |= (1 << i); 1237 chip->requested |= (1 << i);
1213#endif /* CONFIG_PPC64 */
1214 ctrl_addr = np->addrs[0].address;
1215 txdma_addr = np->addrs[1].address;
1216 rxdma_addr = np->addrs[2].address;
1217 } 1238 }
1239 ctrl_addr = chip->rsrc[0].start;
1240 txdma_addr = chip->rsrc[1].start;
1241 rxdma_addr = chip->rsrc[2].start;
1218 } 1242 }
1219 1243
1220 chip->awacs = ioremap(ctrl_addr, 0x1000); 1244 chip->awacs = ioremap(ctrl_addr, 0x1000);
@@ -1266,9 +1290,11 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1266 } else if (chip->is_pbook_G3) { 1290 } else if (chip->is_pbook_G3) {
1267 struct device_node* mio; 1291 struct device_node* mio;
1268 for (mio = chip->node->parent; mio; mio = mio->parent) { 1292 for (mio = chip->node->parent; mio; mio = mio->parent) {
1269 if (strcmp(mio->name, "mac-io") == 0 1293 if (strcmp(mio->name, "mac-io") == 0) {
1270 && mio->n_addrs > 0) { 1294 struct resource r;
1271 chip->macio_base = ioremap(mio->addrs[0].address, 0x40); 1295 if (of_address_to_resource(mio, 0, &r) == 0)
1296 chip->macio_base =
1297 ioremap(r.start, 0x40);
1272 break; 1298 break;
1273 } 1299 }
1274 } 1300 }
diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h
index 086da7a18909..3a9bd4dbb9a6 100644
--- a/sound/ppc/pmac.h
+++ b/sound/ppc/pmac.h
@@ -113,7 +113,8 @@ struct snd_pmac {
113 unsigned int initialized : 1; 113 unsigned int initialized : 1;
114 unsigned int feature_is_set : 1; 114 unsigned int feature_is_set : 1;
115 115
116 unsigned int of_requested; 116 unsigned int requested;
117 struct resource rsrc[3];
117 118
118 int num_freqs; 119 int num_freqs;
119 int *freq_table; 120 int *freq_table;
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index e9086e95a31f..fd6543998788 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -69,13 +69,14 @@ struct sbus_dma_info {
69}; 69};
70#endif 70#endif
71 71
72struct snd_cs4231;
72struct cs4231_dma_control { 73struct cs4231_dma_control {
73 void (*prepare)(struct cs4231_dma_control *dma_cont, int dir); 74 void (*prepare)(struct cs4231_dma_control *dma_cont, int dir);
74 void (*enable)(struct cs4231_dma_control *dma_cont, int on); 75 void (*enable)(struct cs4231_dma_control *dma_cont, int on);
75 int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len); 76 int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len);
76 unsigned int (*address)(struct cs4231_dma_control *dma_cont); 77 unsigned int (*address)(struct cs4231_dma_control *dma_cont);
77 void (*reset)(struct snd_cs4231 *chip); 78 void (*reset)(struct snd_cs4231 *chip);
78 void (*preallocate)(struct snd_cs4231 *chip, struct snd_snd_pcm *pcm); 79 void (*preallocate)(struct snd_cs4231 *chip, struct snd_pcm *pcm);
79#ifdef EBUS_SUPPORT 80#ifdef EBUS_SUPPORT
80 struct ebus_dma_info ebus_info; 81 struct ebus_dma_info ebus_info;
81#endif 82#endif