aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/amiflop.c30
-rw-r--r--drivers/block/ataflop.c27
-rw-r--r--drivers/char/amiserial.c20
-rw-r--r--drivers/char/dsp56k.c29
-rw-r--r--drivers/char/scc.h2
-rw-r--r--drivers/input/evdev.c2
-rw-r--r--drivers/input/joystick/amijoy.c4
-rw-r--r--drivers/input/mouse/amimouse.c6
-rw-r--r--drivers/macintosh/adb-iop.c2
-rw-r--r--drivers/macintosh/via-macii.c4
-rw-r--r--drivers/macintosh/via-maciisi.c22
-rw-r--r--drivers/macintosh/via-pmu68k.c4
-rw-r--r--drivers/md/md.c3
-rw-r--r--drivers/net/hplance.c2
-rw-r--r--drivers/net/mac8390.c31
-rw-r--r--drivers/net/sun3lance.c2
-rw-r--r--drivers/scsi/Makefile3
-rw-r--r--drivers/scsi/NCR53C9x.c5
-rw-r--r--drivers/scsi/blz1230.c4
-rw-r--r--drivers/scsi/blz2060.c4
-rw-r--r--drivers/scsi/cyberstorm.c4
-rw-r--r--drivers/scsi/cyberstormII.c4
-rw-r--r--drivers/scsi/fastlane.c4
-rw-r--r--drivers/scsi/oktagon_esp.c2
-rw-r--r--drivers/scsi/wd33c93.c4
-rw-r--r--drivers/video/amifb.c36
-rw-r--r--drivers/video/aty/atyfb_base.c2
-rw-r--r--drivers/video/macfb.c15
-rw-r--r--drivers/zorro/proc.c2
29 files changed, 161 insertions, 118 deletions
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 3c679d30b698..b6e290956214 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -194,6 +194,8 @@ static DECLARE_WAIT_QUEUE_HEAD(ms_wait);
194 */ 194 */
195#define MAX_ERRORS 12 195#define MAX_ERRORS 12
196 196
197#define custom amiga_custom
198
197/* Prevent "aliased" accesses. */ 199/* Prevent "aliased" accesses. */
198static int fd_ref[4] = { 0,0,0,0 }; 200static int fd_ref[4] = { 0,0,0,0 };
199static int fd_device[4] = { 0, 0, 0, 0 }; 201static int fd_device[4] = { 0, 0, 0, 0 };
@@ -1439,6 +1441,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1439{ 1441{
1440 int drive = iminor(inode) & 3; 1442 int drive = iminor(inode) & 3;
1441 static struct floppy_struct getprm; 1443 static struct floppy_struct getprm;
1444 void __user *argp = (void __user *)param;
1442 1445
1443 switch(cmd){ 1446 switch(cmd){
1444 case FDFMTBEG: 1447 case FDFMTBEG:
@@ -1484,9 +1487,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1484 getprm.head=unit[drive].type->heads; 1487 getprm.head=unit[drive].type->heads;
1485 getprm.sect=unit[drive].dtype->sects * unit[drive].type->sect_mult; 1488 getprm.sect=unit[drive].dtype->sects * unit[drive].type->sect_mult;
1486 getprm.size=unit[drive].blocks; 1489 getprm.size=unit[drive].blocks;
1487 if (copy_to_user((void *)param, 1490 if (copy_to_user(argp, &getprm, sizeof(struct floppy_struct)))
1488 (void *)&getprm,
1489 sizeof(struct floppy_struct)))
1490 return -EFAULT; 1491 return -EFAULT;
1491 break; 1492 break;
1492 case FDSETPRM: 1493 case FDSETPRM:
@@ -1498,8 +1499,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1498 break; 1499 break;
1499#ifdef RAW_IOCTL 1500#ifdef RAW_IOCTL
1500 case IOCTL_RAW_TRACK: 1501 case IOCTL_RAW_TRACK:
1501 if (copy_to_user((void *)param, raw_buf, 1502 if (copy_to_user(argp, raw_buf, unit[drive].type->read_size))
1502 unit[drive].type->read_size))
1503 return -EFAULT; 1503 return -EFAULT;
1504 else 1504 else
1505 return unit[drive].type->read_size; 1505 return unit[drive].type->read_size;
@@ -1654,12 +1654,6 @@ static struct block_device_operations floppy_fops = {
1654 .media_changed = amiga_floppy_change, 1654 .media_changed = amiga_floppy_change,
1655}; 1655};
1656 1656
1657void __init amiga_floppy_setup (char *str, int *ints)
1658{
1659 printk (KERN_INFO "amiflop: Setting default df0 to %x\n", ints[1]);
1660 fd_def_df0 = ints[1];
1661}
1662
1663static int __init fd_probe_drives(void) 1657static int __init fd_probe_drives(void)
1664{ 1658{
1665 int drive,drives,nomem; 1659 int drive,drives,nomem;
@@ -1845,4 +1839,18 @@ void cleanup_module(void)
1845 unregister_blkdev(FLOPPY_MAJOR, "fd"); 1839 unregister_blkdev(FLOPPY_MAJOR, "fd");
1846} 1840}
1847#endif 1841#endif
1842
1843#else
1844static int __init amiga_floppy_setup (char *str)
1845{
1846 int n;
1847 if (!MACH_IS_AMIGA)
1848 return 0;
1849 if (!get_option(&str, &n))
1850 return 0;
1851 printk (KERN_INFO "amiflop: Setting default df0 to %x\n", n);
1852 fd_def_df0 = n;
1853}
1854
1855__setup("floppy=", amiga_floppy_setup);
1848#endif 1856#endif
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 3aa68a5447d6..f8ce235ccfc3 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1361,7 +1361,7 @@ static int floppy_revalidate(struct gendisk *disk)
1361 formats, for 'permanent user-defined' parameter: 1361 formats, for 'permanent user-defined' parameter:
1362 restore default_params[] here if flagged valid! */ 1362 restore default_params[] here if flagged valid! */
1363 if (default_params[drive].blocks == 0) 1363 if (default_params[drive].blocks == 0)
1364 UDT = 0; 1364 UDT = NULL;
1365 else 1365 else
1366 UDT = &default_params[drive]; 1366 UDT = &default_params[drive];
1367 } 1367 }
@@ -1495,6 +1495,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1495 struct floppy_struct getprm; 1495 struct floppy_struct getprm;
1496 int settype; 1496 int settype;
1497 struct floppy_struct setprm; 1497 struct floppy_struct setprm;
1498 void __user *argp = (void __user *)param;
1498 1499
1499 switch (cmd) { 1500 switch (cmd) {
1500 case FDGETPRM: 1501 case FDGETPRM:
@@ -1521,7 +1522,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1521 getprm.head = 2; 1522 getprm.head = 2;
1522 getprm.track = dtp->blocks/dtp->spt/2; 1523 getprm.track = dtp->blocks/dtp->spt/2;
1523 getprm.stretch = dtp->stretch; 1524 getprm.stretch = dtp->stretch;
1524 if (copy_to_user((void *)param, &getprm, sizeof(getprm))) 1525 if (copy_to_user(argp, &getprm, sizeof(getprm)))
1525 return -EFAULT; 1526 return -EFAULT;
1526 return 0; 1527 return 0;
1527 } 1528 }
@@ -1540,7 +1541,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1540 /* get the parameters from user space */ 1541 /* get the parameters from user space */
1541 if (floppy->ref != 1 && floppy->ref != -1) 1542 if (floppy->ref != 1 && floppy->ref != -1)
1542 return -EBUSY; 1543 return -EBUSY;
1543 if (copy_from_user(&setprm, (void *) param, sizeof(setprm))) 1544 if (copy_from_user(&setprm, argp, sizeof(setprm)))
1544 return -EFAULT; 1545 return -EFAULT;
1545 /* 1546 /*
1546 * first of all: check for floppy change and revalidate, 1547 * first of all: check for floppy change and revalidate,
@@ -1647,7 +1648,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1647 case FDFMTTRK: 1648 case FDFMTTRK:
1648 if (floppy->ref != 1 && floppy->ref != -1) 1649 if (floppy->ref != 1 && floppy->ref != -1)
1649 return -EBUSY; 1650 return -EBUSY;
1650 if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc))) 1651 if (copy_from_user(&fmt_desc, argp, sizeof(fmt_desc)))
1651 return -EFAULT; 1652 return -EFAULT;
1652 return do_format(drive, type, &fmt_desc); 1653 return do_format(drive, type, &fmt_desc);
1653 case FDCLRPRM: 1654 case FDCLRPRM:
@@ -1950,14 +1951,20 @@ Enomem:
1950 return -ENOMEM; 1951 return -ENOMEM;
1951} 1952}
1952 1953
1953 1954#ifndef MODULE
1954void __init atari_floppy_setup( char *str, int *ints ) 1955static int __init atari_floppy_setup(char *str)
1955{ 1956{
1957 int ints[3 + FD_MAX_UNITS];
1956 int i; 1958 int i;
1959
1960 if (!MACH_IS_ATARI)
1961 return 0;
1962
1963 str = get_options(str, 3 + FD_MAX_UNITS, ints);
1957 1964
1958 if (ints[0] < 1) { 1965 if (ints[0] < 1) {
1959 printk(KERN_ERR "ataflop_setup: no arguments!\n" ); 1966 printk(KERN_ERR "ataflop_setup: no arguments!\n" );
1960 return; 1967 return 0;
1961 } 1968 }
1962 else if (ints[0] > 2+FD_MAX_UNITS) { 1969 else if (ints[0] > 2+FD_MAX_UNITS) {
1963 printk(KERN_ERR "ataflop_setup: too many arguments\n" ); 1970 printk(KERN_ERR "ataflop_setup: too many arguments\n" );
@@ -1977,9 +1984,13 @@ void __init atari_floppy_setup( char *str, int *ints )
1977 else 1984 else
1978 UserSteprate[i-3] = ints[i]; 1985 UserSteprate[i-3] = ints[i];
1979 } 1986 }
1987 return 1;
1980} 1988}
1981 1989
1982static void atari_floppy_exit(void) 1990__setup("floppy=", atari_floppy_setup);
1991#endif
1992
1993static void __exit atari_floppy_exit(void)
1983{ 1994{
1984 int i; 1995 int i;
1985 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); 1996 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 869518e4035f..667a21c72edb 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -99,6 +99,7 @@ static char *serial_version = "4.30";
99#define _INLINE_ inline 99#define _INLINE_ inline
100#endif 100#endif
101 101
102#define custom amiga_custom
102static char *serial_name = "Amiga-builtin serial driver"; 103static char *serial_name = "Amiga-builtin serial driver";
103 104
104static struct tty_driver *serial_driver; 105static struct tty_driver *serial_driver;
@@ -1088,7 +1089,7 @@ static void rs_unthrottle(struct tty_struct * tty)
1088 */ 1089 */
1089 1090
1090static int get_serial_info(struct async_struct * info, 1091static int get_serial_info(struct async_struct * info,
1091 struct serial_struct * retinfo) 1092 struct serial_struct __user * retinfo)
1092{ 1093{
1093 struct serial_struct tmp; 1094 struct serial_struct tmp;
1094 struct serial_state *state = info->state; 1095 struct serial_state *state = info->state;
@@ -1112,7 +1113,7 @@ static int get_serial_info(struct async_struct * info,
1112} 1113}
1113 1114
1114static int set_serial_info(struct async_struct * info, 1115static int set_serial_info(struct async_struct * info,
1115 struct serial_struct * new_info) 1116 struct serial_struct __user * new_info)
1116{ 1117{
1117 struct serial_struct new_serial; 1118 struct serial_struct new_serial;
1118 struct serial_state old_state, *state; 1119 struct serial_state old_state, *state;
@@ -1193,7 +1194,7 @@ check_and_exit:
1193 * transmit holding register is empty. This functionality 1194 * transmit holding register is empty. This functionality
1194 * allows an RS485 driver to be written in user space. 1195 * allows an RS485 driver to be written in user space.
1195 */ 1196 */
1196static int get_lsr_info(struct async_struct * info, unsigned int *value) 1197static int get_lsr_info(struct async_struct * info, unsigned int __user *value)
1197{ 1198{
1198 unsigned char status; 1199 unsigned char status;
1199 unsigned int result; 1200 unsigned int result;
@@ -1284,6 +1285,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1284 struct async_struct * info = (struct async_struct *)tty->driver_data; 1285 struct async_struct * info = (struct async_struct *)tty->driver_data;
1285 struct async_icount cprev, cnow; /* kernel counter temps */ 1286 struct async_icount cprev, cnow; /* kernel counter temps */
1286 struct serial_icounter_struct icount; 1287 struct serial_icounter_struct icount;
1288 void __user *argp = (void __user *)arg;
1287 unsigned long flags; 1289 unsigned long flags;
1288 1290
1289 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1291 if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
@@ -1298,19 +1300,17 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1298 1300
1299 switch (cmd) { 1301 switch (cmd) {
1300 case TIOCGSERIAL: 1302 case TIOCGSERIAL:
1301 return get_serial_info(info, 1303 return get_serial_info(info, argp);
1302 (struct serial_struct *) arg);
1303 case TIOCSSERIAL: 1304 case TIOCSSERIAL:
1304 return set_serial_info(info, 1305 return set_serial_info(info, argp);
1305 (struct serial_struct *) arg);
1306 case TIOCSERCONFIG: 1306 case TIOCSERCONFIG:
1307 return 0; 1307 return 0;
1308 1308
1309 case TIOCSERGETLSR: /* Get line status register */ 1309 case TIOCSERGETLSR: /* Get line status register */
1310 return get_lsr_info(info, (unsigned int *) arg); 1310 return get_lsr_info(info, argp);
1311 1311
1312 case TIOCSERGSTRUCT: 1312 case TIOCSERGSTRUCT:
1313 if (copy_to_user((struct async_struct *) arg, 1313 if (copy_to_user(argp,
1314 info, sizeof(struct async_struct))) 1314 info, sizeof(struct async_struct)))
1315 return -EFAULT; 1315 return -EFAULT;
1316 return 0; 1316 return 0;
@@ -1369,7 +1369,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
1369 icount.brk = cnow.brk; 1369 icount.brk = cnow.brk;
1370 icount.buf_overrun = cnow.buf_overrun; 1370 icount.buf_overrun = cnow.buf_overrun;
1371 1371
1372 if (copy_to_user((void *)arg, &icount, sizeof(icount))) 1372 if (copy_to_user(argp, &icount, sizeof(icount)))
1373 return -EFAULT; 1373 return -EFAULT;
1374 return 0; 1374 return 0;
1375 case TIOCSERGWILD: 1375 case TIOCSERGWILD:
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/drivers/char/scc.h b/drivers/char/scc.h
index 51810f72f1a9..93998f5baff5 100644
--- a/drivers/char/scc.h
+++ b/drivers/char/scc.h
@@ -399,7 +399,7 @@ struct scc_port {
399 __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" );\ 399 __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" );\
400 } while (0) 400 } while (0)
401 401
402extern unsigned char scc_shadow[2][16]; 402static unsigned char scc_shadow[2][16];
403 403
404/* The following functions should relax the somehow complicated 404/* The following functions should relax the somehow complicated
405 * register access of the SCC. _SCCwrite() stores all written values 405 * register access of the SCC. _SCCwrite() stores all written values
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 362b33556b1a..745979f33dc2 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -159,7 +159,7 @@ struct input_event_compat {
159#ifdef CONFIG_X86_64 159#ifdef CONFIG_X86_64
160# define COMPAT_TEST is_compat_task() 160# define COMPAT_TEST is_compat_task()
161#elif defined(CONFIG_IA64) 161#elif defined(CONFIG_IA64)
162# define COMPAT_TEST IS_IA32_PROCESS(ia64_task_regs(current)) 162# define COMPAT_TEST IS_IA32_PROCESS(task_pt_regs(current))
163#elif defined(CONFIG_S390) 163#elif defined(CONFIG_S390)
164# define COMPAT_TEST test_thread_flag(TIF_31BIT) 164# define COMPAT_TEST test_thread_flag(TIF_31BIT)
165#elif defined(CONFIG_MIPS) 165#elif defined(CONFIG_MIPS)
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index 8558a99f6635..ec55a29fc861 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -64,8 +64,8 @@ static irqreturn_t amijoy_interrupt(int irq, void *dummy, struct pt_regs *fp)
64 if (amijoy[i]) { 64 if (amijoy[i]) {
65 65
66 switch (i) { 66 switch (i) {
67 case 0: data = ~custom.joy0dat; button = (~ciaa.pra >> 6) & 1; break; 67 case 0: data = ~amiga_custom.joy0dat; button = (~ciaa.pra >> 6) & 1; break;
68 case 1: data = ~custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break; 68 case 1: data = ~amiga_custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break;
69 } 69 }
70 70
71 input_regs(amijoy_dev[i], fp); 71 input_regs(amijoy_dev[i], fp);
diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c
index d13d4c8fe3c5..c8b2cc9f184c 100644
--- a/drivers/input/mouse/amimouse.c
+++ b/drivers/input/mouse/amimouse.c
@@ -41,7 +41,7 @@ static irqreturn_t amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp)
41 unsigned short joy0dat, potgor; 41 unsigned short joy0dat, potgor;
42 int nx, ny, dx, dy; 42 int nx, ny, dx, dy;
43 43
44 joy0dat = custom.joy0dat; 44 joy0dat = amiga_custom.joy0dat;
45 45
46 nx = joy0dat & 0xff; 46 nx = joy0dat & 0xff;
47 ny = joy0dat >> 8; 47 ny = joy0dat >> 8;
@@ -57,7 +57,7 @@ static irqreturn_t amimouse_interrupt(int irq, void *dummy, struct pt_regs *fp)
57 amimouse_lastx = nx; 57 amimouse_lastx = nx;
58 amimouse_lasty = ny; 58 amimouse_lasty = ny;
59 59
60 potgor = custom.potgor; 60 potgor = amiga_custom.potgor;
61 61
62 input_regs(amimouse_dev, fp); 62 input_regs(amimouse_dev, fp);
63 63
@@ -77,7 +77,7 @@ static int amimouse_open(struct input_dev *dev)
77{ 77{
78 unsigned short joy0dat; 78 unsigned short joy0dat;
79 79
80 joy0dat = custom.joy0dat; 80 joy0dat = amiga_custom.joy0dat;
81 81
82 amimouse_lastx = joy0dat & 0xff; 82 amimouse_lastx = joy0dat & 0xff;
83 amimouse_lasty = joy0dat >> 8; 83 amimouse_lasty = joy0dat >> 8;
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index 71aeb912ec61..d56d400b6aaa 100644
--- a/drivers/macintosh/adb-iop.c
+++ b/drivers/macintosh/adb-iop.c
@@ -239,7 +239,7 @@ static int adb_iop_write(struct adb_request *req)
239 239
240 local_irq_save(flags); 240 local_irq_save(flags);
241 241
242 req->next = 0; 242 req->next = NULL;
243 req->sent = 0; 243 req->sent = 0;
244 req->complete = 0; 244 req->complete = 0;
245 req->reply_len = 0; 245 req->reply_len = 0;
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
index e9a159ad3022..2a2ffe060169 100644
--- a/drivers/macintosh/via-macii.c
+++ b/drivers/macintosh/via-macii.c
@@ -260,7 +260,7 @@ static int macii_write(struct adb_request *req)
260 return -EINVAL; 260 return -EINVAL;
261 } 261 }
262 262
263 req->next = 0; 263 req->next = NULL;
264 req->sent = 0; 264 req->sent = 0;
265 req->complete = 0; 265 req->complete = 0;
266 req->reply_len = 0; 266 req->reply_len = 0;
@@ -295,7 +295,7 @@ static void macii_poll(void)
295 unsigned long flags; 295 unsigned long flags;
296 296
297 local_irq_save(flags); 297 local_irq_save(flags);
298 if (via[IFR] & SR_INT) macii_interrupt(0, 0, 0); 298 if (via[IFR] & SR_INT) macii_interrupt(0, NULL, NULL);
299 local_irq_restore(flags); 299 local_irq_restore(flags);
300} 300}
301 301
diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c
index a1966975d58f..0129fcc3b183 100644
--- a/drivers/macintosh/via-maciisi.c
+++ b/drivers/macintosh/via-maciisi.c
@@ -294,6 +294,24 @@ static void maciisi_sync(struct adb_request *req)
294 printk(KERN_ERR "maciisi_send_request: poll timed out!\n"); 294 printk(KERN_ERR "maciisi_send_request: poll timed out!\n");
295} 295}
296 296
297int
298maciisi_request(struct adb_request *req, void (*done)(struct adb_request *),
299 int nbytes, ...)
300{
301 va_list list;
302 int i;
303
304 req->nbytes = nbytes;
305 req->done = done;
306 req->reply_expected = 0;
307 va_start(list, nbytes);
308 for (i = 0; i < nbytes; i++)
309 req->data[i++] = va_arg(list, int);
310 va_end(list);
311
312 return maciisi_send_request(req, 1);
313}
314
297/* Enqueue a request, and run the queue if possible */ 315/* Enqueue a request, and run the queue if possible */
298static int 316static int
299maciisi_write(struct adb_request* req) 317maciisi_write(struct adb_request* req)
@@ -308,7 +326,7 @@ maciisi_write(struct adb_request* req)
308 req->complete = 1; 326 req->complete = 1;
309 return -EINVAL; 327 return -EINVAL;
310 } 328 }
311 req->next = 0; 329 req->next = NULL;
312 req->sent = 0; 330 req->sent = 0;
313 req->complete = 0; 331 req->complete = 0;
314 req->reply_len = 0; 332 req->reply_len = 0;
@@ -403,7 +421,7 @@ maciisi_poll(void)
403 421
404 local_irq_save(flags); 422 local_irq_save(flags);
405 if (via[IFR] & SR_INT) { 423 if (via[IFR] & SR_INT) {
406 maciisi_interrupt(0, 0, 0); 424 maciisi_interrupt(0, NULL, NULL);
407 } 425 }
408 else /* avoid calling this function too quickly in a loop */ 426 else /* avoid calling this function too quickly in a loop */
409 udelay(ADB_DELAY); 427 udelay(ADB_DELAY);
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index 6f80d76ac17c..f08e52f2107b 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -493,7 +493,7 @@ pmu_queue_request(struct adb_request *req)
493 return -EINVAL; 493 return -EINVAL;
494 } 494 }
495 495
496 req->next = 0; 496 req->next = NULL;
497 req->sent = 0; 497 req->sent = 0;
498 req->complete = 0; 498 req->complete = 0;
499 local_irq_save(flags); 499 local_irq_save(flags);
@@ -717,7 +717,7 @@ pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs)
717 printk(KERN_ERR "PMU: extra ADB reply\n"); 717 printk(KERN_ERR "PMU: extra ADB reply\n");
718 return; 718 return;
719 } 719 }
720 req_awaiting_reply = 0; 720 req_awaiting_reply = NULL;
721 if (len <= 2) 721 if (len <= 2)
722 req->reply_len = 0; 722 req->reply_len = 0;
723 else { 723 else {
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0302723fa21f..1778104e106c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1238,6 +1238,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1238 mdk_rdev_t *same_pdev; 1238 mdk_rdev_t *same_pdev;
1239 char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; 1239 char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
1240 struct kobject *ko; 1240 struct kobject *ko;
1241 char *s;
1241 1242
1242 if (rdev->mddev) { 1243 if (rdev->mddev) {
1243 MD_BUG(); 1244 MD_BUG();
@@ -1277,6 +1278,8 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1277 bdevname(rdev->bdev,b); 1278 bdevname(rdev->bdev,b);
1278 if (kobject_set_name(&rdev->kobj, "dev-%s", b) < 0) 1279 if (kobject_set_name(&rdev->kobj, "dev-%s", b) < 0)
1279 return -ENOMEM; 1280 return -ENOMEM;
1281 while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL)
1282 *s = '!';
1280 1283
1281 list_add(&rdev->same_set, &mddev->disks); 1284 list_add(&rdev->same_set, &mddev->disks);
1282 rdev->mddev = mddev; 1285 rdev->mddev = mddev;
diff --git a/drivers/net/hplance.c b/drivers/net/hplance.c
index 08703d6f934c..d8410634bcaf 100644
--- a/drivers/net/hplance.c
+++ b/drivers/net/hplance.c
@@ -150,7 +150,7 @@ static void __init hplance_init(struct net_device *dev, struct dio_dev *d)
150 lp->lance.name = (char*)d->name; /* discards const, shut up gcc */ 150 lp->lance.name = (char*)d->name; /* discards const, shut up gcc */
151 lp->lance.base = va; 151 lp->lance.base = va;
152 lp->lance.init_block = (struct lance_init_block *)(va + HPLANCE_MEMOFF); /* CPU addr */ 152 lp->lance.init_block = (struct lance_init_block *)(va + HPLANCE_MEMOFF); /* CPU addr */
153 lp->lance.lance_init_block = 0; /* LANCE addr of same RAM */ 153 lp->lance.lance_init_block = NULL; /* LANCE addr of same RAM */
154 lp->lance.busmaster_regval = LE_C3_BSWP; /* we're bigendian */ 154 lp->lance.busmaster_regval = LE_C3_BSWP; /* we're bigendian */
155 lp->lance.irq = d->ipl; 155 lp->lance.irq = d->ipl;
156 lp->lance.writerap = hplance_writerap; 156 lp->lance.writerap = hplance_writerap;
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
index d8c99f038fa0..06cb460361a8 100644
--- a/drivers/net/mac8390.c
+++ b/drivers/net/mac8390.c
@@ -559,55 +559,52 @@ static void mac8390_no_reset(struct net_device *dev)
559/* directly from daynaport.c by Alan Cox */ 559/* directly from daynaport.c by Alan Cox */
560static void dayna_memcpy_fromcard(struct net_device *dev, void *to, int from, int count) 560static void dayna_memcpy_fromcard(struct net_device *dev, void *to, int from, int count)
561{ 561{
562 volatile unsigned short *ptr; 562 volatile unsigned char *ptr;
563 unsigned short *target=to; 563 unsigned char *target=to;
564 from<<=1; /* word, skip overhead */ 564 from<<=1; /* word, skip overhead */
565 ptr=(unsigned short *)(dev->mem_start+from); 565 ptr=(unsigned char *)(dev->mem_start+from);
566 /* Leading byte? */ 566 /* Leading byte? */
567 if (from&2) { 567 if (from&2) {
568 *((char *)target)++ = *(((char *)ptr++)-1); 568 *target++ = ptr[-1];
569 ptr += 2;
569 count--; 570 count--;
570 } 571 }
571 while(count>=2) 572 while(count>=2)
572 { 573 {
573 *target++=*ptr++; /* Copy and */ 574 *(unsigned short *)target = *(unsigned short volatile *)ptr;
574 ptr++; /* skip cruft */ 575 ptr += 4; /* skip cruft */
576 target += 2;
575 count-=2; 577 count-=2;
576 } 578 }
577 /* Trailing byte? */ 579 /* Trailing byte? */
578 if(count) 580 if(count)
579 { 581 *target = *ptr;
580 /* Big endian */
581 unsigned short v=*ptr;
582 *((char *)target)=v>>8;
583 }
584} 582}
585 583
586static void dayna_memcpy_tocard(struct net_device *dev, int to, const void *from, int count) 584static void dayna_memcpy_tocard(struct net_device *dev, int to, const void *from, int count)
587{ 585{
588 volatile unsigned short *ptr; 586 volatile unsigned short *ptr;
589 const unsigned short *src=from; 587 const unsigned char *src=from;
590 to<<=1; /* word, skip overhead */ 588 to<<=1; /* word, skip overhead */
591 ptr=(unsigned short *)(dev->mem_start+to); 589 ptr=(unsigned short *)(dev->mem_start+to);
592 /* Leading byte? */ 590 /* Leading byte? */
593 if (to&2) { /* avoid a byte write (stomps on other data) */ 591 if (to&2) { /* avoid a byte write (stomps on other data) */
594 ptr[-1] = (ptr[-1]&0xFF00)|*((unsigned char *)src)++; 592 ptr[-1] = (ptr[-1]&0xFF00)|*src++;
595 ptr++; 593 ptr++;
596 count--; 594 count--;
597 } 595 }
598 while(count>=2) 596 while(count>=2)
599 { 597 {
600 *ptr++=*src++; /* Copy and */ 598 *ptr++=*(unsigned short *)src; /* Copy and */
601 ptr++; /* skip cruft */ 599 ptr++; /* skip cruft */
600 src += 2;
602 count-=2; 601 count-=2;
603 } 602 }
604 /* Trailing byte? */ 603 /* Trailing byte? */
605 if(count) 604 if(count)
606 { 605 {
607 /* Big endian */
608 unsigned short v=*src;
609 /* card doesn't like byte writes */ 606 /* card doesn't like byte writes */
610 *ptr=(*ptr&0x00FF)|(v&0xFF00); 607 *ptr=(*ptr&0x00FF)|(*src << 8);
611 } 608 }
612} 609}
613 610
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index 5c8fcd40ef4d..01bdb2334058 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -389,7 +389,7 @@ static int __init lance_probe( struct net_device *dev)
389 dev->stop = &lance_close; 389 dev->stop = &lance_close;
390 dev->get_stats = &lance_get_stats; 390 dev->get_stats = &lance_get_stats;
391 dev->set_multicast_list = &set_multicast_list; 391 dev->set_multicast_list = &set_multicast_list;
392 dev->set_mac_address = 0; 392 dev->set_mac_address = NULL;
393// KLUDGE -- REMOVE ME 393// KLUDGE -- REMOVE ME
394 set_bit(__LINK_STATE_PRESENT, &dev->state); 394 set_bit(__LINK_STATE_PRESENT, &dev->state);
395 395
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index f062ea0f813a..6e0c059df6a5 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -45,7 +45,7 @@ obj-$(CONFIG_CYBERSTORMII_SCSI) += NCR53C9x.o cyberstormII.o
45obj-$(CONFIG_BLZ2060_SCSI) += NCR53C9x.o blz2060.o 45obj-$(CONFIG_BLZ2060_SCSI) += NCR53C9x.o blz2060.o
46obj-$(CONFIG_BLZ1230_SCSI) += NCR53C9x.o blz1230.o 46obj-$(CONFIG_BLZ1230_SCSI) += NCR53C9x.o blz1230.o
47obj-$(CONFIG_FASTLANE_SCSI) += NCR53C9x.o fastlane.o 47obj-$(CONFIG_FASTLANE_SCSI) += NCR53C9x.o fastlane.o
48obj-$(CONFIG_OKTAGON_SCSI) += NCR53C9x.o oktagon_esp.o oktagon_io.o 48obj-$(CONFIG_OKTAGON_SCSI) += NCR53C9x.o oktagon_esp_mod.o
49obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o 49obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o
50obj-$(CONFIG_MAC_SCSI) += mac_scsi.o 50obj-$(CONFIG_MAC_SCSI) += mac_scsi.o
51obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o 51obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o
@@ -164,6 +164,7 @@ CFLAGS_ncr53c8xx.o := $(ncr53c8xx-flags-y) $(ncr53c8xx-flags-m)
164zalon7xx-objs := zalon.o ncr53c8xx.o 164zalon7xx-objs := zalon.o ncr53c8xx.o
165NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o 165NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o
166libata-objs := libata-core.o libata-scsi.o 166libata-objs := libata-core.o libata-scsi.o
167oktagon_esp_mod-objs := oktagon_esp.o oktagon_io.o
167 168
168# Files generated that shall be removed upon make clean 169# Files generated that shall be removed upon make clean
169clean-files := 53c7xx_d.h 53c700_d.h \ 170clean-files := 53c7xx_d.h 53c700_d.h \
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 640590bd014a..c7dd0154d012 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -1799,6 +1799,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs)
1799 */ 1799 */
1800 int oldphase, i = 0; /* or where we left off last time ?? esp->current_data ?? */ 1800 int oldphase, i = 0; /* or where we left off last time ?? esp->current_data ?? */
1801 int fifocnt = 0; 1801 int fifocnt = 0;
1802 unsigned char *p = phys_to_virt((unsigned long)SCptr->SCp.ptr);
1802 1803
1803 oldphase = esp_read(eregs->esp_status) & ESP_STAT_PMASK; 1804 oldphase = esp_read(eregs->esp_status) & ESP_STAT_PMASK;
1804 1805
@@ -1860,7 +1861,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs)
1860 1861
1861 /* read fifo */ 1862 /* read fifo */
1862 for(j=0;j<fifocnt;j++) 1863 for(j=0;j<fifocnt;j++)
1863 SCptr->SCp.ptr[i++] = esp_read(eregs->esp_fdata); 1864 p[i++] = esp_read(eregs->esp_fdata);
1864 1865
1865 ESPDATA(("(%d) ", i)); 1866 ESPDATA(("(%d) ", i));
1866 1867
@@ -1882,7 +1883,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs)
1882 1883
1883 /* fill fifo */ 1884 /* fill fifo */
1884 for(j=0;j<this_count;j++) 1885 for(j=0;j<this_count;j++)
1885 esp_write(eregs->esp_fdata, SCptr->SCp.ptr[i++]); 1886 esp_write(eregs->esp_fdata, p[i++]);
1886 1887
1887 /* how many left if this goes out ?? */ 1888 /* how many left if this goes out ?? */
1888 hmuch -= this_count; 1889 hmuch -= this_count;
diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c
index 763e409a1ff3..3867ac2de4c2 100644
--- a/drivers/scsi/blz1230.c
+++ b/drivers/scsi/blz1230.c
@@ -224,7 +224,7 @@ static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
224static void dma_dump_state(struct NCR_ESP *esp) 224static void dma_dump_state(struct NCR_ESP *esp)
225{ 225{
226 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 226 ESPLOG(("intreq:<%04x>, intena:<%04x>\n",
227 custom.intreqr, custom.intenar)); 227 amiga_custom.intreqr, amiga_custom.intenar));
228} 228}
229 229
230void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) 230void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length)
@@ -298,7 +298,7 @@ static int dma_irq_p(struct NCR_ESP *esp)
298 298
299static int dma_ports_p(struct NCR_ESP *esp) 299static int dma_ports_p(struct NCR_ESP *esp)
300{ 300{
301 return ((custom.intenar) & IF_PORTS); 301 return ((amiga_custom.intenar) & IF_PORTS);
302} 302}
303 303
304static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 304static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c
index d72d05fffdfa..4ebe69e32756 100644
--- a/drivers/scsi/blz2060.c
+++ b/drivers/scsi/blz2060.c
@@ -190,7 +190,7 @@ static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
190static void dma_dump_state(struct NCR_ESP *esp) 190static void dma_dump_state(struct NCR_ESP *esp)
191{ 191{
192 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 192 ESPLOG(("intreq:<%04x>, intena:<%04x>\n",
193 custom.intreqr, custom.intenar)); 193 amiga_custom.intreqr, amiga_custom.intenar));
194} 194}
195 195
196static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) 196static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length)
@@ -251,7 +251,7 @@ static void dma_led_on(struct NCR_ESP *esp)
251 251
252static int dma_ports_p(struct NCR_ESP *esp) 252static int dma_ports_p(struct NCR_ESP *esp)
253{ 253{
254 return ((custom.intenar) & IF_PORTS); 254 return ((amiga_custom.intenar) & IF_PORTS);
255} 255}
256 256
257static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 257static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c
index f9b940e56430..a4a4fac5c0a1 100644
--- a/drivers/scsi/cyberstorm.c
+++ b/drivers/scsi/cyberstorm.c
@@ -223,7 +223,7 @@ static void dma_dump_state(struct NCR_ESP *esp)
223 esp->esp_id, ((struct cyber_dma_registers *) 223 esp->esp_id, ((struct cyber_dma_registers *)
224 (esp->dregs))->cond_reg)); 224 (esp->dregs))->cond_reg));
225 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 225 ESPLOG(("intreq:<%04x>, intena:<%04x>\n",
226 custom.intreqr, custom.intenar)); 226 amiga_custom.intreqr, amiga_custom.intenar));
227} 227}
228 228
229static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) 229static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length)
@@ -322,7 +322,7 @@ static void dma_led_on(struct NCR_ESP *esp)
322 322
323static int dma_ports_p(struct NCR_ESP *esp) 323static int dma_ports_p(struct NCR_ESP *esp)
324{ 324{
325 return ((custom.intenar) & IF_PORTS); 325 return ((amiga_custom.intenar) & IF_PORTS);
326} 326}
327 327
328static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 328static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c
index a3caabfd7557..3a803d73bc5f 100644
--- a/drivers/scsi/cyberstormII.c
+++ b/drivers/scsi/cyberstormII.c
@@ -200,7 +200,7 @@ static void dma_dump_state(struct NCR_ESP *esp)
200 esp->esp_id, ((struct cyberII_dma_registers *) 200 esp->esp_id, ((struct cyberII_dma_registers *)
201 (esp->dregs))->cond_reg)); 201 (esp->dregs))->cond_reg));
202 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 202 ESPLOG(("intreq:<%04x>, intena:<%04x>\n",
203 custom.intreqr, custom.intenar)); 203 amiga_custom.intreqr, amiga_custom.intenar));
204} 204}
205 205
206static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) 206static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length)
@@ -259,7 +259,7 @@ static void dma_led_on(struct NCR_ESP *esp)
259 259
260static int dma_ports_p(struct NCR_ESP *esp) 260static int dma_ports_p(struct NCR_ESP *esp)
261{ 261{
262 return ((custom.intenar) & IF_PORTS); 262 return ((amiga_custom.intenar) & IF_PORTS);
263} 263}
264 264
265static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 265static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c
index ccee68b52f7e..8ae9c406a83b 100644
--- a/drivers/scsi/fastlane.c
+++ b/drivers/scsi/fastlane.c
@@ -268,7 +268,7 @@ static void dma_dump_state(struct NCR_ESP *esp)
268 esp->esp_id, ((struct fastlane_dma_registers *) 268 esp->esp_id, ((struct fastlane_dma_registers *)
269 (esp->dregs))->cond_reg)); 269 (esp->dregs))->cond_reg));
270 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 270 ESPLOG(("intreq:<%04x>, intena:<%04x>\n",
271 custom.intreqr, custom.intenar)); 271 amiga_custom.intreqr, amiga_custom.intenar));
272} 272}
273 273
274static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) 274static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length)
@@ -368,7 +368,7 @@ static void dma_led_on(struct NCR_ESP *esp)
368 368
369static int dma_ports_p(struct NCR_ESP *esp) 369static int dma_ports_p(struct NCR_ESP *esp)
370{ 370{
371 return ((custom.intenar) & IF_PORTS); 371 return ((amiga_custom.intenar) & IF_PORTS);
372} 372}
373 373
374static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 374static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c
index 5d9c9ada814f..dee426f8c07b 100644
--- a/drivers/scsi/oktagon_esp.c
+++ b/drivers/scsi/oktagon_esp.c
@@ -490,7 +490,7 @@ static void dma_led_on(struct NCR_ESP *esp)
490 490
491static int dma_ports_p(struct NCR_ESP *esp) 491static int dma_ports_p(struct NCR_ESP *esp)
492{ 492{
493 return ((custom.intenar) & IF_PORTS); 493 return ((amiga_custom.intenar) & IF_PORTS);
494} 494}
495 495
496static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) 496static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index fd63add6a577..fb53eeaee617 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -465,7 +465,7 @@ wd33c93_execute(struct Scsi_Host *instance)
465 */ 465 */
466 466
467 cmd = (struct scsi_cmnd *) hostdata->input_Q; 467 cmd = (struct scsi_cmnd *) hostdata->input_Q;
468 prev = 0; 468 prev = NULL;
469 while (cmd) { 469 while (cmd) {
470 if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun))) 470 if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun)))
471 break; 471 break;
@@ -1569,7 +1569,7 @@ wd33c93_abort(struct scsi_cmnd * cmd)
1569 */ 1569 */
1570 1570
1571 tmp = (struct scsi_cmnd *) hostdata->input_Q; 1571 tmp = (struct scsi_cmnd *) hostdata->input_Q;
1572 prev = 0; 1572 prev = NULL;
1573 while (tmp) { 1573 while (tmp) {
1574 if (tmp == cmd) { 1574 if (tmp == cmd) {
1575 if (prev) 1575 if (prev)
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index d549e215f3c5..2c42a812655a 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -590,6 +590,8 @@ static u_short maxfmode, chipset;
590#define highw(x) ((u_long)(x)>>16 & 0xffff) 590#define highw(x) ((u_long)(x)>>16 & 0xffff)
591#define loww(x) ((u_long)(x) & 0xffff) 591#define loww(x) ((u_long)(x) & 0xffff)
592 592
593#define custom amiga_custom
594
593#define VBlankOn() custom.intena = IF_SETCLR|IF_COPER 595#define VBlankOn() custom.intena = IF_SETCLR|IF_COPER
594#define VBlankOff() custom.intena = IF_COPER 596#define VBlankOff() custom.intena = IF_COPER
595 597
@@ -1164,8 +1166,8 @@ static void ami_update_display(void);
1164static void ami_init_display(void); 1166static void ami_init_display(void);
1165static void ami_do_blank(void); 1167static void ami_do_blank(void);
1166static int ami_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix); 1168static int ami_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix);
1167static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data); 1169static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data);
1168static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data); 1170static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data);
1169static int ami_get_cursorstate(struct fb_cursorstate *state); 1171static int ami_get_cursorstate(struct fb_cursorstate *state);
1170static int ami_set_cursorstate(struct fb_cursorstate *state); 1172static int ami_set_cursorstate(struct fb_cursorstate *state);
1171static void ami_set_sprite(void); 1173static void ami_set_sprite(void);
@@ -2179,6 +2181,7 @@ static int amifb_ioctl(struct inode *inode, struct file *file,
2179 struct fb_var_cursorinfo var; 2181 struct fb_var_cursorinfo var;
2180 struct fb_cursorstate state; 2182 struct fb_cursorstate state;
2181 } crsr; 2183 } crsr;
2184 void __user *argp = (void __user *)arg;
2182 int i; 2185 int i;
2183 2186
2184 switch (cmd) { 2187 switch (cmd) {
@@ -2186,33 +2189,32 @@ static int amifb_ioctl(struct inode *inode, struct file *file,
2186 i = ami_get_fix_cursorinfo(&crsr.fix); 2189 i = ami_get_fix_cursorinfo(&crsr.fix);
2187 if (i) 2190 if (i)
2188 return i; 2191 return i;
2189 return copy_to_user((void *)arg, &crsr.fix, 2192 return copy_to_user(argp, &crsr.fix,
2190 sizeof(crsr.fix)) ? -EFAULT : 0; 2193 sizeof(crsr.fix)) ? -EFAULT : 0;
2191 2194
2192 case FBIOGET_VCURSORINFO: 2195 case FBIOGET_VCURSORINFO:
2193 i = ami_get_var_cursorinfo(&crsr.var, 2196 i = ami_get_var_cursorinfo(&crsr.var,
2194 ((struct fb_var_cursorinfo *)arg)->data); 2197 ((struct fb_var_cursorinfo __user *)arg)->data);
2195 if (i) 2198 if (i)
2196 return i; 2199 return i;
2197 return copy_to_user((void *)arg, &crsr.var, 2200 return copy_to_user(argp, &crsr.var,
2198 sizeof(crsr.var)) ? -EFAULT : 0; 2201 sizeof(crsr.var)) ? -EFAULT : 0;
2199 2202
2200 case FBIOPUT_VCURSORINFO: 2203 case FBIOPUT_VCURSORINFO:
2201 if (copy_from_user(&crsr.var, (void *)arg, 2204 if (copy_from_user(&crsr.var, argp, sizeof(crsr.var)))
2202 sizeof(crsr.var)))
2203 return -EFAULT; 2205 return -EFAULT;
2204 return ami_set_var_cursorinfo(&crsr.var, 2206 return ami_set_var_cursorinfo(&crsr.var,
2205 ((struct fb_var_cursorinfo *)arg)->data); 2207 ((struct fb_var_cursorinfo __user *)arg)->data);
2206 2208
2207 case FBIOGET_CURSORSTATE: 2209 case FBIOGET_CURSORSTATE:
2208 i = ami_get_cursorstate(&crsr.state); 2210 i = ami_get_cursorstate(&crsr.state);
2209 if (i) 2211 if (i)
2210 return i; 2212 return i;
2211 return copy_to_user((void *)arg, &crsr.state, 2213 return copy_to_user(argp, &crsr.state,
2212 sizeof(crsr.state)) ? -EFAULT : 0; 2214 sizeof(crsr.state)) ? -EFAULT : 0;
2213 2215
2214 case FBIOPUT_CURSORSTATE: 2216 case FBIOPUT_CURSORSTATE:
2215 if (copy_from_user(&crsr.state, (void *)arg, 2217 if (copy_from_user(&crsr.state, argp,
2216 sizeof(crsr.state))) 2218 sizeof(crsr.state)))
2217 return -EFAULT; 2219 return -EFAULT;
2218 return ami_set_cursorstate(&crsr.state); 2220 return ami_set_cursorstate(&crsr.state);
@@ -3325,7 +3327,7 @@ static int ami_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix)
3325 return 0; 3327 return 0;
3326} 3328}
3327 3329
3328static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data) 3330static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data)
3329{ 3331{
3330 struct amifb_par *par = &currentpar; 3332 struct amifb_par *par = &currentpar;
3331 register u_short *lspr, *sspr; 3333 register u_short *lspr, *sspr;
@@ -3347,14 +3349,14 @@ static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data)
3347 var->yspot = par->crsr.spot_y; 3349 var->yspot = par->crsr.spot_y;
3348 if (size > var->height*var->width) 3350 if (size > var->height*var->width)
3349 return -ENAMETOOLONG; 3351 return -ENAMETOOLONG;
3350 if (!access_ok(VERIFY_WRITE, (void *)data, size)) 3352 if (!access_ok(VERIFY_WRITE, data, size))
3351 return -EFAULT; 3353 return -EFAULT;
3352 delta = 1<<par->crsr.fmode; 3354 delta = 1<<par->crsr.fmode;
3353 lspr = lofsprite + (delta<<1); 3355 lspr = lofsprite + (delta<<1);
3354 if (par->bplcon0 & BPC0_LACE) 3356 if (par->bplcon0 & BPC0_LACE)
3355 sspr = shfsprite + (delta<<1); 3357 sspr = shfsprite + (delta<<1);
3356 else 3358 else
3357 sspr = 0; 3359 sspr = NULL;
3358 for (height = (short)var->height-1; height >= 0; height--) { 3360 for (height = (short)var->height-1; height >= 0; height--) {
3359 bits = 0; words = delta; datawords = 0; 3361 bits = 0; words = delta; datawords = 0;
3360 for (width = (short)var->width-1; width >= 0; width--) { 3362 for (width = (short)var->width-1; width >= 0; width--) {
@@ -3400,7 +3402,7 @@ static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data)
3400 return 0; 3402 return 0;
3401} 3403}
3402 3404
3403static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data) 3405static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data)
3404{ 3406{
3405 struct amifb_par *par = &currentpar; 3407 struct amifb_par *par = &currentpar;
3406 register u_short *lspr, *sspr; 3408 register u_short *lspr, *sspr;
@@ -3427,7 +3429,7 @@ static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data)
3427 return -EINVAL; 3429 return -EINVAL;
3428 if (!var->height) 3430 if (!var->height)
3429 return -EINVAL; 3431 return -EINVAL;
3430 if (!access_ok(VERIFY_READ, (void *)data, var->width*var->height)) 3432 if (!access_ok(VERIFY_READ, data, var->width*var->height))
3431 return -EFAULT; 3433 return -EFAULT;
3432 delta = 1<<fmode; 3434 delta = 1<<fmode;
3433 lofsprite = shfsprite = (u_short *)spritememory; 3435 lofsprite = shfsprite = (u_short *)spritememory;
@@ -3442,13 +3444,13 @@ static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data)
3442 if (((var->height+2)<<fmode<<2) > SPRITEMEMSIZE) 3444 if (((var->height+2)<<fmode<<2) > SPRITEMEMSIZE)
3443 return -EINVAL; 3445 return -EINVAL;
3444 memset(lspr, 0, (var->height+2)<<fmode<<2); 3446 memset(lspr, 0, (var->height+2)<<fmode<<2);
3445 sspr = 0; 3447 sspr = NULL;
3446 } 3448 }
3447 for (height = (short)var->height-1; height >= 0; height--) { 3449 for (height = (short)var->height-1; height >= 0; height--) {
3448 bits = 16; words = delta; datawords = 0; 3450 bits = 16; words = delta; datawords = 0;
3449 for (width = (short)var->width-1; width >= 0; width--) { 3451 for (width = (short)var->width-1; width >= 0; width--) {
3450 unsigned long tdata = 0; 3452 unsigned long tdata = 0;
3451 get_user(tdata, (char *)data); 3453 get_user(tdata, data);
3452 data++; 3454 data++;
3453#ifdef __mc68000__ 3455#ifdef __mc68000__
3454 asm volatile ( 3456 asm volatile (
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index e370125e4fbc..ed81005cbdba 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -3501,7 +3501,7 @@ err_release_mem:
3501 3501
3502static int __devinit atyfb_atari_probe(void) 3502static int __devinit atyfb_atari_probe(void)
3503{ 3503{
3504 struct aty_par *par; 3504 struct atyfb_par *par;
3505 struct fb_info *info; 3505 struct fb_info *info;
3506 int m64_num; 3506 int m64_num;
3507 u32 clock_r; 3507 u32 clock_r;
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c
index cfc748e94272..e6cbd9de944a 100644
--- a/drivers/video/macfb.c
+++ b/drivers/video/macfb.c
@@ -609,18 +609,19 @@ void __init macfb_setup(char *options)
609 } 609 }
610} 610}
611 611
612void __init macfb_init(void) 612static int __init macfb_init(void)
613{ 613{
614 int video_cmap_len, video_is_nubus = 0; 614 int video_cmap_len, video_is_nubus = 0;
615 struct nubus_dev* ndev = NULL; 615 struct nubus_dev* ndev = NULL;
616 char *option = NULL; 616 char *option = NULL;
617 int err;
617 618
618 if (fb_get_options("macfb", &option)) 619 if (fb_get_options("macfb", &option))
619 return -ENODEV; 620 return -ENODEV;
620 macfb_setup(option); 621 macfb_setup(option);
621 622
622 if (!MACH_IS_MAC) 623 if (!MACH_IS_MAC)
623 return; 624 return -ENODEV;
624 625
625 /* There can only be one internal video controller anyway so 626 /* There can only be one internal video controller anyway so
626 we're not too worried about this */ 627 we're not too worried about this */
@@ -958,11 +959,11 @@ void __init macfb_init(void)
958 959
959 fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0); 960 fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
960 961
961 if (register_framebuffer(&fb_info) < 0) 962 err = register_framebuffer(&fb_info);
962 return; 963 if (!err)
963 964 printk("fb%d: %s frame buffer device\n",
964 printk("fb%d: %s frame buffer device\n", 965 fb_info.node, fb_info.fix.id);
965 fb_info.node, fb_info.fix.id); 966 return err;
966} 967}
967 968
968module_init(macfb_init); 969module_init(macfb_init);
diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
index 1a409c2c320c..7aa2d3de6d37 100644
--- a/drivers/zorro/proc.c
+++ b/drivers/zorro/proc.c
@@ -45,7 +45,7 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
45} 45}
46 46
47static ssize_t 47static ssize_t
48proc_bus_zorro_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos) 48proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
49{ 49{
50 struct inode *ino = file->f_dentry->d_inode; 50 struct inode *ino = file->f_dentry->d_inode;
51 struct proc_dir_entry *dp = PDE(ino); 51 struct proc_dir_entry *dp = PDE(ino);