aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/dsp56k.c29
-rw-r--r--include/asm-m68k/dsp56k.h2
2 files changed, 16 insertions, 15 deletions
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 8693835cb2d5..e233cf280bc0 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -165,7 +165,7 @@ static int dsp56k_reset(void)
165 return 0; 165 return 0;
166} 166}
167 167
168static int dsp56k_upload(u_char *bin, int len) 168static int dsp56k_upload(u_char __user *bin, int len)
169{ 169{
170 int i; 170 int i;
171 u_char *p; 171 u_char *p;
@@ -199,7 +199,7 @@ static int dsp56k_upload(u_char *bin, int len)
199 return 0; 199 return 0;
200} 200}
201 201
202static ssize_t dsp56k_read(struct file *file, char *buf, size_t count, 202static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
203 loff_t *ppos) 203 loff_t *ppos)
204{ 204{
205 struct inode *inode = file->f_dentry->d_inode; 205 struct inode *inode = file->f_dentry->d_inode;
@@ -225,10 +225,10 @@ static ssize_t dsp56k_read(struct file *file, char *buf, size_t count,
225 } 225 }
226 case 2: /* 16 bit */ 226 case 2: /* 16 bit */
227 { 227 {
228 short *data; 228 short __user *data;
229 229
230 count /= 2; 230 count /= 2;
231 data = (short*) buf; 231 data = (short __user *) buf;
232 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE, 232 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE,
233 put_user(dsp56k_host_interface.data.w[1], data+n++)); 233 put_user(dsp56k_host_interface.data.w[1], data+n++));
234 return 2*n; 234 return 2*n;
@@ -244,10 +244,10 @@ static ssize_t dsp56k_read(struct file *file, char *buf, size_t count,
244 } 244 }
245 case 4: /* 32 bit */ 245 case 4: /* 32 bit */
246 { 246 {
247 long *data; 247 long __user *data;
248 248
249 count /= 4; 249 count /= 4;
250 data = (long*) buf; 250 data = (long __user *) buf;
251 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE, 251 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE,
252 put_user(dsp56k_host_interface.data.l, data+n++)); 252 put_user(dsp56k_host_interface.data.l, data+n++));
253 return 4*n; 253 return 4*n;
@@ -262,7 +262,7 @@ static ssize_t dsp56k_read(struct file *file, char *buf, size_t count,
262 } 262 }
263} 263}
264 264
265static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count, 265static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
266 loff_t *ppos) 266 loff_t *ppos)
267{ 267{
268 struct inode *inode = file->f_dentry->d_inode; 268 struct inode *inode = file->f_dentry->d_inode;
@@ -287,10 +287,10 @@ static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count,
287 } 287 }
288 case 2: /* 16 bit */ 288 case 2: /* 16 bit */
289 { 289 {
290 const short *data; 290 const short __user *data;
291 291
292 count /= 2; 292 count /= 2;
293 data = (const short *)buf; 293 data = (const short __user *)buf;
294 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT, 294 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT,
295 get_user(dsp56k_host_interface.data.w[1], data+n++)); 295 get_user(dsp56k_host_interface.data.w[1], data+n++));
296 return 2*n; 296 return 2*n;
@@ -306,10 +306,10 @@ static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count,
306 } 306 }
307 case 4: /* 32 bit */ 307 case 4: /* 32 bit */
308 { 308 {
309 const long *data; 309 const long __user *data;
310 310
311 count /= 4; 311 count /= 4;
312 data = (const long *)buf; 312 data = (const long __user *)buf;
313 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT, 313 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT,
314 get_user(dsp56k_host_interface.data.l, data+n++)); 314 get_user(dsp56k_host_interface.data.l, data+n++));
315 return 4*n; 315 return 4*n;
@@ -328,6 +328,7 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
328 unsigned int cmd, unsigned long arg) 328 unsigned int cmd, unsigned long arg)
329{ 329{
330 int dev = iminor(inode) & 0x0f; 330 int dev = iminor(inode) & 0x0f;
331 void __user *argp = (void __user *)arg;
331 332
332 switch(dev) 333 switch(dev)
333 { 334 {
@@ -336,9 +337,9 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
336 switch(cmd) { 337 switch(cmd) {
337 case DSP56K_UPLOAD: 338 case DSP56K_UPLOAD:
338 { 339 {
339 char *bin; 340 char __user *bin;
340 int r, len; 341 int r, len;
341 struct dsp56k_upload *binary = (struct dsp56k_upload *) arg; 342 struct dsp56k_upload __user *binary = argp;
342 343
343 if(get_user(len, &binary->len) < 0) 344 if(get_user(len, &binary->len) < 0)
344 return -EFAULT; 345 return -EFAULT;
@@ -372,7 +373,7 @@ static int dsp56k_ioctl(struct inode *inode, struct file *file,
372 case DSP56K_HOST_FLAGS: 373 case DSP56K_HOST_FLAGS:
373 { 374 {
374 int dir, out, status; 375 int dir, out, status;
375 struct dsp56k_host_flags *hf = (struct dsp56k_host_flags*) arg; 376 struct dsp56k_host_flags __user *hf = argp;
376 377
377 if(get_user(dir, &hf->dir) < 0) 378 if(get_user(dir, &hf->dir) < 0)
378 return -EFAULT; 379 return -EFAULT;
diff --git a/include/asm-m68k/dsp56k.h b/include/asm-m68k/dsp56k.h
index ab3dd33e23a1..2d8c0c9f794b 100644
--- a/include/asm-m68k/dsp56k.h
+++ b/include/asm-m68k/dsp56k.h
@@ -13,7 +13,7 @@
13/* Used for uploading DSP binary code */ 13/* Used for uploading DSP binary code */
14struct dsp56k_upload { 14struct dsp56k_upload {
15 int len; 15 int len;
16 char *bin; 16 char __user *bin;
17}; 17};
18 18
19/* For the DSP host flags */ 19/* For the DSP host flags */