diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS	Thu Apr 17 12:34:56 2003
+++ b/MAINTAINERS	Tue Apr 22 00:40:49 2003
@@ -651,9 +651,11 @@
 S:	Maintained
 
 ETHERNET BRIDGE
+P:	Stephen Hemminger
+M:	shemminger@osdl.org
 L:	bridge@math.leidenuniv.nl
 W:	http://bridge.sourceforge.net/
-S:	Unmaintained
+S:	Maintained
 
 ETHERTEAM 16I DRIVER
 P:	Mika Kuoppala
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Sat Apr 19 19:39:07 2003
+++ b/Makefile	Fri Apr 25 04:30:21 2003
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 68
-EXTRAVERSION =
+EXTRAVERSION = -bk6
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig
--- a/arch/alpha/Kconfig	Tue Apr 15 12:43:41 2003
+++ b/arch/alpha/Kconfig	Sun Apr 20 12:56:50 2003
@@ -291,7 +291,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -514,7 +514,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
 	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -688,7 +688,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -710,7 +710,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -862,7 +862,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -912,7 +912,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c
--- a/arch/alpha/kernel/core_irongate.c	Tue Feb 18 05:29:57 2003
+++ b/arch/alpha/kernel/core_irongate.c	Sun Apr 20 09:14:40 2003
@@ -14,6 +14,7 @@
 #include <linux/pci.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 
 #include <asm/ptrace.h>
 #include <asm/system.h>
diff -Nru a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
--- a/arch/alpha/kernel/irq.c	Sat Mar  8 14:50:43 2003
+++ b/arch/alpha/kernel/irq.c	Mon Apr 21 10:00:46 2003
@@ -45,7 +45,10 @@
  * Special irq handlers.
  */
 
-void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
+irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs)
+{
+	return IRQ_NONE;
+}
 
 /*
  * Generic no controller code
@@ -414,7 +417,7 @@
 }
 
 int
-request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
 	    unsigned long irqflags, const char * devname, void *dev_id)
 {
 	int retval;
diff -Nru a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h
--- a/arch/alpha/kernel/proto.h	Tue Apr 15 10:38:00 2003
+++ b/arch/alpha/kernel/proto.h	Mon Apr 21 10:00:46 2003
@@ -1,4 +1,5 @@
 #include <linux/config.h>
+#include <linux/interrupt.h>
 
 
 /* Prototypes of functions used across modules here in this directory.  */
@@ -128,7 +129,7 @@
 /* extern void reset_for_srm(void); */
 
 /* time.c */
-extern void timer_interrupt(int irq, void *dev, struct pt_regs * regs);
+extern irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs);
 extern void common_init_rtc(void);
 extern unsigned long est_cycle_freq;
 
diff -Nru a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
--- a/arch/alpha/kernel/setup.c	Tue Apr 15 10:58:12 2003
+++ b/arch/alpha/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -32,11 +32,7 @@
 #include <linux/pci.h>
 #include <linux/seq_file.h>
 #include <linux/root_dev.h>
-
-#ifdef CONFIG_BLK_DEV_INITRD
-#include <linux/blk.h>
-#endif
-
+#include <linux/initrd.h>
 #ifdef CONFIG_MAGIC_SYSRQ
 #include <linux/sysrq.h>
 #include <linux/reboot.h>
diff -Nru a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
--- a/arch/alpha/kernel/srmcons.c	Mon Jan 20 09:38:36 2003
+++ b/arch/alpha/kernel/srmcons.c	Thu Apr 24 03:30:40 2003
@@ -318,11 +318,11 @@
 	spin_unlock_irqrestore(&srmcons_callback_lock, flags);
 }
 
-static kdev_t
-srm_console_device(struct console *co)
+static struct tty_driver *
+srm_console_device(struct console *co, int *index)
 {
-	return mk_kdev(srmcons_driver.major,
-		       srmcons_driver.minor_start + co->index);
+	*index = co->index;
+	return &srmcons_driver;
 }
 
 static int __init
diff -Nru a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
--- a/arch/alpha/kernel/time.c	Thu Apr  3 14:49:57 2003
+++ b/arch/alpha/kernel/time.c	Mon Apr 21 10:00:46 2003
@@ -94,7 +94,7 @@
  * timer_interrupt() needs to keep up the real-time clock,
  * as well as call the "do_timer()" routine every clocktick
  */
-void timer_interrupt(int irq, void *dev, struct pt_regs * regs)
+irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs)
 {
 	unsigned long delta;
 	__u32 now;
@@ -139,6 +139,7 @@
 	}
 
 	write_sequnlock(&xtime_lock);
+	return IRQ_HANDLED;
 }
 
 void
diff -Nru a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
--- a/arch/alpha/mm/init.c	Wed Jan  8 12:37:27 2003
+++ b/arch/alpha/mm/init.c	Sat Apr 19 23:22:41 2003
@@ -66,19 +66,9 @@
 pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-	pte_t *pte;
-	long timeout = 10;
-
- retry:
-	pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte)
 		clear_page(pte);
-	else if (--timeout >= 0) {
-		current->state = TASK_UNINTERRUPTIBLE;
-		schedule_timeout(HZ);
-		goto retry;
-	}
-
 	return pte;
 }
 
diff -Nru a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
--- a/arch/alpha/mm/numa.c	Tue Feb 18 05:31:01 2003
+++ b/arch/alpha/mm/numa.c	Sun Apr 20 09:14:40 2003
@@ -12,9 +12,7 @@
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/swap.h>
-#ifdef CONFIG_BLK_DEV_INITRD
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 
 #include <asm/hwrpb.h>
 #include <asm/pgalloc.h>
diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig
--- a/arch/arm/Kconfig	Tue Apr 15 07:31:47 2003
+++ b/arch/arm/Kconfig	Sun Apr 20 12:56:50 2003
@@ -445,7 +445,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -459,7 +459,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -717,7 +717,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -739,7 +739,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -770,7 +770,7 @@
 	  page on the WWW at
 	  <http://www.cs.utexas.edu/users/kharker/linux-laptop/> and the
 	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that, even if you say N here, Linux on the x86 architecture
 	  will issue the hlt instruction if nothing is to be done, thereby
@@ -809,7 +809,7 @@
 	  In order to use APM, you will need supporting software. For location
 	  and more information, read <file:Documentation/pm.txt> and the
 	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver does not spin down disk drives (see the hdparm(8)
 	  manpage ("man 8 hdparm") for that), and it doesn't turn off
@@ -1063,7 +1063,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S
--- a/arch/arm/boot/compressed/head-xscale.S	Tue Apr 15 08:12:47 2003
+++ b/arch/arm/boot/compressed/head-xscale.S	Mon Apr 21 04:10:46 2003
@@ -35,7 +35,7 @@
 		mcr	p15, 0, r0, c1, c0, 0
 
 #ifdef	CONFIG_ARCH_IQ80321
-		orr	pc, pc, #0xa0000000
+		orr	pc, pc, #PHYS_OFFSET	@ jump to physical memory if we are not there.
 		nop
 		mov	r7, #MACH_TYPE_IQ80321
 #endif
diff -Nru a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
--- a/arch/arm/kernel/process.c	Tue Mar  4 16:50:09 2003
+++ b/arch/arm/kernel/process.c	Mon Apr 21 15:43:40 2003
@@ -2,7 +2,7 @@
  *  linux/arch/arm/kernel/process.c
  *
  *  Copyright (C) 1996-2000 Russell King - Converted to ARM.
- *  Origional Copyright (C) 1995  Linus Torvalds
+ *  Original Copyright (C) 1995  Linus Torvalds
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
--- a/arch/arm/kernel/setup.c	Tue Mar  4 16:48:44 2003
+++ b/arch/arm/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -13,7 +13,7 @@
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/utsname.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
diff -Nru a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
--- a/arch/arm/mach-clps711x/fortunet.c	Sun Nov 17 07:31:08 2002
+++ b/arch/arm/mach-clps711x/fortunet.c	Sun Apr 20 09:14:40 2003
@@ -22,7 +22,7 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
diff -Nru a/arch/arm/mach-iop3xx/iop321-pci.c b/arch/arm/mach-iop3xx/iop321-pci.c
--- a/arch/arm/mach-iop3xx/iop321-pci.c	Tue Apr 15 08:12:47 2003
+++ b/arch/arm/mach-iop3xx/iop321-pci.c	Mon Apr 21 04:16:16 2003
@@ -212,13 +212,13 @@
 
 	switch (nr) {
 	case 0:
-		res[0].start = IOP321_PCI_LOWER_IO + 0x6e000000;
-		res[0].end   = IOP321_PCI_LOWER_IO + 0x6e00ffff;
+		res[0].start = IOP321_PCI_IO_BASE + 0x6e000000;
+		res[0].end   = IOP321_PCI_IO_BASE + IOP321_PCI_IO_SIZE-1 + 0x6e000000;
 		res[0].name  = "PCI IO Primary";
 		res[0].flags = IORESOURCE_IO;
 
-		res[1].start = IOP321_PCI_LOWER_MEM;
-		res[1].end   = IOP321_PCI_LOWER_MEM + IOP321_PCI_WINDOW_SIZE;
+		res[1].start = IOP321_PCI_MEM_BASE;
+		res[1].end   = IOP321_PCI_MEM_BASE + IOP321_PCI_MEM_SIZE;
 		res[1].name  = "PCI Memory Primary";
 		res[1].flags = IORESOURCE_MEM;
 		break;
diff -Nru a/arch/arm/mach-iop3xx/iq80310-time.c b/arch/arm/mach-iop3xx/iq80310-time.c
--- a/arch/arm/mach-iop3xx/iq80310-time.c	Tue Apr  1 03:16:51 2003
+++ b/arch/arm/mach-iop3xx/iq80310-time.c	Mon Apr 21 15:43:40 2003
@@ -101,7 +101,7 @@
 	 *
 	 * Since the timer interrupt is cascaded through the CPLD and
 	 * the 80312 and the demux code calls do_IRQ, the irq count is
-	 * going to be atleast 2 when we get here and this will cause the
+	 * going to be at least 2 when we get here and this will cause the
 	 * kernel to increment the system tick counter even if we're
 	 * idle. This causes it to look like there's always 100% system
 	 * time, which is not the case.  To get around it, we just decrement
diff -Nru a/arch/arm/mach-iop3xx/mm-321.c b/arch/arm/mach-iop3xx/mm-321.c
--- a/arch/arm/mach-iop3xx/mm-321.c	Tue Apr 15 08:12:47 2003
+++ b/arch/arm/mach-iop3xx/mm-321.c	Mon Apr 21 15:43:40 2003
@@ -1,7 +1,7 @@
 /*
  * linux/arch/arm/mach-iop3xx/mm.c
  *
- * Low level memory intialization for IOP321 based systems
+ * Low level memory initialization for IOP321 based systems
  *
  * Author: Rory Bolt <rorybolt@pacbell.net>
  * Copyright (C) 2002 Rory Bolt
@@ -31,7 +31,7 @@
  /* virtual     physical      length      type */
 
  /* mem mapped registers */
- { 0xfff00000,  0xffffe000,   0x00002000,  MT_DEVICE },
+ { IOP321_VIRT_MEM_BASE,  IOP321_PHY_MEM_BASE,   0x00002000,  MT_DEVICE },
 
  /* PCI IO space */
  { 0xfe000000,  0x90000000,   0x00020000,  MT_DEVICE }
@@ -52,7 +52,7 @@
  /* virtual     physical      length        type */
 
  /* on-board devices */
- { 0xfe800000,  0xfe800000,   0x00100000,   MT_DEVICE }
+ { 0xfe800000,  IQ80321_UART1,   0x00100000,   MT_DEVICE }
 };
 
 void __init iq80321_map_io(void)
diff -Nru a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
--- a/arch/arm/mach-pxa/generic.c	Wed Feb 19 05:30:25 2003
+++ b/arch/arm/mach-pxa/generic.c	Mon Apr 21 15:43:40 2003
@@ -13,7 +13,7 @@
  *
  * Since this file should be linked before any other machine specific file,
  * the __initcall() here will be executed first.  This serves as default
- * initialization stuff for PXA machines which can be overriden later if
+ * initialization stuff for PXA machines which can be overridden later if
  * need be.
  */
 #include <linux/config.h>
diff -Nru a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
--- a/arch/arm/mach-pxa/sleep.S	Tue Jul 16 13:04:42 2002
+++ b/arch/arm/mach-pxa/sleep.S	Mon Apr 21 15:43:40 2003
@@ -95,7 +95,7 @@
  *       This is to allow sleep_save_sp to be accessed with a relative load
  *       while we can't rely on any MMU translation.  We could have put
  *       sleep_save_sp in the .text section as well, but some setups might
- *       insist on it to be truely read-only.
+ *       insist on it to be truly read-only.
  */
 
 	.data
diff -Nru a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S
--- a/arch/arm/mach-sa1100/sleep.S	Wed Jul 10 09:01:31 2002
+++ b/arch/arm/mach-sa1100/sleep.S	Mon Apr 21 15:43:40 2003
@@ -171,7 +171,7 @@
  *       This is to allow sleep_save_sp to be accessed with a relative load
  *       while we can't rely on any MMU translation.  We could have put
  *       sleep_save_sp in the .text section as well, but some setups might
- *       insist on it to be truely read-only.
+ *       insist on it to be truly read-only.
  */
 
 	.data
diff -Nru a/arch/arm/mm/discontig.c b/arch/arm/mm/discontig.c
--- a/arch/arm/mm/discontig.c	Mon Nov 11 05:21:09 2002
+++ b/arch/arm/mm/discontig.c	Mon Apr 21 15:43:41 2003
@@ -20,7 +20,7 @@
 #endif
 
 /*
- * Our node_data structure for discontigous memory.
+ * Our node_data structure for discontiguous memory.
  */
 
 static bootmem_data_t node_bootmem_data[NR_NODES];
diff -Nru a/arch/arm/mm/init.c b/arch/arm/mm/init.c
--- a/arch/arm/mm/init.c	Wed Jan  8 12:37:27 2003
+++ b/arch/arm/mm/init.c	Sun Apr 20 09:14:40 2003
@@ -20,7 +20,7 @@
 #include <linux/smp.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 
 #include <asm/segment.h>
 #include <asm/mach-types.h>
diff -Nru a/arch/cris/Kconfig b/arch/cris/Kconfig
--- a/arch/cris/Kconfig	Sat Mar  8 14:50:37 2003
+++ b/arch/cris/Kconfig	Sun Apr 20 12:56:50 2003
@@ -40,7 +40,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -615,7 +615,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -667,7 +667,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/cris/drivers/Kconfig b/arch/cris/drivers/Kconfig
--- a/arch/cris/drivers/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/arch/cris/drivers/Kconfig	Sun Apr 20 12:56:50 2003
@@ -30,7 +30,7 @@
 	  If your Linux machine will be connected to an Ethernet and you have
 	  an Ethernet network interface card (NIC) installed in your computer,
 	  say Y here and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. You will then also have
+	  <http://www.tldp.org/docs.html#howto>. You will then also have
 	  to say Y to the driver for your particular NIC.
 
 	  Note that the answer to this question won't directly affect the
@@ -392,7 +392,7 @@
 	  box (as opposed to using a serial printer; if the connector at the
 	  printer has 9 or 25 holes ["female"], then it's serial), say Y.
 	  Also read the Printing-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  It is possible to share one parallel port among several devices
 	  (e.g. printer and ZIP drive) and it is safe to compile the
@@ -485,7 +485,7 @@
 	  topics, is contained in <file:Documentation/ide.txt>. For detailed
 	  information about hard drives, consult the Disk-HOWTO and the
 	  Multi-Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  To fine-tune ATA/IDE drive/interface parameters for improved
 	  performance, look for the hdparm package at
diff -Nru a/arch/cris/drivers/serial.c b/arch/cris/drivers/serial.c
--- a/arch/cris/drivers/serial.c	Tue Feb 25 10:27:11 2003
+++ b/arch/cris/drivers/serial.c	Mon Apr 21 20:58:41 2003
@@ -1402,7 +1402,7 @@
 
 	if (!E100_RTS_GET(info) &&
 	    CIRC_SPACE(info->recv.head, info->recv.tail, SERIAL_RECV_SIZE) < TTY_THROTTLE_LIMIT)
-		info->tty->driver.throttle(info->tty);
+		info->tty->driver->throttle(info->tty);
 	
 	START_FLUSH_FAST_TIMER(info, "receive_chars");
 
@@ -1658,7 +1658,7 @@
 	/* unthrottle if we have throttled */
 	if (E100_RTS_GET(info) &&
 	    CIRC_SPACE(info->recv.head, info->recv.tail, SERIAL_RECV_SIZE) > TTY_THROTTLE_LIMIT)
-		tty->driver.unthrottle(info->tty);
+		tty->driver->unthrottle(info->tty);
 }
 
 static _INLINE_ void
@@ -3049,8 +3049,8 @@
 #endif
 
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -3169,7 +3169,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -3289,7 +3289,7 @@
 
 	/* find which port we want to open */
 
-	line = MINOR(tty->device) - tty->driver.minor_start;
+	line = tty->index;
   
 	if (line < 0 || line >= NR_PORTS)
 		return -ENODEV;
@@ -3302,8 +3302,7 @@
 		return -ENODEV; 
   
 #ifdef SERIAL_DEBUG_OPEN
-	printk("[%d] rs_open %s%d, count = %d\n", current->pid,
-	       tty->driver.name, info->line,
+	printk("[%d] rs_open %s, count = %d\n", current->pid, tty->name,
 	       info->count);
 #endif
 
@@ -3359,7 +3358,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
diff -Nru a/arch/h8300/Kconfig b/arch/h8300/Kconfig
--- a/arch/h8300/Kconfig	Thu Apr 17 12:30:45 2003
+++ b/arch/h8300/Kconfig	Sun Apr 20 12:56:51 2003
@@ -181,7 +181,7 @@
 	  telephone line with a modem either via UUCP (UUCP is a protocol to
 	  forward mail and news between unix hosts over telephone lines; read
 	  the UUCP-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
+	  <http://www.tldp.org/docs.html#howto>) or dialing up a shell
 	  account or a BBS, even using term (term is a program which gives you
 	  almost full Internet connectivity if you have a regular dial up
 	  shell account on some Internet connected Unix computer. Read
@@ -201,7 +201,7 @@
 
 	  Make sure to read the NET-3-HOWTO. Eventually, you will have to read
 	  Olaf Kirch's excellent and free book "Network Administrator's
-	  Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
+	  Guide", to be found in <http://www.tldp.org/docs.html#guide>. If
 	  unsure, say Y.
 
 endmenu
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
--- a/arch/i386/Kconfig	Fri Apr  4 07:22:18 2003
+++ b/arch/i386/Kconfig	Tue Apr 22 04:20:16 2003
@@ -183,7 +183,7 @@
 	  optimizations.
 
 config MPENTIUMIII
-	bool "Pentium-III/Celeron(Coppermine)"
+	bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
 	help
 	  Select this for Intel chips based on the Pentium-III and
 	  Celeron-Coppermine core.  This option enables use of some
@@ -191,7 +191,7 @@
 	  extensions.
 
 config MPENTIUM4
-	bool "Pentium-4/Celeron(P4-based)"
+	bool "Pentium-4/Celeron(P4-based)/Xeon"
 	help
 	  Select this for Intel Pentium 4 chips.  This includes both
 	  the Pentium 4 and P4-based Celeron chips.  This option
@@ -345,7 +345,7 @@
 
 config X86_INTEL_USERCOPY
 	bool
-	depends on MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M586MMX
+	depends on MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7
 	default y
 
 config X86_USE_PPRO_CHECKSUM
@@ -409,7 +409,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
 	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -790,7 +790,7 @@
 	  page on the WWW at
 	  <http://www.cs.utexas.edu/users/kharker/linux-laptop/> and the
 	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that, even if you say N here, Linux on the x86 architecture
 	  will issue the hlt instruction if nothing is to be done, thereby
@@ -798,7 +798,7 @@
 
 config SOFTWARE_SUSPEND
 	bool "Software Suspend (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && PM
+	depends on EXPERIMENTAL && PM && SWAP
 	---help---
 	  Enable the possibilty of suspendig machine. It doesn't need APM.
 	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
@@ -847,7 +847,7 @@
 	  In order to use APM, you will need supporting software. For location
 	  and more information, read <file:Documentation/pm.txt> and the
 	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver does not spin down disk drives (see the hdparm(8)
 	  manpage ("man 8 hdparm") for that), and it doesn't turn off
@@ -1000,7 +1000,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -1203,7 +1203,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -1225,7 +1225,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -1341,7 +1341,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -1412,7 +1412,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/i386/kernel/cpu/mcheck/k7.c
--- a/arch/i386/kernel/cpu/mcheck/k7.c	Mon Apr 14 00:28:13 2003
+++ b/arch/i386/kernel/cpu/mcheck/k7.c	Thu Apr 24 16:15:01 2003
@@ -82,9 +82,6 @@
 	nr_mce_banks = l & 0xff;
 
 	for (i=0; i<nr_mce_banks; i++) {
-		/* Don't enable northbridge MCE by default on Hammer */
-		if (boot_cpu_data.x86_model == 15 && i == 4) 
-			continue;
 		wrmsr (MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
 		wrmsr (MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
 	}
diff -Nru a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
--- a/arch/i386/kernel/i8259.c	Mon Mar  3 13:11:24 2003
+++ b/arch/i386/kernel/i8259.c	Sun Apr 20 14:14:28 2003
@@ -325,15 +325,16 @@
  * =PC9800NOTE= In NEC PC-9800, we use irq8 instead of irq13!
  */
 
-static void math_error_irq(int cpl, void *dev_id, struct pt_regs *regs)
+static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs)
 {
 	extern void math_error(void *);
 #ifndef CONFIG_X86_PC9800
 	outb(0,0xF0);
 #endif
 	if (ignore_fpu_irq || !boot_cpu_data.hard_math)
-		return;
+		return IRQ_NONE;
 	math_error((void *)regs->eip);
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
--- a/arch/i386/kernel/io_apic.c	Mon Apr 14 16:09:21 2003
+++ b/arch/i386/kernel/io_apic.c	Sun Apr 20 16:00:22 2003
@@ -1117,7 +1117,7 @@
 	if (current_vector == SYSCALL_VECTOR)
 		goto next;
 
-	if (current_vector > FIRST_SYSTEM_VECTOR) {
+	if (current_vector >= FIRST_SYSTEM_VECTOR) {
 		offset = (offset + 1) & 7;
 		current_vector = FIRST_DEVICE_VECTOR + offset;
 	}
diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
--- a/arch/i386/kernel/irq.c	Thu Mar 20 03:11:45 2003
+++ b/arch/i386/kernel/irq.c	Tue Apr 22 03:15:43 2003
@@ -32,6 +32,7 @@
 #include <linux/irq.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/kallsyms.h>
 
 #include <asm/atomic.h>
 #include <asm/io.h>
@@ -74,7 +75,8 @@
  * Special irq handlers.
  */
 
-void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
+irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs)
+{ return IRQ_NONE; }
 
 /*
  * Generic no controller code
@@ -202,21 +204,46 @@
  * waste of time and is not what some drivers would
  * prefer.
  */
-int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, struct irqaction * action)
+int handle_IRQ_event(unsigned int irq,
+		struct pt_regs *regs, struct irqaction *action)
 {
 	int status = 1;	/* Force the "do bottom halves" bit */
+	int retval = 0;
+	struct irqaction *first_action = action;
 
 	if (!(action->flags & SA_INTERRUPT))
 		local_irq_enable();
 
 	do {
 		status |= action->flags;
-		action->handler(irq, action->dev_id, regs);
+		retval |= action->handler(irq, action->dev_id, regs);
 		action = action->next;
 	} while (action);
 	if (status & SA_SAMPLE_RANDOM)
 		add_interrupt_randomness(irq);
 	local_irq_disable();
+	if (retval != 1) {
+		static int count = 100;
+		if (count) {
+			count--;
+			if (retval) {
+				printk("irq event %d: bogus retval mask %x\n",
+					irq, retval);
+			} else {
+				printk("irq %d: nobody cared!\n", irq);
+			}
+			dump_stack();
+			printk("handlers:\n");
+			action = first_action;
+			do {
+				printk("[<%p>]", action->handler);
+				print_symbol(" (%s)",
+					(unsigned long)action->handler);
+				printk("\n");
+				action = action->next;
+			} while (action);
+		}
+	}
 
 	return status;
 }
@@ -447,7 +474,7 @@
  */
  
 int request_irq(unsigned int irq, 
-		void (*handler)(int, void *, struct pt_regs *),
+		irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		unsigned long irqflags, 
 		const char * devname,
 		void *dev_id)
diff -Nru a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c
--- a/arch/i386/kernel/module.c	Mon Jan 13 09:46:25 2003
+++ b/arch/i386/kernel/module.c	Tue Apr 22 03:17:44 2003
@@ -104,9 +104,22 @@
 	return -ENOEXEC;
 }
 
+extern void apply_alternatives(void *start, void *end); 
+
 int module_finalize(const Elf_Ehdr *hdr,
 		    const Elf_Shdr *sechdrs,
 		    struct module *me)
 {
+	const Elf_Shdr *s;
+	char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+
+	/* look for .altinstructions to patch */ 
+	for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { 
+		void *seg; 		
+		if (strcmp(".altinstructions", secstrings + s->sh_name))
+			continue;
+		seg = (void *)s->sh_addr; 
+		apply_alternatives(seg, seg + s->sh_size); 
+	} 	
 	return 0;
 }
diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c	Thu Mar 13 17:10:39 2003
+++ b/arch/i386/kernel/mpparse.c	Wed Apr 23 10:32:20 2003
@@ -1089,11 +1089,15 @@
 	list_for_each(node, &acpi_prt.entries) {
 		entry = list_entry(node, struct acpi_prt_entry, node);
 
-		/* We're only interested in static (non-link) entries. */
-		if (entry->link.handle)
-			continue;
+		/* Need to get irq for dynamic entry */
+		if (entry->link.handle) {
+			irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index);
+			if (!irq)
+				continue;
+		}
+		else
+			irq = entry->link.index;
 
-		irq = entry->link.index;
 		ioapic = mp_find_ioapic(irq);
 		if (ioapic < 0)
 			continue;
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	Thu Apr 17 12:05:47 2003
+++ b/arch/i386/kernel/setup.c	Tue Apr 22 03:17:44 2003
@@ -29,9 +29,7 @@
 #include <linux/ioport.h>
 #include <linux/acpi.h>
 #include <linux/apm_bios.h>
-#ifdef CONFIG_BLK_DEV_RAM
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/console.h>
@@ -796,6 +794,63 @@
 	if (low_mem_size > pci_mem_start)
 		pci_mem_start = low_mem_size;
 }
+
+/* Replace instructions with better alternatives for this CPU type.
+
+   This runs before SMP is initialized to avoid SMP problems with
+   self modifying code. This implies that assymetric systems where
+   APs have less capabilities than the boot processor are not handled. 
+    
+   In this case boot with "noreplacement". */ 
+void apply_alternatives(void *start, void *end) 
+{ 
+	struct alt_instr *a; 
+	int diff, i, k;
+
+	for (a = start; a < (struct alt_instr *)end; 
+	     a = (void *)ALIGN((unsigned long)(a + 1) + a->instrlen, 4)) { 
+		if (!boot_cpu_has(a->cpuid))
+			continue;
+		BUG_ON(a->replacementlen > a->instrlen); 
+		memcpy(a->instr, a->replacement, a->replacementlen); 
+		diff = a->instrlen - a->replacementlen; 
+		for (i = a->replacementlen; diff > 0; diff -= k, i += k) {
+			static const char *nops[] = {
+				0,
+				"\x90",
+#if CONFIG_MK7 || CONFIG_MK8
+				"\x66\x90",
+				"\x66\x66\x90",
+				"\x66\x66\x66\x90",
+#else
+				"\x89\xf6",
+				"\x8d\x76\x00",
+				"\x8d\x74\x26\x00",
+#endif
+			};
+			k = min_t(int, diff, ARRAY_SIZE(nops)); 
+			memcpy(a->instr + i, nops[k], k); 
+		} 
+	}
+} 
+
+static int no_replacement __initdata = 0; 
+ 
+void __init alternative_instructions(void)
+{
+	extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+	if (no_replacement) 
+		return;
+	apply_alternatives(__alt_instructions, __alt_instructions_end);
+}
+
+static int __init noreplacement_setup(char *s)
+{ 
+     no_replacement = 1; 
+     return 0; 
+} 
+
+__setup("noreplacement", noreplacement_setup); 
 
 void __init setup_arch(char **cmdline_p)
 {
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c	Mon Apr  7 16:40:21 2003
+++ b/arch/i386/kernel/time.c	Sun Apr 20 14:47:44 2003
@@ -124,15 +124,28 @@
 	 * made, and then undo it!
 	 */
 	tv->tv_usec -= timer->get_offset();
-	tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
+	tv->tv_usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ);
 
 	while (tv->tv_usec < 0) {
-		tv->tv_usec += 1000000;
+		tv->tv_usec += USEC_PER_SEC;
 		tv->tv_sec--;
 	}
+	tv->tv_usec *= NSEC_PER_USEC;
+
+	wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec;
+	wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_usec;
+
+	if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) {
+		wall_to_monotonic.tv_nsec -= NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec++;
+	}
+	if (wall_to_monotonic.tv_nsec < 0) {
+		wall_to_monotonic.tv_nsec += NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec--;
+	}
 
 	xtime.tv_sec = tv->tv_sec;
-	xtime.tv_nsec = (tv->tv_usec * 1000);
+	xtime.tv_nsec = tv->tv_usec;
 	time_adjust = 0;		/* stop active adjtime() */
 	time_status |= STA_UNSYNC;
 	time_maxerror = NTP_PHASE_LIMIT;
@@ -228,46 +241,11 @@
 }
 
 /*
- * Lost tick detection and compensation
- */
-static inline void detect_lost_tick(void)
-{
-	/* read time since last interrupt */
-	unsigned long delta = timer->get_offset();
-	static unsigned long dbg_print;
-	
-	/* check if delta is greater then two ticks */
-	if(delta >= 2*(1000000/HZ)){
-
-		/*
-		 * only print debug info first 5 times
-		 */
-		/*
-		 * AKPM: disable this for now; it's nice, but irritating.
-		 */
-		if (0 && dbg_print < 5) {
-			printk(KERN_WARNING "\nWarning! Detected %lu "
-				"micro-second gap between interrupts.\n",
-				delta);
-			printk(KERN_WARNING "  Compensating for %lu lost "
-				"ticks.\n",
-				delta/(1000000/HZ)-1);
-			dump_stack();
-			dbg_print++;
-		}
-		/* calculate number of missed ticks */
-		delta = delta/(1000000/HZ)-1;
-		jiffies += delta;
-	}
-		
-}
-
-/*
  * This is the same as the above, except we _also_ save the current
  * Time Stamp Counter value at the time of the timer interrupt, so that
  * we later on can estimate the time of day more exactly.
  */
-void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
 	 * Here we are in the timer irq handler. We just have irqs locally
@@ -278,13 +256,12 @@
 	 */
 	write_seqlock(&xtime_lock);
 
-	detect_lost_tick();
 	timer->mark_offset();
  
 	do_timer_interrupt(irq, NULL, regs);
 
 	write_sequnlock(&xtime_lock);
-
+	return IRQ_HANDLED;
 }
 
 /* not static: needed by APM */
@@ -322,7 +299,9 @@
 {
 	
 	xtime.tv_sec = get_cmos_time();
-	xtime.tv_nsec = 0;
+	wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ;
+	xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+	wall_to_monotonic.tv_nsec = 0;
 
 
 	timer = select_timer();
diff -Nru a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c
--- a/arch/i386/kernel/timers/timer_cyclone.c	Mon Mar 31 08:03:54 2003
+++ b/arch/i386/kernel/timers/timer_cyclone.c	Sat Apr 19 23:22:28 2003
@@ -18,6 +18,7 @@
 #include <asm/fixmap.h>
 
 extern spinlock_t i8253_lock;
+extern unsigned long jiffies;
 extern unsigned long calibrate_tsc(void);
 
 /* Number of usecs that the last interrupt was delayed */
@@ -46,6 +47,8 @@
 
 static void mark_offset_cyclone(void)
 {
+	unsigned long lost, delay;
+	unsigned long delta = last_cyclone_low;
 	int count;
 	unsigned long long this_offset, last_offset;
 
@@ -62,6 +65,15 @@
 	count |= inb(0x40) << 8;
 	spin_unlock(&i8253_lock);
 
+	/* lost tick compensation */
+	delta = last_cyclone_low - delta;	
+	delta /=(CYCLONE_TIMER_FREQ/1000000);
+	delta += delay_at_last_interrupt;
+	lost = delta/(1000000/HZ);
+	delay = delta%(1000000/HZ);
+	if(lost >= 2)
+		jiffies += lost-1;
+	
 	/* update the monotonic base value */
 	this_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low;
 	monotonic_base += (this_offset - last_offset) & CYCLONE_TIMER_MASK;
@@ -70,6 +82,12 @@
 	/* calculate delay_at_last_interrupt */
 	count = ((LATCH-1) - count) * TICK_SIZE;
 	delay_at_last_interrupt = (count + LATCH/2) / LATCH;
+
+	/* catch corner case where tick rollover 
+	 * occured between cyclone and pit reads
+	 */
+	if(abs(delay - delay_at_last_interrupt) > 900)
+		jiffies++;
 }
 
 static unsigned long get_offset_cyclone(void)
diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
--- a/arch/i386/kernel/timers/timer_pit.c	Mon Apr  7 16:40:44 2003
+++ b/arch/i386/kernel/timers/timer_pit.c	Sat Apr 19 23:22:27 2003
@@ -54,7 +54,7 @@
 }
 
 
-/* This function must be called with interrupts disabled 
+/* This function must be called with xtime_lock held.
  * It was inspired by Steve McCanne's microtime-i386 for BSD.  -- jrs
  * 
  * However, the pc-audio speaker driver changes the divisor so that
@@ -93,7 +93,7 @@
 	static unsigned long jiffies_p = 0;
 
 	/*
-	 * cache volatile jiffies temporarily; we have IRQs turned off. 
+	 * cache volatile jiffies temporarily; we have xtime_lock. 
 	 */
 	unsigned long jiffies_t;
 
@@ -119,8 +119,6 @@
                 count = LATCH - 1;
         }
 	
-	spin_unlock_irqrestore(&i8253_lock, flags);
-
 	/*
 	 * avoiding timer inconsistencies (they are rare, but they happen)...
 	 * there are two kinds of problems that must be avoided here:
@@ -130,7 +128,6 @@
 	 *     (see c't 95/10 page 335 for Neptun bug.)
 	 */
 
-
 	if( jiffies_t == jiffies_p ) {
 		if( count > count_p ) {
 			/* the nutcase */
@@ -140,6 +137,8 @@
 		jiffies_p = jiffies_t;
 
 	count_p = count;
+
+	spin_unlock_irqrestore(&i8253_lock, flags);
 
 	count = ((LATCH-1) - count) * TICK_SIZE;
 	count = (count + LATCH/2) / LATCH;
diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
--- a/arch/i386/kernel/timers/timer_tsc.c	Thu Apr 17 12:40:54 2003
+++ b/arch/i386/kernel/timers/timer_tsc.c	Sat Apr 19 23:22:28 2003
@@ -21,6 +21,7 @@
 int tsc_disable __initdata = 0;
 
 extern spinlock_t i8253_lock;
+extern unsigned long jiffies;
 
 static int use_tsc;
 /* Number of usecs that the last interrupt was delayed */
@@ -117,6 +118,8 @@
 
 static void mark_offset_tsc(void)
 {
+	unsigned long lost,delay;
+	unsigned long delta = last_tsc_low;
 	int count;
 	int countmp;
 	static int count1 = 0;
@@ -161,6 +164,23 @@
 		}
 	}
 
+	/* lost tick compensation */
+	delta = last_tsc_low - delta;
+	{
+		register unsigned long eax, edx;
+		eax = delta;
+		__asm__("mull %2"
+		:"=a" (eax), "=d" (edx)
+		:"rm" (fast_gettimeoffset_quotient),
+		 "0" (eax));
+		delta = edx;
+	}
+	delta += delay_at_last_interrupt;
+	lost = delta/(1000000/HZ);
+	delay = delta%(1000000/HZ);
+	if(lost >= 2)
+		jiffies += lost-1;
+
 	/* update the monotonic base value */
 	this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
 	monotonic_base += cycles_2_ns(this_offset - last_offset);
@@ -169,6 +189,12 @@
 	/* calculate delay_at_last_interrupt */
 	count = ((LATCH-1) - count) * TICK_SIZE;
 	delay_at_last_interrupt = (count + LATCH/2) / LATCH;
+
+	/* catch corner case where tick rollover 
+	 * occured between tsc and pit reads
+	 */
+	if(abs(delay - delay_at_last_interrupt) > 900)
+		jiffies++;
 }
 
 static void delay_tsc(unsigned long loops)
diff -Nru a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
--- a/arch/i386/kernel/vm86.c	Thu Apr  3 07:48:45 2003
+++ b/arch/i386/kernel/vm86.c	Sun Apr 20 14:14:28 2003
@@ -695,7 +695,8 @@
 	| (1 << SIGUSR1) | (1 << SIGUSR2) | (1 << SIGIO)  | (1 << SIGURG) \
 	| (1 << SIGUNUSED) )
 	
-static void irq_handler(int intno, void *dev_id, struct pt_regs * regs) {
+static irqreturn_t irq_handler(int intno, void *dev_id, struct pt_regs * regs)
+{
 	int irq_bit;
 	unsigned long flags;
 
@@ -709,6 +710,7 @@
 	/* else user will poll for IRQs */
 out:
 	spin_unlock_irqrestore(&irqbits_lock, flags);	
+	return IRQ_NONE;
 }
 
 static inline void free_vm86_irq(int irqnumber)
@@ -742,7 +744,10 @@
 	bit = irqbits & (1 << irqnumber);
 	irqbits &= ~bit;
 	spin_unlock_irqrestore(&irqbits_lock, flags);	
-	return bit;
+	if (!bit)
+		return 0;
+	enable_irq(irqnumber);
+	return 1;
 }
 
 
diff -Nru a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
--- a/arch/i386/mm/discontig.c	Tue Mar  4 23:41:55 2003
+++ b/arch/i386/mm/discontig.c	Sun Apr 20 09:14:40 2003
@@ -27,9 +27,7 @@
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
 #include <linux/highmem.h>
-#ifdef CONFIG_BLK_DEV_RAM
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 #include <asm/e820.h>
 #include <asm/setup.h>
 
diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
--- a/arch/i386/mm/hugetlbpage.c	Mon Feb 24 23:13:11 2003
+++ b/arch/i386/mm/hugetlbpage.c	Sat Apr 19 23:22:35 2003
@@ -129,37 +129,45 @@
 int
 follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
 		    struct page **pages, struct vm_area_struct **vmas,
-		    unsigned long *st, int *length, int i)
+		    unsigned long *position, int *length, int i)
 {
-	pte_t *ptep, pte;
-	unsigned long start = *st;
-	unsigned long pstart;
-	int len = *length;
-	struct page *page;
+	unsigned long vpfn, vaddr = *position;
+	int remainder = *length;
+
+	WARN_ON(!is_vm_hugetlb_page(vma));
 
-	do {
-		pstart = start;
-		ptep = huge_pte_offset(mm, start);
-		pte = *ptep;
+	vpfn = vaddr/PAGE_SIZE;
+	while (vaddr < vma->vm_end && remainder) {
 
-back1:
-		page = pte_page(pte);
 		if (pages) {
-			page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT);
+			pte_t *pte;
+			struct page *page;
+
+			pte = huge_pte_offset(mm, vaddr);
+
+			/* hugetlb should be locked, and hence, prefaulted */
+			WARN_ON(!pte || pte_none(*pte));
+
+			page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)];
+
+			WARN_ON(!PageCompound(page));
+
 			get_page(page);
 			pages[i] = page;
 		}
+
 		if (vmas)
 			vmas[i] = vma;
-		i++;
-		len--;
-		start += PAGE_SIZE;
-		if (((start & HPAGE_MASK) == pstart) && len &&
-				(start < vma->vm_end))
-			goto back1;
-	} while (len && start < vma->vm_end);
-	*length = len;
-	*st = start;
+
+		vaddr += PAGE_SIZE;
+		++vpfn;
+		--remainder;
+		++i;
+	}
+
+	*length = remainder;
+	*position = vaddr;
+
 	return i;
 }
 
@@ -474,9 +482,7 @@
 
 int is_hugepage_mem_enough(size_t size)
 {
-	if (size > (htlbpagemem << HPAGE_SHIFT))
-		return 0;
-	return 1;
+	return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem;
 }
 
 /*
diff -Nru a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c
--- a/arch/i386/mm/pgtable.c	Thu Mar  6 08:19:03 2003
+++ b/arch/i386/mm/pgtable.c	Sat Apr 19 23:22:41 2003
@@ -131,39 +131,23 @@
 
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-	int count = 0;
-	pte_t *pte;
-   
-   	do {
-		pte = (pte_t *) __get_free_page(GFP_KERNEL);
-		if (pte)
-			clear_page(pte);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	if (pte)
+		clear_page(pte);
 	return pte;
 }
 
 struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	int count = 0;
 	struct page *pte;
-   
-   	do {
+
 #if CONFIG_HIGHPTE
-		pte = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, 0);
+	pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0);
 #else
-		pte = alloc_pages(GFP_KERNEL, 0);
+	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
 #endif
-		if (pte)
-			clear_highpage(pte);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+	if (pte)
+		clear_highpage(pte);
 	return pte;
 }
 
diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
--- a/arch/i386/pci/irq.c	Fri Mar  7 19:36:28 2003
+++ b/arch/i386/pci/irq.c	Sun Apr 20 14:14:28 2003
@@ -560,8 +560,9 @@
 	return NULL;
 }
 
-static void pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pcibios_test_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
+	return IRQ_NONE;
 }
 
 static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
diff -Nru a/arch/i386/vmlinux.lds.S b/arch/i386/vmlinux.lds.S
--- a/arch/i386/vmlinux.lds.S	Wed Apr  2 00:42:56 2003
+++ b/arch/i386/vmlinux.lds.S	Sun Apr 20 12:24:22 2003
@@ -81,6 +81,10 @@
   __con_initcall_start = .;
   .con_initcall.init : { *(.con_initcall.init) }
   __con_initcall_end = .;
+  . = ALIGN(4);
+  __alt_instructions = .;
+  .altinstructions : { *(.altinstructions) } 
+  __alt_instructions_end = .; 
   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig
--- a/arch/ia64/Kconfig	Tue Apr  8 12:03:12 2003
+++ b/arch/ia64/Kconfig	Sun Apr 20 12:56:50 2003
@@ -280,7 +280,7 @@
 	  page on the WWW at
 	  <http://www.cs.utexas.edu/users/kharker/linux-laptop/> and the
 	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that, even if you say N here, Linux on the x86 architecture
 	  will issue the hlt instruction if nothing is to be done, thereby
@@ -425,7 +425,7 @@
 
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -497,7 +497,7 @@
 	  systems. Saying Y here will enable your kernel to run ELF binaries.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config BINFMT_MISC
 	tristate "Kernel support for MISC binaries"
@@ -535,7 +535,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -684,7 +684,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -762,7 +762,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/ia64/hp/sim/hpsim_console.c b/arch/ia64/hp/sim/hpsim_console.c
--- a/arch/ia64/hp/sim/hpsim_console.c	Fri Jul 19 07:02:26 2002
+++ b/arch/ia64/hp/sim/hpsim_console.c	Thu Apr 24 03:30:40 2003
@@ -27,7 +27,7 @@
 
 static int simcons_init (struct console *, char *);
 static void simcons_write (struct console *, const char *, unsigned);
-static kdev_t simcons_console_device (struct console *);
+static struct tty_driver *simcons_console_device (struct console *, int *);
 
 struct console hpsim_cons = {
 	.name =		"simcons",
@@ -57,8 +57,9 @@
 	}
 }
 
-static kdev_t
-simcons_console_device (struct console *c)
+static struct tty_driver *simcons_console_device (struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	extern struct tty_driver hp_serial_driver;
+	*index = c->index;
+	return &hp_serial_driver;
 }
diff -Nru a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
--- a/arch/ia64/hp/sim/simserial.c	Thu Feb 13 05:43:47 2003
+++ b/arch/ia64/hp/sim/simserial.c	Thu Apr 24 03:30:40 2003
@@ -103,7 +103,7 @@
 	{ 0, 0}
 };
 
-static struct tty_driver serial_driver, callout_driver;
+static struct tty_driver hp_serial_driver, callout_driver;
 static int serial_refcount;
 
 static struct async_struct *IRQ_ports[NR_IRQS];
@@ -676,7 +676,7 @@
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	shutdown(info);
-	if (tty->driver.flush_buffer) tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty);
 	info->event = 0;
 	info->tty = 0;
@@ -879,7 +879,7 @@
 	unsigned long		page;
 
 	MOD_INC_USE_COUNT;
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS)) {
 		MOD_DEC_USE_COUNT;
 		return -ENODEV;
@@ -893,8 +893,7 @@
 	info->tty = tty;
 
 #ifdef SIMSERIAL_DEBUG
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->state->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->state->count);
 #endif
 	info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
 
@@ -937,7 +936,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else
 			*tty->termios = info->state->callout_termios;
@@ -1029,43 +1028,43 @@
 
 	/* Initialize the tty_driver structure */
 
-	memset(&serial_driver, 0, sizeof(struct tty_driver));
-	serial_driver.magic = TTY_DRIVER_MAGIC;
-	serial_driver.driver_name = "simserial";
-	serial_driver.name = "ttyS";
-	serial_driver.major = TTY_MAJOR;
-	serial_driver.minor_start = 64;
-	serial_driver.num = 1;
-	serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
-	serial_driver.subtype = SERIAL_TYPE_NORMAL;
-	serial_driver.init_termios = tty_std_termios;
-	serial_driver.init_termios.c_cflag =
+	memset(&hp_serial_driver, 0, sizeof(struct tty_driver));
+	hp_serial_driver.magic = TTY_DRIVER_MAGIC;
+	hp_serial_driver.driver_name = "simserial";
+	hp_serial_driver.name = "ttyS";
+	hp_serial_driver.major = TTY_MAJOR;
+	hp_serial_driver.minor_start = 64;
+	hp_serial_driver.num = 1;
+	hp_serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
+	hp_serial_driver.subtype = SERIAL_TYPE_NORMAL;
+	hp_serial_driver.init_termios = tty_std_termios;
+	hp_serial_driver.init_termios.c_cflag =
 		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
-	serial_driver.flags = TTY_DRIVER_REAL_RAW;
-	serial_driver.refcount = &serial_refcount;
-	serial_driver.table = serial_table;
-	serial_driver.termios = serial_termios;
-	serial_driver.termios_locked = serial_termios_locked;
-
-	serial_driver.open = rs_open;
-	serial_driver.close = rs_close;
-	serial_driver.write = rs_write;
-	serial_driver.put_char = rs_put_char;
-	serial_driver.flush_chars = rs_flush_chars;
-	serial_driver.write_room = rs_write_room;
-	serial_driver.chars_in_buffer = rs_chars_in_buffer;
-	serial_driver.flush_buffer = rs_flush_buffer;
-	serial_driver.ioctl = rs_ioctl;
-	serial_driver.throttle = rs_throttle;
-	serial_driver.unthrottle = rs_unthrottle;
-	serial_driver.send_xchar = rs_send_xchar;
-	serial_driver.set_termios = rs_set_termios;
-	serial_driver.stop = rs_stop;
-	serial_driver.start = rs_start;
-	serial_driver.hangup = rs_hangup;
-	serial_driver.break_ctl = rs_break;
-	serial_driver.wait_until_sent = rs_wait_until_sent;
-	serial_driver.read_proc = rs_read_proc;
+	hp_serial_driver.flags = TTY_DRIVER_REAL_RAW;
+	hp_serial_driver.refcount = &serial_refcount;
+	hp_serial_driver.table = serial_table;
+	hp_serial_driver.termios = serial_termios;
+	hp_serial_driver.termios_locked = serial_termios_locked;
+
+	hp_serial_driver.open = rs_open;
+	hp_serial_driver.close = rs_close;
+	hp_serial_driver.write = rs_write;
+	hp_serial_driver.put_char = rs_put_char;
+	hp_serial_driver.flush_chars = rs_flush_chars;
+	hp_serial_driver.write_room = rs_write_room;
+	hp_serial_driver.chars_in_buffer = rs_chars_in_buffer;
+	hp_serial_driver.flush_buffer = rs_flush_buffer;
+	hp_serial_driver.ioctl = rs_ioctl;
+	hp_serial_driver.throttle = rs_throttle;
+	hp_serial_driver.unthrottle = rs_unthrottle;
+	hp_serial_driver.send_xchar = rs_send_xchar;
+	hp_serial_driver.set_termios = rs_set_termios;
+	hp_serial_driver.stop = rs_stop;
+	hp_serial_driver.start = rs_start;
+	hp_serial_driver.hangup = rs_hangup;
+	hp_serial_driver.break_ctl = rs_break;
+	hp_serial_driver.wait_until_sent = rs_wait_until_sent;
+	hp_serial_driver.read_proc = rs_read_proc;
 
 	/*
 	 * Let's have a little bit of fun !
@@ -1088,14 +1087,14 @@
 	 * The callout device is just like normal device except for
 	 * major number and the subtype code.
 	 */
-	callout_driver = serial_driver;
+	callout_driver = hp_serial_driver;
 	callout_driver.name = "cua";
 	callout_driver.major = TTYAUX_MAJOR;
 	callout_driver.subtype = SERIAL_TYPE_CALLOUT;
 	callout_driver.read_proc = 0;
 	callout_driver.proc_entry = 0;
 
-	if (tty_register_driver(&serial_driver))
+	if (tty_register_driver(&hp_serial_driver))
 		panic("Couldn't register simserial driver\n");
 
 	if (tty_register_driver(&callout_driver))
diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
--- a/arch/ia64/ia32/sys_ia32.c	Wed Apr  9 11:51:34 2003
+++ b/arch/ia64/ia32/sys_ia32.c	Sat Apr 19 23:22:56 2003
@@ -3040,7 +3040,6 @@
 #define ca32_svc	u.u32_svc
 #define ca32_client	u.u32_client
 #define ca32_export	u.u32_export
-#define ca32_authd	u.u32_authd
 #define ca32_debug	u.u32_debug
 };
 
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
--- a/arch/ia64/kernel/perfmon.c	Thu Mar 27 10:37:09 2003
+++ b/arch/ia64/kernel/perfmon.c	Thu Apr 24 03:37:07 2003
@@ -21,7 +21,6 @@
 #include <linux/proc_fs.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
-#include <linux/wrapper.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 #include <linux/smp.h>
@@ -555,7 +554,7 @@
 		memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 		adr=(unsigned long) mem;
 		while (size > 0) {
-			mem_map_reserve(vmalloc_to_page((void *)adr));
+			SetPageReserved(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
@@ -571,7 +570,7 @@
 	if (mem) {
 		adr=(unsigned long) mem;
 		while ((long) size > 0) {
-			mem_map_unreserve(vmalloc_to_page((void*)adr));
+			ClearPageReserved(vmalloc_to_page((void*)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c	Wed Feb 12 00:11:32 2003
+++ b/arch/ia64/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -31,6 +31,7 @@
 #include <linux/threads.h>
 #include <linux/tty.h>
 #include <linux/efi.h>
+#include <linux/initrd.h>
 
 #include <asm/ia32.h>
 #include <asm/page.h>
@@ -41,10 +42,6 @@
 #include <asm/system.h>
 #include <asm/mca.h>
 #include <asm/smp.h>
-
-#ifdef CONFIG_BLK_DEV_RAM
-# include <linux/blk.h>
-#endif
 
 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
 # error "struct cpuinfo_ia64 too big!"
diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig
--- a/arch/m68k/Kconfig	Thu Feb 27 08:02:04 2003
+++ b/arch/m68k/Kconfig	Sun Apr 20 12:56:50 2003
@@ -65,7 +65,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  Please also read the PCMCIA-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -106,7 +106,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -413,7 +413,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -435,7 +435,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -592,7 +592,7 @@
 	  box (as opposed to using a serial printer; if the connector at the
 	  printer has 9 or 25 holes ["female"], then it's serial), say Y.
 	  Also read the Printing-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  It is possible to share one parallel port among several devices
 	  (e.g. printer and ZIP drive) and it is safe to compile the
@@ -741,7 +741,7 @@
 	  If you want to use a SCSI hard disk or the SCSI or parallel port
 	  version of the IOMEGA ZIP drive under Linux, say Y and read the
 	  SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. This is NOT for SCSI
+	  <http://www.tldp.org/docs.html#howto>. This is NOT for SCSI
 	  CD-ROMs.
 
 	  This driver is also available as a module ( = code which can be
@@ -776,7 +776,7 @@
 	---help---
 	  If you want to use a SCSI tape drive under Linux, say Y and read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, and
+	  <http://www.tldp.org/docs.html#howto>, and
 	  <file:Documentation/scsi/st.txt> in the kernel source.  This is NOT for
 	  SCSI CD-ROMs.
 
@@ -809,7 +809,7 @@
 	---help---
 	  If you want to use a SCSI CD-ROM under Linux, say Y and read the
 	  SCSI-HOWTO and the CD-ROM-HOWTO at
-	  <http://www.linuxdoc.org/docs.html#howto>. Also make sure to say Y
+	  <http://www.tldp.org/docs.html#howto>. Also make sure to say Y
 	  or M to "ISO 9660 CD-ROM file system support" later.
 
 	  This driver is also available as a module ( = code which can be
@@ -1084,7 +1084,7 @@
 	  This is the NCR 5380 SCSI controller included on most of the 68030
 	  based Macintoshes.  If you have one of these say Y and read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config SCSI_MAC_ESP
 	tristate "Macintosh NCR53c9[46] SCSI"
@@ -1093,7 +1093,7 @@
 	  This is the NCR 53c9x SCSI controller found on most of the 68040
 	  based Macintoshes.  If you have one of these say Y and read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1201,7 +1201,7 @@
 	  Say Y here if you have dumb serial boards other than the four
 	  standard COM 1/2/3/4 ports. This may happen if you have an AST
 	  FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
-	  from <http://www.linuxdoc.org/docs.html#howto>), or other custom
+	  from <http://www.tldp.org/docs.html#howto>), or other custom
 	  serial port hardware which acts similar to standard serial port
 	  hardware. If you only use the standard COM 1/2/3/4 ports, you can
 	  say N here to save some memory. You can also say Y if you have an
diff -Nru a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
--- a/arch/m68k/kernel/setup.c	Fri Jan  3 07:55:43 2003
+++ b/arch/m68k/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -23,6 +23,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/module.h>
+#include <linux/initrd.h>
 
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -39,10 +40,6 @@
 #ifdef CONFIG_SUN3X
 #include <asm/dvma.h>
 extern void sun_serial_setup(void);
-#endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
-#include <linux/blk.h>
 #endif
 
 unsigned long m68k_machtype;
diff -Nru a/arch/m68k/sun3x/prom.c b/arch/m68k/sun3x/prom.c
--- a/arch/m68k/sun3x/prom.c	Thu Nov  7 14:07:22 2002
+++ b/arch/m68k/sun3x/prom.c	Thu Apr 24 03:30:40 2003
@@ -90,16 +90,10 @@
 /* debug console - write-only */
 
 static struct console sun3x_debug = {
-	"debug",
-	sun3x_prom_write,  	/* write */
-	NULL,			/* read */
-	NULL,			/* device */
-	NULL,			/* unblank */
-	NULL,			/* setup */
-	CON_PRINTBUFFER,
-	-1,
-	0,
-	NULL
+	.name  =	"debug",
+	.write =	sun3x_prom_write,
+	.flags =	CON_PRINTBUFFER,
+	.index =	-1,
 };
 
 void sun3x_prom_init(void)
diff -Nru a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
--- a/arch/m68knommu/Kconfig	Wed Mar  5 15:33:01 2003
+++ b/arch/m68knommu/Kconfig	Sun Apr 20 12:56:50 2003
@@ -563,7 +563,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -635,7 +635,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig
--- a/arch/mips/Kconfig	Sat Mar  8 14:50:37 2003
+++ b/arch/mips/Kconfig	Sun Apr 20 12:56:50 2003
@@ -35,7 +35,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
 	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -363,7 +363,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -740,7 +740,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -762,7 +762,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -931,7 +931,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -1083,7 +1083,7 @@
 
 	  Although PS/2 mice are not technically bus mice, they are explained
 	  in detail in the Busmouse-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  When using a PS/2 mouse, you can get problems if you want to use the
 	  mouse both on the Linux console and under X. Using the "-R" option
@@ -1102,7 +1102,7 @@
 	  MouseSystem or Microsoft mouse (made by Logitech) that plugs into a
 	  COM port (rectangular with 9 or 25 pins). These people say N here.
 	  If you have something else, read the Busmouse-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. This HOWTO contains
+	  <http://www.tldp.org/docs.html#howto>. This HOWTO contains
 	  information about all non-serial mice, not just bus mice.
 
 	  If you have a laptop, you either have to check the documentation or
@@ -1139,7 +1139,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/mips/au1000/common/serial.c b/arch/mips/au1000/common/serial.c
--- a/arch/mips/au1000/common/serial.c	Thu Mar  6 09:10:40 2003
+++ b/arch/mips/au1000/common/serial.c	Thu Apr 24 03:30:40 2003
@@ -195,7 +195,7 @@
 
 #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
 #define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
- cdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
 #else
 #define DBG_CNT(s)
 #endif
@@ -218,7 +218,7 @@
 
 
 static inline int serial_paranoia_check(struct async_struct *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -227,11 +227,11 @@
 		"Warning: null async_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -273,7 +273,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -289,7 +289,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1144,7 +1144,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty || !info->xmit.buf)
@@ -1168,7 +1168,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	if (info->xmit.head == info->xmit.tail
@@ -1190,7 +1190,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit.buf || !tmp_buf)
@@ -1264,7 +1264,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
 }
@@ -1273,7 +1273,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
 }
@@ -1283,7 +1283,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	save_flags(flags); cli();
 	info->xmit.head = info->xmit.tail = 0;
@@ -1305,7 +1305,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_send_char"))
 		return;
 
 	info->x_char = ch;
@@ -1335,7 +1335,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1360,7 +1360,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1451,7 +1451,7 @@
 		goto check_and_exit;
 	}
 
-	new_serial.irq = irq_cannonicalize(new_serial.irq);
+	new_serial.irq = irq_canonicalize(new_serial.irq);
 
 	if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) || 
 	    (new_serial.baud_base < 9600)|| (new_serial.type < PORT_UNKNOWN) ||
@@ -1697,7 +1697,7 @@
 	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_break"))
+	if (serial_paranoia_check(info, tty->name, "rs_break"))
 		return;
 
 	if (!CONFIGURED_SERIAL_PORT(info))
@@ -1720,7 +1720,7 @@
 	struct serial_icounter_struct icount;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1887,7 +1887,7 @@
 	struct serial_state *state;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	state = info->state;
@@ -1962,8 +1962,8 @@
 		rs_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1991,7 +1991,7 @@
 	unsigned long orig_jiffies, char_time;
 	int lsr;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 	if (info->state->type == PORT_UNKNOWN)
@@ -2055,7 +2055,7 @@
 	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	struct serial_state *state = info->state;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	state = info->state;
@@ -2105,7 +2105,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -2264,7 +2264,7 @@
 	unsigned long		page;
 
 	MOD_INC_USE_COUNT;
-	line = MINOR(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS)) {
 		MOD_DEC_USE_COUNT;
 		return -ENODEV;
@@ -2276,14 +2276,13 @@
 	}
 	tty->driver_data = info;
 	info->tty = tty;
-	if (serial_paranoia_check(info, tty->device, "rs_open")) {
+	if (serial_paranoia_check(info, tty->name, "rs_open")) {
 		MOD_DEC_USE_COUNT;		
 		return -ENODEV;
 	}
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->state->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->state->count);
 #endif
 	info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
 
@@ -2336,7 +2335,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else 
 			*tty->termios = info->state->callout_termios;
@@ -2353,7 +2352,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttys%d successful...", info->line);
+	printk("rs_open %s successful...", tty->name);
 #endif
 	return 0;
 }
@@ -2589,7 +2588,7 @@
 	serial_driver.magic = TTY_DRIVER_MAGIC;
 	serial_driver.driver_name = "serial";
 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
-	serial_driver.name = "tts/%d";
+	serial_driver.name = "tts/";
 #else
 	serial_driver.name = "ttyS";
 #endif
@@ -2633,7 +2632,7 @@
 	 */
 	callout_driver = serial_driver;
 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
-	callout_driver.name = "cua/%d";
+	callout_driver.name = "cua/";
 #else
 	callout_driver.name = "cua";
 #endif
@@ -2662,7 +2661,7 @@
 		state->icount.rx = state->icount.tx = 0;
 		state->icount.frame = state->icount.parity = 0;
 		state->icount.overrun = state->icount.brk = 0;
-		state->irq = irq_cannonicalize(state->irq);
+		state->irq = irq_canonicalize(state->irq);
 		if (state->hub6)
 			state->io_type = SERIAL_IO_HUB6;
 		if (state->port && check_region(state->port,8)) {
@@ -2682,10 +2681,8 @@
 		       (state->flags & ASYNC_FOURPORT) ? " FourPort" : "",
 		       state->port, state->irq,
 		       uart_config[state->type].name);
-		tty_register_device(&serial_driver,
-				   serial_driver.minor_start + state->line);
-		tty_register_device(&callout_driver,
-				   callout_driver.minor_start + state->line);
+		tty_register_device(&serial_driver, state->line);
+		tty_register_device(&callout_driver, state->line);
 	}
 	return 0;
 }
@@ -2772,10 +2769,8 @@
 	      state->iomem_base ? "iomem" : "port",
 	      state->iomem_base ? (unsigned long)state->iomem_base :
 	      state->port, state->irq, uart_config[state->type].name);
-	tty_register_device(&serial_driver,
-			   serial_driver.minor_start + state->line); 
-	tty_register_device(&callout_driver,
-			   callout_driver.minor_start + state->line);
+	tty_register_device(&serial_driver, state->line); 
+	tty_register_device(&callout_driver, state->line);
 	return state->line + SERIAL_DEV_OFFSET;
 }
 
@@ -2801,10 +2796,8 @@
 	/* These will be hidden, because they are devices that will no longer
 	 * be available to the system. (ie, PCMCIA modems, once ejected)
 	 */
-	tty_unregister_device(&serial_driver,
-			     serial_driver.minor_start + state->line);
-	tty_unregister_device(&callout_driver,
-			     callout_driver.minor_start + state->line);
+	tty_unregister_device(&serial_driver, state->line);
+	tty_unregister_device(&callout_driver, state->line);
 	restore_flags(flags);
 }
 
@@ -2922,9 +2915,10 @@
 	serial_out(info, UART_IER, ier);
 }
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return MKDEV(TTY_MAJOR, 64 + c->index);
+	*index = c->index - SERIAL_DEV_OFFSET;
+	return &serial_driver;
 }
 
 /*
diff -Nru a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c
--- a/arch/mips/baget/vacserial.c	Mon Feb  3 05:47:46 2003
+++ b/arch/mips/baget/vacserial.c	Thu Apr 24 03:30:40 2003
@@ -29,7 +29,7 @@
   
 #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
 #define DBG_CNT(s) baget_printk("(%s):[%x] refc=%d, serc=%d, ttyc=%d-> %s\n", \
-  cdevname(tty->device),(info->flags),serial_refcount,info->count,tty->count,s)
+  tty->name,(info->flags),serial_refcount,info->count,tty->count,s)
 #else
 #define DBG_CNT(s)
 #endif
@@ -164,7 +164,7 @@
 static DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int serial_paranoia_check(struct async_struct *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -173,11 +173,11 @@
 		"Warning: null async_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -266,7 +266,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -282,7 +282,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1023,7 +1023,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty || !info->xmit_buf)
@@ -1046,7 +1046,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1066,7 +1066,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 		
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf || !tmp_buf)
@@ -1134,7 +1134,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	int	ret;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -1146,7 +1146,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -1156,7 +1156,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags; 
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 
 	save_flags(flags); cli();
@@ -1177,7 +1177,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_send_char"))
 		return;
 
 	info->x_char = ch;
@@ -1207,7 +1207,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1224,7 +1224,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1456,7 +1456,7 @@
 	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_break"))
+	if (serial_paranoia_check(info, tty->name, "rs_break"))
 		return;
 
 	if (!info->port)
@@ -1482,7 +1482,7 @@
 	struct serial_icounter_struct *p_cuser;	/* user space */
 	unsigned long flags; 
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1640,7 +1640,7 @@
 	struct serial_state *state;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	state = info->state;
@@ -1717,8 +1717,8 @@
 		rs_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1747,7 +1747,7 @@
 	unsigned long orig_jiffies, char_time;
 	int lsr;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 	if (info->state->type == PORT_UNKNOWN)
@@ -1802,7 +1802,7 @@
 	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	struct serial_state *state = info->state;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	state = info->state;
@@ -1850,7 +1850,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1997,7 +1997,7 @@
 	unsigned long		page;
 
 	MOD_INC_USE_COUNT; 
-	line = MINOR(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS)) {
 		MOD_DEC_USE_COUNT; 
 		return -ENODEV;
@@ -2009,14 +2009,13 @@
 	}
         tty->driver_data = info;
         info->tty = tty;
-	if (serial_paranoia_check(info, tty->device, "rs_open")) {
+	if (serial_paranoia_check(info, tty->name, "rs_open")) {
 	        /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ 
 		return -ENODEV;
 	}
 
 #ifdef SERIAL_DEBUG_OPEN
-	baget_printk("rs_open %s%d, count = %d\n", 
-		     tty->driver.name, info->line,
+	baget_printk("rs_open %s, count = %d\n", tty->name,
 		     info->state->count);
 #endif
 	info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
@@ -2071,7 +2070,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else 
 			*tty->termios = info->state->callout_termios;
@@ -2088,7 +2087,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	baget_printk("rs_open ttys%d successful...", info->line);
+	baget_printk("rs_open %s successful...", tty->name);
 #endif
 	return 0;
 }
@@ -2622,9 +2621,10 @@
 	serial_outp(&scr_info, VAC_UART_INT_MASK, ier);
 }
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return MKDEV(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 /*
diff -Nru a/arch/mips/gt64120/momenco_ocelot/setup.c b/arch/mips/gt64120/momenco_ocelot/setup.c
--- a/arch/mips/gt64120/momenco_ocelot/setup.c	Fri May  3 05:28:15 2002
+++ b/arch/mips/gt64120/momenco_ocelot/setup.c	Sun Apr 20 09:14:40 2003
@@ -60,7 +60,7 @@
 #include <asm/mc146818rtc.h>
 #include <linux/version.h>
 #include <linux/bootmem.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <asm/gt64120/gt64120.h>
 #include "ocelot_pld.h"
 
diff -Nru a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
--- a/arch/mips/kernel/gdb-stub.c	Mon Nov 11 05:21:23 2002
+++ b/arch/mips/kernel/gdb-stub.c	Thu Apr 24 03:30:40 2003
@@ -942,11 +942,6 @@
 	}
 }
 
-static kdev_t gdb_console_dev(struct console *con)
-{
-	return MKDEV(1, 3); /* /dev/null */
-}
-
 static void gdb_console_write(struct console *con, const char *s, unsigned n)
 {
 	gdb_puts(s);
@@ -955,7 +950,6 @@
 static struct console gdb_console = {
 	.name	= "gdb",
 	.write	= gdb_console_write,
-	.device	= gdb_console_dev,
 	.flags	= CON_PRINTBUFFER,
 	.index	= -1
 };
diff -Nru a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c
--- a/arch/mips/kernel/irixioctl.c	Mon Apr 14 19:05:22 2003
+++ b/arch/mips/kernel/irixioctl.c	Mon Apr 21 20:58:40 2003
@@ -48,8 +48,8 @@
 
 static struct tty_struct *get_real_tty(struct tty_struct *tp)
 {
-	if (tp->driver.type == TTY_DRIVER_TYPE_PTY &&
-	   tp->driver.subtype == PTY_TYPE_MASTER)
+	if (tp->driver->type == TTY_DRIVER_TYPE_PTY &&
+	   tp->driver->subtype == PTY_TYPE_MASTER)
 		return tp->link;
 	else
 		return tp;
diff -Nru a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
--- a/arch/mips/kernel/setup.c	Tue Feb 25 02:42:13 2003
+++ b/arch/mips/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -26,7 +26,7 @@
 #include <linux/a.out.h>
 #include <linux/tty.h>
 #include <linux/bootmem.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ide.h>
 #include <linux/timex.h>
 #include <linux/root_dev.h>
diff -Nru a/arch/mips64/Kconfig b/arch/mips64/Kconfig
--- a/arch/mips64/Kconfig	Sat Mar  8 21:41:49 2003
+++ b/arch/mips64/Kconfig	Sun Apr 20 12:56:50 2003
@@ -113,7 +113,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
 	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -145,7 +145,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -350,7 +350,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -392,7 +392,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -520,7 +520,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -594,7 +594,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c
--- a/arch/mips64/mm/init.c	Wed Jan  8 12:37:27 2003
+++ b/arch/mips64/mm/init.c	Sun Apr 20 09:14:40 2003
@@ -21,9 +21,7 @@
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
 #include <linux/swap.h>
-#ifdef CONFIG_BLK_DEV_INITRD
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 
 #include <asm/bootinfo.h>
 #include <asm/cachectl.h>
diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig
--- a/arch/parisc/Kconfig	Sat Mar  8 14:50:37 2003
+++ b/arch/parisc/Kconfig	Sun Apr 20 12:56:50 2003
@@ -136,7 +136,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/nmi_watchdog.txt>
 	  and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -184,7 +184,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -206,7 +206,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -309,7 +309,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c
--- a/arch/parisc/kernel/ioctl32.c	Mon Mar  3 16:52:27 2003
+++ b/arch/parisc/kernel/ioctl32.c	Mon Apr 21 20:58:40 2003
@@ -1446,7 +1446,7 @@
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
 		return -EINVAL;
 	                                                
-	if (tty->driver.ioctl != vt_ioctl)
+	if (tty->driver->ioctl != vt_ioctl)
 		return -EINVAL;
 	
 	/*
diff -Nru a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
--- a/arch/parisc/kernel/irq.c	Sun Mar  2 18:13:32 2003
+++ b/arch/parisc/kernel/irq.c	Wed Apr 23 00:49:34 2003
@@ -161,7 +161,7 @@
 
 	DBG_IRQ(irq, ("mask_irq(%d) %d+%d eiem 0x%lx\n", irq,
 				IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
-	irq = irq_cannonicalize(irq);
+	irq = irq_canonicalize(irq);
 	region = irq_region[IRQ_REGION(irq)];
 	if (region->ops.mask_irq)
 		region->ops.mask_irq(region->data.dev, IRQ_OFFSET(irq));
@@ -173,7 +173,7 @@
 
 	DBG_IRQ(irq, ("unmask_irq(%d) %d+%d eiem 0x%lx\n", irq,
 				IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
-	irq = irq_cannonicalize(irq);
+	irq = irq_canonicalize(irq);
 	region = irq_region[IRQ_REGION(irq)];
 	if (region->ops.unmask_irq)
 		region->ops.unmask_irq(region->data.dev, IRQ_OFFSET(irq));
@@ -185,7 +185,7 @@
 
 	DBG_IRQ(irq, ("disable_irq(%d) %d+%d eiem 0x%lx\n", irq,
 				IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
-	irq = irq_cannonicalize(irq);
+	irq = irq_canonicalize(irq);
 	region = irq_region[IRQ_REGION(irq)];
 	if (region->ops.disable_irq)
 		region->ops.disable_irq(region->data.dev, IRQ_OFFSET(irq));
@@ -199,7 +199,7 @@
 
 	DBG_IRQ(irq, ("enable_irq(%d) %d+%d eiem 0x%lx\n", irq,
 				IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
-	irq = irq_cannonicalize(irq);
+	irq = irq_canonicalize(irq);
 	region = irq_region[IRQ_REGION(irq)];
 
 	if (region->ops.enable_irq)
@@ -594,7 +594,7 @@
 	printk(KERN_INFO "request_irq(%d, %p, 0x%lx, %s, %p)\n",irq, handler, irqflags, devname, dev_id);
 #endif
 
-	irq = irq_cannonicalize(irq);
+	irq = irq_canonicalize(irq);
 	/* request_irq()/free_irq() may not be called from interrupt context. */
 	if (in_interrupt())
 		BUG();
@@ -654,7 +654,7 @@
 	struct irqaction *action, **p;
 
 	/* See comments in request_irq() about interrupt context */
-	irq = irq_cannonicalize(irq);
+	irq = irq_canonicalize(irq);
 	
 	if (in_interrupt()) BUG();
 
diff -Nru a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
--- a/arch/parisc/kernel/setup.c	Sun Jan  5 03:16:46 2003
+++ b/arch/parisc/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -29,7 +29,7 @@
 
 #include <linux/config.h>
 #include <linux/kernel.h>
-#include <linux/blk.h>          /* for initrd_start and initrd_end */
+#include <linux/initrd.h>
 #include <linux/init.h>
 #include <linux/console.h>
 #include <linux/seq_file.h>
diff -Nru a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
--- a/arch/parisc/kernel/sys_parisc32.c	Tue Apr 15 22:48:20 2003
+++ b/arch/parisc/kernel/sys_parisc32.c	Sat Apr 19 23:22:56 2003
@@ -1131,7 +1131,7 @@
 struct nfsctl_export32 {
 	char		ex_client[NFSCLNT_IDMAX+1];
 	char		ex_path[NFS_MAXPATHLEN+1];
-	__kernel_dev_t	ex_dev;
+	__kernel_old_dev_t ex_dev;
 	compat_ino_t	ex_ino;
 	int		ex_flags;
 	__kernel_uid_t	ex_anon_uid;
diff -Nru a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
--- a/arch/parisc/mm/init.c	Sun Mar  2 18:13:32 2003
+++ b/arch/parisc/mm/init.c	Sun Apr 20 09:14:40 2003
@@ -15,7 +15,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/pci.h>		/* for hppa_dma_ops and pcxl_dma_ops */
-#include <linux/blk.h>          /* for initrd_start and initrd_end */
+#include <linux/initrd.h>
 #include <linux/swap.h>
 #include <linux/unistd.h>
 
diff -Nru a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
--- a/arch/ppc/4xx_io/serial_sicc.c	Mon Feb 24 10:25:04 2003
+++ b/arch/ppc/4xx_io/serial_sicc.c	Thu Apr 24 03:30:40 2003
@@ -1052,8 +1052,7 @@
     unsigned long flags;
 
 #if DEBUG
-    printk("siccuart_flush_buffer(%d) called\n",
-           MINOR(tty->device) - tty->driver.minor_start);
+    printk("siccuart_flush_buffer(%d) called\n", tty->index);
 #endif
     save_flags(flags); cli();
     info->xmit.head = info->xmit.tail = 0;
@@ -1482,7 +1481,7 @@
         state->count = 1;
     }
     if (--state->count < 0) {
-        printk("rs_close: bad serial port count for %s%d: %d\n", tty->driver.name, info->state->line, state->count);
+        printk("rs_close: bad serial port count for %s: %d\n", tty->name, state->count);
         state->count = 0;
     }
     if (state->count) {
@@ -1521,8 +1520,8 @@
         siccuart_wait_until_sent(tty, info->timeout);
     }
     siccuart_shutdown(info);
-    if (tty->driver.flush_buffer)
-        tty->driver.flush_buffer(tty);
+    if (tty->driver->flush_buffer)
+        tty->driver->flush_buffer(tty);
     if (tty->ldisc.flush_buffer)
         tty->ldisc.flush_buffer(tty);
     tty->closing = 0;
@@ -1580,7 +1579,7 @@
     expire = jiffies + timeout;
 #if DEBUG
     printk("siccuart_wait_until_sent(%d), jiff=%lu, expire=%lu  char_time=%lu...\n",
-           MINOR(tty->device) - tty->driver.minor_start, jiffies,
+           tty->index, jiffies,
            expire, char_time);
 #endif
     while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) != _LSR_TX_ALL) {
@@ -1634,7 +1633,7 @@
      * If this is a callout device, then just make sure the normal
      * device isn't being used.
      */
-    if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+    if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
         if (info->flags & ASYNC_NORMAL_ACTIVE)
             return -EBUSY;
         if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1754,7 +1753,7 @@
 static int siccuart_open(struct tty_struct *tty, struct file *filp)
 {
     struct SICC_info *info;
-    int retval, line = MINOR(tty->device) - tty->driver.minor_start;
+    int retval, line = tty->index;
 
 
     // is this a line that we've got?
@@ -1814,7 +1813,7 @@
 
     if ((info->state->count == 1) &&
         (info->flags & ASYNC_SPLIT_TERMIOS)) {
-        if (tty->driver.subtype == SERIAL_TYPE_NORMAL) {
+        if (tty->driver->subtype == SERIAL_TYPE_NORMAL) {
             *tty->termios = info->state->normal_termios;
         }
         else  {
@@ -1991,11 +1990,11 @@
     return c;
 }
 
-static kdev_t siccuart_console_device(struct console *c)
+static struct tty_driver *siccuart_console_device(struct console *c, int *index)
 {
-    return MKDEV(SERIAL_SICC_MAJOR, SERIAL_SICC_MINOR + c->index);
+	*index = c->index;
+	return &siccnormal_driver;
 }
-
 
 static int __init siccuart_console_setup(struct console *co, char *options)
 {
diff -Nru a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c
--- a/arch/ppc/8260_io/uart.c	Sat Mar 22 17:18:48 2003
+++ b/arch/ppc/8260_io/uart.c	Thu Apr 24 03:30:40 2003
@@ -219,7 +219,7 @@
 static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout);
 
 static inline int serial_paranoia_check(ser_info_t *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -228,11 +228,11 @@
 		"Warning: null async_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -265,7 +265,7 @@
 	volatile scc_t	*sccp;
 	volatile smc_t	*smcp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -288,7 +288,7 @@
 	volatile scc_t	*sccp;
 	volatile smc_t	*smcp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -964,7 +964,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	volatile cbd_t	*bdp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty)
@@ -995,7 +995,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	volatile cbd_t *bdp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty) 
@@ -1047,7 +1047,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	int	ret;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 
 	if ((info->tx_cur->cbd_sc & BD_SC_READY) == 0) {
@@ -1067,7 +1067,7 @@
 {
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return 0;
 }
@@ -1076,7 +1076,7 @@
 {
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 
 	/* There is nothing to "flush", whatever we gave the CPM
@@ -1099,7 +1099,7 @@
 
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_send_char"))
 		return;
 
 	bdp = info->tx_cur;
@@ -1137,7 +1137,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1163,7 +1163,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1414,7 +1414,7 @@
 	struct async_icount cnow;	/* kernel counter temps */
 	struct serial_icounter_struct *p_cuser;	/* user space */
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
@@ -1619,7 +1619,7 @@
 	volatile smc_t	*smcp;
 	volatile scc_t	*sccp;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	state = info->state;
@@ -1701,8 +1701,8 @@
 		rs_8xx_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1732,7 +1732,7 @@
 	/*int lsr;*/
 	volatile cbd_t *bdp;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 #ifdef maybe
@@ -1789,7 +1789,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	struct serial_state *state = info->state;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	state = info->state;
@@ -1840,7 +1840,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1975,18 +1975,17 @@
 	ser_info_t	*info;
 	int 		retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS))
 		return -ENODEV;
 	retval = get_async_struct(line, &info);
 	if (retval)
 		return retval;
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->state->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->state->count);
 #endif
 	tty->driver_data = info;
 	info->tty = tty;
@@ -2010,7 +2009,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else 
 			*tty->termios = info->state->callout_termios;
@@ -2021,7 +2020,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttys%d successful...", info->line);
+	printk("rs_open %s successful...", line);
 #endif
 	return 0;
 }
@@ -2450,7 +2449,8 @@
 
 static kdev_t serial_console_device(struct console *c)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 
@@ -2507,7 +2507,7 @@
 	serial_driver.magic = TTY_DRIVER_MAGIC;
 	serial_driver.driver_name = "serial";
 #ifdef CONFIG_DEVFS_FS
-	serial_driver.name = "tts/%d";
+	serial_driver.name = "tts/";
 #else
 	serial_driver.name = "ttyS";
 #endif
@@ -2549,7 +2549,7 @@
 	 */
 	callout_driver = serial_driver;
 #ifdef CONFIG_DEVFS_FS
-	callout_driver.name = "cua/%d";
+	callout_driver.name = "cua/";
 #else
 	callout_driver.name = "cua";
 #endif
diff -Nru a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c
--- a/arch/ppc/8xx_io/uart.c	Mon Mar  3 11:33:06 2003
+++ b/arch/ppc/8xx_io/uart.c	Thu Apr 24 03:30:40 2003
@@ -91,7 +91,7 @@
 
 static void serial_console_write(struct console *c, const char *s,
 				unsigned count);
-static kdev_t serial_console_device(struct console *c);
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 
 #if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 static unsigned long break_pressed; /* break, really ... */
@@ -233,7 +233,7 @@
 static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout);
 
 static inline int serial_paranoia_check(ser_info_t *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -242,11 +242,11 @@
 		"Warning: null async_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -279,7 +279,7 @@
 	volatile scc_t	*sccp;
 	volatile smc_t	*smcp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -303,7 +303,7 @@
 	volatile scc_t	*sccp;
 	volatile smc_t	*smcp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	idx = PORT_NUM(info->state->smc_scc_num);
@@ -1043,7 +1043,7 @@
 	volatile cbd_t	*bdp;
 	unsigned char *cp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty)
@@ -1082,7 +1082,7 @@
             return ret;
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty) 
@@ -1135,7 +1135,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	int	ret;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 
 	if ((info->tx_cur->cbd_sc & BD_SC_READY) == 0) {
@@ -1155,7 +1155,7 @@
 {
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return 0;
 }
@@ -1164,7 +1164,7 @@
 {
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 
 	/* There is nothing to "flush", whatever we gave the CPM
@@ -1188,7 +1188,7 @@
 
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_send_char"))
 		return;
 
 	bdp = info->tx_cur;
@@ -1227,7 +1227,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1253,7 +1253,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1462,7 +1462,7 @@
 	struct async_icount cnow;	/* kernel counter temps */
 	struct serial_icounter_struct *p_cuser;	/* user space */
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
@@ -1667,7 +1667,7 @@
 	volatile smc_t	*smcp;
 	volatile scc_t	*sccp;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	state = info->state;
@@ -1750,8 +1750,8 @@
 		rs_8xx_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1781,7 +1781,7 @@
 	/*int lsr;*/
 	volatile cbd_t *bdp;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 #ifdef maybe
@@ -1849,7 +1849,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	struct serial_state *state = info->state;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	state = info->state;
@@ -1900,7 +1900,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -2035,18 +2035,17 @@
 	ser_info_t	*info;
 	int 		retval, line;
 
-	line = MINOR(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS))
 		return -ENODEV;
 	retval = get_async_struct(line, &info);
 	if (retval)
 		return retval;
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->state->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->state->count);
 #endif
 	tty->driver_data = info;
 	info->tty = tty;
@@ -2071,7 +2070,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else 
 			*tty->termios = info->state->callout_termios;
@@ -2082,7 +2081,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttys%d successful...", info->line);
+	printk("rs_open %s successful...", tty->name);
 #endif
 	return 0;
 }
@@ -2514,9 +2513,10 @@
 }
 #endif
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return MKDEV(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 /*
@@ -2561,7 +2561,7 @@
 	serial_driver.magic = TTY_DRIVER_MAGIC;
 	serial_driver.driver_name = "serial";
 #ifdef CONFIG_DEVFS_FS
-	serial_driver.name = "tts/%d";
+	serial_driver.name = "tts/";
 #else
 	serial_driver.name = "ttyS";
 #endif
@@ -2603,7 +2603,7 @@
 	 */
 	callout_driver = serial_driver;
 #ifdef CONFIG_DEVFS_FS
-	callout_driver.name = "cua/%d";
+	callout_driver.name = "cua/";
 #else
 	callout_driver.name = "cua";
 #endif
diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig
--- a/arch/ppc/Kconfig	Wed Mar 26 22:00:59 2003
+++ b/arch/ppc/Kconfig	Sun Apr 20 12:56:50 2003
@@ -808,7 +808,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp.  It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>).  Once you have
+	  <http://www.tldp.org/docs.html#howto>).  Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -1444,7 +1444,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c	Fri Feb 14 01:58:30 2003
+++ b/arch/ppc/kernel/setup.c	Sun Apr 20 09:14:40 2003
@@ -9,7 +9,7 @@
 #include <linux/init.h>
 #include <linux/reboot.h>
 #include <linux/delay.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ide.h>
 #include <linux/tty.h>
 #include <linux/bootmem.h>
diff -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
--- a/arch/ppc/mm/init.c	Sat Mar 15 03:34:49 2003
+++ b/arch/ppc/mm/init.c	Sun Apr 20 09:14:40 2003
@@ -28,9 +28,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
-#ifdef CONFIG_BLK_DEV_INITRD
-#include <linux/blk.h>		/* for initrd_* */
-#endif
+#include <linux/initrd.h>
 
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
diff -Nru a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
--- a/arch/ppc/mm/pgtable.c	Sat Jan  4 00:44:11 2003
+++ b/arch/ppc/mm/pgtable.c	Sat Apr 19 23:22:41 2003
@@ -76,15 +76,11 @@
 	extern void *early_get_page(void);
 	int timeout = 0;
 
-	if (mem_init_done) {
-		while ((pte = (pte_t *) __get_free_page(GFP_KERNEL)) == NULL
-		       && ++timeout < 10) {
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ);
-		}
-	} else
-		pte = (pte_t *) early_get_page();
-	if (pte != NULL)
+	if (mem_init_done)
+		pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	else
+		pte = (pte_t *)early_get_page();
+	if (pte)
 		clear_page(pte);
 	return pte;
 }
@@ -92,20 +88,16 @@
 struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	struct page *pte;
-	int timeout = 0;
+
 #ifdef CONFIG_HIGHPTE
-	int flags = GFP_KERNEL | __GFP_HIGHMEM;
+	int flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
 #else
-	int flags = GFP_KERNEL;
+	int flags = GFP_KERNEL | __GFP_REPEAT;
 #endif
 
-	while ((pte = alloc_pages(flags, 0)) == NULL) {
-		if (++timeout >= 10)
-			return NULL;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ);
-	}
-	clear_highpage(pte);
+	pte = alloc_pages(flags, 0);
+	if (pte)
+		clear_highpage(pte);
 	return pte;
 }
 
diff -Nru a/arch/ppc/platforms/4xx/oak_setup.c b/arch/ppc/platforms/4xx/oak_setup.c
--- a/arch/ppc/platforms/4xx/oak_setup.c	Mon Jan  6 03:43:48 2003
+++ b/arch/ppc/platforms/4xx/oak_setup.c	Wed Apr 23 00:49:34 2003
@@ -18,7 +18,7 @@
 #include <linux/threads.h>
 #include <linux/param.h>
 #include <linux/string.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/irq.h>
 #include <linux/seq_file.h>
 
@@ -101,7 +101,7 @@
 
 	ppc_md.setup_arch	 	= oak_setup_arch;
 	ppc_md.show_percpuinfo	 	= oak_show_percpuinfo;
-	ppc_md.irq_cannonicalize 	= NULL;
+	ppc_md.irq_canonicalize 	= NULL;
 	ppc_md.init_IRQ		 	= oak_init_IRQ;
 	ppc_md.get_irq		 	= oak_get_irq;
 	ppc_md.init		 	= NULL;
diff -Nru a/arch/ppc/platforms/adir_setup.c b/arch/ppc/platforms/adir_setup.c
--- a/arch/ppc/platforms/adir_setup.c	Sat Jan  4 03:26:31 2003
+++ b/arch/ppc/platforms/adir_setup.c	Wed Apr 23 00:49:34 2003
@@ -17,7 +17,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
@@ -189,7 +189,7 @@
 
 	ppc_md.setup_arch = adir_setup_arch;
 	ppc_md.show_cpuinfo = adir_show_cpuinfo;
-	ppc_md.irq_cannonicalize = NULL;
+	ppc_md.irq_canonicalize = NULL;
 	ppc_md.init_IRQ = adir_init_IRQ;
 	ppc_md.get_irq = adir_get_irq;
 	ppc_md.init = NULL;
diff -Nru a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c
--- a/arch/ppc/platforms/apus_setup.c	Sun Sep 15 21:52:01 2002
+++ b/arch/ppc/platforms/apus_setup.c	Sun Apr 20 09:14:40 2003
@@ -17,7 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/seq_file.h>
 
 /* Needs INITSERIAL call in head.S! */
diff -Nru a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
--- a/arch/ppc/platforms/chrp_setup.c	Sun Sep 15 21:52:01 2002
+++ b/arch/ppc/platforms/chrp_setup.c	Thu Apr 24 03:30:41 2003
@@ -67,7 +67,7 @@
 extern unsigned long pmac_find_end_of_memory(void);
 extern int of_show_percpuinfo(struct seq_file *, int);
 
-extern kdev_t boot_dev;
+extern dev_t boot_dev;
 
 extern PTE *Hash, *Hash_end;
 extern unsigned long Hash_size, Hash_mask;
@@ -306,7 +306,7 @@
 }
 
 u_int __chrp
-chrp_irq_cannonicalize(u_int irq)
+chrp_irq_canonicalize(u_int irq)
 {
 	if (irq == 2)
 		return 9;
@@ -456,7 +456,7 @@
 	ppc_md.setup_arch     = chrp_setup_arch;
 	ppc_md.show_percpuinfo = of_show_percpuinfo;
 	ppc_md.show_cpuinfo   = chrp_show_cpuinfo;
-	ppc_md.irq_cannonicalize = chrp_irq_cannonicalize;
+	ppc_md.irq_canonicalize = chrp_irq_canonicalize;
 	ppc_md.init_IRQ       = chrp_init_IRQ;
 	ppc_md.get_irq        = openpic_get_irq;
 
diff -Nru a/arch/ppc/platforms/ev64260_setup.c b/arch/ppc/platforms/ev64260_setup.c
--- a/arch/ppc/platforms/ev64260_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/ev64260_setup.c	Wed Apr 23 00:49:34 2003
@@ -25,7 +25,7 @@
 #include <linux/pci.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
@@ -437,7 +437,7 @@
 
 	ppc_md.setup_arch = ev64260_setup_arch;
 	ppc_md.show_cpuinfo = ev64260_show_cpuinfo;
-	ppc_md.irq_cannonicalize = NULL;
+	ppc_md.irq_canonicalize = NULL;
 	ppc_md.init_IRQ = ev64260_init_irq;
 	ppc_md.get_irq = gt64260_get_irq;
 	ppc_md.init = NULL;
diff -Nru a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c
--- a/arch/ppc/platforms/gemini_setup.c	Mon Dec 30 04:29:15 2002
+++ b/arch/ppc/platforms/gemini_setup.c	Wed Apr 23 00:49:34 2003
@@ -19,7 +19,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/irq.h>
 #include <linux/seq_file.h>
@@ -559,7 +559,7 @@
 
 	ppc_md.setup_arch = gemini_setup_arch;
 	ppc_md.show_cpuinfo = gemini_show_cpuinfo;
-	ppc_md.irq_cannonicalize = NULL;
+	ppc_md.irq_canonicalize = NULL;
 	ppc_md.init_IRQ = gemini_init_IRQ;
 	ppc_md.get_irq = openpic_get_irq;
 	ppc_md.init = NULL;
diff -Nru a/arch/ppc/platforms/k2_setup.c b/arch/ppc/platforms/k2_setup.c
--- a/arch/ppc/platforms/k2_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/k2_setup.c	Sun Apr 20 09:14:40 2003
@@ -21,7 +21,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
diff -Nru a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c
--- a/arch/ppc/platforms/lopec_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/lopec_setup.c	Wed Apr 23 00:49:34 2003
@@ -20,7 +20,7 @@
 #include <linux/init.h>
 #include <linux/ide.h>
 #include <linux/seq_file.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/root_dev.h>
 
@@ -67,7 +67,7 @@
 }
 
 static u32
-lopec_irq_cannonicalize(u32 irq)
+lopec_irq_canonicalize(u32 irq)
 {
 	if (irq == 2)
 		return 9;
@@ -360,7 +360,7 @@
 
 	ppc_md.setup_arch = lopec_setup_arch;
 	ppc_md.show_cpuinfo = lopec_show_cpuinfo;
-	ppc_md.irq_cannonicalize = lopec_irq_cannonicalize;
+	ppc_md.irq_canonicalize = lopec_irq_canonicalize;
 	ppc_md.init_IRQ = lopec_init_IRQ;
 	ppc_md.get_irq = openpic_get_irq;
 
diff -Nru a/arch/ppc/platforms/mcpn765_setup.c b/arch/ppc/platforms/mcpn765_setup.c
--- a/arch/ppc/platforms/mcpn765_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/mcpn765_setup.c	Wed Apr 23 00:49:34 2003
@@ -24,7 +24,7 @@
 #include <linux/pci.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
@@ -201,7 +201,7 @@
 }
 
 static u32
-mcpn765_irq_cannonicalize(u32 irq)
+mcpn765_irq_canonicalize(u32 irq)
 {
 	if (irq == 2)
 		return 9;
@@ -434,7 +434,7 @@
 
 	ppc_md.setup_arch = mcpn765_setup_arch;
 	ppc_md.show_cpuinfo = mcpn765_show_cpuinfo;
-	ppc_md.irq_cannonicalize = mcpn765_irq_cannonicalize;
+	ppc_md.irq_canonicalize = mcpn765_irq_canonicalize;
 	ppc_md.init_IRQ = mcpn765_init_IRQ;
 	ppc_md.get_irq = openpic_get_irq;
 	ppc_md.init = mcpn765_init2;
diff -Nru a/arch/ppc/platforms/menf1_setup.c b/arch/ppc/platforms/menf1_setup.c
--- a/arch/ppc/platforms/menf1_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/menf1_setup.c	Sun Apr 20 09:14:40 2003
@@ -21,7 +21,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
diff -Nru a/arch/ppc/platforms/mvme5100_setup.c b/arch/ppc/platforms/mvme5100_setup.c
--- a/arch/ppc/platforms/mvme5100_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/mvme5100_setup.c	Sun Apr 20 09:14:40 2003
@@ -20,7 +20,7 @@
 #include <linux/pci.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
diff -Nru a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c
--- a/arch/ppc/platforms/pal4_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/pal4_setup.c	Sun Apr 20 09:14:40 2003
@@ -20,7 +20,7 @@
 #include <linux/time.h>
 #include <linux/irq.h>
 #include <linux/kdev_t.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/seq_file.h>
 #include <linux/root_dev.h>
diff -Nru a/arch/ppc/platforms/pcore_setup.c b/arch/ppc/platforms/pcore_setup.c
--- a/arch/ppc/platforms/pcore_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/pcore_setup.c	Sun Apr 20 09:14:40 2003
@@ -21,7 +21,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
diff -Nru a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
--- a/arch/ppc/platforms/pmac_setup.c	Wed Mar 26 22:00:59 2003
+++ b/arch/ppc/platforms/pmac_setup.c	Thu Apr 24 03:30:41 2003
@@ -40,7 +40,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/vt_kern.h>
 #include <linux/console.h>
 #include <linux/ide.h>
@@ -364,7 +364,7 @@
 void *boot_host;
 int boot_target;
 int boot_part;
-extern kdev_t boot_dev;
+extern dev_t boot_dev;
 
 #ifdef CONFIG_SCSI
 void __init
@@ -398,18 +398,18 @@
 #endif
 
 #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-kdev_t __init
+dev_t __init
 find_ide_boot(void)
 {
 	char *p;
 	int n;
-	kdev_t __init pmac_find_ide_boot(char *bootdevice, int n);
+	dev_t __init pmac_find_ide_boot(char *bootdevice, int n);
 
 	if (bootdevice == NULL)
-		return NODEV;
+		return 0;
 	p = strrchr(bootdevice, '/');
 	if (p == NULL)
-		return NODEV;
+		return 0;
 	n = p - bootdevice;
 
 	return pmac_find_ide_boot(bootdevice, n);
@@ -436,7 +436,7 @@
 
 /* can't be __init - can be called whenever a disk is first accessed */
 void __pmac
-note_bootable_part(kdev_t dev, int part, int goodness)
+note_bootable_part(dev_t dev, int part, int goodness)
 {
 	static int found_boot = 0;
 	char *p;
@@ -454,9 +454,9 @@
 		find_boot_device();
 		found_boot = 1;
 	}
-	if (kdev_same(boot_dev, NODEV) || kdev_same(dev, boot_dev)) {
-		ROOT_DEV = MKDEV(major(dev), minor(dev) + part);
-		boot_dev = NODEV;
+	if (!boot_dev || dev == boot_dev) {
+		ROOT_DEV = dev + part;
+		boot_dev = 0;
 		current_root_goodness = goodness;
 	}
 }
@@ -619,7 +619,7 @@
 	ppc_md.setup_arch     = pmac_setup_arch;
 	ppc_md.show_cpuinfo   = pmac_show_cpuinfo;
 	ppc_md.show_percpuinfo = pmac_show_percpuinfo;
-	ppc_md.irq_cannonicalize = NULL;
+	ppc_md.irq_canonicalize = NULL;
 	ppc_md.init_IRQ       = pmac_pic_init;
 	ppc_md.get_irq        = pmac_get_irq; /* Changed later on ... */
 	
diff -Nru a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c
--- a/arch/ppc/platforms/powerpmc250.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/powerpmc250.c	Sun Apr 20 09:14:40 2003
@@ -23,7 +23,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
diff -Nru a/arch/ppc/platforms/pplus_setup.c b/arch/ppc/platforms/pplus_setup.c
--- a/arch/ppc/platforms/pplus_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/pplus_setup.c	Wed Apr 23 00:49:34 2003
@@ -33,7 +33,7 @@
 #include <linux/interrupt.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ioport.h>
 #include <linux/console.h>
 #include <linux/timex.h>
@@ -206,7 +206,7 @@
 }
 
 static unsigned int
-pplus_irq_cannonicalize(u_int irq)
+pplus_irq_canonicalize(u_int irq)
 {
 	if (irq == 2)
 	{
@@ -469,7 +469,7 @@
 	ppc_md.setup_arch     = pplus_setup_arch;
 	ppc_md.show_percpuinfo = NULL;
 	ppc_md.show_cpuinfo    = pplus_show_cpuinfo;
-	ppc_md.irq_cannonicalize = pplus_irq_cannonicalize;
+	ppc_md.irq_canonicalize = pplus_irq_canonicalize;
 	ppc_md.init_IRQ       = pplus_init_IRQ;
 	/* this gets changed later on if we have an OpenPIC -- Cort */
 	ppc_md.get_irq        = i8259_irq;
diff -Nru a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
--- a/arch/ppc/platforms/prep_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/prep_setup.c	Thu Apr 24 03:30:41 2003
@@ -31,7 +31,7 @@
 #include <linux/interrupt.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ioport.h>
 #include <linux/console.h>
 #include <linux/timex.h>
@@ -91,7 +91,7 @@
 #define cached_A1	(((char *)(ppc_cached_irq_mask))[2])
 
 /* for the mac fs */
-kdev_t boot_dev;
+dev_t boot_dev;
 
 #ifdef CONFIG_SOUND_CS4232 
 long ppc_cs4232_dma, ppc_cs4232_dma2;
@@ -976,7 +976,7 @@
 }
 
 static unsigned int __prep
-prep_irq_cannonicalize(u_int irq)
+prep_irq_canonicalize(u_int irq)
 {
 	if (irq == 2)
 	{
@@ -1150,7 +1150,7 @@
 	ppc_md.setup_arch     = prep_setup_arch;
 	ppc_md.show_percpuinfo = prep_show_percpuinfo;
 	ppc_md.show_cpuinfo   = NULL; /* set in prep_setup_arch() */
-	ppc_md.irq_cannonicalize = prep_irq_cannonicalize;
+	ppc_md.irq_canonicalize = prep_irq_canonicalize;
 	ppc_md.init_IRQ       = prep_init_IRQ;
 	/* this gets changed later on if we have an OpenPIC -- Cort */
 	ppc_md.get_irq        = i8259_irq;
diff -Nru a/arch/ppc/platforms/prpmc750_setup.c b/arch/ppc/platforms/prpmc750_setup.c
--- a/arch/ppc/platforms/prpmc750_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/prpmc750_setup.c	Sun Apr 20 09:14:40 2003
@@ -21,7 +21,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
diff -Nru a/arch/ppc/platforms/prpmc800_setup.c b/arch/ppc/platforms/prpmc800_setup.c
--- a/arch/ppc/platforms/prpmc800_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/prpmc800_setup.c	Sun Apr 20 09:14:40 2003
@@ -18,7 +18,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
diff -Nru a/arch/ppc/platforms/sandpoint_setup.c b/arch/ppc/platforms/sandpoint_setup.c
--- a/arch/ppc/platforms/sandpoint_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/platforms/sandpoint_setup.c	Wed Apr 23 00:49:34 2003
@@ -64,7 +64,7 @@
 #include <linux/pci.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
@@ -349,7 +349,7 @@
 }
 
 static u32
-sandpoint_irq_cannonicalize(u32 irq)
+sandpoint_irq_canonicalize(u32 irq)
 {
 	if (irq == 2)
 	{
@@ -602,7 +602,7 @@
 
 	ppc_md.setup_arch = sandpoint_setup_arch;
 	ppc_md.show_cpuinfo = sandpoint_show_cpuinfo;
-	ppc_md.irq_cannonicalize = sandpoint_irq_cannonicalize;
+	ppc_md.irq_canonicalize = sandpoint_irq_canonicalize;
 	ppc_md.init_IRQ = sandpoint_init_IRQ;
 	ppc_md.get_irq = sandpoint_get_irq;
 	ppc_md.init = sandpoint_init2;
diff -Nru a/arch/ppc/platforms/spruce_setup.c b/arch/ppc/platforms/spruce_setup.c
--- a/arch/ppc/platforms/spruce_setup.c	Thu Mar 27 02:17:35 2003
+++ b/arch/ppc/platforms/spruce_setup.c	Sun Apr 20 09:14:41 2003
@@ -22,7 +22,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
diff -Nru a/arch/ppc/platforms/zx4500_setup.c b/arch/ppc/platforms/zx4500_setup.c
--- a/arch/ppc/platforms/zx4500_setup.c	Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/zx4500_setup.c	Wed Apr 23 00:49:34 2003
@@ -35,7 +35,7 @@
 #include <linux/kdev_t.h>
 #include <linux/types.h>
 #include <linux/major.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
@@ -331,7 +331,7 @@
 
 	ppc_md.setup_arch = zx4500_setup_arch;
 	ppc_md.show_cpuinfo = zx4500_show_cpuinfo;
-	ppc_md.irq_cannonicalize = NULL;
+	ppc_md.irq_canonicalize = NULL;
 	ppc_md.init_IRQ = zx4500_init_IRQ;
 	ppc_md.get_irq = openpic_get_irq;
 	ppc_md.init = NULL;
diff -Nru a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
--- a/arch/ppc/syslib/m8260_setup.c	Sat Mar 22 17:18:48 2003
+++ b/arch/ppc/syslib/m8260_setup.c	Wed Apr 23 00:49:34 2003
@@ -28,7 +28,7 @@
 #include <linux/interrupt.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ioport.h>
 #include <linux/ide.h>
 #include <linux/seq_file.h>
@@ -243,7 +243,7 @@
 
 	ppc_md.setup_arch		= m8260_setup_arch;
 	ppc_md.show_percpuinfo		= m8260_show_percpuinfo;
-	ppc_md.irq_cannonicalize	= NULL;
+	ppc_md.irq_canonicalize	= NULL;
 	ppc_md.init_IRQ			= m8260_init_IRQ;
 	ppc_md.get_irq			= m8260_get_irq;
 	ppc_md.init			= NULL;
diff -Nru a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
--- a/arch/ppc/syslib/m8xx_setup.c	Tue Nov  5 13:53:07 2002
+++ b/arch/ppc/syslib/m8xx_setup.c	Wed Apr 23 00:49:34 2003
@@ -28,7 +28,7 @@
 #include <linux/interrupt.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ioport.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
@@ -377,7 +377,7 @@
 
 	ppc_md.setup_arch		= m8xx_setup_arch;
 	ppc_md.show_percpuinfo		= m8xx_show_percpuinfo;
-	ppc_md.irq_cannonicalize	= NULL;
+	ppc_md.irq_canonicalize	= NULL;
 	ppc_md.init_IRQ			= m8xx_init_IRQ;
 	ppc_md.get_irq			= m8xx_get_irq;
 	ppc_md.init			= NULL;
diff -Nru a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c
--- a/arch/ppc/syslib/ppc4xx_setup.c	Sat Mar 22 16:59:59 2003
+++ b/arch/ppc/syslib/ppc4xx_setup.c	Sun Apr 20 09:14:41 2003
@@ -22,7 +22,7 @@
 #include <linux/reboot.h>
 #include <linux/param.h>
 #include <linux/string.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/pci.h>
 #include <linux/rtc.h>
 #include <linux/console.h>
diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
--- a/arch/ppc64/Kconfig	Sat Mar  8 14:50:37 2003
+++ b/arch/ppc64/Kconfig	Sun Apr 20 12:56:50 2003
@@ -195,7 +195,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp.  It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>).  Once you have
+	  <http://www.tldp.org/docs.html#howto>).  Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -387,7 +387,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/ppc64/kernel/chrp_setup.c b/arch/ppc64/kernel/chrp_setup.c
--- a/arch/ppc64/kernel/chrp_setup.c	Mon Mar 24 16:01:56 2003
+++ b/arch/ppc64/kernel/chrp_setup.c	Thu Apr 24 03:30:41 2003
@@ -31,7 +31,7 @@
 #include <linux/interrupt.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ioport.h>
 #include <linux/console.h>
 #include <linux/pci.h>
@@ -79,7 +79,7 @@
 extern void SystemReset_FWNMI(void), MachineCheck_FWNMI(void);	/* from head.S */
 int fwnmi_active;  /* TRUE if an FWNMI handler is present */
 
-kdev_t boot_dev;
+dev_t boot_dev;
 unsigned long  virtPython0Facilities = 0;  // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address.
 
 extern unsigned long loops_per_jiffy;
diff -Nru a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
--- a/arch/ppc64/kernel/iSeries_setup.c	Mon Mar 24 16:01:56 2003
+++ b/arch/ppc64/kernel/iSeries_setup.c	Sun Apr 20 09:14:41 2003
@@ -23,7 +23,7 @@
 #include <linux/param.h>
 #include <linux/string.h>
 #include <linux/bootmem.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/seq_file.h>
 #include <linux/root_dev.h>
 
diff -Nru a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
--- a/arch/ppc64/kernel/ioctl32.c	Tue Feb 25 10:47:17 2003
+++ b/arch/ppc64/kernel/ioctl32.c	Mon Apr 21 20:58:40 2003
@@ -1799,7 +1799,7 @@
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
 		return -EINVAL;
 	                                                
-	if (tty->driver.ioctl != vt_ioctl)
+	if (tty->driver->ioctl != vt_ioctl)
 		return -EINVAL;
 	
 	/*
diff -Nru a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
--- a/arch/ppc64/kernel/setup.c	Sun Dec 15 17:35:20 2002
+++ b/arch/ppc64/kernel/setup.c	Sun Apr 20 09:14:41 2003
@@ -17,7 +17,7 @@
 #include <linux/init.h>
 #include <linux/reboot.h>
 #include <linux/delay.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/ide.h>
 #include <linux/seq_file.h>
 #include <linux/ioport.h>
diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
--- a/arch/ppc64/kernel/sys_ppc32.c	Tue Apr 15 22:48:20 2003
+++ b/arch/ppc64/kernel/sys_ppc32.c	Sat Apr 19 23:22:56 2003
@@ -910,7 +910,6 @@
 #define ca32_export	u.u32_export
 #define ca32_getfd	u.u32_getfd
 #define ca32_getfs	u.u32_getfs
-#define ca32_authd	u.u32_authd
 };
 
 union nfsctl_res32 {
diff -Nru a/arch/s390/Kconfig b/arch/s390/Kconfig
--- a/arch/s390/Kconfig	Mon Apr 14 12:11:54 2003
+++ b/arch/s390/Kconfig	Sun Apr 20 12:56:51 2003
@@ -60,7 +60,7 @@
 
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Even if you don't know what to do here, say Y.
 
@@ -226,7 +226,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -248,7 +248,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
diff -Nru a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
--- a/arch/s390/kernel/setup.c	Mon Apr 14 12:11:56 2003
+++ b/arch/s390/kernel/setup.c	Sun Apr 20 09:14:41 2003
@@ -29,9 +29,7 @@
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/init.h>
-#ifdef CONFIG_BLK_DEV_RAM
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 #include <linux/bootmem.h>
 #include <linux/root_dev.h>
 #include <linux/console.h>
diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig
--- a/arch/sh/Kconfig	Sat Mar  8 14:50:37 2003
+++ b/arch/sh/Kconfig	Sun Apr 20 12:56:51 2003
@@ -483,7 +483,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -608,7 +608,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -630,7 +630,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -748,7 +748,7 @@
 	---help---
 	  If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y
 	  here, otherwise N. Read the CD-ROM-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -980,7 +980,7 @@
 	  box (as opposed to using a serial printer; if the connector at the
 	  printer has 9 or 25 holes ["female"], then it's serial), say Y.
 	  Also read the Printing-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  It is possible to share one parallel port among several devices
 	  (e.g. printer and ZIP drive) and it is safe to compile the
@@ -1049,7 +1049,7 @@
 
 	  Although PS/2 mice are not technically bus mice, they are explained
 	  in detail in the Busmouse-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  When using a PS/2 mouse, you can get problems if you want to use the
 	  mouse both on the Linux console and under X. Using the "-R" option
@@ -1157,7 +1157,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
--- a/arch/sh/kernel/setup.c	Sat Oct 12 07:52:54 2002
+++ b/arch/sh/kernel/setup.c	Thu Apr 24 03:30:40 2003
@@ -25,9 +25,7 @@
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/init.h>
-#ifdef CONFIG_BLK_DEV_RAM
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 #include <linux/bootmem.h>
 #include <linux/console.h>
 #include <linux/ctype.h>
@@ -141,12 +139,6 @@
     	sh_bios_console_write(s, count);
 }
 
-static kdev_t sh_console_device(struct console *c)
-{
-	/* /dev/null */
-	return mk_kdev(MEM_MAJOR, 3);
-}
-
 /*
  *	Setup initial baud/bits/parity. We do two things here:
  *	- construct a cflag setting for the first rs_open()
@@ -173,7 +165,6 @@
 static struct console sh_console = {
 	.name		= "bios",
 	.write		= sh_console_write,
-	.device		= sh_console_device,
 	.setup		= sh_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig
--- a/arch/sparc/Kconfig	Sat Mar  8 14:50:37 2003
+++ b/arch/sparc/Kconfig	Sun Apr 20 12:56:50 2003
@@ -106,7 +106,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
 	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -160,7 +160,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  Please also read the PCMCIA-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -314,7 +314,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -336,7 +336,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -372,7 +372,7 @@
 	  box (as opposed to using a serial printer; if the connector at the
 	  printer has 9 or 25 holes ["female"], then it's serial), say Y.
 	  Also read the Printing-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  It is possible to share one parallel port among several devices
 	  (e.g. printer and ZIP drive) and it is safe to compile the
@@ -636,7 +636,7 @@
 	  If you want to use a SCSI hard disk or the SCSI or parallel port
 	  version of the IOMEGA ZIP drive under Linux, say Y and read the
 	  SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. This is NOT for SCSI
+	  <http://www.tldp.org/docs.html#howto>. This is NOT for SCSI
 	  CD-ROMs.
 
 	  This driver is also available as a module ( = code which can be
@@ -671,7 +671,7 @@
 	---help---
 	  If you want to use a SCSI tape drive under Linux, say Y and read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, and
+	  <http://www.tldp.org/docs.html#howto>, and
 	  <file:Documentation/scsi/st.txt> in the kernel source.  This is NOT
 	  for SCSI CD-ROMs.
 
@@ -693,7 +693,7 @@
 	  tape drives (ADR-x0) that supports the standard SCSI-2 commands for
 	  tapes (QIC-157) and can be driven by the standard driver st.
 	  For more information, you may have a look at the SCSI-HOWTO
-	  <http://www.linuxdoc.org/docs.html#howto>  and
+	  <http://www.tldp.org/docs.html#howto>  and
 	  <file:Documentation/scsi/osst.txt>  in the kernel source.
 	  More info on the OnStream driver may be found on
 	  <http://linux1.onstream.nl/test/>
@@ -712,7 +712,7 @@
 	---help---
 	  If you want to use a SCSI CD-ROM under Linux, say Y and read the
 	  SCSI-HOWTO and the CD-ROM-HOWTO at
-	  <http://www.linuxdoc.org/docs.html#howto>. Also make sure to say Y
+	  <http://www.tldp.org/docs.html#howto>. Also make sure to say Y
 	  or M to "ISO 9660 CD-ROM file system support" later.
 
 	  This driver is also available as a module ( = code which can be
@@ -925,7 +925,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/sparc/kernel/auxio.c b/arch/sparc/kernel/auxio.c
--- a/arch/sparc/kernel/auxio.c	Tue Feb  5 09:40:23 2002
+++ b/arch/sparc/kernel/auxio.c	Tue Apr 22 22:43:02 2003
@@ -6,13 +6,19 @@
 #include <linux/stddef.h>
 #include <linux/init.h>
 #include <linux/config.h>
+#include <linux/spinlock.h>
 #include <asm/oplib.h>
 #include <asm/io.h>
 #include <asm/auxio.h>
 #include <asm/string.h>		/* memset(), Linux has no bzero() */
 
 /* Probe and map in the Auxiliary I/O register */
-unsigned char *auxio_register;
+
+/* auxio_register is not static because it is referenced 
+ * in entry.S::floppy_tdone
+ */
+unsigned long auxio_register = 0UL;
+static spinlock_t auxio_lock = SPIN_LOCK_UNLOCKED;
 
 void __init auxio_probe(void)
 {
@@ -23,7 +29,6 @@
 	switch (sparc_cpu_model) {
 	case sun4d:
 	case sun4:
-		auxio_register = 0;
 		return;
 	default:
 		break;
@@ -37,12 +42,10 @@
 		if(!auxio_nd) {
 #ifdef CONFIG_PCI
 			/* There may be auxio on Ebus */
-			auxio_register = 0;
 			return;
 #else
 			if(prom_searchsiblings(node, "leds")) {
 				/* VME chassis sun4m machine, no auxio exists. */
-				auxio_register = 0;
 				return;
 			}
 			prom_printf("Cannot find auxio node, cannot continue...\n");
@@ -56,14 +59,46 @@
 	r.flags = auxregs[0].which_io & 0xF;
 	r.start = auxregs[0].phys_addr;
 	r.end = auxregs[0].phys_addr + auxregs[0].reg_size - 1;
-	auxio_register = (unsigned char *) sbus_ioremap(&r, 0,
-	    auxregs[0].reg_size, "auxio");
+	auxio_register = sbus_ioremap(&r, 0, auxregs[0].reg_size, "auxio");
 	/* Fix the address on sun4m and sun4c. */
 	if((((unsigned long) auxregs[0].phys_addr) & 3) == 3 ||
 	   sparc_cpu_model == sun4c)
-		auxio_register = (unsigned char *) ((int)auxio_register | 3);
+		auxio_register |= 3;
+
+	set_auxio(AUXIO_LED, 0);
+}
 
-	TURN_ON_LED;
+unsigned char get_auxio(void)
+{
+	if(auxio_register) 
+		return sbus_readb(auxio_register);
+	return 0;
+}
+
+void set_auxio(unsigned char bits_on, unsigned char bits_off)
+{
+	unsigned char regval;
+	unsigned long flags;
+	spin_lock_irqsave(&auxio_lock, flags);
+	switch(sparc_cpu_model) {
+	case sun4c:
+		regval = sbus_readb(auxio_register);
+		sbus_writeb(((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN,
+			auxio_register);
+		break;
+	case sun4m:
+		if(!auxio_register)
+			break;     /* VME chassic sun4m, no auxio. */
+		regval = sbus_readb(auxio_register);
+		sbus_writeb(((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M,
+			auxio_register);
+		break;
+	case sun4d:
+		break;
+	default:
+		panic("Can't set AUXIO register on this machine.");
+	};
+	spin_unlock_irqrestore(&auxio_lock, flags);
 }
 
 
diff -Nru a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
--- a/arch/sparc/kernel/entry.S	Fri Feb  7 00:20:33 2003
+++ b/arch/sparc/kernel/entry.S	Tue Apr 22 21:35:02 2003
@@ -40,6 +40,14 @@
 
 #define NR_SYSCALLS 256      /* Each OS is different... */
 
+/* These are just handy. */
+#define _SV	save	%sp, -STACKFRAME_SZ, %sp
+#define _RS     restore 
+
+#define FLUSH_ALL_KERNEL_WINDOWS \
+	_SV; _SV; _SV; _SV; _SV; _SV; _SV; \
+	_RS; _RS; _RS; _RS; _RS; _RS; _RS;
+
 /* First, KGDB low level things.  This is a rewrite
  * of the routines found in the sparc-stub.c asm() statement
  * from the gdb distribution.  This is also dual-purpose
@@ -73,11 +81,11 @@
 	/* Make sure kgdb sees the same state we just saved. */
 	LOAD_PT_GLOBALS(sp)
 	LOAD_PT_INS(sp)
-	ld	[%sp + REGWIN_SZ + PT_Y], %l4
-	ld	[%sp + REGWIN_SZ + PT_WIM], %l3
-	ld	[%sp + REGWIN_SZ + PT_PSR], %l0
-	ld	[%sp + REGWIN_SZ + PT_PC], %l1
-	ld	[%sp + REGWIN_SZ + PT_NPC], %l2
+	ld	[%sp + STACKFRAME_SZ + PT_Y], %l4
+	ld	[%sp + STACKFRAME_SZ + PT_WIM], %l3
+	ld	[%sp + STACKFRAME_SZ + PT_PSR], %l0
+	ld	[%sp + STACKFRAME_SZ + PT_PC], %l1
+	ld	[%sp + STACKFRAME_SZ + PT_NPC], %l2
 	rd	%tbr, %l5	/* Never changes... */
 
 	/* Make kgdb exception frame. */	
@@ -97,7 +105,7 @@
 	WRITE_PAUSE
 
 	call	C_LABEL(handle_exception)
-	 add	%sp, REGWIN_SZ, %o0	! Pass address of registers
+	 add	%sp, STACKFRAME_SZ, %o0	! Pass address of registers
 
 	/* Load new kgdb register set. */
 	LOAD_KGDB_GLOBALS(sp)
@@ -266,7 +274,7 @@
 	mov	11, %o0			! floppy irq level (unused anyway)
 	mov	%g0, %o1		! devid is not used in fast interrupts
 	call	C_LABEL(sparc_floppy_irq)
-	 add	%sp, REGWIN_SZ, %o2	! struct pt_regs *regs
+	 add	%sp, STACKFRAME_SZ, %o2	! struct pt_regs *regs
 
 	RESTORE_ALL
 	
@@ -315,7 +323,7 @@
 	mov	%l7, %o0		! irq level
 patch_handler_irq:
 	call	C_LABEL(handler_irq)
-	 add	%sp, REGWIN_SZ, %o1	! pt_regs ptr
+	 add	%sp, STACKFRAME_SZ, %o1	! pt_regs ptr
 	or	%l0, PSR_PIL, %g2	! restore PIL after handler_irq
 	wr	%g2, PSR_ET, %psr	! keep ET up
 	WRITE_PAUSE
@@ -332,7 +340,7 @@
 	wr	%g2, PSR_ET, %psr
 	WRITE_PAUSE
 	call	C_LABEL(smp4m_percpu_timer_interrupt)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 	wr	%l0, PSR_ET, %psr
 	WRITE_PAUSE
 	RESTORE_ALL
@@ -439,7 +447,7 @@
 	wr	%g2, PSR_ET, %psr
 	WRITE_PAUSE
 	call	C_LABEL(smp4d_percpu_timer_interrupt)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 	wr	%l0, PSR_ET, %psr
 	WRITE_PAUSE
 	RESTORE_ALL
@@ -501,7 +509,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(do_illegal_instruction)
@@ -521,7 +529,7 @@
 	wr	%l0, PSR_ET, %psr
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(do_priv_instruction)
@@ -544,7 +552,7 @@
 
 	ld	[%l1], %o1
 	call	C_LABEL(kernel_unaligned_trap)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	RESTORE_ALL
 
@@ -556,7 +564,7 @@
 
 	ld	[%l1], %o1
 	call	C_LABEL(user_unaligned_trap)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	RESTORE_ALL
 
@@ -569,7 +577,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(do_fpd_trap)
@@ -608,7 +616,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(do_fpe_trap)
@@ -625,7 +633,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(handle_tag_overflow)
@@ -642,7 +650,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(handle_watchpoint)
@@ -659,7 +667,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(handle_reg_access)
@@ -676,7 +684,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(handle_cp_disabled)
@@ -693,7 +701,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(handle_cp_exception)
@@ -710,7 +718,7 @@
 	wr	%l0, PSR_ET, %psr		! re-enable traps
 	WRITE_PAUSE
 
-	add	%sp, REGWIN_SZ, %o0
+	add	%sp, STACKFRAME_SZ, %o0
 	mov	%l1, %o1
 	mov	%l2, %o2
 	call	C_LABEL(handle_hw_divzero)
@@ -734,10 +742,10 @@
 	 nop
 
 	/* Advance over the trap instruction. */
-	ld	[%sp + REGWIN_SZ + PT_NPC], %l1
+	ld	[%sp + STACKFRAME_SZ + PT_NPC], %l1
 	add	%l1, 0x4, %l2
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
-	st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
+	st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 
 	RESTORE_ALL
 
@@ -749,10 +757,10 @@
 	FLUSH_ALL_KERNEL_WINDOWS
 
 	/* Advance over the trap instruction. */
-	ld	[%sp + REGWIN_SZ + PT_NPC], %l1
+	ld	[%sp + STACKFRAME_SZ + PT_NPC], %l1
 	add	%l1, 0x4, %l2
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
-	st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
+	st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 
 	RESTORE_ALL
 
@@ -821,7 +829,7 @@
 	sub	%o0, 0x4, %o0
 	lda	[%o0] ASI_CONTROL, %o3	! async error
 	call	C_LABEL(sparc_lvl15_nmi)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	RESTORE_ALL
 
@@ -1155,7 +1163,7 @@
 	WRITE_PAUSE
 
 	call	C_LABEL(do_sun4c_fault)
-	 add	%sp, REGWIN_SZ, %o0	! arg1 = pt_regs ptr
+	 add	%sp, STACKFRAME_SZ, %o0	! arg1 = pt_regs ptr
 
 	RESTORE_ALL
 
@@ -1189,7 +1197,7 @@
 	WRITE_PAUSE
 
 	call	C_LABEL(do_sparc_fault)
-	 add	%sp, REGWIN_SZ, %o0	! arg1 = pt_regs ptr
+	 add	%sp, STACKFRAME_SZ, %o0	! arg1 = pt_regs ptr
 
 	RESTORE_ALL
 
@@ -1227,7 +1235,7 @@
 	.globl	C_LABEL(sys_nis_syscall)
 C_LABEL(sys_nis_syscall):
 	mov	%o7, %l5
-	add	%sp, REGWIN_SZ, %o0		! pt_regs *regs arg
+	add	%sp, STACKFRAME_SZ, %o0		! pt_regs *regs arg
 	call	C_LABEL(c_sys_nis_syscall)
 	 mov	%l5, %o7
 
@@ -1235,7 +1243,7 @@
 	.globl	C_LABEL(sys_ptrace)
 C_LABEL(sys_ptrace):
 	call	C_LABEL(do_ptrace)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	ld	[%curptr + TI_TASK], %l5
 	ld	[%l5 + AOFF_task_ptrace], %l5
@@ -1253,7 +1261,7 @@
 	.globl	C_LABEL(sys_execve)
 C_LABEL(sys_execve):
 	mov	%o7, %l5
-	add	%sp, REGWIN_SZ, %o0		! pt_regs *regs arg
+	add	%sp, STACKFRAME_SZ, %o0		! pt_regs *regs arg
 	call	C_LABEL(sparc_execve)
 	 mov	%l5, %o7
 
@@ -1261,7 +1269,7 @@
 	.globl	C_LABEL(sys_pipe)
 C_LABEL(sys_pipe):
 	mov	%o7, %l5
-	add	%sp, REGWIN_SZ, %o0		! pt_regs *regs arg
+	add	%sp, STACKFRAME_SZ, %o0		! pt_regs *regs arg
 	call	C_LABEL(sparc_pipe)
 	 mov	%l5, %o7
 
@@ -1286,7 +1294,7 @@
 C_LABEL(sys_sigpause):
 	/* Note: %o0 already has correct value... */
 	call	C_LABEL(do_sigpause)
-	 add	%sp, REGWIN_SZ, %o1
+	 add	%sp, STACKFRAME_SZ, %o1
 
 	ld	[%curptr + TI_TASK], %l5
 	ld	[%l5 + AOFF_task_ptrace], %l5
@@ -1305,7 +1313,7 @@
 	.globl	C_LABEL(sys_sigsuspend)
 C_LABEL(sys_sigsuspend):
 	call	C_LABEL(do_sigsuspend)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	ld	[%curptr + TI_TASK], %l5
 	ld	[%l5 + AOFF_task_ptrace], %l5
@@ -1325,7 +1333,7 @@
 C_LABEL(sys_rt_sigsuspend):
 	/* Note: %o0, %o1 already have correct value... */
 	call	C_LABEL(do_rt_sigsuspend)
-	 add	%sp, REGWIN_SZ, %o2
+	 add	%sp, STACKFRAME_SZ, %o2
 
 	ld	[%curptr + TI_TASK], %l5
 	ld	[%l5 + AOFF_task_ptrace], %l5
@@ -1344,7 +1352,7 @@
 	.globl	C_LABEL(sys_sigreturn)
 C_LABEL(sys_sigreturn):
 	call	C_LABEL(do_sigreturn)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	ld	[%curptr + TI_TASK], %l5
 	ld	[%l5 + AOFF_task_ptrace], %l5
@@ -1365,7 +1373,7 @@
 	.globl	C_LABEL(sys_rt_sigreturn)
 C_LABEL(sys_rt_sigreturn):
 	call	C_LABEL(do_rt_sigreturn)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	ld	[%curptr + TI_TASK], %l5
 	ld	[%l5 + AOFF_task_ptrace], %l5
@@ -1401,7 +1409,7 @@
 	WRITE_PAUSE
 	mov	%fp, %o1			! arg1:	usp
 	std	%g4, [%o4 + AOFF_task_thread + AOFF_thread_fork_kpsr]
-	add	%sp, REGWIN_SZ, %o2		! arg2:	pt_regs ptr
+	add	%sp, STACKFRAME_SZ, %o2		! arg2:	pt_regs ptr
 	mov	0, %o3
 	call	C_LABEL(sparc_do_fork)
 	 mov	%l5, %o7
@@ -1425,7 +1433,7 @@
 	andn	%o1, 7, %o1			! no, align to 8 bytes
 1:
 	std	%g4, [%o4 + AOFF_task_thread + AOFF_thread_fork_kpsr]
-	add	%sp, REGWIN_SZ, %o2		! arg2:	pt_regs ptr
+	add	%sp, STACKFRAME_SZ, %o2		! arg2:	pt_regs ptr
 	mov	0, %o3
 	call	C_LABEL(sparc_do_fork)
 	 mov	%l5, %o7
@@ -1447,7 +1455,7 @@
 	sethi	%hi(C_LABEL(sparc_do_fork)), %l1
 	mov	0, %o3
 	jmpl	%l1 + %lo(C_LABEL(sparc_do_fork)), %g0
-	 add	%sp, REGWIN_SZ, %o2
+	 add	%sp, STACKFRAME_SZ, %o2
 
         .align  4
 linux_sparc_ni_syscall:
@@ -1478,7 +1486,7 @@
 	call	schedule_tail
 	 mov	%g3, %o0
 	b	C_LABEL(ret_sys_call)
-	 ld	[%sp + REGWIN_SZ + PT_I0], %o0
+	 ld	[%sp + STACKFRAME_SZ + PT_I0], %o0
 
 	/* Linux native and SunOS system calls enter here... */
 	.align	4
@@ -1514,14 +1522,14 @@
 	call	%l7
 	 mov	%i5, %o5
 
-	st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 
 	.globl	C_LABEL(ret_sys_call)
 C_LABEL(ret_sys_call):
 	ld	[%curptr + TI_TASK], %l6
 	ld	[%l6 + AOFF_task_ptrace], %l6
 	cmp	%o0, -ENOIOCTLCMD
-	ld	[%sp + REGWIN_SZ + PT_PSR], %g3
+	ld	[%sp + STACKFRAME_SZ + PT_PSR], %g3
 	set	PSR_C, %g2
 	bgeu	1f
 	 andcc	%l6, 0x02, %l6	
@@ -1529,35 +1537,35 @@
 	/* System call success, clear Carry condition code. */
 	andn	%g3, %g2, %g3
 	clr	%l6
-	st	%g3, [%sp + REGWIN_SZ + PT_PSR]	
+	st	%g3, [%sp + STACKFRAME_SZ + PT_PSR]	
 	bne	linux_syscall_trace2
-	 ld	[%sp + REGWIN_SZ + PT_NPC], %l1 /* pc = npc */
+	 ld	[%sp + STACKFRAME_SZ + PT_NPC], %l1 /* pc = npc */
 	add	%l1, 0x4, %l2			/* npc = npc+4 */
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
 	b	ret_trap_entry
-	 st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	 st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 1:
 	/* System call failure, set Carry condition code.
 	 * Also, get abs(errno) to return to the process.
 	 */
 	sub	%g0, %o0, %o0
 	or	%g3, %g2, %g3
-	st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 	mov	1, %l6
-	st	%g3, [%sp + REGWIN_SZ + PT_PSR]
+	st	%g3, [%sp + STACKFRAME_SZ + PT_PSR]
 	bne	linux_syscall_trace2
-	 ld	[%sp + REGWIN_SZ + PT_NPC], %l1 /* pc = npc */
+	 ld	[%sp + STACKFRAME_SZ + PT_NPC], %l1 /* pc = npc */
 	add	%l1, 0x4, %l2			/* npc = npc+4 */
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
 	b	ret_trap_entry
-	 st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	 st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 
 linux_syscall_trace2:
 	call	C_LABEL(syscall_trace)
 	 add	%l1, 0x4, %l2			/* npc = npc+4 */
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
 	b	ret_trap_entry
-	 st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	 st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 
 
 	/*
@@ -1595,19 +1603,19 @@
 	mov	%i0, %l5
 
 	call	C_LABEL(do_solaris_syscall)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
-	st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 	set	PSR_C, %g2
 	cmp	%o0, -ENOIOCTLCMD
 	bgeu	1f
-	 ld	[%sp + REGWIN_SZ + PT_PSR], %g3
+	 ld	[%sp + STACKFRAME_SZ + PT_PSR], %g3
 
 	/* System call success, clear Carry condition code. */		
 	andn	%g3, %g2, %g3
 	clr	%l6
 	b	2f
-	 st	%g3, [%sp + REGWIN_SZ + PT_PSR]	
+	 st	%g3, [%sp + STACKFRAME_SZ + PT_PSR]	
 
 1:
 	/* System call failure, set Carry condition code.
@@ -1615,9 +1623,9 @@
 	 */
 	sub	%g0, %o0, %o0
 	mov	1, %l6
-	st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 	or	%g3, %g2, %g3
-	st	%g3, [%sp + REGWIN_SZ + PT_PSR]
+	st	%g3, [%sp + STACKFRAME_SZ + PT_PSR]
 
 	/* Advance the pc and npc over the trap instruction.
 	 * If the npc is unaligned (has a 1 in the lower byte), it means
@@ -1626,19 +1634,19 @@
 	 * nPC (setcontext).
 	 */
 2:
-	ld	[%sp + REGWIN_SZ + PT_NPC], %l1	/* pc  = npc   */
+	ld	[%sp + STACKFRAME_SZ + PT_NPC], %l1	/* pc  = npc   */
 	andcc	%l1, 1, %g0
 	bne	1f
 	 add	%l1, 0x4, %l2			/* npc = npc+4 */
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
 	b	ret_trap_entry
-	 st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	 st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 
 	/* kernel knows what it is doing, fixup npc and continue */
 1:
 	sub	%l1, 1, %l1
  	b	ret_trap_entry	
-	 st	%l1, [%sp + REGWIN_SZ + PT_NPC]
+	 st	%l1, [%sp + STACKFRAME_SZ + PT_NPC]
 
 #ifndef CONFIG_SUNOS_EMUL
 	.align	4
@@ -1651,7 +1659,7 @@
 	nop
 	mov	%i0, %l5
 	call	C_LABEL(do_sunos_syscall)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 #endif
 
 	/* {net, open}bsd system calls enter here... */
@@ -1688,17 +1696,17 @@
 	call	%l7
 	 mov	%i5, %o5
 
-	st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 	set	PSR_C, %g2
 	cmp	%o0, -ENOIOCTLCMD
 	bgeu	1f
-	 ld	[%sp + REGWIN_SZ + PT_PSR], %g3
+	 ld	[%sp + STACKFRAME_SZ + PT_PSR], %g3
 
 	/* System call success, clear Carry condition code. */		
 	andn	%g3, %g2, %g3
 	clr	%l6
 	b	2f
-	 st	%g3, [%sp + REGWIN_SZ + PT_PSR]	
+	 st	%g3, [%sp + STACKFRAME_SZ + PT_PSR]	
 
 1:
 	/* System call failure, set Carry condition code.
@@ -1712,17 +1720,17 @@
 	ld	[%o3 + %o0], %o0
 #endif
 	mov	1, %l6
-	st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 	or	%g3, %g2, %g3
-	st	%g3, [%sp + REGWIN_SZ + PT_PSR]
+	st	%g3, [%sp + STACKFRAME_SZ + PT_PSR]
 
 	/* Advance the pc and npc over the trap instruction. */
 2:
-	ld	[%sp + REGWIN_SZ + PT_NPC], %l1	/* pc  = npc   */
+	ld	[%sp + STACKFRAME_SZ + PT_NPC], %l1	/* pc  = npc   */
 	add	%l1, 0x4, %l2			/* npc = npc+4 */
-	st	%l1, [%sp + REGWIN_SZ + PT_PC]
+	st	%l1, [%sp + STACKFRAME_SZ + PT_PC]
 	b	ret_trap_entry
-	 st	%l2, [%sp + REGWIN_SZ + PT_NPC]
+	 st	%l2, [%sp + STACKFRAME_SZ + PT_NPC]
 
 /* Saving and restoring the FPU state is best done from lowlevel code.
  *
@@ -1810,7 +1818,7 @@
 
 	.globl	C_LABEL(ndelay)
 C_LABEL(ndelay):
-	save	%sp, -REGWIN_SZ, %sp
+	save	%sp, -STACKFRAME_SZ, %sp
 	mov	%i0, %o0
 	call	.umul
 	 mov	5, %o1
@@ -1819,7 +1827,7 @@
 
 	.globl	C_LABEL(udelay)
 C_LABEL(udelay):
-	save	%sp, -REGWIN_SZ, %sp
+	save	%sp, -STACKFRAME_SZ, %sp
 	mov	%i0, %o0
 	sethi	%hi(0x10c6), %o1
 	call	.umul
@@ -1856,9 +1864,9 @@
 	wr 	%l0, PSR_ET, %psr
 	WRITE_PAUSE
 
-	st	%i0, [%sp + REGWIN_SZ + PT_G0] ! for restarting syscalls
+	st	%i0, [%sp + STACKFRAME_SZ + PT_G0] ! for restarting syscalls
 	call	C_LABEL(sparc_breakpoint)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	RESTORE_ALL
 
@@ -1953,7 +1961,7 @@
 	WRITE_PAUSE
 
 	call	C_LABEL(pcic_nmi)
-	 add	%sp, REGWIN_SZ, %o1	! struct pt_regs *regs
+	 add	%sp, STACKFRAME_SZ, %o1	! struct pt_regs *regs
 	RESTORE_ALL
 
 	.globl	C_LABEL(pcic_nmi_trap_patch)
diff -Nru a/arch/sparc/kernel/etrap.S b/arch/sparc/kernel/etrap.S
--- a/arch/sparc/kernel/etrap.S	Thu Oct 17 00:55:17 2002
+++ b/arch/sparc/kernel/etrap.S	Tue Apr 22 21:35:55 2003
@@ -88,7 +88,7 @@
 	/* From kernel, allocate more kernel stack and
 	 * build a pt_regs trap frame.
 	 */
-	sub	%fp, (REGWIN_SZ + TRACEREG_SZ), %t_kstack
+	sub	%fp, (STACKFRAME_SZ + TRACEREG_SZ), %t_kstack
 	STORE_PT_ALL(t_kstack, t_psr, t_pc, t_npc, g2)
 
 	/* See if we are in the trap window. */
@@ -129,7 +129,7 @@
 	jmpl	%t_retpc + 0x8, %g0	! return to caller
 	 mov	%t_kstack, %sp		! and onto new kernel stack
 
-#define STACK_OFFSET (THREAD_SIZE - (TRACEREG_SZ + REGWIN_SZ))
+#define STACK_OFFSET (THREAD_SIZE - TRACEREG_SZ - STACKFRAME_SZ)
 
 trap_setup_from_user:
 	/* We can't use %curptr yet. */
diff -Nru a/arch/sparc/kernel/head.S b/arch/sparc/kernel/head.S
--- a/arch/sparc/kernel/head.S	Tue Jul 16 17:12:12 2002
+++ b/arch/sparc/kernel/head.S	Tue Apr 22 21:35:55 2003
@@ -1012,7 +1012,7 @@
 
 		/* I want a kernel stack NOW! */
 		set	C_LABEL(init_thread_union), %g1
-		set	(THREAD_SIZE - REGWIN_SZ), %g2
+		set	(THREAD_SIZE - STACKFRAME_SZ), %g2
 		add	%g1, %g2, %sp
 		mov	0, %fp			/* And for good luck */
 
diff -Nru a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
--- a/arch/sparc/kernel/irq.c	Mon Mar 31 14:29:49 2003
+++ b/arch/sparc/kernel/irq.c	Sun Apr 20 23:43:42 2003
@@ -74,8 +74,8 @@
     prom_halt();
 }
 
-void (*sparc_init_timers)(void (*)(int, void *,struct pt_regs *)) =
-    (void (*)(void (*)(int, void *,struct pt_regs *))) irq_panic;
+void (*sparc_init_timers)(irqreturn_t (*)(int, void *,struct pt_regs *)) =
+    (void (*)(irqreturn_t (*)(int, void *,struct pt_regs *))) irq_panic;
 
 /*
  * Dave Redman (djhr@tadpole.co.uk)
@@ -461,7 +461,7 @@
  * thus no sharing possible.
  */
 int request_fast_irq(unsigned int irq,
-		     void (*handler)(int, void *, struct pt_regs *),
+		     irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		     unsigned long irqflags, const char *devname)
 {
 	struct irqaction *action;
@@ -549,7 +549,7 @@
 }
 
 int request_irq(unsigned int irq,
-		void (*handler)(int, void *, struct pt_regs *),
+		irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		unsigned long irqflags, const char * devname, void *dev_id)
 {
 	struct irqaction * action, *tmp = NULL;
@@ -558,7 +558,7 @@
 	
 	if (sparc_cpu_model == sun4d) {
 		extern int sun4d_request_irq(unsigned int, 
-					     void (*)(int, void *, struct pt_regs *),
+					     irqreturn_t (*)(int, void *, struct pt_regs *),
 					     unsigned long, const char *, void *);
 		return sun4d_request_irq(irq, handler, irqflags, devname, dev_id);
 	}
diff -Nru a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
--- a/arch/sparc/kernel/pcic.c	Sun Mar 16 14:16:33 2003
+++ b/arch/sparc/kernel/pcic.c	Tue Apr 22 00:09:20 2003
@@ -736,12 +736,13 @@
 	pcic_timer_dummy = readl(pcic0.pcic_regs+PCI_SYS_LIMIT);
 }
 
-static void pcic_timer_handler (int irq, void *h, struct pt_regs *regs)
+static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs)
 {
 	write_seqlock(&xtime_lock);	/* Dummy, to show that we remember */
 	pcic_clear_clock_irq();
 	do_timer(regs);
 	write_sequnlock(&xtime_lock);
+	return IRQ_HANDLED;
 }
 
 #define USECS_PER_JIFFY  10000  /* We have 100HZ "standard" timer for sparc */
@@ -827,13 +828,27 @@
 	 * made, and then undo it!
 	 */
 	tv->tv_usec -= do_gettimeoffset();
-	tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
+	tv->tv_usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ);
 	while (tv->tv_usec < 0) {
-		tv->tv_usec += 1000000;
+		tv->tv_usec += USEC_PER_SEC;
 		tv->tv_sec--;
 	}
+	tv->tv_usec *= NSEC_PER_USEC;
+
+	wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec;
+	wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_usec;
+
+	if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) {
+		wall_to_monotonic.tv_nsec -= NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec++;
+	}
+	if (wall_to_monotonic.tv_nsec < 0) {
+		wall_to_monotonic.tv_nsec += NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec--;
+	}
+
 	xtime.tv_sec = tv->tv_sec;
-	xtime.tv_nsec = (tv->tv_usec * 1000);
+	xtime.tv_nsec = tv->tv_usec;
 	time_adjust = 0;		/* stop active adjtime() */
 	time_status |= STA_UNSYNC;
 	time_maxerror = NTP_PHASE_LIMIT;
diff -Nru a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
--- a/arch/sparc/kernel/process.c	Sat Apr  5 23:36:07 2003
+++ b/arch/sparc/kernel/process.c	Tue Apr 22 21:35:55 2003
@@ -377,60 +377,12 @@
 		current->thread.flags &= ~SPARC_FLAG_KTHREAD;
 
 		/* We must fixup kregs as well. */
+		/* XXX This was not fixed for ti for a while, worked. Unused? */
 		current->thread.kregs = (struct pt_regs *)
-			(((unsigned long)current) +
-			 (THREAD_SIZE - TRACEREG_SZ));
+		    ((char *)current->thread_info + (THREAD_SIZE - TRACEREG_SZ));
 	}
 }
 
-static __inline__ void copy_regs(struct pt_regs *dst, struct pt_regs *src)
-{
-	__asm__ __volatile__("ldd\t[%1 + 0x00], %%g2\n\t"
-			     "ldd\t[%1 + 0x08], %%g4\n\t"
-			     "ldd\t[%1 + 0x10], %%o4\n\t"
-			     "std\t%%g2, [%0 + 0x00]\n\t"
-			     "std\t%%g4, [%0 + 0x08]\n\t"
-			     "std\t%%o4, [%0 + 0x10]\n\t"
-			     "ldd\t[%1 + 0x18], %%g2\n\t"
-			     "ldd\t[%1 + 0x20], %%g4\n\t"
-			     "ldd\t[%1 + 0x28], %%o4\n\t"
-			     "std\t%%g2, [%0 + 0x18]\n\t"
-			     "std\t%%g4, [%0 + 0x20]\n\t"
-			     "std\t%%o4, [%0 + 0x28]\n\t"
-			     "ldd\t[%1 + 0x30], %%g2\n\t"
-			     "ldd\t[%1 + 0x38], %%g4\n\t"
-			     "ldd\t[%1 + 0x40], %%o4\n\t"
-			     "std\t%%g2, [%0 + 0x30]\n\t"
-			     "std\t%%g4, [%0 + 0x38]\n\t"
-			     "ldd\t[%1 + 0x48], %%g2\n\t"
-			     "std\t%%o4, [%0 + 0x40]\n\t"
-			     "std\t%%g2, [%0 + 0x48]\n\t" : :
-			     "r" (dst), "r" (src) :
-			     "g2", "g3", "g4", "g5", "o4", "o5");
-}
-
-static __inline__ void copy_regwin(struct reg_window *dst, struct reg_window *src)
-{
-	__asm__ __volatile__("ldd\t[%1 + 0x00], %%g2\n\t"
-			     "ldd\t[%1 + 0x08], %%g4\n\t"
-			     "ldd\t[%1 + 0x10], %%o4\n\t"
-			     "std\t%%g2, [%0 + 0x00]\n\t"
-			     "std\t%%g4, [%0 + 0x08]\n\t"
-			     "std\t%%o4, [%0 + 0x10]\n\t"
-			     "ldd\t[%1 + 0x18], %%g2\n\t"
-			     "ldd\t[%1 + 0x20], %%g4\n\t"
-			     "ldd\t[%1 + 0x28], %%o4\n\t"
-			     "std\t%%g2, [%0 + 0x18]\n\t"
-			     "std\t%%g4, [%0 + 0x20]\n\t"
-			     "std\t%%o4, [%0 + 0x28]\n\t"
-			     "ldd\t[%1 + 0x30], %%g2\n\t"
-			     "ldd\t[%1 + 0x38], %%g4\n\t"
-			     "std\t%%g2, [%0 + 0x30]\n\t"
-			     "std\t%%g4, [%0 + 0x38]\n\t" : :
-			     "r" (dst), "r" (src) :
-			     "g2", "g3", "g4", "g5", "o4", "o5");
-}
-
 static __inline__ struct sparc_stackf *
 clone_stackframe(struct sparc_stackf *dst, struct sparc_stackf *src)
 {
@@ -495,8 +447,7 @@
 {
 	struct thread_info *ti = p->thread_info;
 	struct pt_regs *childregs;
-	struct reg_window *new_stack;
-	unsigned long stack_offset;
+	char *new_stack;
 
 #ifndef CONFIG_SMP
 	if(last_task_used_math == current) {
@@ -513,15 +464,18 @@
 
 	p->set_child_tid = p->clear_child_tid = NULL;
 
-	/* Calculate offset to stack_frame & pt_regs */
-	stack_offset = THREAD_SIZE - TRACEREG_SZ;
-
-	if(regs->psr & PSR_PS)
-		stack_offset -= REGWIN_SZ;
-	childregs = ((struct pt_regs *) (((unsigned long)ti) + stack_offset));
-	copy_regs(childregs, regs);
-	new_stack = (((struct reg_window *) childregs) - 1);
-	copy_regwin(new_stack, (((struct reg_window *) regs) - 1));
+	/*
+	 *  p->thread_info         new_stack   childregs
+	 *  !                      !           !             {if(PSR_PS) }
+	 *  V                      V (stk.fr.) V  (pt_regs)  { (stk.fr.) }
+	 *  +----- - - - - - ------+===========+============={+==========}+
+	 */
+	new_stack = (char*)ti + THREAD_SIZE;
+	if (regs->psr & PSR_PS)
+		new_stack -= STACKFRAME_SZ;
+	new_stack -= STACKFRAME_SZ + TRACEREG_SZ;
+	memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ);
+	childregs = (struct pt_regs *) (new_stack + STACKFRAME_SZ);
 
 	/*
 	 * A new process must start with interrupts closed in 2.5,
@@ -542,14 +496,11 @@
 		extern struct pt_regs fake_swapper_regs;
 
 		p->thread.kregs = &fake_swapper_regs;
-		new_stack = (struct reg_window *)
-			((((unsigned long)ti) + (THREAD_SIZE)) - REGWIN_SZ);
+		new_stack += STACKFRAME_SZ + TRACEREG_SZ;
 		childregs->u_regs[UREG_FP] = (unsigned long) new_stack;
 		p->thread.flags |= SPARC_FLAG_KTHREAD;
 		p->thread.current_ds = KERNEL_DS;
-		memcpy((void *)new_stack,
-		       (void *)regs->u_regs[UREG_FP],
-		       sizeof(struct reg_window));
+		memcpy(new_stack, (void *)regs->u_regs[UREG_FP], STACKFRAME_SZ);
 		childregs->u_regs[UREG_G6] = (unsigned long) ti;
 	} else {
 		p->thread.kregs = childregs;
diff -Nru a/arch/sparc/kernel/rtrap.S b/arch/sparc/kernel/rtrap.S
--- a/arch/sparc/kernel/rtrap.S	Thu Oct 17 00:55:17 2002
+++ b/arch/sparc/kernel/rtrap.S	Tue Apr 22 21:35:55 2003
@@ -72,16 +72,16 @@
 signal_p:
 	andcc	%g2, (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING), %g0
 	bz,a	ret_trap_continue
-	 ld	[%sp + REGWIN_SZ + PT_PSR], %t_psr
+	 ld	[%sp + STACKFRAME_SZ + PT_PSR], %t_psr
 
 	clr	%o0
 	mov	%l5, %o2
 	mov	%l6, %o3
 	call	C_LABEL(do_signal)
-	 add	%sp, REGWIN_SZ, %o1	! pt_regs ptr
+	 add	%sp, STACKFRAME_SZ, %o1	! pt_regs ptr
 
 	/* Fall through. */
-	ld	[%sp + REGWIN_SZ + PT_PSR], %t_psr
+	ld	[%sp + STACKFRAME_SZ + PT_PSR], %t_psr
 	clr	%l6
 ret_trap_continue:
 	wr	%t_psr, 0x0, %psr
@@ -98,7 +98,7 @@
 
 	mov	1, %o1
 	call	C_LABEL(try_to_clear_window_buffer)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	b	signal_p
 	 ld	[%curptr + TI_FLAGS], %g2
@@ -145,7 +145,7 @@
 	 nop
 
 	b	ret_trap_unaligned_pc
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 1:
 	LOAD_PT_YREG(sp, g1)
@@ -158,9 +158,9 @@
 	rett	%t_npc
 	
 ret_trap_unaligned_pc:
-	ld	[%sp + REGWIN_SZ + PT_PC], %o1
-	ld	[%sp + REGWIN_SZ + PT_NPC], %o2
-	ld	[%sp + REGWIN_SZ + PT_PSR], %o3
+	ld	[%sp + STACKFRAME_SZ + PT_PC], %o1
+	ld	[%sp + STACKFRAME_SZ + PT_NPC], %o2
+	ld	[%sp + STACKFRAME_SZ + PT_PSR], %o3
 
 	wr	%t_wim, 0x0, %wim		! or else...
 
@@ -218,7 +218,7 @@
 	WRITE_PAUSE
 
 	call	C_LABEL(window_ret_fault)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	b	signal_p
 	 ld	[%curptr + TI_FLAGS], %g2
diff -Nru a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
--- a/arch/sparc/kernel/setup.c	Mon Mar 31 14:29:49 2003
+++ b/arch/sparc/kernel/setup.c	Sun Apr 20 23:39:15 2003
@@ -13,6 +13,7 @@
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
 #include <linux/slab.h>
+#include <linux/initrd.h>
 #include <asm/smp.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
diff -Nru a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
--- a/arch/sparc/kernel/signal.c	Wed Apr  9 21:58:33 2003
+++ b/arch/sparc/kernel/signal.c	Tue Apr 22 21:35:55 2003
@@ -753,7 +753,7 @@
 
 	synchronize_user_stack();
 	sfp = (svr4_signal_frame_t __user *)
-		get_sigframe(sa, regs, SVR4_SF_ALIGNED + REGWIN_SZ);
+		get_sigframe(sa, regs, SVR4_SF_ALIGNED + sizeof(struct reg_window));
 
 	if (invalid_frame_pointer(sfp, sizeof(*sfp)))
 		goto sigill_and_return;
diff -Nru a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
--- a/arch/sparc/kernel/smp.c	Mon Mar 31 14:29:49 2003
+++ b/arch/sparc/kernel/smp.c	Wed Apr 23 00:07:08 2003
@@ -100,13 +100,6 @@
 	local_flush_tlb_all();
 }
 
-/* Only broken Intel needs this, thus it should not even be referenced
- * globally...
- */
-void __init initialize_secondary(void)
-{
-}
-
 extern int cpu_idle(void);
 
 /* Activate a secondary processor. */
diff -Nru a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
--- a/arch/sparc/kernel/sparc_ksyms.c	Thu Apr 10 23:31:36 2003
+++ b/arch/sparc/kernel/sparc_ksyms.c	Tue Apr 22 22:43:02 2003
@@ -158,7 +158,8 @@
 EXPORT_SYMBOL(mostek_lock);
 EXPORT_SYMBOL(mstk48t02_regs);
 #if CONFIG_SUN_AUXIO
-EXPORT_SYMBOL(auxio_register);
+EXPORT_SYMBOL(set_auxio);
+EXPORT_SYMBOL(get_auxio);
 #endif
 EXPORT_SYMBOL(request_fast_irq);
 EXPORT_SYMBOL(io_remap_page_range);
diff -Nru a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c
--- a/arch/sparc/kernel/sun4c_irq.c	Fri Jan  3 00:21:36 2003
+++ b/arch/sparc/kernel/sun4c_irq.c	Sun Apr 20 23:43:42 2003
@@ -155,7 +155,7 @@
 	/* Errm.. not sure how to do this.. */
 }
 
-static void __init sun4c_init_timers(void (*counter_fn)(int, void *, struct pt_regs *))
+static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
 {
 	int irq;
 
diff -Nru a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
--- a/arch/sparc/kernel/sun4d_irq.c	Fri Jan  3 00:21:36 2003
+++ b/arch/sparc/kernel/sun4d_irq.c	Sun Apr 20 23:43:42 2003
@@ -262,7 +262,7 @@
 }
 
 int sun4d_request_irq(unsigned int irq,
-		void (*handler)(int, void *, struct pt_regs *),
+		irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		unsigned long irqflags, const char * devname, void *dev_id)
 {
 	struct irqaction *action, *tmp = NULL, **actionp;
@@ -445,7 +445,7 @@
 	bw_set_prof_limit(cpu, limit);
 }
 
-static void __init sun4d_init_timers(void (*counter_fn)(int, void *, struct pt_regs *))
+static void __init sun4d_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
 {
 	int irq;
 	extern struct prom_cpuinfo linux_cpus[NR_CPUS];
diff -Nru a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c
--- a/arch/sparc/kernel/sun4m_irq.c	Fri Jan  3 00:21:36 2003
+++ b/arch/sparc/kernel/sun4m_irq.c	Sun Apr 20 23:43:42 2003
@@ -235,7 +235,7 @@
 	return buff;
 }
 
-static void __init sun4m_init_timers(void (*counter_fn)(int, void *, struct pt_regs *))
+static void __init sun4m_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
 {
 	int reg_count, irq, cpu;
 	struct linux_prom_registers cnt_regs[PROMREG_MAX];
diff -Nru a/arch/sparc/kernel/sunos_asm.S b/arch/sparc/kernel/sunos_asm.S
--- a/arch/sparc/kernel/sunos_asm.S	Tue Feb  5 09:40:22 2002
+++ b/arch/sparc/kernel/sunos_asm.S	Tue Apr 22 21:35:55 2003
@@ -16,7 +16,7 @@
 	.align 4
 
 	/* When calling ret_sys_call, %o0 should contain the same
-	 * value as in [%sp + REGWIN_SZ + PT_I0] */
+	 * value as in [%sp + STACKFRAME_SZ + PT_I0] */
 
 	/* SunOS getpid() returns pid in %o0 and ppid in %o1 */
 	.globl	C_LABEL(sunos_getpid)
@@ -25,10 +25,10 @@
 	 nop
 
 	call	C_LABEL(sys_getpid)
-	 st	%o0, [%sp + REGWIN_SZ + PT_I1]
+	 st	%o0, [%sp + STACKFRAME_SZ + PT_I1]
 
 	b	C_LABEL(ret_sys_call)
-	 st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	 st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 
 	/* SunOS getuid() returns uid in %o0 and euid in %o1 */
 	.globl	C_LABEL(sunos_getuid)
@@ -37,10 +37,10 @@
 	 nop
 
 	call	C_LABEL(sys_getuid16)
-	 st	%o0, [%sp + REGWIN_SZ + PT_I1]
+	 st	%o0, [%sp + STACKFRAME_SZ + PT_I1]
 
 	b	C_LABEL(ret_sys_call)
-	 st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	 st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 
 	/* SunOS getgid() returns gid in %o0 and egid in %o1 */
 	.globl	C_LABEL(sunos_getgid)
@@ -49,20 +49,20 @@
 	 nop
 
 	call	C_LABEL(sys_getgid16)
-	 st	%o0, [%sp + REGWIN_SZ + PT_I1]
+	 st	%o0, [%sp + STACKFRAME_SZ + PT_I1]
 
 	b	C_LABEL(ret_sys_call)
-	 st	%o0, [%sp + REGWIN_SZ + PT_I0]
+	 st	%o0, [%sp + STACKFRAME_SZ + PT_I0]
 
 	/* SunOS's execv() call only specifies the argv argument, the
 	 * environment settings are the same as the calling processes.
 	 */
 	.globl	C_LABEL(sunos_execv)
 C_LABEL(sunos_execv):
-	st	%g0, [%sp + REGWIN_SZ + PT_I2]
+	st	%g0, [%sp + STACKFRAME_SZ + PT_I2]
 
 	call	C_LABEL(sparc_execve)
-	 add	%sp, REGWIN_SZ, %o0
+	 add	%sp, STACKFRAME_SZ, %o0
 
 	b	C_LABEL(ret_sys_call)
-	 ld	[%sp + REGWIN_SZ + PT_I0], %o0
+	 ld	[%sp + STACKFRAME_SZ + PT_I0], %o0
diff -Nru a/arch/sparc/kernel/tick14.c b/arch/sparc/kernel/tick14.c
--- a/arch/sparc/kernel/tick14.c	Mon Dec  2 00:41:11 2002
+++ b/arch/sparc/kernel/tick14.c	Sun Apr 20 23:43:42 2003
@@ -56,7 +56,7 @@
 	linux_lvl14[3] =  obp_lvl14[3]; 
 }
 
-void claim_ticker14(void (*handler)(int, void *, struct pt_regs *),
+void claim_ticker14(irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		    int irq_nr, unsigned int timeout )
 {
 	int cpu = smp_processor_id();
diff -Nru a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
--- a/arch/sparc/kernel/time.c	Mon Feb 24 23:13:09 2003
+++ b/arch/sparc/kernel/time.c	Tue Apr 22 00:09:20 2003
@@ -120,7 +120,7 @@
 
 #define TICK_SIZE (tick_nsec / 1000)
 
-void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	/* last time the cmos clock got updated */
 	static long last_rtc_update;
@@ -156,6 +156,8 @@
 	    last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
 	}
 	write_sequnlock(&xtime_lock);
+
+	return IRQ_HANDLED;
 }
 
 /* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */
@@ -406,7 +408,9 @@
 	mon = MSTK_REG_MONTH(mregs);
 	year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
 	xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
-	xtime.tv_nsec = 0;
+	wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ;
+	xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+	wall_to_monotonic.tv_nsec = 0;
 	mregs->creg &= ~MSTK_CREG_READ;
 	spin_unlock_irq(&mostek_lock);
 #ifdef CONFIG_SUN4
@@ -437,7 +441,9 @@
 		intersil_start(iregs);
 
 		xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
-		xtime.tv_nsec = 0;
+		wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ;
+		xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+		wall_to_monotonic.tv_nsec = 0;
 		printk("%u/%u/%u %u:%u:%u\n",day,mon,year,hour,min,sec);
 	}
 #endif
@@ -510,13 +516,28 @@
 	 * made, and then undo it!
 	 */
 	tv->tv_usec -= do_gettimeoffset();
-	tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
+	tv->tv_usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ);
+
 	while (tv->tv_usec < 0) {
-		tv->tv_usec += 1000000;
+		tv->tv_usec += USEC_PER_SEC;
 		tv->tv_sec--;
 	}
+	tv->tv_usec *= NSEC_PER_USEC;
+
+	wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec;
+	wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_usec;
+
+	if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) {
+		wall_to_monotonic.tv_nsec -= NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec++;
+	}
+	if (wall_to_monotonic.tv_nsec < 0) {
+		wall_to_monotonic.tv_nsec += NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec--;
+	}
+
 	xtime.tv_sec = tv->tv_sec;
-	xtime.tv_nsec = (tv->tv_usec * 1000);
+	xtime.tv_nsec = tv->tv_usec;
 	time_adjust = 0;		/* stop active adjtime() */
 	time_status |= STA_UNSYNC;
 	time_maxerror = NTP_PHASE_LIMIT;
diff -Nru a/arch/sparc/kernel/trampoline.S b/arch/sparc/kernel/trampoline.S
--- a/arch/sparc/kernel/trampoline.S	Tue Jul 16 17:12:13 2002
+++ b/arch/sparc/kernel/trampoline.S	Tue Apr 22 21:35:55 2003
@@ -63,8 +63,8 @@
 	and	%g4, 0xc, %g4
 	ld	[%g5 + %g4], %g6
 
-	sethi	%hi(THREAD_SIZE - REGWIN_SZ), %sp
-	or	%sp, %lo(THREAD_SIZE - REGWIN_SZ), %sp
+	sethi	%hi(THREAD_SIZE - STACKFRAME_SZ), %sp
+	or	%sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
 	add	%g6, %sp, %sp
 
 	/* Turn on traps (PSR_ET). */
@@ -142,8 +142,8 @@
 	srl	%g3, 1, %g4
 	ld	[%g5 + %g4], %g6
 
-	sethi	%hi(THREAD_SIZE - REGWIN_SZ), %sp
-	or	%sp, %lo(THREAD_SIZE - REGWIN_SZ), %sp
+	sethi	%hi(THREAD_SIZE - STACKFRAME_SZ), %sp
+	or	%sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
 	add	%g6, %sp, %sp
 
 	/* Turn on traps (PSR_ET). */
diff -Nru a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c
--- a/arch/sparc/kernel/windows.c	Tue Jul 16 17:12:13 2002
+++ b/arch/sparc/kernel/windows.c	Tue Apr 22 21:35:55 2003
@@ -120,7 +120,7 @@
 		unsigned long sp = tp->rwbuf_stkptrs[window];
 
 		if((sp & 7) ||
-		   copy_to_user((char *) sp, &tp->reg_window[window], REGWIN_SZ))
+		   copy_to_user((char *) sp, &tp->reg_window[window], sizeof(struct reg_window)))
 			do_exit(SIGILL);
 	}
 	tp->w_saved = 0;
diff -Nru a/arch/sparc/kernel/wof.S b/arch/sparc/kernel/wof.S
--- a/arch/sparc/kernel/wof.S	Thu Oct 17 00:55:17 2002
+++ b/arch/sparc/kernel/wof.S	Tue Apr 22 21:35:55 2003
@@ -238,7 +238,7 @@
 spnwin_patch3:	and	%twin_tmp, 0xff, %twin_tmp	! patched on 7win Sparcs
 		st	%twin_tmp, [%curptr + TI_UWINMASK]
 
-#define STACK_OFFSET	(THREAD_SIZE - TRACEREG_SZ - REGWIN_SZ)
+#define STACK_OFFSET (THREAD_SIZE - TRACEREG_SZ - STACKFRAME_SZ)
 
 	sethi	%hi(STACK_OFFSET), %sp
 	or	%sp, %lo(STACK_OFFSET), %sp
diff -Nru a/arch/sparc/kernel/wuf.S b/arch/sparc/kernel/wuf.S
--- a/arch/sparc/kernel/wuf.S	Thu Oct 17 00:55:17 2002
+++ b/arch/sparc/kernel/wuf.S	Tue Apr 22 21:35:55 2003
@@ -140,7 +140,7 @@
 C_LABEL(fwin_mmu_patchme):	b	C_LABEL(sun4c_fwin_stackchk)
 				 andcc	%sp, 0x7, %g0
 
-#define STACK_OFFSET (THREAD_SIZE - TRACEREG_SZ - REGWIN_SZ)
+#define STACK_OFFSET (THREAD_SIZE - TRACEREG_SZ - STACKFRAME_SZ)
 
 fwin_user_stack_is_bolixed:
 	/* LOCATION: Window 'W' */
diff -Nru a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
--- a/arch/sparc/mm/init.c	Mon Feb 10 02:46:32 2003
+++ b/arch/sparc/mm/init.c	Sun Apr 20 09:14:41 2003
@@ -18,9 +18,7 @@
 #include <linux/mman.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
-#ifdef CONFIG_BLK_DEV_INITRD
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
 #include <linux/bootmem.h>
diff -Nru a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
--- a/arch/sparc/mm/sun4c.c	Sun Apr 13 22:32:09 2003
+++ b/arch/sparc/mm/sun4c.c	Tue Apr 22 22:43:02 2003
@@ -248,7 +248,7 @@
 	_unused = sun4c_get_context();
 	sun4c_set_context(_unused);
 #ifdef CONFIG_SUN_AUXIO
-	_unused = *AUXREG;
+	_unused = get_auxio();
 #endif
 }
 
@@ -1901,7 +1901,7 @@
 	if ((pte = sun4c_pte_alloc_one_fast(mm, address)) != NULL)
 		return pte;
 
-	pte = (pte_t *)__get_free_page(GFP_KERNEL);
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte)
 		memset(pte, 0, PAGE_SIZE);
 	return pte;
diff -Nru a/arch/sparc/prom/misc.c b/arch/sparc/prom/misc.c
--- a/arch/sparc/prom/misc.c	Thu Sep  5 22:26:21 2002
+++ b/arch/sparc/prom/misc.c	Tue Apr 22 22:43:02 2003
@@ -68,7 +68,7 @@
 	install_linux_ticker();
 	spin_unlock_irqrestore(&prom_lock, flags);
 #ifdef CONFIG_SUN_AUXIO
-	TURN_ON_LED;
+	set_auxio(AUXIO_LED, 0);
 #endif
 	if(!serial_console && prom_palette)
 		prom_palette (0);
diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
--- a/arch/sparc64/Kconfig	Wed Mar 26 02:27:26 2003
+++ b/arch/sparc64/Kconfig	Sun Apr 20 12:56:50 2003
@@ -114,7 +114,7 @@
 	  See also the <file:Documentation/smp.tex>,
 	  <file:Documentation/smp.txt>, <file:Documentation/i386/IO-APIC.txt>,
 	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
@@ -281,7 +281,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  Please also read the PCMCIA-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -314,7 +314,7 @@
 	  VESA. If you have PCI, say Y, otherwise N.
 
 	  The PCI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information about which PCI hardware does work under Linux and which
 	  doesn't.
 
@@ -426,7 +426,7 @@
 	  want to say Y here.
 
 	  Information about ELF is contained in the ELF HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you find that after upgrading from Linux kernel 1.2 and saying Y
 	  here, you still can't run any ELF binaries (they just crash), then
@@ -448,7 +448,7 @@
 	  programs that need an interpreter to run like Java, Python or
 	  Emacs-Lisp. It's also useful if you often run DOS executables under
 	  the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>). Once you have
+	  <http://www.tldp.org/docs.html#howto>). Once you have
 	  registered such a binary class with the kernel, you can start one of
 	  those programs simply by typing in its name at a shell prompt; Linux
 	  will automatically feed it to the correct interpreter.
@@ -496,7 +496,7 @@
 	  box (as opposed to using a serial printer; if the connector at the
 	  printer has 9 or 25 holes ["female"], then it's serial), say Y.
 	  Also read the Printing-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  It is possible to share one parallel port among several devices
 	  (e.g. printer and ZIP drive) and it is safe to compile the
@@ -804,7 +804,7 @@
 	  If you want to use a SCSI hard disk or the SCSI or parallel port
 	  version of the IOMEGA ZIP drive under Linux, say Y and read the
 	  SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. This is NOT for SCSI
+	  <http://www.tldp.org/docs.html#howto>. This is NOT for SCSI
 	  CD-ROMs.
 
 	  This driver is also available as a module ( = code which can be
@@ -839,7 +839,7 @@
 	---help---
 	  If you want to use a SCSI tape drive under Linux, say Y and read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, and
+	  <http://www.tldp.org/docs.html#howto>, and
 	  <file:Documentation/scsi/st.txt> in the kernel source.  This is NOT
 	  for SCSI CD-ROMs.
 
@@ -861,7 +861,7 @@
 	  tape drives (ADR-x0) that supports the standard SCSI-2 commands for
 	  tapes (QIC-157) and can be driven by the standard driver st.
 	  For more information, you may have a look at the SCSI-HOWTO
-	  <http://www.linuxdoc.org/docs.html#howto>  and
+	  <http://www.tldp.org/docs.html#howto>  and
 	  <file:Documentation/scsi/osst.txt>  in the kernel source.
 	  More info on the OnStream driver may be found on
 	  <http://linux1.onstream.nl/test/>
@@ -880,7 +880,7 @@
 	---help---
 	  If you want to use a SCSI CD-ROM under Linux, say Y and read the
 	  SCSI-HOWTO and the CD-ROM-HOWTO at
-	  <http://www.linuxdoc.org/docs.html#howto>. Also make sure to say Y
+	  <http://www.tldp.org/docs.html#howto>. Also make sure to say Y
 	  or M to "ISO 9660 CD-ROM file system support" later.
 
 	  This driver is also available as a module ( = code which can be
@@ -1060,7 +1060,7 @@
 	  configuration options. You should read
 	  <file:Documentation/scsi/aic7xxx_old.txt> at a minimum before
 	  contacting the maintainer with any questions.  The SCSI-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>, can also
+	  available from <http://www.tldp.org/docs.html#howto>, can also
 	  be of great help.
 
 	  If you want to compile this driver as a module ( = code which can be
@@ -1406,7 +1406,7 @@
 
 	  Please read the file <file:Documentation/scsi/qlogicisp.txt>.  You
 	  should also read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1586,7 +1586,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig	Sun Apr 13 17:07:35 2003
+++ b/arch/sparc64/defconfig	Mon Apr 21 23:58:27 2003
@@ -334,7 +334,30 @@
 #
 # IEEE 1394 (FireWire) support (EXPERIMENTAL)
 #
-# CONFIG_IEEE1394 is not set
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+CONFIG_IEEE1394_OUI_DB=y
+
+#
+# Device Drivers
+#
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+CONFIG_IEEE1394_ETH1394=m
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
 
 #
 # Networking support
diff -Nru a/arch/sparc64/kernel/auxio.c b/arch/sparc64/kernel/auxio.c
--- a/arch/sparc64/kernel/auxio.c	Mon Feb  4 23:39:40 2002
+++ b/arch/sparc64/kernel/auxio.c	Tue Apr 22 22:43:02 2003
@@ -1,28 +1,114 @@
 /* auxio.c: Probing for the Sparc AUXIO register at boot time.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ *
+ * Refactoring for unified NCR/PCIO support 2002 Eric Brower (ebrower@usa.net)
  */
 
 #include <linux/config.h>
-#include <linux/stddef.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/smp.h>
 #include <linux/init.h>
-#include <linux/delay.h>
 #include <linux/ioport.h>
 
 #include <asm/oplib.h>
 #include <asm/io.h>
-#include <asm/auxio.h>
 #include <asm/sbus.h>
 #include <asm/ebus.h>
-#include <asm/fhc.h>
-#include <asm/spitfire.h>
-#include <asm/starfire.h>
+#include <asm/auxio.h>
+
+/* This cannot be static, as it is referenced in entry.S */
+unsigned long auxio_register = 0UL;
+
+enum auxio_type {
+	AUXIO_TYPE_NODEV,
+	AUXIO_TYPE_SBUS,
+	AUXIO_TYPE_EBUS
+};
+
+static enum auxio_type auxio_devtype = AUXIO_TYPE_NODEV;
+static spinlock_t auxio_lock = SPIN_LOCK_UNLOCKED;
+
+static void __auxio_sbus_set(u8 bits_on, u8 bits_off)
+{
+	if(auxio_register) {
+		unsigned char regval;
+		unsigned long flags;
+		unsigned char newval;
+
+		spin_lock_irqsave(&auxio_lock, flags);
+
+		regval =  sbus_readb(auxio_register);
+		newval =  regval | bits_on;
+		newval &= ~bits_off;
+		newval &= ~AUXIO_AUX1_MASK;
+		sbus_writeb(newval, auxio_register);
+		
+		spin_unlock_irqrestore(&auxio_lock, flags);
+	}
+}
+
+static void __auxio_ebus_set(u8 bits_on, u8 bits_off)
+{
+	if(auxio_register) {
+		unsigned char regval;
+		unsigned long flags;
+		unsigned char newval;
+
+		spin_lock_irqsave(&auxio_lock, flags);
+
+		regval =  (u8)readl(auxio_register);
+		newval =  regval | bits_on;
+		newval &= ~bits_off;
+		writel((u32)newval, auxio_register);
+
+		spin_unlock_irqrestore(&auxio_lock, flags);
+	}
+}
+
+static inline void __auxio_ebus_set_led(int on)
+{
+	(on) ? __auxio_ebus_set(AUXIO_PCIO_LED, 0) :
+		__auxio_ebus_set(0, AUXIO_PCIO_LED) ;
+}
 
-/* Probe and map in the Auxiliary I/O register */
-unsigned long auxio_register = 0;
+static inline void __auxio_sbus_set_led(int on)
+{
+	(on) ? __auxio_sbus_set(AUXIO_AUX1_LED, 0) :
+		__auxio_sbus_set(0, AUXIO_AUX1_LED) ;
+}
+
+void auxio_set_led(int on)
+{
+	switch(auxio_devtype) {
+	case AUXIO_TYPE_SBUS:
+		__auxio_sbus_set_led(on);
+		break;
+	case AUXIO_TYPE_EBUS:
+		__auxio_ebus_set_led(on);
+		break;
+	default:
+		break;
+	}
+}
+
+static inline void __auxio_sbus_set_lte(int on)
+{
+	(on) ? __auxio_sbus_set(AUXIO_AUX1_LTE, 0) : 
+		__auxio_sbus_set(0, AUXIO_AUX1_LTE) ;
+}
+
+void auxio_set_lte(int on)
+{
+	switch(auxio_devtype) {
+	case AUXIO_TYPE_SBUS:
+		__auxio_sbus_set_lte(on);
+		break;
+	case AUXIO_TYPE_EBUS:
+		/* FALL-THROUGH */
+	default:
+		break;
+	}
+}
 
 void __init auxio_probe(void)
 {
@@ -37,11 +123,15 @@
         }
 
 found_sdev:
-	if (!sdev) {
+	if (sdev) {
+		auxio_devtype  = AUXIO_TYPE_SBUS;
+		auxio_register = sbus_ioremap(&sdev->resource[0], 0,
+		  		sdev->reg_addrs[0].reg_size, "auxiliaryIO");
+	}
 #ifdef CONFIG_PCI
+	else {
 		struct linux_ebus *ebus;
 		struct linux_ebus_device *edev = 0;
-		unsigned long led_auxio;
 
 		for_each_ebus(ebus) {
 			for_each_ebusdev(edev, ebus) {
@@ -50,19 +140,12 @@
 			}
 		}
 	ebus_done:
-
 		if (edev) {
-			led_auxio = edev->resource[0].start;
-			outl(0x01, led_auxio);
-			return;
+			auxio_devtype  = AUXIO_TYPE_EBUS;
+			auxio_register = (unsigned long)
+				ioremap(edev->resource[0].start, sizeof(u32));
 		}
-#endif
-		auxio_register = 0UL;
-		return;
 	}
-
-	/* Map the register both read and write */
-	auxio_register = sbus_ioremap(&sdev->resource[0], 0,
-				      sdev->reg_addrs[0].reg_size, "auxiliaryIO");
-	TURN_ON_LED;
+	auxio_set_led(AUXIO_LED_ON);
+#endif
 }
diff -Nru a/arch/sparc64/kernel/chmc.c b/arch/sparc64/kernel/chmc.c
--- a/arch/sparc64/kernel/chmc.c	Mon Aug 19 01:18:52 2002
+++ b/arch/sparc64/kernel/chmc.c	Mon Apr 21 23:09:30 2003
@@ -224,7 +224,7 @@
 		int dimm;
 
 		/* Multi-bit error, we just dump out all the
-		 * dimm labels assosciated with this bank.
+		 * dimm labels associated with this bank.
 		 */
 		for (dimm = 0; dimm < CHMCTRL_NDIMMS; dimm++) {
 			sprintf(buf, "%s ",
diff -Nru a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
--- a/arch/sparc64/kernel/ebus.c	Mon Nov 18 12:27:30 2002
+++ b/arch/sparc64/kernel/ebus.c	Sun Apr 20 23:43:42 2003
@@ -73,7 +73,7 @@
 	}
 }
 
-static void ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct ebus_dma_info *p = dev_id;
 	unsigned long flags;
@@ -87,12 +87,16 @@
 	if (csr & EBDMA_CSR_ERR_PEND) {
 		printk(KERN_CRIT "ebus_dma(%s): DMA error!\n", p->name);
 		p->callback(p, EBUS_DMA_EVENT_ERROR, p->client_cookie);
+		return IRQ_HANDLED;
 	} else if (csr & EBDMA_CSR_INT_PEND) {
 		p->callback(p,
 			    (csr & EBDMA_CSR_TC) ?
 			    EBUS_DMA_EVENT_DMA : EBUS_DMA_EVENT_DEVICE,
 			    p->client_cookie);
+		return IRQ_HANDLED;
 	}
+
+	return IRQ_NONE;
 }
 
 int ebus_dma_register(struct ebus_dma_info *p)
diff -Nru a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
--- a/arch/sparc64/kernel/entry.S	Thu Apr  3 13:32:55 2003
+++ b/arch/sparc64/kernel/entry.S	Tue Apr 22 22:43:02 2003
@@ -20,6 +20,7 @@
 #include <asm/processor.h>
 #include <asm/visasm.h>
 #include <asm/estate.h>
+#include <asm/auxio.h>
 
 /* #define SYSCALL_TRACING	1 */
 
@@ -662,9 +663,11 @@
 	sethi		%hi(auxio_register), %g1
 	ldx		[%g1 + %lo(auxio_register)], %g7
 	lduba		[%g7] ASI_PHYS_BYPASS_EC_E, %g5
-	or		%g5, 0xc2, %g5
+	or		%g5, AUXIO_AUX1_FTCNT, %g5
+/*	andn		%g5, AUXIO_AUX1_MASK, %g5 */
 	stba		%g5, [%g7] ASI_PHYS_BYPASS_EC_E
-	andn		%g5, 0x02, %g5
+	andn		%g5, AUXIO_AUX1_FTCNT, %g5
+/*	andn		%g5, AUXIO_AUX1_MASK, %g5 */
 
 	nop; nop;  nop; nop;  nop; nop;
 	nop; nop;  nop; nop;  nop; nop;
@@ -1264,7 +1267,7 @@
 	 * because corrupt data may have been placed there and we don't
 	 * want to reference it.
 	 *
-	 * %g1 is one if this trap occured at %tl >= 1.
+	 * %g1 is one if this trap occurred at %tl >= 1.
 	 *
 	 * Next, we turn off error reporting so that we don't recurse.
 	 */
diff -Nru a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
--- a/arch/sparc64/kernel/head.S	Thu Apr  3 13:32:55 2003
+++ b/arch/sparc64/kernel/head.S	Mon Apr 21 23:09:31 2003
@@ -84,7 +84,7 @@
 	 nop
 
 cheetah_plus_boot:
-	/* Preserve OBP choosen DCU and DCR register settings.  */
+	/* Preserve OBP chosen DCU and DCR register settings.  */
 	ba,pt	%xcc, cheetah_generic_boot
 	 nop
 
diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
--- a/arch/sparc64/kernel/ioctl32.c	Fri Apr 18 10:45:16 2003
+++ b/arch/sparc64/kernel/ioctl32.c	Mon Apr 21 20:58:40 2003
@@ -2109,7 +2109,7 @@
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
 		return -EINVAL;
 	                                                
-	if (tty->driver.ioctl != vt_ioctl)
+	if (tty->driver->ioctl != vt_ioctl)
 		return -EINVAL;
 	
 	/*
@@ -3137,7 +3137,7 @@
 #define DRM32_IOCTL_DMA	     DRM_IOWR(0x29, drm32_dma_t)
 
 /* RED PEN	The DRM layer blindly dereferences the send/request
- * 		indice/size arrays even though they are userland
+ * 		index/size arrays even though they are userland
  * 		pointers.  -DaveM
  */
 static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
@@ -4243,6 +4243,8 @@
 /* Big L */
 COMPATIBLE_IOCTL(LOOP_SET_FD)
 COMPATIBLE_IOCTL(LOOP_CLR_FD)
+COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
+COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
 /* Big A */
 COMPATIBLE_IOCTL(AUDIO_GETINFO)
 COMPATIBLE_IOCTL(AUDIO_SETINFO)
diff -Nru a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
--- a/arch/sparc64/kernel/irq.c	Mon Mar 31 14:29:49 2003
+++ b/arch/sparc64/kernel/irq.c	Sun Apr 20 23:43:42 2003
@@ -294,7 +294,7 @@
 	__asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate));
 }
 
-int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		unsigned long irqflags, const char *name, void *dev_id)
 {
 	struct irqaction *action, *tmp = NULL;
@@ -831,7 +831,7 @@
 #define SPARC_NOP (0x01000000)
 
 static void install_fast_irq(unsigned int cpu_irq,
-			     void (*handler)(int, void *, struct pt_regs *))
+			     irqreturn_t (*handler)(int, void *, struct pt_regs *))
 {
 	extern unsigned long sparc64_ttable_tl0;
 	unsigned long ttent = (unsigned long) &sparc64_ttable_tl0;
@@ -847,7 +847,7 @@
 }
 
 int request_fast_irq(unsigned int irq,
-		     void (*handler)(int, void *, struct pt_regs *),
+		     irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		     unsigned long irqflags, const char *name, void *dev_id)
 {
 	struct irqaction *action;
diff -Nru a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
--- a/arch/sparc64/kernel/pci_common.c	Fri Mar  7 19:08:16 2003
+++ b/arch/sparc64/kernel/pci_common.c	Mon Apr 21 23:09:31 2003
@@ -145,7 +145,7 @@
 		 * there must be a damn good reason for it.
 		 *
 		 * So what we do is delete the device from the
-		 * PCI device tree completely.  This scenerio
+		 * PCI device tree completely.  This scenario
 		 * is seen, for example, on CP1500 for the
 		 * second EBUS/HappyMeal pair if the external
 		 * connector for it is not present.
diff -Nru a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
--- a/arch/sparc64/kernel/pci_psycho.c	Mon Nov 18 12:11:19 2002
+++ b/arch/sparc64/kernel/pci_psycho.c	Mon Apr 21 23:09:31 2003
@@ -713,7 +713,7 @@
 #define  PSYCHO_UEAFSR_RESV2	0x00000000007fffff /* Reserved                     */
 #define PSYCHO_UE_AFAR	0x0038UL
 
-static void psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg = p->controller_regs + PSYCHO_UE_AFSR;
@@ -730,7 +730,7 @@
 		(PSYCHO_UEAFSR_PPIO | PSYCHO_UEAFSR_PDRD | PSYCHO_UEAFSR_PDWR |
 		 PSYCHO_UEAFSR_SPIO | PSYCHO_UEAFSR_SDRD | PSYCHO_UEAFSR_SDWR);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	psycho_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -769,6 +769,8 @@
 
 	/* Interrogate IOMMU for error status. */
 	psycho_check_iommu_error(p, afsr, afar, UE_ERR);
+
+	return IRQ_HANDLED;
 }
 
 /* Correctable Errors. */
@@ -788,7 +790,7 @@
 #define  PSYCHO_CEAFSR_RESV2	0x00000000007fffff /* Reserved                     */
 #define PSYCHO_CE_AFAR	0x0040UL
 
-static void psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg = p->controller_regs + PSYCHO_CE_AFSR;
@@ -805,7 +807,7 @@
 		(PSYCHO_CEAFSR_PPIO | PSYCHO_CEAFSR_PDRD | PSYCHO_CEAFSR_PDWR |
 		 PSYCHO_CEAFSR_SPIO | PSYCHO_CEAFSR_SDRD | PSYCHO_CEAFSR_SDWR);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	psycho_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -847,10 +849,12 @@
 	if (!reported)
 		printk("(none)");
 	printk("]\n");
+
+	return IRQ_HANDLED;
 }
 
 /* PCI Errors.  They are signalled by the PCI bus module since they
- * are assosciated with a specific bus segment.
+ * are associated with a specific bus segment.
  */
 #define PSYCHO_PCI_AFSR_A	0x2010UL
 #define PSYCHO_PCI_AFSR_B	0x4010UL
@@ -871,7 +875,7 @@
 #define PSYCHO_PCI_AFAR_A	0x2018UL
 #define PSYCHO_PCI_AFAR_B	0x4018UL
 
-static void psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_pbm_info *pbm = dev_id;
 	struct pci_controller_info *p = pbm->parent;
@@ -899,7 +903,7 @@
 		 PSYCHO_PCIAFSR_SMA | PSYCHO_PCIAFSR_STA |
 		 PSYCHO_PCIAFSR_SRTRY | PSYCHO_PCIAFSR_SPERR);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	psycho_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -968,6 +972,8 @@
 
 	if (error_bits & (PSYCHO_PCIAFSR_PPERR | PSYCHO_PCIAFSR_SPERR))
 		pci_scan_for_parity_error(p, pbm, pbm->pci_bus);
+
+	return IRQ_HANDLED;
 }
 
 /* XXX What about PowerFail/PowerManagement??? -DaveM */
diff -Nru a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
--- a/arch/sparc64/kernel/pci_sabre.c	Mon Nov 18 12:11:19 2002
+++ b/arch/sparc64/kernel/pci_sabre.c	Sun Apr 20 23:43:42 2003
@@ -744,7 +744,7 @@
 	spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
-static void sabre_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sabre_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg = p->controller_regs + SABRE_UE_AFSR;
@@ -762,7 +762,7 @@
 		 SABRE_UEAFSR_SDRD | SABRE_UEAFSR_SDWR |
 		 SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	sabre_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -800,9 +800,11 @@
 
 	/* Interrogate IOMMU for error status. */
 	sabre_check_iommu_error(p, afsr, afar);
+
+	return IRQ_HANDLED;
 }
 
-static void sabre_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sabre_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg = p->controller_regs + SABRE_CE_AFSR;
@@ -819,7 +821,7 @@
 		(SABRE_CEAFSR_PDRD | SABRE_CEAFSR_PDWR |
 		 SABRE_CEAFSR_SDRD | SABRE_CEAFSR_SDWR);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	sabre_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -854,9 +856,11 @@
 	if (!reported)
 		printk("(none)");
 	printk("]\n");
+
+	return IRQ_HANDLED;
 }
 
-static void sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg, afar_reg;
@@ -877,7 +881,7 @@
 		 SABRE_PIOAFSR_SMA | SABRE_PIOAFSR_STA |
 		 SABRE_PIOAFSR_SRTRY | SABRE_PIOAFSR_SPERR);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	sabre_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -947,6 +951,8 @@
 		pci_scan_for_parity_error(p, &p->pbm_A, p->pbm_A.pci_bus);
 		pci_scan_for_parity_error(p, &p->pbm_B, p->pbm_B.pci_bus);
 	}
+
+	return IRQ_HANDLED;
 }
 
 /* XXX What about PowerFail/PowerManagement??? -DaveM */
diff -Nru a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
--- a/arch/sparc64/kernel/pci_schizo.c	Mon Nov 18 12:11:19 2002
+++ b/arch/sparc64/kernel/pci_schizo.c	Sun Apr 20 23:43:43 2003
@@ -672,7 +672,7 @@
 #define SCHIZO_UEAFSR_MTAG	0x000000000000e000UL
 #define SCHIZO_UEAFSR_ECCSYND	0x00000000000001ffUL
 
-static void schizo_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t schizo_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg = p->controller_regs + SCHIZO_UE_AFSR;
@@ -697,7 +697,7 @@
 		(SCHIZO_UEAFSR_PPIO | SCHIZO_UEAFSR_PDRD | SCHIZO_UEAFSR_PDWR |
 		 SCHIZO_UEAFSR_SPIO | SCHIZO_UEAFSR_SDMA);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	schizo_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -740,6 +740,8 @@
 	schizo_check_iommu_error(p, UE_ERR);
 
 	schizo_clear_other_err_intr(irq);
+
+	return IRQ_HANDLED;
 }
 
 #define SCHIZO_CE_AFSR	0x10040UL
@@ -760,7 +762,7 @@
 #define SCHIZO_CEAFSR_MTAG	0x000000000000e000UL
 #define SCHIZO_CEAFSR_ECCSYND	0x00000000000001ffUL
 
-static void schizo_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t schizo_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	unsigned long afsr_reg = p->controller_regs + SCHIZO_CE_AFSR;
@@ -785,7 +787,7 @@
 		(SCHIZO_CEAFSR_PPIO | SCHIZO_CEAFSR_PDRD | SCHIZO_CEAFSR_PDWR |
 		 SCHIZO_CEAFSR_SPIO | SCHIZO_CEAFSR_SDMA);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	schizo_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -829,6 +831,8 @@
 	printk("]\n");
 
 	schizo_clear_other_err_intr(irq);
+
+	return IRQ_HANDLED;
 }
 
 #define SCHIZO_PCI_AFSR	0x2010UL
@@ -852,7 +856,7 @@
 #define SCHIZO_PCIAFSR_MEM	0x0000000020000000UL
 #define SCHIZO_PCIAFSR_IO	0x0000000010000000UL
 
-static void schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t schizo_pcierr_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_pbm_info *pbm = dev_id;
 	struct pci_controller_info *p = pbm->parent;
@@ -886,7 +890,7 @@
 		 SCHIZO_PCIAFSR_SRTRY | SCHIZO_PCIAFSR_SPERR |
 		 SCHIZO_PCIAFSR_STTO | SCHIZO_PCIAFSR_SUNUS);
 	if (!error_bits)
-		return;
+		return IRQ_NONE;
 	schizo_write(afsr_reg, error_bits);
 
 	/* Log the error. */
@@ -974,6 +978,8 @@
 		pci_scan_for_parity_error(p, pbm, pbm->pci_bus);
 
 	schizo_clear_other_err_intr(irq);
+
+	return IRQ_HANDLED;
 }
 
 #define SCHIZO_SAFARI_ERRLOG	0x10018UL
@@ -1002,7 +1008,7 @@
 /* We only expect UNMAP errors here.  The rest of the Safari errors
  * are marked fatal and thus cause a system reset.
  */
-static void schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct pci_controller_info *p = dev_id;
 	u64 errlog;
@@ -1016,7 +1022,7 @@
 		       p->index, errlog);
 
 		schizo_clear_other_err_intr(irq);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	printk("SCHIZO%d: Safari interrupt, UNMAPPED error, interrogating IOMMUs.\n",
@@ -1024,6 +1030,7 @@
 	schizo_check_iommu_error(p, SAFARI_ERR);
 
 	schizo_clear_other_err_intr(irq);
+	return IRQ_HANDLED;
 }
 
 /* Nearly identical to PSYCHO equivalents... */
diff -Nru a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
--- a/arch/sparc64/kernel/power.c	Tue Feb 11 14:57:50 2003
+++ b/arch/sparc64/kernel/power.c	Tue Apr 22 22:43:02 2003
@@ -14,24 +14,26 @@
 
 #include <asm/system.h>
 #include <asm/ebus.h>
+#include <asm/auxio.h>
 
 #define __KERNEL_SYSCALLS__
 #include <linux/unistd.h>
 
 #ifdef CONFIG_PCI
 static unsigned long power_reg = 0UL;
-#define POWER_SYSTEM_OFF (1 << 0)
-#define POWER_COURTESY_OFF (1 << 1)
 
 static DECLARE_WAIT_QUEUE_HEAD(powerd_wait);
 static int button_pressed;
 
-static void power_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t power_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	if (button_pressed == 0) {
 		wake_up(&powerd_wait);
 		button_pressed = 1;
 	}
+
+	/* FIXME: Check registers for status... */
+	return IRQ_HANDLED;
 }
 #endif /* CONFIG_PCI */
 
@@ -48,7 +50,7 @@
 			 * same effect, so until I figure out
 			 * what the difference is...
 			 */
-			writel(POWER_COURTESY_OFF | POWER_SYSTEM_OFF, power_reg);
+			writel(AUXIO_PCIO_CPWR_OFF | AUXIO_PCIO_SPWR_OFF, power_reg);
 		} else
 #endif /* CONFIG_PCI */
 			if (poweroff_method != NULL) {
diff -Nru a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
--- a/arch/sparc64/kernel/ptrace.c	Wed Nov 27 15:14:11 2002
+++ b/arch/sparc64/kernel/ptrace.c	Mon Apr 21 23:09:31 2003
@@ -6,7 +6,7 @@
  * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson,
  * and David Mosberger.
  *
- * Added Linux support -miguel (weird, eh?, the orignal code was meant
+ * Added Linux support -miguel (weird, eh?, the original code was meant
  * to emulate SunOS).
  */
 
diff -Nru a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
--- a/arch/sparc64/kernel/rtrap.S	Thu Apr  3 13:32:55 2003
+++ b/arch/sparc64/kernel/rtrap.S	Mon Apr 21 23:09:31 2003
@@ -210,7 +210,7 @@
 __handle_perfctrs_continue:
 		 andcc			%l1, %o0, %g0
 
-		/* This fpdepth clear is neccessary for non-syscall rtraps only */
+		/* This fpdepth clear is necessary for non-syscall rtraps only */
 user_nowork:
 		bne,pn			%xcc, __handle_userfpu
 		 stb			%g0, [%g6 + TI_FPDEPTH]
diff -Nru a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
--- a/arch/sparc64/kernel/sbus.c	Tue Feb 25 09:56:15 2003
+++ b/arch/sparc64/kernel/sbus.c	Mon Apr 21 23:09:31 2003
@@ -728,7 +728,7 @@
 
 #define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0]))
 
-/* Convert Interrupt Mapping register pointer to assosciated
+/* Convert Interrupt Mapping register pointer to associated
  * Interrupt Clear register pointer, SYSIO specific version.
  */
 #define SYSIO_ICLR_UNUSED0	0x3400UL
@@ -813,7 +813,7 @@
 #define  SYSIO_UEAFSR_SIZE	0x00001c0000000000 /* Bad transfer size is 2**SIZE */
 #define  SYSIO_UEAFSR_MID	0x000003e000000000 /* UPA MID causing the fault    */
 #define  SYSIO_UEAFSR_RESV2	0x0000001fffffffff /* Reserved                     */
-static void sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sbus_bus *sbus = dev_id;
 	struct sbus_iommu *iommu = sbus->iommu;
@@ -867,6 +867,8 @@
 	if (!reported)
 		printk("(none)");
 	printk("]\n");
+
+	return IRQ_HANDLED;
 }
 
 #define SYSIO_CE_AFSR	0x0040UL
@@ -883,7 +885,7 @@
 #define  SYSIO_CEAFSR_SIZE	0x00001c0000000000 /* Bad transfer size is 2**SIZE */
 #define  SYSIO_CEAFSR_MID	0x000003e000000000 /* UPA MID causing the fault    */
 #define  SYSIO_CEAFSR_RESV2	0x0000001fffffffff /* Reserved                     */
-static void sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sbus_bus *sbus = dev_id;
 	struct sbus_iommu *iommu = sbus->iommu;
@@ -942,6 +944,8 @@
 	if (!reported)
 		printk("(none)");
 	printk("]\n");
+
+	return IRQ_HANDLED;
 }
 
 #define SYSIO_SBUS_AFSR		0x2010UL
@@ -958,7 +962,7 @@
 #define  SYSIO_SBAFSR_SIZE	0x00001c0000000000 /* Size of transfer             */
 #define  SYSIO_SBAFSR_MID	0x000003e000000000 /* MID causing the error        */
 #define  SYSIO_SBAFSR_RESV3	0x0000001fffffffff /* Reserved                     */
-static void sysio_sbus_error_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sbus_bus *sbus = dev_id;
 	struct sbus_iommu *iommu = sbus->iommu;
@@ -1013,6 +1017,8 @@
 	printk("]\n");
 
 	/* XXX check iommu/strbuf for further error status XXX */
+
+	return IRQ_HANDLED;
 }
 
 #define ECC_CONTROL	0x0020UL
@@ -1092,7 +1098,7 @@
 		prom_halt();
 	}
 
-	/* Align on E$ line boundry. */
+	/* Align on E$ line boundary. */
 	iommu = (struct sbus_iommu *)
 		(((unsigned long)iommu + (SMP_CACHE_BYTES - 1UL)) &
 		 ~(SMP_CACHE_BYTES - 1UL));
diff -Nru a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
--- a/arch/sparc64/kernel/setup.c	Wed Mar 26 00:49:46 2003
+++ b/arch/sparc64/kernel/setup.c	Sun Apr 20 23:39:15 2003
@@ -31,6 +31,7 @@
 #include <linux/root_dev.h>
 #include <linux/interrupt.h>
 #include <linux/cpu.h>
+#include <linux/initrd.h>
 
 #include <asm/segment.h>
 #include <asm/system.h>
diff -Nru a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
--- a/arch/sparc64/kernel/smp.c	Mon Mar 31 14:29:49 2003
+++ b/arch/sparc64/kernel/smp.c	Mon Apr 21 23:09:31 2003
@@ -1071,7 +1071,7 @@
 			prof_counter(cpu) = prof_multiplier(cpu);
 		}
 
-		/* Guarentee that the following sequences execute
+		/* Guarantee that the following sequences execute
 		 * uninterrupted.
 		 */
 		__asm__ __volatile__("rdpr	%%pstate, %0\n\t"
@@ -1096,7 +1096,7 @@
 
 	prof_counter(cpu) = prof_multiplier(cpu) = 1;
 
-	/* Guarentee that the following sequences execute
+	/* Guarantee that the following sequences execute
 	 * uninterrupted.
 	 */
 	__asm__ __volatile__("rdpr	%%pstate, %0\n\t"
diff -Nru a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
--- a/arch/sparc64/kernel/sparc64_ksyms.c	Wed Apr  2 14:43:17 2003
+++ b/arch/sparc64/kernel/sparc64_ksyms.c	Tue Apr 22 22:43:02 2003
@@ -197,7 +197,8 @@
 EXPORT_SYMBOL(mstk48t02_regs);
 EXPORT_SYMBOL(request_fast_irq);
 #if CONFIG_SUN_AUXIO
-EXPORT_SYMBOL(auxio_register);
+EXPORT_SYMBOL(auxio_set_led);
+EXPORT_SYMBOL(auxio_set_lte);
 #endif
 #if CONFIG_SBUS
 EXPORT_SYMBOL(sbus_root);
diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
--- a/arch/sparc64/kernel/sys_sparc32.c	Tue Apr 15 22:48:21 2003
+++ b/arch/sparc64/kernel/sys_sparc32.c	Sat Apr 19 23:22:56 2003
@@ -2133,7 +2133,6 @@
 #define ca32_export	u.u32_export
 #define ca32_getfd	u.u32_getfd
 #define ca32_getfs	u.u32_getfs
-#define ca32_authd	u.u32_authd
 };
 
 union nfsctl_res32 {
diff -Nru a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
--- a/arch/sparc64/kernel/time.c	Wed Mar 26 00:49:46 2003
+++ b/arch/sparc64/kernel/time.c	Tue Apr 22 00:09:20 2003
@@ -477,7 +477,7 @@
 	}
 }
 
-static void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	unsigned long ticks, pstate;
 
@@ -489,7 +489,7 @@
 #endif
 		do_timer(regs);
 
-		/* Guarentee that the following sequences execute
+		/* Guarantee that the following sequences execute
 		 * uninterrupted.
 		 */
 		__asm__ __volatile__("rdpr	%%pstate, %0\n\t"
@@ -509,6 +509,8 @@
 	timer_check_rtc();
 
 	write_sequnlock(&xtime_lock);
+
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_SMP
@@ -701,7 +703,9 @@
 	}
 
 	xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
-	xtime.tv_nsec = 0;
+	wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ;
+	xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+	wall_to_monotonic.tv_nsec = 0;
 
 	if (mregs) {
 		tmp = mostek_read(mregs + MOSTEK_CREG);
@@ -739,7 +743,9 @@
 			(unsigned int) (long) &unix_tod);
 		prom_feval(obp_gettod);
 		xtime.tv_sec = unix_tod;
-		xtime.tv_nsec = 0;
+		wall_to_monotonic.tv_sec = -xtime.tv_sec + INITIAL_JIFFIES / HZ;
+		xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+		wall_to_monotonic.tv_nsec = 0;
 		return;
 	}
 
@@ -925,7 +931,7 @@
 }
 
 /* This is gets the master TICK_INT timer going. */
-static unsigned long sparc64_init_timers(void (*cfunc)(int, void *, struct pt_regs *))
+static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struct pt_regs *))
 {
 	unsigned long pstate, clock;
 	int node, err;
@@ -970,7 +976,7 @@
 		prom_halt();
 	}
 
-	/* Guarentee that the following sequences execute
+	/* Guarantee that the following sequences execute
 	 * uninterrupted.
 	 */
 	__asm__ __volatile__("rdpr	%%pstate, %0\n\t"
@@ -1095,15 +1101,28 @@
 	 * made, and then undo it!
 	 */
 	tv->tv_usec -= do_gettimeoffset();
-	tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
+	tv->tv_usec -= (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ);
 
 	while (tv->tv_usec < 0) {
-		tv->tv_usec += 1000000;
+		tv->tv_usec += USEC_PER_SEC;
 		tv->tv_sec--;
 	}
+	tv->tv_usec *= NSEC_PER_USEC;
+
+	wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec;
+	wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_usec;
+
+	if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) {
+		wall_to_monotonic.tv_nsec -= NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec++;
+	}
+	if (wall_to_monotonic.tv_nsec < 0) {
+		wall_to_monotonic.tv_nsec += NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec--;
+	}
 
 	xtime.tv_sec = tv->tv_sec;
-	xtime.tv_nsec = (tv->tv_usec * 1000);
+	xtime.tv_nsec = tv->tv_usec;
 	time_adjust = 0;		/* stop active adjtime() */
 	time_status |= STA_UNSYNC;
 	time_maxerror = NTP_PHASE_LIMIT;
diff -Nru a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
--- a/arch/sparc64/kernel/trampoline.S	Thu Apr  3 13:32:55 2003
+++ b/arch/sparc64/kernel/trampoline.S	Mon Apr 21 23:09:31 2003
@@ -40,7 +40,7 @@
 	 nop
 
 cheetah_plus_startup:
-	/* Preserve OBP choosen DCU and DCR register settings.  */
+	/* Preserve OBP chosen DCU and DCR register settings.  */
 	ba,pt	%xcc, cheetah_generic_startup
 	 nop
 
diff -Nru a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
--- a/arch/sparc64/mm/init.c	Wed Jan  8 12:37:27 2003
+++ b/arch/sparc64/mm/init.c	Sun Apr 20 18:28:00 2003
@@ -14,7 +14,7 @@
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
 #include <linux/slab.h>
-#include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/swap.h>
 #include <linux/pagemap.h>
 #include <linux/fs.h>
@@ -1173,7 +1173,7 @@
 	}
 
 	color = VPTE_COLOR(address);
-	page = alloc_pages(GFP_KERNEL, DC_ALIAS_SHIFT);
+	page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, DC_ALIAS_SHIFT);
 	if (page) {
 		unsigned long *to_free;
 		unsigned long paddr;
diff -Nru a/arch/sparc64/prom/printf.c b/arch/sparc64/prom/printf.c
--- a/arch/sparc64/prom/printf.c	Sun Aug 11 18:02:59 2002
+++ b/arch/sparc64/prom/printf.c	Mon Apr 21 23:09:31 2003
@@ -6,7 +6,7 @@
  * Copyright (c) 2002 Pete Zaitcev (zaitcev@yahoo.com)
  *
  * We used to warn all over the code: DO NOT USE prom_printf(),
- * and yet people do. Anton's banking code was outputing banks
+ * and yet people do. Anton's banking code was outputting banks
  * with prom_printf for most of the 2.4 lifetime. Since an effective
  * stick is not available, we deployed a carrot: an early printk
  * through PROM by means of -p boot option. This ought to fix it.
diff -Nru a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
--- a/arch/sparc64/solaris/misc.c	Wed Dec  4 11:05:21 2002
+++ b/arch/sparc64/solaris/misc.c	Mon Apr 21 23:09:31 2003
@@ -1,5 +1,5 @@
 /* $Id: misc.c,v 1.36 2002/02/09 19:49:31 davem Exp $
- * misc.c: Miscelaneous syscall emulation for Solaris
+ * misc.c: Miscellaneous syscall emulation for Solaris
  *
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  */
diff -Nru a/arch/um/drivers/line.c b/arch/um/drivers/line.c
--- a/arch/um/drivers/line.c	Sat Mar 22 07:37:12 2003
+++ b/arch/um/drivers/line.c	Mon Apr 21 20:58:42 2003
@@ -109,7 +109,7 @@
 		buf = new;
 	}
 
-	i = minor(tty->device) - tty->driver.minor_start;
+	i = tty->index;
 	line = &lines[i];
 
 	down(&line->sem);
@@ -219,7 +219,7 @@
 	int n, err = 0;
 
 	if(tty == NULL) n = 0;
-	else n = minor(tty->device) - tty->driver.minor_start;
+	else n = tty->index;
 	line = &lines[n];
 
 	down(&line->sem);
@@ -267,7 +267,7 @@
 	int n;
 
 	if(tty == NULL) n = 0;
-	else n = minor(tty->device) - tty->driver.minor_start;
+	else n = tty->index;
 	line = &lines[n];
 
 	down(&line->sem);
@@ -444,7 +444,7 @@
 
 	for(i = 0; i < nlines; i++){
 		if(!lines[i].valid) 
-			tty_unregister_devfs(driver, driver->minor_start + i);
+			tty_unregister_devfs(driver, i);
 	}
 
 	mconsole_register_dev(&line_driver->mc);
diff -Nru a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
--- a/arch/um/drivers/stdio_console.c	Mon Mar 31 14:29:49 2003
+++ b/arch/um/drivers/stdio_console.c	Thu Apr 24 03:30:40 2003
@@ -199,9 +199,10 @@
 	.set_termios 		= set_termios
 };
 
-static kdev_t console_device(struct console *c)
+static struct tty_driver *console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, c->index);
+	*index = c->index;
+	return &console_driver;
 }
 
 static int console_setup(struct console *co, char *options)
diff -Nru a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
--- a/arch/um/drivers/ubd_kern.c	Sat Mar 22 09:04:18 2003
+++ b/arch/um/drivers/ubd_kern.c	Sat Apr 19 14:17:05 2003
@@ -106,8 +106,6 @@
 	__u64 size;
 	struct openflags boot_openflags;
 	struct openflags openflags;
-	devfs_handle_t real;
-	devfs_handle_t fake;
 	struct cow cow;
 };
 
@@ -127,8 +125,6 @@
 	.size =			-1, \
 	.boot_openflags =	OPEN_FLAGS, \
 	.openflags =		OPEN_FLAGS, \
-	.real =			NULL, \
-	.fake =			NULL, \
         .cow =			DEFAULT_COW, \
 }
 
@@ -484,41 +480,30 @@
 	return(err);
 }
 
-static int ubd_new_disk(int major, u64 size, char *name, int unit,
-			struct gendisk **disk_out, devfs_handle_t dir_handle,
-			devfs_handle_t *handle_out)
+static int ubd_new_disk(int major, u64 size, int unit,
+			struct gendisk **disk_out)
+			
 {
-	char devfs_name[sizeof("ubd/nnnnnn\0")];
 	struct gendisk *disk;
-	int minor = unit << UBD_SHIFT;
 
 	disk = alloc_disk(1 << UBD_SHIFT);
-	if(disk == NULL)
-		return(-ENOMEM);
+	if (!disk)
+		return -ENOMEM;
 
 	disk->major = major;
-	disk->first_minor = minor;
+	disk->first_minor = unit << UBD_SHIFT;
 	disk->fops = &ubd_blops;
 	set_capacity(disk, size / 512);
-	/* needs to be ubd -> /dev/ubd/discX/disc */
 	sprintf(disk->disk_name, "ubd");
-	*disk_out = disk;
+	sprintf(disk->devfs_name, "ubd/disc%d", unit);
 
-	/* /dev/ubd/N style names */
-	sprintf(devfs_name, "ubd/%d", unit);
-	*handle_out = devfs_register(NULL, devfs_name,
-				     0, major, minor,
-				     S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |
-				     S_IWGRP, &ubd_blops, NULL);
 	disk->private_data = &ubd_dev[unit];
 	disk->queue = &ubd_queue;
 	add_disk(disk);
-	return(0);
-}
 
-/* Initialized in an initcall, and unchanged thereafter */
-devfs_handle_t ubd_dir_handle;
-devfs_handle_t ubd_fake_dir_handle;
+	*disk_out = disk;
+	return 0;
+}
 
 static int ubd_add(int n)
 {
@@ -538,15 +523,13 @@
 	if(err)
 		return(err);
 
-	err = ubd_new_disk(MAJOR_NR, dev->size, "ubd", n, &ubd_gendisk[n], 
-			   ubd_dir_handle, &dev->real);
+	err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
 	if(err) 
 		return(err);
  
 	if(fake_major)
-		ubd_new_disk(fake_major, dev->size, "ubd%d", n, 
-			     &fake_gendisk[n], ubd_fake_dir_handle, 
-			     &dev->fake);
+		ubd_new_disk(fake_major, dev->size, n, 
+			     &fake_gendisk[n]);
 
 	/* perhaps this should also be under the "if (fake_major)" above */
 	/* using the fake_disk->disk_name and also the fakehd_set name */
@@ -645,15 +628,11 @@
 	del_gendisk(ubd_gendisk[n]);
 	put_disk(ubd_gendisk[n]);
 	ubd_gendisk[n] = NULL;
-	if(dev->real != NULL) 
-		devfs_unregister(dev->real);
 
 	if(fake_gendisk[n] != NULL){
 		del_gendisk(fake_gendisk[n]);
 		put_disk(fake_gendisk[n]);
 		fake_gendisk[n] = NULL;
-		if(dev->fake != NULL) 
-			devfs_unregister(dev->fake);
 	}
 
 	*dev = ((struct ubd) DEFAULT_UBD);
@@ -682,7 +661,7 @@
 {
         int i;
 
-	ubd_dir_handle = devfs_mk_dir("ubd");
+	devfs_mk_dir("ubd");
 	if (register_blkdev(MAJOR_NR, "ubd"))
 		return -1;
 
@@ -693,7 +672,7 @@
 		char name[sizeof("ubd_nnn\0")];
 
 		snprintf(name, sizeof(name), "ubd_%d", fake_major);
-		ubd_fake_dir_handle = devfs_mk_dir(name);
+		devfs_mk_dir(name);
 		if (register_blkdev(fake_major, "ubd"))
 			return -1;
 	}
diff -Nru a/arch/um/kernel/initrd_kern.c b/arch/um/kernel/initrd_kern.c
--- a/arch/um/kernel/initrd_kern.c	Mon Oct 14 06:53:49 2002
+++ b/arch/um/kernel/initrd_kern.c	Sun Apr 20 09:14:41 2003
@@ -5,7 +5,7 @@
 
 #include "linux/init.h"
 #include "linux/bootmem.h"
-#include "linux/blk.h"
+#include "linux/initrd.h"
 #include "asm/types.h"
 #include "user_util.h"
 #include "kern_util.h"
diff -Nru a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
--- a/arch/um/kernel/mem.c	Thu Mar  6 08:19:07 2003
+++ b/arch/um/kernel/mem.c	Sat Apr 19 23:22:41 2003
@@ -810,35 +810,21 @@
 
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-	int count = 0;
 	pte_t *pte;
 
-   	do {
-		pte = (pte_t *) __get_free_page(GFP_KERNEL);
-		if (pte)
-			clear_page(pte);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	if (pte)
+		clear_page(pte);
 	return pte;
 }
 
 struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	int count = 0;
 	struct page *pte;
    
-   	do {
-		pte = alloc_pages(GFP_KERNEL, 0);
-		if (pte)
-			clear_highpage(pte);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
+	if (pte)
+		clear_highpage(pte);
 	return pte;
 }
 
diff -Nru a/arch/v850/Kconfig b/arch/v850/Kconfig
--- a/arch/v850/Kconfig	Thu Apr  3 15:01:04 2003
+++ b/arch/v850/Kconfig	Sun Apr 20 12:56:51 2003
@@ -341,7 +341,7 @@
 	  interrupt and DMA channel), because you will be asked for it.
 
 	  You want to read the Sound-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. General information about
+	  <http://www.tldp.org/docs.html#howto>. General information about
 	  the modular sound system is contained in the files
 	  <file:Documentation/sound/Introduction>.  The file
 	  <file:Documentation/sound/README.OSS> contains some slightly
diff -Nru a/arch/v850/kernel/memcons.c b/arch/v850/kernel/memcons.c
--- a/arch/v850/kernel/memcons.c	Mon Nov 11 05:20:56 2002
+++ b/arch/v850/kernel/memcons.c	Thu Apr 24 03:30:40 2003
@@ -58,9 +58,11 @@
 		len -= write (buf, len);
 }
 
-static kdev_t memcons_device (struct console *co)
+extern struct tty_driver tty_driver;
+static struct tty_driver *memcons_device (struct console *co, int *index)
 {
-        return MKDEV (TTY_MAJOR, 64 + co->index);
+	*index = co->index;
+	return &tty_driver;
 }
 
 static struct console memcons =
diff -Nru a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c
--- a/arch/v850/kernel/simcons.c	Thu Apr  3 14:57:47 2003
+++ b/arch/v850/kernel/simcons.c	Thu Apr 24 03:30:40 2003
@@ -35,9 +35,11 @@
 	return V850_SIM_SYSCALL (read, 0, buf, len);
 }
 
-static kdev_t simcons_device (struct console *c)
+extern struct tty_driver tty_driver;
+static struct tty_driver *simcons_device (struct console *c, int *index)
 {
-        return mk_kdev (TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &tty_driver;
 }
 
 static struct console simcons =
diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig	Sun Mar 23 16:25:04 2003
+++ b/arch/x86_64/Kconfig	Mon Apr 21 15:02:37 2003
@@ -286,7 +286,7 @@
 
 config SOFTWARE_SUSPEND
 	bool "Software Suspend (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && PM
+	depends on EXPERIMENTAL && PM && SWAP
 	---help---
 	  Enable the possibilty of suspending the machine. It doesn't need APM.
 	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
diff -Nru a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
--- a/arch/x86_64/ia32/ia32_ioctl.c	Fri Mar 28 09:53:11 2003
+++ b/arch/x86_64/ia32/ia32_ioctl.c	Mon Apr 21 20:58:43 2003
@@ -1987,7 +1987,7 @@
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
 		return -EINVAL;
 	                                                
-	if (tty->driver.ioctl != vt_ioctl)
+	if (tty->driver->ioctl != vt_ioctl)
 		return -EINVAL;
 	
 	/*
@@ -2847,7 +2847,7 @@
 	real_tty = (struct tty_struct *)file->private_data;
 	if (!real_tty) 	
 		return -EINVAL; 
-	return put_user(kdev_t_to_nr(real_tty->device), ptr); 
+	return put_user(real_tty->device, ptr); 
 } 
 
 
diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
--- a/arch/x86_64/ia32/sys_ia32.c	Tue Apr 15 22:48:21 2003
+++ b/arch/x86_64/ia32/sys_ia32.c	Sat Apr 19 23:22:56 2003
@@ -1708,7 +1708,6 @@
 #define ca32_export	u.u32_export
 #define ca32_getfd	u.u32_getfd
 #define ca32_getfs	u.u32_getfs
-#define ca32_authd	u.u32_authd
 };
 
 union nfsctl_res32 {
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c	Fri Mar 28 09:55:32 2003
+++ b/arch/x86_64/kernel/setup.c	Sun Apr 20 09:14:41 2003
@@ -28,9 +28,7 @@
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/init.h>
-#ifdef CONFIG_BLK_DEV_RAM
-#include <linux/blk.h>
-#endif
+#include <linux/initrd.h>
 #include <linux/highmem.h>
 #include <linux/bootmem.h>
 #include <asm/processor.h>
diff -Nru a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c
--- a/drivers/acorn/block/fd1772.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/acorn/block/fd1772.c	Thu Apr 24 03:30:41 2003
@@ -1474,9 +1474,6 @@
 
 	fd_device[drive] = type;
 
-	if (old_dev && old_dev != type)
-		invalidate_buffers(mk_kdev(MAJOR_NR, drive + (old_dev<<2)));
-
 	if (filp->f_flags & O_NDELAY)
 		return 0;
 
diff -Nru a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
--- a/drivers/acpi/dispatcher/dsfield.c	Tue Feb 18 15:32:32 2003
+++ b/drivers/acpi/dispatcher/dsfield.c	Fri Apr 18 16:27:54 2003
@@ -249,9 +249,9 @@
 			 * In field_flags, preserve the flag bits other than the ACCESS_TYPE bits
 			 */
 			info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
-					  ((u8) (arg->common.value.integer32 >> 8)));
+					  ((u8) ((u32) arg->common.value.integer >> 8)));
 
-			info->attribute = (u8) (arg->common.value.integer32);
+			info->attribute = (u8) (arg->common.value.integer);
 			break;
 
 
@@ -356,7 +356,7 @@
 	/* Second arg is the field flags */
 
 	arg = arg->common.next;
-	info.field_flags = arg->common.value.integer8;
+	info.field_flags = (u8) arg->common.value.integer;
 	info.attribute = 0;
 
 	/* Each remaining arg is a Named Field */
@@ -509,12 +509,12 @@
 	/* Third arg is the bank_value */
 
 	arg = arg->common.next;
-	info.bank_value = arg->common.value.integer32;
+	info.bank_value = (u32) arg->common.value.integer;
 
 	/* Fourth arg is the field flags */
 
 	arg = arg->common.next;
-	info.field_flags = arg->common.value.integer8;
+	info.field_flags = (u8) arg->common.value.integer;
 
 	/* Each remaining arg is a Named Field */
 
@@ -580,7 +580,7 @@
 	/* Next arg is the field flags */
 
 	arg = arg->common.next;
-	info.field_flags = arg->common.value.integer8;
+	info.field_flags = (u8) arg->common.value.integer;
 
 	/* Each remaining arg is a Named Field */
 
diff -Nru a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
--- a/drivers/acpi/dispatcher/dsmthdat.c	Tue Feb 18 15:32:32 2003
+++ b/drivers/acpi/dispatcher/dsmthdat.c	Fri Apr 18 16:27:54 2003
@@ -87,8 +87,8 @@
 	/* Init the method arguments */
 
 	for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
-		ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
-				 NAMEOF_ARG_NTE);
+		ACPI_MOVE_32_TO_32 (&walk_state->arguments[i].name,
+				   NAMEOF_ARG_NTE);
 		walk_state->arguments[i].name.integer |= (i << 24);
 		walk_state->arguments[i].descriptor   = ACPI_DESC_TYPE_NAMED;
 		walk_state->arguments[i].type         = ACPI_TYPE_ANY;
@@ -98,8 +98,8 @@
 	/* Init the method locals */
 
 	for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
-		ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
-				 NAMEOF_LOCAL_NTE);
+		ACPI_MOVE_32_TO_32 (&walk_state->local_variables[i].name,
+				   NAMEOF_LOCAL_NTE);
 
 		walk_state->local_variables[i].name.integer |= (i << 24);
 		walk_state->local_variables[i].descriptor  = ACPI_DESC_TYPE_NAMED;
diff -Nru a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
--- a/drivers/acpi/dispatcher/dsobject.c	Tue Feb 25 10:47:06 2003
+++ b/drivers/acpi/dispatcher/dsobject.c	Fri Apr 18 16:27:54 2003
@@ -187,7 +187,7 @@
 			return (AE_TYPE);
 		}
 
-		byte_list_length = byte_list->common.value.integer32;
+		byte_list_length = (u32) byte_list->common.value.integer;
 	}
 
 	/*
diff -Nru a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
--- a/drivers/acpi/dispatcher/dswexec.c	Tue Feb 18 15:32:32 2003
+++ b/drivers/acpi/dispatcher/dswexec.c	Fri Apr 18 16:27:54 2003
@@ -647,7 +647,7 @@
 		acpi_ds_delete_result_if_not_used (op, walk_state->result_obj, walk_state);
 	}
 
-#if _UNDER_DEVELOPMENT
+#ifdef _UNDER_DEVELOPMENT
 
 	if (walk_state->parser_state.aml == walk_state->parser_state.aml_end) {
 		acpi_db_method_end (walk_state);
diff -Nru a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
--- a/drivers/acpi/events/evgpe.c	Fri Mar 28 14:10:26 2003
+++ b/drivers/acpi/events/evgpe.c	Fri Apr 18 16:27:54 2003
@@ -76,7 +76,7 @@
 	acpi_native_uint                i;
 
 
-	ACPI_FUNCTION_NAME ("ev_get_gpe_event_info");
+	ACPI_FUNCTION_ENTRY ();
 
 
 	/* A NULL gpe_block means use the FADT-defined GPE block(s) */
diff -Nru a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
--- a/drivers/acpi/events/evgpeblk.c	Fri Mar 28 14:10:26 2003
+++ b/drivers/acpi/events/evgpeblk.c	Fri Apr 18 16:27:54 2003
@@ -71,7 +71,7 @@
 	struct acpi_gpe_block_info      *gpe_block;
 
 
-	ACPI_FUNCTION_NAME ("ev_valid_gpe_event");
+	ACPI_FUNCTION_ENTRY ();
 
 
 	/* No need for spin lock since we are not changing any list elements */
@@ -81,7 +81,7 @@
 		gpe_block = gpe_xrupt_block->gpe_block_list_head;
 		while (gpe_block) {
 			if ((&gpe_block->event_info[0] <= gpe_event_info) &&
-				(&gpe_block->event_info[gpe_block->register_count * 8] > gpe_event_info)) {
+				(&gpe_block->event_info[((acpi_size) gpe_block->register_count) * 8] > gpe_event_info)) {
 				return (TRUE);
 			}
 
@@ -186,13 +186,13 @@
 	acpi_status                     status;
 
 
-	ACPI_FUNCTION_NAME ("ev_save_method_info");
+	ACPI_FUNCTION_TRACE ("ev_save_method_info");
 
 
 	/* Extract the name from the object and convert to a string */
 
-	ACPI_MOVE_UNALIGNED32_TO_32 (name,
-			 &((struct acpi_namespace_node *) obj_handle)->name.integer);
+	ACPI_MOVE_32_TO_32 (name,
+			   &((struct acpi_namespace_node *) obj_handle)->name.integer);
 	name[ACPI_NAME_SIZE] = 0;
 
 	/*
@@ -213,7 +213,7 @@
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Unknown GPE method type: %s (name not of form _Lnn or _Enn)\n",
 			name));
-		return (AE_OK);
+		return_ACPI_STATUS (AE_OK);
 	}
 
 	/* Convert the last two characters of the name to the GPE Number */
@@ -225,7 +225,7 @@
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Could not extract GPE number from name: %s (name is not of form _Lnn or _Enn)\n",
 			name));
-		return (AE_OK);
+		return_ACPI_STATUS (AE_OK);
 	}
 
 	/* Ensure that we have a valid GPE number for this GPE block */
@@ -237,7 +237,7 @@
 		 * However, it may be valid for a different GPE block, since GPE0 and GPE1
 		 * methods both appear under \_GPE.
 		 */
-		return (AE_OK);
+		return_ACPI_STATUS (AE_OK);
 	}
 
 	/*
@@ -254,13 +254,13 @@
 	 */
 	status = acpi_hw_enable_gpe (gpe_event_info);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 		"Registered GPE method %s as GPE number 0x%.2X\n",
 		name, gpe_number));
-	return (AE_OK);
+	return_ACPI_STATUS (AE_OK);
 }
 
 
@@ -279,7 +279,7 @@
  *
  ******************************************************************************/
 
-struct acpi_gpe_xrupt_info *
+static struct acpi_gpe_xrupt_info *
 acpi_ev_get_gpe_xrupt_block (
 	u32                             interrupt_level)
 {
@@ -288,12 +288,15 @@
 	acpi_status                     status;
 
 
+	ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block");
+
+
 	/* No need for spin lock since we are not changing any list elements here */
 
 	next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
 	while (next_gpe_xrupt) {
 		if (next_gpe_xrupt->interrupt_level == interrupt_level) {
-			return (next_gpe_xrupt);
+			return_PTR (next_gpe_xrupt);
 		}
 
 		next_gpe_xrupt = next_gpe_xrupt->next;
@@ -303,7 +306,7 @@
 
 	gpe_xrupt = ACPI_MEM_CALLOCATE (sizeof (struct acpi_gpe_xrupt_info));
 	if (!gpe_xrupt) {
-		return (NULL);
+		return_PTR (NULL);
 	}
 
 	gpe_xrupt->interrupt_level = interrupt_level;
@@ -330,9 +333,15 @@
 	if (interrupt_level != acpi_gbl_FADT->sci_int) {
 		status = acpi_os_install_interrupt_handler (interrupt_level,
 				 acpi_ev_gpe_xrupt_handler, gpe_xrupt);
+		if (ACPI_FAILURE (status)) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"Could not install GPE interrupt handler at level 0x%X\n",
+				interrupt_level));
+			return_PTR (NULL);
+		}
 	}
 
-	return (gpe_xrupt);
+	return_PTR (gpe_xrupt);
 }
 
 
@@ -349,7 +358,7 @@
  *
  ******************************************************************************/
 
-acpi_status
+static acpi_status
 acpi_ev_delete_gpe_xrupt (
 	struct acpi_gpe_xrupt_info      *gpe_xrupt)
 {
@@ -406,7 +415,7 @@
  *
  ******************************************************************************/
 
-acpi_status
+static acpi_status
 acpi_ev_install_gpe_block (
 	struct acpi_gpe_block_info      *gpe_block,
 	u32                             interrupt_level)
@@ -535,7 +544,7 @@
  *
  ******************************************************************************/
 
-acpi_status
+static acpi_status
 acpi_ev_create_gpe_info_blocks (
 	struct acpi_gpe_block_info      *gpe_block)
 {
diff -Nru a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
--- a/drivers/acpi/events/evregion.c	Tue Feb 18 15:32:32 2003
+++ b/drivers/acpi/events/evregion.c	Fri Apr 18 16:27:54 2003
@@ -315,9 +315,10 @@
 	handler = handler_desc->addr_handler.handler;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-		"Addrhandler %p (%p), Address %8.8X%8.8X\n",
+		"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
 		&region_obj->region.addr_handler->addr_handler, handler,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+		ACPI_HIDWORD (address), ACPI_LODWORD (address),
+		acpi_ut_get_region_name (region_obj->region.space_id)));
 
 	if (!(handler_desc->addr_handler.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
 		/*
diff -Nru a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c
--- a/drivers/acpi/events/evxfregn.c	Tue Feb 18 15:32:32 2003
+++ b/drivers/acpi/events/evxfregn.c	Fri Apr 18 16:27:54 2003
@@ -159,16 +159,14 @@
 		}
 	}
 
-	/*
-	 * If the caller hasn't specified a setup routine, use the default
-	 */
+	/* If the caller hasn't specified a setup routine, use the default */
+
 	if (!setup) {
 		setup = acpi_ev_default_region_setup;
 	}
 
-	/*
-	 * Check for an existing internal object
-	 */
+	/* Check for an existing internal object */
+
 	obj_desc = acpi_ns_get_attached_object (node);
 	if (obj_desc) {
 		/*
@@ -181,7 +179,7 @@
 		handler_obj = obj_desc->device.addr_handler;
 		while (handler_obj) {
 			/*
-			 * We have an Address handler, see if user requested this
+			 * Found an Address handler, see if user requested this
 			 * address space.
 			 */
 			if(handler_obj->addr_handler.space_id == space_id) {
@@ -189,9 +187,8 @@
 				goto unlock_and_exit;
 			}
 
-			/*
-			 * Move through the linked list of handlers
-			 */
+			/* Walk the linked list of handlers */
+
 			handler_obj = handler_obj->addr_handler.next;
 		}
 	}
@@ -232,10 +229,10 @@
 		acpi_ut_get_region_name (space_id), space_id, node->name.ascii, node, obj_desc));
 
 	/*
-	 * Now we can install the handler
+	 * Install the handler
 	 *
-	 * At this point we know that there is no existing handler.
-	 * So, we just allocate the object for the handler and link it
+	 * At this point there is no existing handler.
+	 * Just allocate the object for the handler and link it
 	 * into the list.
 	 */
 	handler_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
@@ -254,15 +251,15 @@
 	handler_obj->addr_handler.setup     = setup;
 
 	/*
-	 * Now walk the namespace finding all of the regions this
+	 * Walk the namespace finding all of the regions this
 	 * handler will manage.
 	 *
-	 * We start at the device and search the branch toward
+	 * Start at the device and search the branch toward
 	 * the leaf nodes until either the leaf is encountered or
 	 * a device is detected that has an address handler of the
 	 * same type.
 	 *
-	 * In either case we back up and search down the remainder
+	 * In either case, back up and search down the remainder
 	 * of the branch
 	 */
 	status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device,
@@ -270,9 +267,8 @@
 			 acpi_ev_addr_handler_helper,
 			 handler_obj, NULL);
 
-	/*
-	 * Place this handler 1st on the list
-	 */
+	/* Place this handler 1st on the list */
+
 	handler_obj->common.reference_count =
 			 (u16) (handler_obj->common.reference_count +
 			 obj_desc->common.reference_count - 1);
@@ -289,12 +285,13 @@
  *
  * FUNCTION:    acpi_remove_address_space_handler
  *
- * PARAMETERS:  space_id        - The address space ID
+ * PARAMETERS:  Device          - Handle for the device
+ *              space_id        - The address space ID
  *              Handler         - Address of the handler
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Install a handler for accesses on an Operation Region
+ * DESCRIPTION: Remove a previously installed handler.
  *
  ******************************************************************************/
 
@@ -342,19 +339,16 @@
 		goto unlock_and_exit;
 	}
 
-	/*
-	 * find the address handler the user requested
-	 */
+	/* Find the address handler the user requested */
+
 	handler_obj = obj_desc->device.addr_handler;
 	last_obj_ptr = &obj_desc->device.addr_handler;
 	while (handler_obj) {
-		/*
-		 * We have a handler, see if user requested this one
-		 */
+		/* We have a handler, see if user requested this one */
+
 		if (handler_obj->addr_handler.space_id == space_id) {
-			/*
-			 * Got it, first dereference this in the Regions
-			 */
+			/* Matched space_id, first dereference this in the Regions */
+
 			ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
 				"Removing address handler %p(%p) for region %s on Device %p(%p)\n",
 				handler_obj, handler, acpi_ut_get_region_name (space_id),
@@ -375,45 +369,36 @@
 				acpi_ev_detach_region (region_obj, TRUE);
 
 				/*
-				 * Walk the list, since we took the first region and it
-				 * was removed from the list by the dissassociate call
-				 * we just get the first item on the list again
+				 * Walk the list: Just grab the head because the
+				 * detach_region removed the previous head.
 				 */
 				region_obj = handler_obj->addr_handler.region_list;
 
 			}
 
-			/*
-			 * Remove this Handler object from the list
-			 */
+			/* Remove this Handler object from the list */
+
 			*last_obj_ptr = handler_obj->addr_handler.next;
 
-			/*
-			 * Now we can delete the handler object
-			 */
-			acpi_ut_remove_reference (handler_obj);
-			acpi_ut_remove_reference (handler_obj);
+			/* Now we can delete the handler object */
 
+			acpi_ut_remove_reference (handler_obj);
 			goto unlock_and_exit;
 		}
 
-		/*
-		 * Move through the linked list of handlers
-		 */
+		/* Walk the linked list of handlers */
+
 		last_obj_ptr = &handler_obj->addr_handler.next;
 		handler_obj = handler_obj->addr_handler.next;
 	}
 
+	/* The handler does not exist */
 
-	/*
-	 * The handler does not exist
-	 */
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
 		"Unable to remove address handler %p for %s(%X), dev_node %p, obj %p\n",
 		handler, acpi_ut_get_region_name (space_id), space_id, node, obj_desc));
 
 	status = AE_NOT_EXIST;
-
 
 unlock_and_exit:
 	(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
diff -Nru a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
--- a/drivers/acpi/executer/exfldio.c	Tue Feb 18 15:32:32 2003
+++ b/drivers/acpi/executer/exfldio.c	Fri Apr 18 16:27:54 2003
@@ -568,9 +568,10 @@
  *
  * PARAMETERS:  Datum               - Where the Datum is returned
  *              Buffer              - Raw field buffer
+ *              buffer_length       - Entire length (used for big-endian only)
  *              byte_granularity    - 1/2/4/8 Granularity of the field
  *                                    (aka Datum Size)
- *              Offset              - Datum offset into the buffer
+ *              buffer_offset       - Datum offset into the buffer
  *
  * RETURN:      none
  *
@@ -580,35 +581,44 @@
  ******************************************************************************/
 
 void
-acpi_ex_get_buffer_datum(
+acpi_ex_get_buffer_datum (
 	acpi_integer                    *datum,
 	void                            *buffer,
+	u32                             buffer_length,
 	u32                             byte_granularity,
-	u32                             offset)
+	u32                             buffer_offset)
 {
+	u32                             index;
+
 
 	ACPI_FUNCTION_ENTRY ();
 
 
+	/* Get proper index into buffer (handles big/little endian) */
+
+	index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity);
+
+	/* Move the requested number of bytes */
+
 	switch (byte_granularity) {
 	case ACPI_FIELD_BYTE_GRANULARITY:
 
-		*datum = ((u8 *) buffer) [offset];
+		*datum = ((u8 *) buffer) [index];
 		break;
 
 	case ACPI_FIELD_WORD_GRANULARITY:
 
-		ACPI_MOVE_UNALIGNED16_TO_32 (datum, &(((u16 *) buffer) [offset]));
+		ACPI_MOVE_16_TO_64 (datum, &(((u16 *) buffer) [index]));
 		break;
 
 	case ACPI_FIELD_DWORD_GRANULARITY:
 
-		ACPI_MOVE_UNALIGNED32_TO_32 (datum, &(((u32 *) buffer) [offset]));
+		ACPI_MOVE_32_TO_64 (datum, &(((u32 *) buffer) [index]));
 		break;
 
 	case ACPI_FIELD_QWORD_GRANULARITY:
 
-		ACPI_MOVE_UNALIGNED64_TO_64 (datum, &(((u64 *) buffer) [offset]));
+		ACPI_MOVE_64_TO_64 (datum, &(((u64 *) buffer) [index]));
 		break;
 
 	default:
@@ -624,9 +634,10 @@
  *
  * PARAMETERS:  merged_datum        - Value to store
  *              Buffer              - Receiving buffer
+ *              buffer_length       - Entire length (used for big-endian only)
  *              byte_granularity    - 1/2/4/8 Granularity of the field
  *                                    (aka Datum Size)
- *              Offset              - Datum offset into the buffer
+ *              buffer_offset       - Datum offset into the buffer
  *
  * RETURN:      none
  *
@@ -639,32 +650,40 @@
 acpi_ex_set_buffer_datum (
 	acpi_integer                    merged_datum,
 	void                            *buffer,
+	u32                             buffer_length,
 	u32                             byte_granularity,
-	u32                             offset)
+	u32                             buffer_offset)
 {
+	u32                             index;
 
 	ACPI_FUNCTION_ENTRY ();
 
 
+	/* Get proper index into buffer (handles big/little endian) */
+
+	index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity);
+
+	/* Move the requested number of bytes */
+
 	switch (byte_granularity) {
 	case ACPI_FIELD_BYTE_GRANULARITY:
 
-		((u8 *) buffer) [offset] = (u8) merged_datum;
+		((u8 *) buffer) [index] = (u8) merged_datum;
 		break;
 
 	case ACPI_FIELD_WORD_GRANULARITY:
 
-		ACPI_MOVE_UNALIGNED16_TO_16 (&(((u16 *) buffer)[offset]), &merged_datum);
+		ACPI_MOVE_64_TO_16 (&(((u16 *) buffer)[index]), &merged_datum);
 		break;
 
 	case ACPI_FIELD_DWORD_GRANULARITY:
 
-		ACPI_MOVE_UNALIGNED32_TO_32 (&(((u32 *) buffer)[offset]), &merged_datum);
+		ACPI_MOVE_64_TO_32 (&(((u32 *) buffer)[index]), &merged_datum);
 		break;
 
 	case ACPI_FIELD_QWORD_GRANULARITY:
 
-		ACPI_MOVE_UNALIGNED64_TO_64 (&(((u64 *) buffer)[offset]), &merged_datum);
+		ACPI_MOVE_64_TO_64 (&(((u64 *) buffer)[index]), &merged_datum);
 		break;
 
 	default:
@@ -762,8 +781,8 @@
 
 		/* Store the datum to the caller buffer */
 
-		acpi_ex_set_buffer_datum (merged_datum, buffer, obj_desc->common_field.access_byte_width,
-				datum_offset);
+		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+				obj_desc->common_field.access_byte_width, datum_offset);
 
 		return_ACPI_STATUS (AE_OK);
 	}
@@ -835,7 +854,7 @@
 		 * Store the merged field datum in the caller's buffer, according to
 		 * the granularity of the field (size of each datum).
 		 */
-		acpi_ex_set_buffer_datum (merged_datum, buffer,
+		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
 				obj_desc->common_field.access_byte_width, datum_offset);
 
 		/*
@@ -916,7 +935,7 @@
 
 	/* Get a single datum from the caller's buffer */
 
-	acpi_ex_get_buffer_datum (&previous_raw_datum, buffer,
+	acpi_ex_get_buffer_datum (&previous_raw_datum, buffer, buffer_length,
 			obj_desc->common_field.access_byte_width, datum_offset);
 
 	/*
@@ -979,7 +998,7 @@
 		 * Get the next raw buffer datum.  It may contain bits of the previous
 		 * field datum
 		 */
-		acpi_ex_get_buffer_datum (&this_raw_datum, buffer,
+		acpi_ex_get_buffer_datum (&this_raw_datum, buffer, buffer_length,
 				obj_desc->common_field.access_byte_width, datum_offset);
 
 		/* Create the field datum based on the field alignment */
diff -Nru a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
--- a/drivers/acpi/executer/exregion.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/executer/exregion.c	Fri Apr 18 16:27:55 2003
@@ -83,7 +83,7 @@
 	struct acpi_mem_space_context   *mem_info = region_context;
 	u32                             length;
 	acpi_size                       window_size;
-#ifndef _HW_ALIGNMENT_SUPPORT
+#ifndef ACPI_MISALIGNED_TRANSFERS
 	u32                             remainder;
 #endif
 
@@ -116,7 +116,7 @@
 	}
 
 
-#ifndef _HW_ALIGNMENT_SUPPORT
+#ifndef ACPI_MISALIGNED_TRANSFERS
 	/*
 	 * Hardware does not support non-aligned data transfers, we must verify
 	 * the request.
@@ -283,6 +283,7 @@
 	void                            *region_context)
 {
 	acpi_status                     status = AE_OK;
+	u32                             value32;
 
 
 	ACPI_FUNCTION_TRACE ("ex_system_io_space_handler");
@@ -297,13 +298,13 @@
 	switch (function) {
 	case ACPI_READ:
 
-		*value = 0;
-		status = acpi_os_read_port ((acpi_io_address) address, value, bit_width);
+		status = acpi_os_read_port ((acpi_io_address) address, &value32, bit_width);
+		*value = value32;
 		break;
 
 	case ACPI_WRITE:
 
-		status = acpi_os_write_port ((acpi_io_address) address, *value, bit_width);
+		status = acpi_os_write_port ((acpi_io_address) address, (u32) *value, bit_width);
 		break;
 
 	default:
diff -Nru a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c
--- a/drivers/acpi/hardware/hwacpi.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/hardware/hwacpi.c	Fri Apr 18 16:27:55 2003
@@ -141,7 +141,7 @@
 		/* BIOS should have disabled ALL fixed and GP events */
 
 		status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd,
-				  (acpi_integer) acpi_gbl_FADT->acpi_enable, 8);
+				  (u32) acpi_gbl_FADT->acpi_enable, 8);
 		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
 		break;
 
@@ -152,7 +152,7 @@
 		 * enable bits to default
 		 */
 		status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd,
-				 (acpi_integer) acpi_gbl_FADT->acpi_disable, 8);
+				 (u32) acpi_gbl_FADT->acpi_disable, 8);
 		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 				 "Attempting to enable Legacy (non-ACPI) mode\n"));
 		break;
diff -Nru a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c
--- a/drivers/acpi/hardware/hwgpe.c	Fri Mar 21 10:44:02 2003
+++ b/drivers/acpi/hardware/hwgpe.c	Fri Apr 18 16:27:55 2003
@@ -424,7 +424,7 @@
  *
  ******************************************************************************/
 
-acpi_status
+static acpi_status
 acpi_hw_disable_non_wakeup_gpe_block (
 	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
 	struct acpi_gpe_block_info      *gpe_block)
@@ -515,7 +515,7 @@
  *
  ******************************************************************************/
 
-acpi_status
+static acpi_status
 acpi_hw_enable_non_wakeup_gpe_block (
 	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
 	struct acpi_gpe_block_info      *gpe_block)
diff -Nru a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
--- a/drivers/acpi/hardware/hwregs.c	Fri Mar 21 10:44:02 2003
+++ b/drivers/acpi/hardware/hwregs.c	Fri Apr 18 16:27:55 2003
@@ -654,7 +654,7 @@
 
 		/* SMI_CMD is currently always in IO space */
 
-		status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (acpi_integer) value, 8);
+		status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, value, 8);
 		break;
 
 
@@ -812,7 +812,7 @@
 		mem_address = (reg->address
 				  + (acpi_physical_address) offset);
 
-		status = acpi_os_write_memory (mem_address, (acpi_integer) value, width);
+		status = acpi_os_write_memory (mem_address, value, width);
 		break;
 
 
@@ -821,7 +821,7 @@
 		io_address = (acpi_io_address) (reg->address
 				   + (acpi_physical_address) offset);
 
-		status = acpi_os_write_port (io_address, (acpi_integer) value, width);
+		status = acpi_os_write_port (io_address, value, width);
 		break;
 
 
diff -Nru a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
--- a/drivers/acpi/hardware/hwsleep.c	Fri Feb 28 09:36:25 2003
+++ b/drivers/acpi/hardware/hwsleep.c	Fri Apr 18 16:27:55 2003
@@ -226,7 +226,7 @@
 
 	/* Clear wake status */
 
-	status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_LOCK);
+	status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
@@ -238,7 +238,7 @@
 
 	/* Disable BM arbitration */
 
-	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_LOCK);
+	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
@@ -327,11 +327,6 @@
 
 	} while (!in_value);
 
-	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
-
 	return_ACPI_STATUS (AE_OK);
 }
 
@@ -366,7 +361,7 @@
 
 	ACPI_FLUSH_CPU_CACHE();
 
-	status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (acpi_integer) acpi_gbl_FADT->S4bios_req, 8);
+	status = acpi_os_write_port (acpi_gbl_FADT->smi_cmd, (u32) acpi_gbl_FADT->S4bios_req, 8);
 
 	do {
 		acpi_os_stall(1000);
diff -Nru a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
--- a/drivers/acpi/namespace/nsaccess.c	Fri Mar 21 10:44:02 2003
+++ b/drivers/acpi/namespace/nsaccess.c	Fri Apr 18 16:27:55 2003
@@ -527,7 +527,7 @@
 
 		/* Extract one ACPI name from the front of the pathname */
 
-		ACPI_MOVE_UNALIGNED32_TO_32 (&simple_name, path);
+		ACPI_MOVE_32_TO_32 (&simple_name, path);
 
 		/* Try to find the single (4 character) ACPI name */
 
diff -Nru a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
--- a/drivers/acpi/namespace/nsnames.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/namespace/nsnames.c	Fri Apr 18 16:27:55 2003
@@ -98,7 +98,7 @@
 
 		/* Put the name into the buffer */
 
-		ACPI_MOVE_UNALIGNED32_TO_32 ((name_buffer + index), &parent_node->name);
+		ACPI_MOVE_32_TO_32 ((name_buffer + index), &parent_node->name);
 		parent_node = acpi_ns_get_parent_node (parent_node);
 
 		/* Prefix name with the path separator */
diff -Nru a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
--- a/drivers/acpi/namespace/nsutils.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/namespace/nsutils.c	Fri Apr 18 16:27:55 2003
@@ -76,31 +76,38 @@
 	acpi_status                     lookup_status)
 {
 	acpi_status                     status;
-	char                            *name;
+	char                            *name = NULL;
 
 
-	/* Convert path to external format */
-
-	status = acpi_ns_externalize_name (ACPI_UINT32_MAX, internal_name, NULL, &name);
-
 	acpi_os_printf ("%8s-%04d: *** Error: Looking up ",
 		module_name, line_number);
 
-	/* Print target name */
+	if (lookup_status == AE_BAD_CHARACTER) {
+		/* There is a non-ascii character in the name */
 
-	if (ACPI_SUCCESS (status)) {
-		acpi_os_printf ("[%s]", name);
+		acpi_os_printf ("[0x%4.4X] (NON-ASCII)\n", *(ACPI_CAST_PTR (u32, internal_name)));
 	}
 	else {
-		acpi_os_printf ("[COULD NOT EXTERNALIZE NAME]");
+		/* Convert path to external format */
+
+		status = acpi_ns_externalize_name (ACPI_UINT32_MAX, internal_name, NULL, &name);
+
+		/* Print target name */
+
+		if (ACPI_SUCCESS (status)) {
+			acpi_os_printf ("[%s]", name);
+		}
+		else {
+			acpi_os_printf ("[COULD NOT EXTERNALIZE NAME]");
+		}
+
+		if (name) {
+			ACPI_MEM_FREE (name);
+		}
 	}
 
 	acpi_os_printf (" in namespace, %s\n",
 		acpi_format_exception (lookup_status));
-
-	if (name) {
-		ACPI_MEM_FREE (name);
-	}
 }
 
 
@@ -609,7 +616,7 @@
 			/* <count> 4-byte names */
 
 			names_index = prefix_length + 2;
-			num_segments = (u32) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)];
+			num_segments = (acpi_native_uint) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)];
 			break;
 
 		case AML_DUAL_NAME_PREFIX:
diff -Nru a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
--- a/drivers/acpi/namespace/nsxfeval.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/namespace/nsxfeval.c	Fri Apr 18 16:27:55 2003
@@ -524,8 +524,8 @@
  *
  * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
  *              starting (and ending) at the object specified by start_handle.
- *              The user_function is called whenever an object that matches
- *              the type parameter is found.  If the user function returns
+ *              The user_function is called whenever an object of type
+ *              Device is found.  If the user function returns
  *              a non-zero value, the search is terminated immediately and this
  *              value is returned to the caller.
  *
diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c
--- a/drivers/acpi/osl.c	Thu Apr  3 05:01:25 2003
+++ b/drivers/acpi/osl.c	Wed Apr 23 10:57:15 2003
@@ -234,10 +234,10 @@
 	return AE_OK;
 }
 
-static void
+static irqreturn_t
 acpi_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
-	(*acpi_irq_handler)(acpi_irq_context);
+	return (*acpi_irq_handler)(acpi_irq_context);
 }
 
 acpi_status
@@ -303,7 +303,7 @@
 acpi_status
 acpi_os_read_port(
 	acpi_io_address	port,
-	void		*value,
+	u32		*value,
 	u32		width)
 {
 	u32 dummy;
@@ -332,7 +332,7 @@
 acpi_status
 acpi_os_write_port(
 	acpi_io_address	port,
-	acpi_integer	value,
+	u32		value,
 	u32		width)
 {
 	switch (width)
@@ -356,7 +356,7 @@
 acpi_status
 acpi_os_read_memory(
 	acpi_physical_address	phys_addr,
-	void			*value,
+	u32			*value,
 	u32			width)
 {
 	u32			dummy;
@@ -402,7 +402,7 @@
 acpi_status
 acpi_os_write_memory(
 	acpi_physical_address	phys_addr,
-	acpi_integer		value,
+	u32			value,
 	u32			width)
 {
 	void			*virt_addr;
diff -Nru a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c
--- a/drivers/acpi/parser/psargs.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/parser/psargs.c	Fri Apr 18 16:27:55 2003
@@ -412,7 +412,7 @@
 
 		/* Get 2 bytes from the AML stream */
 
-		ACPI_MOVE_UNALIGNED16_TO_32 (&arg->common.value.integer, parser_state->aml);
+		ACPI_MOVE_16_TO_32 (&arg->common.value.integer, parser_state->aml);
 		parser_state->aml += 2;
 		break;
 
@@ -423,7 +423,7 @@
 
 		/* Get 4 bytes from the AML stream */
 
-		ACPI_MOVE_UNALIGNED32_TO_32 (&arg->common.value.integer, parser_state->aml);
+		ACPI_MOVE_32_TO_32 (&arg->common.value.integer, parser_state->aml);
 		parser_state->aml += 4;
 		break;
 
@@ -434,7 +434,7 @@
 
 		/* Get 8 bytes from the AML stream */
 
-		ACPI_MOVE_UNALIGNED64_TO_64 (&arg->common.value.integer, parser_state->aml);
+		ACPI_MOVE_64_TO_64 (&arg->common.value.integer, parser_state->aml);
 		parser_state->aml += 8;
 		break;
 
@@ -533,7 +533,7 @@
 
 		/* Get the 4-character name */
 
-		ACPI_MOVE_UNALIGNED32_TO_32 (&name, parser_state->aml);
+		ACPI_MOVE_32_TO_32 (&name, parser_state->aml);
 		acpi_ps_set_name (field, name);
 		parser_state->aml += ACPI_NAME_SIZE;
 
@@ -557,9 +557,9 @@
 		 * Get access_type and access_attrib and merge into the field Op
 		 * access_type is first operand, access_attribute is second
 		 */
-		field->common.value.integer32 = (ACPI_GET8 (parser_state->aml) << 8);
+		field->common.value.integer = (ACPI_GET8 (parser_state->aml) << 8);
 		parser_state->aml++;
-		field->common.value.integer32 |= ACPI_GET8 (parser_state->aml);
+		field->common.value.integer |= ACPI_GET8 (parser_state->aml);
 		parser_state->aml++;
 		break;
 
diff -Nru a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c
--- a/drivers/acpi/resources/rsaddr.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/resources/rsaddr.c	Fri Apr 18 16:27:55 2003
@@ -92,7 +92,7 @@
 	 * Point past the Descriptor to get the number of bytes consumed
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_ADDRESS16;
@@ -162,36 +162,31 @@
 	 * Get Granularity (Bytes 6-7)
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.granularity,
-			 buffer);
+	ACPI_MOVE_16_TO_32 (&output_struct->data.address16.granularity, buffer);
 
 	/*
 	 * Get min_address_range (Bytes 8-9)
 	 */
 	buffer += 2;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.min_address_range,
-			 buffer);
+	ACPI_MOVE_16_TO_32 (&output_struct->data.address16.min_address_range, buffer);
 
 	/*
 	 * Get max_address_range (Bytes 10-11)
 	 */
 	buffer += 2;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.max_address_range,
-			 buffer);
+	ACPI_MOVE_16_TO_32 (&output_struct->data.address16.max_address_range, buffer);
 
 	/*
 	 * Get address_translation_offset (Bytes 12-13)
 	 */
 	buffer += 2;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_translation_offset,
-			 buffer);
+	ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_translation_offset, buffer);
 
 	/*
 	 * Get address_length (Bytes 14-15)
 	 */
 	buffer += 2;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_length,
-			 buffer);
+	ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_length, buffer);
 
 	/*
 	 * Resource Source Index (if present)
@@ -360,36 +355,31 @@
 	/*
 	 * Set the address space granularity
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
-			   &linked_list->data.address16.granularity);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.granularity);
 	buffer += 2;
 
 	/*
 	 * Set the address range minimum
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
-			   &linked_list->data.address16.min_address_range);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.min_address_range);
 	buffer += 2;
 
 	/*
 	 * Set the address range maximum
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
-			   &linked_list->data.address16.max_address_range);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.max_address_range);
 	buffer += 2;
 
 	/*
 	 * Set the address translation offset
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
-			   &linked_list->data.address16.address_translation_offset);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_translation_offset);
 	buffer += 2;
 
 	/*
 	 * Set the address length
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer,
-			   &linked_list->data.address16.address_length);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_length);
 	buffer += 2;
 
 	/*
@@ -413,7 +403,7 @@
 		 * Buffer needs to be set to the length of the sting + one for the
 		 *  terminating null
 		 */
-		buffer += (ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1);
+		buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1);
 	}
 
 	/*
@@ -427,7 +417,7 @@
 	 * minus the header size (3 bytes)
 	 */
 	actual_bytes -= 3;
-	ACPI_MOVE_UNALIGNED16_TO_16 (length_field, &actual_bytes);
+	ACPI_MOVE_SIZE_TO_16 (length_field, &actual_bytes);
 	return_ACPI_STATUS (AE_OK);
 }
 
@@ -479,7 +469,7 @@
 	 * Point past the Descriptor to get the number of bytes consumed
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	*bytes_consumed = temp16 + 3;
 
 	output_struct->id = ACPI_RSTYPE_ADDRESS32;
@@ -553,36 +543,31 @@
 	 * Get Granularity (Bytes 6-9)
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.granularity,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.address32.granularity, buffer);
 
 	/*
 	 * Get min_address_range (Bytes 10-13)
 	 */
 	buffer += 4;
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.min_address_range,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.address32.min_address_range, buffer);
 
 	/*
 	 * Get max_address_range (Bytes 14-17)
 	 */
 	buffer += 4;
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.max_address_range,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.address32.max_address_range, buffer);
 
 	/*
 	 * Get address_translation_offset (Bytes 18-21)
 	 */
 	buffer += 4;
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_translation_offset,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_translation_offset, buffer);
 
 	/*
 	 * Get address_length (Bytes 22-25)
 	 */
 	buffer += 4;
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_length,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_length, buffer);
 
 	/*
 	 * Resource Source Index (if present)
@@ -749,36 +734,31 @@
 	/*
 	 * Set the address space granularity
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
-			  &linked_list->data.address32.granularity);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.granularity);
 	buffer += 4;
 
 	/*
 	 * Set the address range minimum
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
-			  &linked_list->data.address32.min_address_range);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.min_address_range);
 	buffer += 4;
 
 	/*
 	 * Set the address range maximum
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
-			  &linked_list->data.address32.max_address_range);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.max_address_range);
 	buffer += 4;
 
 	/*
 	 * Set the address translation offset
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
-			  &linked_list->data.address32.address_translation_offset);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_translation_offset);
 	buffer += 4;
 
 	/*
 	 * Set the address length
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
-			  &linked_list->data.address32.address_length);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_length);
 	buffer += 4;
 
 	/*
@@ -802,7 +782,7 @@
 		 * Buffer needs to be set to the length of the sting + one for the
 		 *  terminating null
 		 */
-		buffer += (ACPI_STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1);
+		buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1);
 	}
 
 	/*
@@ -866,7 +846,7 @@
 	 * Point past the Descriptor to get the number of bytes consumed
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_ADDRESS64;
@@ -941,36 +921,31 @@
 	 * Get Granularity (Bytes 6-13)
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.granularity,
-			 buffer);
+	ACPI_MOVE_64_TO_64 (&output_struct->data.address64.granularity, buffer);
 
 	/*
 	 * Get min_address_range (Bytes 14-21)
 	 */
 	buffer += 8;
-	ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.min_address_range,
-			 buffer);
+	ACPI_MOVE_64_TO_64 (&output_struct->data.address64.min_address_range, buffer);
 
 	/*
 	 * Get max_address_range (Bytes 22-29)
 	 */
 	buffer += 8;
-	ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.max_address_range,
-			 buffer);
+	ACPI_MOVE_64_TO_64 (&output_struct->data.address64.max_address_range, buffer);
 
 	/*
 	 * Get address_translation_offset (Bytes 30-37)
 	 */
 	buffer += 8;
-	ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_translation_offset,
-			 buffer);
+	ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_translation_offset, buffer);
 
 	/*
 	 * Get address_length (Bytes 38-45)
 	 */
 	buffer += 8;
-	ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_length,
-			 buffer);
+	ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_length, buffer);
 
 	/*
 	 * Resource Source Index (if present)
@@ -1141,36 +1116,31 @@
 	/*
 	 * Set the address space granularity
 	 */
-	ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
-			   &linked_list->data.address64.granularity);
+	ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.granularity);
 	buffer += 8;
 
 	/*
 	 * Set the address range minimum
 	 */
-	ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
-			   &linked_list->data.address64.min_address_range);
+	ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.min_address_range);
 	buffer += 8;
 
 	/*
 	 * Set the address range maximum
 	 */
-	ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
-			   &linked_list->data.address64.max_address_range);
+	ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.max_address_range);
 	buffer += 8;
 
 	/*
 	 * Set the address translation offset
 	 */
-	ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
-			   &linked_list->data.address64.address_translation_offset);
+	ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_translation_offset);
 	buffer += 8;
 
 	/*
 	 * Set the address length
 	 */
-	ACPI_MOVE_UNALIGNED64_TO_64 (buffer,
-			   &linked_list->data.address64.address_length);
+	ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_length);
 	buffer += 8;
 
 	/*
@@ -1193,7 +1163,7 @@
 		 * Buffer needs to be set to the length of the sting + one for the
 		 *  terminating null
 		 */
-		buffer += (ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1);
+		buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1);
 	}
 
 	/*
diff -Nru a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
--- a/drivers/acpi/resources/rscalc.c	Tue Feb 18 15:32:33 2003
+++ b/drivers/acpi/resources/rscalc.c	Fri Apr 18 16:27:55 2003
@@ -349,7 +349,7 @@
 			buffer = byte_stream_buffer;
 			++buffer;
 
-			ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+			ACPI_MOVE_16_TO_16 (&temp16, buffer);
 			bytes_consumed = temp16 + 3;
 
 			/*
@@ -390,7 +390,7 @@
 			buffer = byte_stream_buffer;
 
 			++buffer;
-			ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+			ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 			bytes_consumed = temp16 + 3;
 
@@ -428,7 +428,7 @@
 			buffer = byte_stream_buffer;
 
 			++buffer;
-			ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+			ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 			bytes_consumed = temp16 + 3;
 
@@ -466,7 +466,7 @@
 			buffer = byte_stream_buffer;
 
 			++buffer;
-			ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+			ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 			bytes_consumed = temp16 + 3;
 
@@ -504,7 +504,7 @@
 			buffer = byte_stream_buffer;
 
 			++buffer;
-			ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+			ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 			bytes_consumed = temp16 + 3;
 
@@ -573,7 +573,7 @@
 			/*
 			 * Look at the number of bits set
 			 */
-			ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+			ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 			for (index = 0; index < 16; index++) {
 				if (temp16 & 0x1) {
diff -Nru a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
--- a/drivers/acpi/resources/rsio.c	Tue Feb 18 15:32:34 2003
+++ b/drivers/acpi/resources/rsio.c	Fri Apr 18 16:27:55 2003
@@ -106,7 +106,7 @@
 	 * Check min_base Address
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	output_struct->data.io.min_base_address = temp16;
 
@@ -114,7 +114,7 @@
 	 * Check max_base Address
 	 */
 	buffer += 2;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	output_struct->data.io.max_base_address = temp16;
 
@@ -196,7 +196,7 @@
 	 * Check Range Base Address
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	output_struct->data.fixed_io.base_address = temp16;
 
@@ -270,7 +270,7 @@
 	 */
 	temp16 = (u16) linked_list->data.io.min_base_address;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
@@ -278,7 +278,7 @@
 	 */
 	temp16 = (u16) linked_list->data.io.max_base_address;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
@@ -347,7 +347,7 @@
 	 */
 	temp16 = (u16) linked_list->data.fixed_io.base_address;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
diff -Nru a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c
--- a/drivers/acpi/resources/rsirq.c	Tue Feb 18 15:32:34 2003
+++ b/drivers/acpi/resources/rsirq.c	Fri Apr 18 16:27:55 2003
@@ -101,7 +101,7 @@
 	 * Point to the 16-bits of Bytes 1 and 2
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	output_struct->data.irq.number_of_interrupts = 0;
 
@@ -242,7 +242,7 @@
 		temp16 |= 0x1 << temp8;
 	}
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
@@ -317,7 +317,7 @@
 	 * Point past the Descriptor to get the number of bytes consumed
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	*bytes_consumed = temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_EXT_IRQ;
@@ -374,7 +374,7 @@
 	 * Cycle through every IRQ in the table
 	 */
 	for (index = 0; index < temp8; index++) {
-		ACPI_MOVE_UNALIGNED32_TO_32 (
+		ACPI_MOVE_32_TO_32 (
 			&output_struct->data.extended_irq.interrupts[index], buffer);
 
 		/* Point to the next IRQ */
@@ -533,7 +533,7 @@
 
 	for (index = 0; index < linked_list->data.extended_irq.number_of_interrupts;
 		 index++) {
-		ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
+		ACPI_MOVE_32_TO_32 (buffer,
 				  &linked_list->data.extended_irq.interrupts[index]);
 		buffer += 4;
 	}
@@ -557,7 +557,7 @@
 		 * Buffer needs to be set to the length of the sting + one for the
 		 * terminating null
 		 */
-		buffer += (ACPI_STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1);
+		buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1);
 	}
 
 	/*
diff -Nru a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c
--- a/drivers/acpi/resources/rsmemory.c	Tue Feb 25 10:47:06 2003
+++ b/drivers/acpi/resources/rsmemory.c	Fri Apr 18 16:27:55 2003
@@ -92,7 +92,7 @@
 	 */
 	buffer += 1;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	buffer += 2;
 	*bytes_consumed = (acpi_size) temp16 + 3;
 	output_struct->id = ACPI_RSTYPE_MEM24;
@@ -107,28 +107,28 @@
 	/*
 	 * Get min_base_address (Bytes 4-5)
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	buffer += 2;
 	output_struct->data.memory24.min_base_address = temp16;
 
 	/*
 	 * Get max_base_address (Bytes 6-7)
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	buffer += 2;
 	output_struct->data.memory24.max_base_address = temp16;
 
 	/*
 	 * Get Alignment (Bytes 8-9)
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	buffer += 2;
 	output_struct->data.memory24.alignment = temp16;
 
 	/*
 	 * Get range_length (Bytes 10-11)
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	output_struct->data.memory24.range_length = temp16;
 
 	/*
@@ -184,7 +184,7 @@
 	 * The length field is static
 	 */
 	temp16 = 0x09;
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
@@ -197,25 +197,25 @@
 	/*
 	 * Set the Range minimum base address
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.min_base_address);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.min_base_address);
 	buffer += 2;
 
 	/*
 	 * Set the Range maximum base address
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.max_base_address);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.max_base_address);
 	buffer += 2;
 
 	/*
 	 * Set the base alignment
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.alignment);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.alignment);
 	buffer += 2;
 
 	/*
 	 * Set the range length
 	 */
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &linked_list->data.memory24.range_length);
+	ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.range_length);
 	buffer += 2;
 
 	/*
@@ -269,7 +269,7 @@
 	 */
 	buffer += 1;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 	buffer += 2;
 	*bytes_consumed = (acpi_size) temp16 + 3;
 
@@ -296,27 +296,25 @@
 	/*
 	 * Get min_base_address (Bytes 4-7)
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.min_base_address,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.min_base_address, buffer);
 	buffer += 4;
 
 	/*
 	 * Get max_base_address (Bytes 8-11)
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.max_base_address,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.max_base_address, buffer);
 	buffer += 4;
 
 	/*
 	 * Get Alignment (Bytes 12-15)
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.alignment, buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.alignment, buffer);
 	buffer += 4;
 
 	/*
 	 * Get range_length (Bytes 16-19)
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.range_length, buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.range_length, buffer);
 
 	/*
 	 * Set the Length parameter
@@ -373,7 +371,7 @@
 	 * Point past the Descriptor to get the number of bytes consumed
 	 */
 	buffer += 1;
-	ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+	ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 	buffer += 2;
 	*bytes_consumed = (acpi_size) temp16 + 3;
@@ -390,15 +388,13 @@
 	/*
 	 * Get range_base_address (Bytes 4-7)
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_base_address,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_base_address, buffer);
 	buffer += 4;
 
 	/*
 	 * Get range_length (Bytes 8-11)
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_length,
-			 buffer);
+	ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_length, buffer);
 
 	/*
 	 * Set the Length parameter
@@ -454,7 +450,7 @@
 	 */
 	temp16 = 0x11;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
@@ -467,25 +463,25 @@
 	/*
 	 * Set the Range minimum base address
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.min_base_address);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.min_base_address);
 	buffer += 4;
 
 	/*
 	 * Set the Range maximum base address
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.max_base_address);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.max_base_address);
 	buffer += 4;
 
 	/*
 	 * Set the base alignment
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.alignment);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.alignment);
 	buffer += 4;
 
 	/*
 	 * Set the range length
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer, &linked_list->data.memory32.range_length);
+	ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.range_length);
 	buffer += 4;
 
 	/*
@@ -537,7 +533,7 @@
 	 */
 	temp16 = 0x09;
 
-	ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+	ACPI_MOVE_16_TO_16 (buffer, &temp16);
 	buffer += 2;
 
 	/*
@@ -550,14 +546,14 @@
 	/*
 	 * Set the Range base address
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
+	ACPI_MOVE_32_TO_32 (buffer,
 			 &linked_list->data.fixed_memory32.range_base_address);
 	buffer += 4;
 
 	/*
 	 * Set the range length
 	 */
-	ACPI_MOVE_UNALIGNED32_TO_32 (buffer,
+	ACPI_MOVE_32_TO_32 (buffer,
 			 &linked_list->data.fixed_memory32.range_length);
 	buffer += 4;
 
diff -Nru a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
--- a/drivers/acpi/resources/rsmisc.c	Tue Feb 18 15:32:34 2003
+++ b/drivers/acpi/resources/rsmisc.c	Fri Apr 18 16:27:55 2003
@@ -211,7 +211,7 @@
 
 		/* Dereference */
 
-		ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
+		ACPI_MOVE_16_TO_16 (&temp16, buffer);
 
 		/* Calculate bytes consumed */
 
@@ -307,7 +307,7 @@
 
 		temp16 = (u16) linked_list->data.vendor_specific.length;
 
-		ACPI_MOVE_UNALIGNED16_TO_16 (buffer, &temp16);
+		ACPI_MOVE_16_TO_16 (buffer, &temp16);
 		buffer += 2;
 	}
 	else {
diff -Nru a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c
--- a/drivers/acpi/resources/rsxface.c	Fri Mar 21 10:44:02 2003
+++ b/drivers/acpi/resources/rsxface.c	Fri Apr 18 16:27:55 2003
@@ -339,20 +339,20 @@
 }
 
 
-#define COPY_FIELD(out, in, field)  out->field = in->field
-#define COPY_ADDRESS(out, in)                      \
-	COPY_FIELD(out, in, resource_type);             \
-	COPY_FIELD(out, in, producer_consumer);         \
-	COPY_FIELD(out, in, decode);                    \
-	COPY_FIELD(out, in, min_address_fixed);         \
-	COPY_FIELD(out, in, max_address_fixed);         \
-	COPY_FIELD(out, in, attribute);                 \
-	COPY_FIELD(out, in, granularity);               \
-	COPY_FIELD(out, in, min_address_range);         \
-	COPY_FIELD(out, in, max_address_range);         \
-	COPY_FIELD(out, in, address_translation_offset); \
-	COPY_FIELD(out, in, address_length);            \
-	COPY_FIELD(out, in, resource_source);
+#define ACPI_COPY_FIELD(out, in, field)  ((out)->field = (in)->field)
+#define ACPI_COPY_ADDRESS(out, in)                      \
+	ACPI_COPY_FIELD(out, in, resource_type);             \
+	ACPI_COPY_FIELD(out, in, producer_consumer);         \
+	ACPI_COPY_FIELD(out, in, decode);                    \
+	ACPI_COPY_FIELD(out, in, min_address_fixed);         \
+	ACPI_COPY_FIELD(out, in, max_address_fixed);         \
+	ACPI_COPY_FIELD(out, in, attribute);                 \
+	ACPI_COPY_FIELD(out, in, granularity);               \
+	ACPI_COPY_FIELD(out, in, min_address_range);         \
+	ACPI_COPY_FIELD(out, in, max_address_range);         \
+	ACPI_COPY_FIELD(out, in, address_translation_offset); \
+	ACPI_COPY_FIELD(out, in, address_length);            \
+	ACPI_COPY_FIELD(out, in, resource_source);
 
 /******************************************************************************
  *
@@ -385,17 +385,17 @@
 	switch (resource->id) {
 	case ACPI_RSTYPE_ADDRESS16:
 		address16 = (struct acpi_resource_address16 *) &resource->data;
-		COPY_ADDRESS(out, address16);
+		ACPI_COPY_ADDRESS(out, address16);
 		break;
 
 	case ACPI_RSTYPE_ADDRESS32:
 		address32 = (struct acpi_resource_address32 *) &resource->data;
-		COPY_ADDRESS(out, address32);
+		ACPI_COPY_ADDRESS(out, address32);
 		break;
 
 	case ACPI_RSTYPE_ADDRESS64:
 		address64 = (struct acpi_resource_address64 *) &resource->data;
-		COPY_ADDRESS(out, address64);
+		ACPI_COPY_ADDRESS(out, address64);
 		break;
 
 	default:
diff -Nru a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
--- a/drivers/acpi/tables/tbutils.c	Tue Feb 18 15:32:34 2003
+++ b/drivers/acpi/tables/tbutils.c	Fri Apr 18 16:27:55 2003
@@ -133,7 +133,7 @@
 
 	/* Ensure that the signature is 4 ASCII characters */
 
-	ACPI_MOVE_UNALIGNED32_TO_32 (&signature, table_header->signature);
+	ACPI_MOVE_32_TO_32 (&signature, table_header->signature);
 	if (!acpi_ut_valid_acpi_name (signature)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Table signature at %p [%p] has invalid characters\n",
diff -Nru a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
--- a/drivers/acpi/utilities/utdebug.c	Tue Feb 18 15:32:34 2003
+++ b/drivers/acpi/utilities/utdebug.c	Fri Apr 18 16:27:55 2003
@@ -559,8 +559,7 @@
 
 			case DB_WORD_DISPLAY:
 
-				ACPI_MOVE_UNALIGNED16_TO_32 (&temp32,
-						   &buffer[i + j]);
+				ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]);
 				acpi_os_printf ("%04X ", temp32);
 				j += 2;
 				break;
@@ -568,8 +567,7 @@
 
 			case DB_DWORD_DISPLAY:
 
-				ACPI_MOVE_UNALIGNED32_TO_32 (&temp32,
-						   &buffer[i + j]);
+				ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]);
 				acpi_os_printf ("%08X ", temp32);
 				j += 4;
 				break;
@@ -577,12 +575,10 @@
 
 			case DB_QWORD_DISPLAY:
 
-				ACPI_MOVE_UNALIGNED32_TO_32 (&temp32,
-						   &buffer[i + j]);
+				ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]);
 				acpi_os_printf ("%08X", temp32);
 
-				ACPI_MOVE_UNALIGNED32_TO_32 (&temp32,
-						   &buffer[i + j + 4]);
+				ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]);
 				acpi_os_printf ("%08X ", temp32);
 				j += 8;
 				break;
diff -Nru a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
--- a/drivers/acpi/utilities/utmisc.c	Fri Mar 21 10:44:02 2003
+++ b/drivers/acpi/utilities/utmisc.c	Fri Apr 18 16:27:55 2003
@@ -592,7 +592,7 @@
 		(void) acpi_ut_delete_mutex (i);
 	}
 
-	(void) acpi_os_delete_lock (acpi_gbl_gpe_lock);
+	acpi_os_delete_lock (acpi_gbl_gpe_lock);
 	return_VOID;
 }
 
diff -Nru a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
--- a/drivers/atm/ambassador.c	Mon Jan 13 17:54:31 2003
+++ b/drivers/atm/ambassador.c	Thu Apr 24 05:17:22 2003
@@ -868,7 +868,8 @@
 
 /********** interrupt handling **********/
 
-static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) {
+static irqreturn_t interrupt_handler(int irq, void *dev_id,
+					struct pt_regs *pt_regs) {
   amb_dev * dev = amb_devs;
   (void) pt_regs;
   
@@ -876,7 +877,7 @@
   
   if (!dev_id) {
     PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
-    return;
+    return IRQ_NONE;
   }
   // Did one of our cards generate the interrupt?
   while (dev) {
@@ -889,12 +890,12 @@
   // the card generates an IRQ at startup - should not happen again
   if (!dev) {
     PRINTD (DBG_IRQ, "irq for unknown device: %d", irq);
-    return;
+    return IRQ_NONE;
   }
   // impossible - unless we have memory corruption of dev or kernel
   if (irq != dev->irq) {
     PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq);
-    return;
+    return IRQ_NONE;
   }
   
   {
@@ -903,7 +904,7 @@
     // for us or someone else sharing the same interrupt
     if (!interrupt) {
       PRINTD (DBG_IRQ, "irq not for me: %d", irq);
-      return;
+      return IRQ_NONE;
     }
     
     // definitely for us
@@ -934,7 +935,7 @@
   }
   
   PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id);
-  return;
+  return IRQ_HANDLED;
 }
 
 /********** don't panic... yeah, right **********/
diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c
--- a/drivers/atm/eni.c	Mon Oct  7 11:39:20 2002
+++ b/drivers/atm/eni.c	Thu Apr 24 05:17:22 2003
@@ -1483,7 +1483,7 @@
 }
 
 
-static void eni_int(int irq,void *dev_id,struct pt_regs *regs)
+static irqreturn_t eni_int(int irq,void *dev_id,struct pt_regs *regs)
 {
 	struct atm_dev *dev;
 	struct eni_dev *eni_dev;
@@ -1515,6 +1515,7 @@
 	eni_dev->events |= reason;
 	spin_unlock(&eni_dev->lock);
 	tasklet_schedule(&eni_dev->task);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c
--- a/drivers/atm/firestream.c	Thu Mar  6 09:14:50 2003
+++ b/drivers/atm/firestream.c	Thu Apr 24 05:17:22 2003
@@ -1562,14 +1562,15 @@
 
 
 
-static void fs_irq (int irq, void *dev_id,  struct pt_regs * pt_regs) 
+static irqreturn_t fs_irq (int irq, void *dev_id,  struct pt_regs * pt_regs) 
 {
 	int i;
 	u32 status;
 	struct fs_dev *dev = dev_id;
 
 	status = read_fs (dev, ISR);
-	if (!status) return;
+	if (!status)
+		return IRQ_NONE;
 
 	func_enter ();
 
@@ -1649,6 +1650,7 @@
 	}
 
 	func_exit ();
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
--- a/drivers/atm/fore200e.c	Mon Mar  3 01:18:32 2003
+++ b/drivers/atm/fore200e.c	Thu Apr 24 05:17:22 2003
@@ -1227,7 +1227,7 @@
 }
 
 
-static void
+static irqreturn_t
 fore200e_interrupt(int irq, void* dev, struct pt_regs* regs)
 {
     struct fore200e* fore200e = FORE200E_DEV((struct atm_dev*)dev);
@@ -1235,13 +1235,14 @@
     if (fore200e->bus->irq_check(fore200e) == 0) {
 	
 	DPRINTK(3, "unexpected interrupt on device %c\n", fore200e->name[9]);
-	return;
+	return IRQ_NONE;
     }
     DPRINTK(3, "valid interrupt on device %c\n", fore200e->name[9]);
 
     tasklet_schedule(&fore200e->tasklet);
     
     fore200e->bus->irq_ack(fore200e);
+    return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c
--- a/drivers/atm/horizon.c	Sat Jan 11 09:23:18 2003
+++ b/drivers/atm/horizon.c	Thu Apr 24 05:17:22 2003
@@ -1398,7 +1398,8 @@
 
 /********** interrupt handler **********/
 
-static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) {
+static irqreturn_t interrupt_handler(int irq, void *dev_id,
+					struct pt_regs *pt_regs) {
   hrz_dev * dev = hrz_devs;
   u32 int_source;
   unsigned int irq_ok;
@@ -1408,7 +1409,7 @@
   
   if (!dev_id) {
     PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
-    return;
+    return IRQ_NONE;
   }
   // Did one of our cards generate the interrupt?
   while (dev) {
@@ -1418,11 +1419,11 @@
   }
   if (!dev) {
     PRINTD (DBG_IRQ, "irq not for me: %d", irq);
-    return;
+    return IRQ_NONE;
   }
   if (irq != dev->irq) {
     PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq);
-    return;
+    return IRQ_NONE;
   }
   
   // definitely for us
@@ -1468,6 +1469,9 @@
   }
   
   PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id);
+  if (irq_ok)
+	return IRQ_HANDLED;
+  return IRQ_NONE;
 }
 
 /********** housekeeping **********/
diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
--- a/drivers/atm/idt77252.c	Thu Mar 20 00:45:11 2003
+++ b/drivers/atm/idt77252.c	Thu Apr 24 05:17:22 2003
@@ -134,8 +134,6 @@
 			       int flags);
 static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos,
 			      char *page);
-static void idt77252_interrupt(int irq, void *dev_id,
-			       struct pt_regs *regs);
 static void idt77252_softint(void *dev_id);
 
 
@@ -2812,7 +2810,7 @@
 #endif
 }
 
-static void
+static irqreturn_t
 idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 {
 	struct idt77252_dev *card = dev_id;
@@ -2820,7 +2818,7 @@
 
 	stat = readl(SAR_REG_STAT) & 0xffff;
 	if (!stat)	/* no interrupt for us */
-		return;
+		return IRQ_NONE;
 
 	if (test_and_set_bit(IDT77252_BIT_INTERRUPT, &card->flags)) {
 		printk("%s: Re-entering irq_handler()\n", card->name);
@@ -2901,6 +2899,7 @@
 
 out:
 	clear_bit(IDT77252_BIT_INTERRUPT, &card->flags);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/atm/iphase.c b/drivers/atm/iphase.c
--- a/drivers/atm/iphase.c	Thu Apr  3 04:39:06 2003
+++ b/drivers/atm/iphase.c	Thu Apr 24 05:17:22 2003
@@ -2197,16 +2197,18 @@
 	return -ENOMEM;
 }   
    
-static void ia_int(int irq, void *dev_id, struct pt_regs *regs)  
+static irqreturn_t ia_int(int irq, void *dev_id, struct pt_regs *regs)  
 {  
    struct atm_dev *dev;  
    IADEV *iadev;  
    unsigned int status;  
+   int handled = 0;
 
    dev = dev_id;  
    iadev = INPH_IA_DEV(dev);  
    while( (status = readl(iadev->reg+IPHASE5575_BUS_STATUS_REG) & 0x7f))  
    { 
+	handled = 1;
         IF_EVENT(printk("ia_int: status = 0x%x\n", status);) 
 	if (status & STAT_REASSINT)  
 	{  
@@ -2236,7 +2238,8 @@
            if (status & STAT_FEINT) 
                IaFrontEndIntr(iadev);
 	}  
-   }  
+   }
+   return IRQ_RETVAL(handled);
 }  
 	  
 	  
diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c
--- a/drivers/atm/lanai.c	Tue Feb 25 10:47:23 2003
+++ b/drivers/atm/lanai.c	Thu Apr 24 05:17:22 2003
@@ -2047,10 +2047,12 @@
 		reg_write(lanai, ack, IntAck_Reg);
 }
 
-static void lanai_int(int irq, void *devid, struct pt_regs *regs)
+static irqreturn_t lanai_int(int irq, void *devid, struct pt_regs *regs)
 {
 	struct lanai_dev *lanai = (struct lanai_dev *) devid;
 	u32 reason;
+	int handled = 0;
+
 	(void) irq; (void) regs;	/* unused variables */
 #ifdef USE_POWERDOWN
 	if (lanai->conf1 & CONFIG1_POWERDOWN) {
@@ -2062,8 +2064,11 @@
 		conf2_write(lanai);
 	}
 #endif
-	while ((reason = intr_pending(lanai)) != 0)
+	while ((reason = intr_pending(lanai)) != 0) {
+		handled = 1;
 		lanai_int_1(lanai, reason);
+	}
+	return IRQ_RETVAL(handled);
 }
 
 /* TODO - it would be nice if we could use the "delayed interrupt" system
diff -Nru a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
--- a/drivers/atm/nicstar.c	Sun Mar 23 01:14:47 2003
+++ b/drivers/atm/nicstar.c	Thu Apr 24 05:17:22 2003
@@ -220,7 +220,7 @@
 static void free_scq(scq_info *scq, struct atm_vcc *vcc);
 static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1,
                        u32 handle2, u32 addr2);
-static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
 static int ns_open(struct atm_vcc *vcc, short vpi, int vci);
 static void ns_close(struct atm_vcc *vcc);
 static void fill_tst(ns_dev *card, int n, vc_map *vc);
@@ -1186,7 +1186,7 @@
 
 
 
-static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
    u32 stat_r;
    ns_dev *card;
@@ -1366,6 +1366,7 @@
    
    spin_unlock_irqrestore(&card->int_lock, flags);
    PRINTK("nicstar%d: end of interrupt service\n", card->index);
+   return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/atm/zatm.c b/drivers/atm/zatm.c
--- a/drivers/atm/zatm.c	Thu Oct 31 08:47:09 2002
+++ b/drivers/atm/zatm.c	Thu Apr 24 05:17:22 2003
@@ -1214,15 +1214,17 @@
 /*------------------------------- interrupts --------------------------------*/
 
 
-static void zatm_int(int irq,void *dev_id,struct pt_regs *regs)
+static irqreturn_t zatm_int(int irq,void *dev_id,struct pt_regs *regs)
 {
 	struct atm_dev *dev;
 	struct zatm_dev *zatm_dev;
 	u32 reason;
+	int handled = 0;
 
 	dev = dev_id;
 	zatm_dev = ZATM_DEV(dev);
 	while ((reason = zin(GSR))) {
+		handled = 1;
 		EVENT("reason 0x%x\n",reason,0);
 		if (reason & uPD98401_INT_PI) {
 			EVENT("PHY int\n",0,0);
@@ -1285,6 +1287,7 @@
 		}
 		/* @@@ handle RCRn */
 	}
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c
--- a/drivers/block/DAC960.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/DAC960.c	Sun Apr 20 22:09:23 2003
@@ -1069,6 +1069,7 @@
   
   if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask))
 	return DAC960_Failure(Controller, "DMA mask out of range");
+  Controller->BounceBufferLimit = DAC690_V1_PciDmaMask;
 
   if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) {
     CommandMailboxesSize =  0;
@@ -1271,6 +1272,7 @@
 
   if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask))
 	return DAC960_Failure(Controller, "DMA mask out of range");
+  Controller->BounceBufferLimit = DAC690_V2_PciDmaMask;
 
   /* This is a temporary dma mapping, used only in the scope of this function */
   CommandMailbox =
@@ -2386,6 +2388,7 @@
   */
   RequestQueue = &Controller->RequestQueue;
   blk_init_queue(RequestQueue, DAC960_RequestFunction, &Controller->queue_lock);
+  blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit);
   RequestQueue->queuedata = Controller;
   blk_queue_max_hw_segments(RequestQueue,
 			    Controller->DriverScatterGatherLimit);
@@ -2583,7 +2586,7 @@
 					const struct pci_device_id *entry)
 {
   struct DAC960_privdata *privdata = (struct DAC960_privdata *)entry->driver_data;
-  void (*InterruptHandler)(int, void *, Registers_T *) = privdata->InterruptHandler;
+  irqreturn_t (*InterruptHandler)(int, void *, Registers_T *) = privdata->InterruptHandler;
   unsigned int MemoryWindowSize = privdata->MemoryWindowSize;
   DAC960_Controller_T *Controller = NULL;
   unsigned char DeviceFunction = PCI_Device->devfn;
@@ -5109,7 +5112,7 @@
   Controllers.
 */
 
-static void DAC960_BA_InterruptHandler(int IRQ_Channel,
+static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel,
 				       void *DeviceIdentifier,
 				       Registers_T *InterruptRegisters)
 {
@@ -5117,6 +5120,7 @@
   void *ControllerBaseAddress = Controller->BaseAddress;
   DAC960_V2_StatusMailbox_T *NextStatusMailbox;
   ProcessorFlags_T ProcessorFlags;
+
   /*
     Acquire exclusive access to Controller.
   */
@@ -5151,6 +5155,7 @@
     Release exclusive access to Controller.
   */
   DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
@@ -5159,7 +5164,7 @@
   Controllers.
 */
 
-static void DAC960_LP_InterruptHandler(int IRQ_Channel,
+static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel,
 				       void *DeviceIdentifier,
 				       Registers_T *InterruptRegisters)
 {
@@ -5201,6 +5206,7 @@
     Release exclusive access to Controller.
   */
   DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
@@ -5209,7 +5215,7 @@
   Controllers.
 */
 
-static void DAC960_LA_InterruptHandler(int IRQ_Channel,
+static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel,
 				       void *DeviceIdentifier,
 				       Registers_T *InterruptRegisters)
 {
@@ -5247,6 +5253,7 @@
     Release exclusive access to Controller.
   */
   DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
@@ -5255,7 +5262,7 @@
   Controllers.
 */
 
-static void DAC960_PG_InterruptHandler(int IRQ_Channel,
+static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel,
 				       void *DeviceIdentifier,
 				       Registers_T *InterruptRegisters)
 {
@@ -5293,6 +5300,7 @@
     Release exclusive access to Controller.
   */
   DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
@@ -5301,7 +5309,7 @@
   Controllers.
 */
 
-static void DAC960_PD_InterruptHandler(int IRQ_Channel,
+static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel,
 				       void *DeviceIdentifier,
 				       Registers_T *InterruptRegisters)
 {
@@ -5335,6 +5343,7 @@
     Release exclusive access to Controller.
   */
   DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
@@ -5347,7 +5356,7 @@
   an arbitrary buffer.
 */
 
-static void DAC960_P_InterruptHandler(int IRQ_Channel,
+static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel,
 				      void *DeviceIdentifier,
 				      Registers_T *InterruptRegisters)
 {
@@ -5416,6 +5425,7 @@
     Release exclusive access to Controller.
   */
   DAC960_ReleaseControllerLockIH(Controller, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/block/DAC960.h b/drivers/block/DAC960.h
--- a/drivers/block/DAC960.h	Mon Feb  3 23:46:58 2003
+++ b/drivers/block/DAC960.h	Sun Apr 20 22:10:31 2003
@@ -62,11 +62,6 @@
 
 /*
   Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers
-
-  For now set the V2 mask to only 32 bits.  The controller IS capable
-  of doing 64 bit dma.  But I have yet to find out whether this needs to
-  be explicitely enabled in the controller, or of the controller adapts
-  automatically.
  */
 
 #define DAC690_V1_PciDmaMask	0xffffffff
@@ -2234,7 +2229,7 @@
 struct DAC960_privdata {
 	DAC960_HardwareType_T	HardwareType;
 	DAC960_FirmwareType_T	FirmwareType;
-	void (*InterruptHandler)(int, void *, Registers_T *);
+	irqreturn_t (*InterruptHandler)(int, void *, Registers_T *);
 	unsigned int		MemoryWindowSize;
 };
 
@@ -2370,6 +2365,7 @@
   unsigned short ControllerScatterGatherLimit;
   unsigned short DriverScatterGatherLimit;
   unsigned int ControllerUsageCount;
+  u64		BounceBufferLimit;
   unsigned int CombinedStatusBufferLength;
   unsigned int InitialStatusLength;
   unsigned int CurrentStatusLength;
@@ -4237,12 +4233,12 @@
 static void DAC960_V1_QueueReadWriteCommand(DAC960_Command_T *);
 static void DAC960_V2_QueueReadWriteCommand(DAC960_Command_T *); 
 static void DAC960_RequestFunction(RequestQueue_T *);
-static void DAC960_BA_InterruptHandler(int, void *, Registers_T *);
-static void DAC960_LP_InterruptHandler(int, void *, Registers_T *);
-static void DAC960_LA_InterruptHandler(int, void *, Registers_T *);
-static void DAC960_PG_InterruptHandler(int, void *, Registers_T *);
-static void DAC960_PD_InterruptHandler(int, void *, Registers_T *);
-static void DAC960_P_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t DAC960_BA_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t DAC960_LP_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t DAC960_LA_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t DAC960_PG_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t DAC960_PD_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t DAC960_P_InterruptHandler(int, void *, Registers_T *);
 static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *);
 static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *);
 static void DAC960_MonitoringTimerFunction(unsigned long);
diff -Nru a/drivers/block/Kconfig b/drivers/block/Kconfig
--- a/drivers/block/Kconfig	Wed Mar 26 12:04:13 2003
+++ b/drivers/block/Kconfig	Sun Apr 20 16:21:17 2003
@@ -331,7 +331,6 @@
 
 config BLK_DEV_INITRD
 	bool "Initial RAM disk (initrd) support"
-	depends on BLK_DEV_RAM=y
 	help
 	  The initial RAM disk is a RAM disk that is loaded by the boot loader
 	  (loadlin or lilo) and that is mounted as root before the normal boot
diff -Nru a/drivers/block/Makefile b/drivers/block/Makefile
--- a/drivers/block/Makefile	Thu Feb 20 08:30:00 2003
+++ b/drivers/block/Makefile	Sun Apr 20 16:21:17 2003
@@ -20,6 +20,7 @@
 obj-$(CONFIG_ATARI_SLM)		+= acsi_slm.o
 obj-$(CONFIG_AMIGA_Z2RAM)	+= z2ram.o
 obj-$(CONFIG_BLK_DEV_RAM)	+= rd.o
+obj-$(CONFIG_BLK_DEV_INITRD)	+= initrd.o
 obj-$(CONFIG_BLK_DEV_LOOP)	+= loop.o
 obj-$(CONFIG_BLK_DEV_PS2)	+= ps2esdi.o
 obj-$(CONFIG_BLK_DEV_XD)	+= xd.o
diff -Nru a/drivers/block/amiflop.c b/drivers/block/amiflop.c
--- a/drivers/block/amiflop.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/amiflop.c	Thu Apr 24 03:30:41 2003
@@ -1496,7 +1496,7 @@
 		break;
 	case FDFMTEND:
 		floppy_off(drive);
-		invalidate_device(inode->i_rdev, 0);
+		invalidate_bdev(inode->i_bdev, 0);
 		break;
 	case FDGETPRM:
 		memset((void *)&getprm, 0, sizeof (getprm));
@@ -1603,9 +1603,6 @@
 		MOD_INC_USE_COUNT;
 #endif
 	local_irq_restore(flags);
-
-	if (old_dev != system)
-		invalidate_buffers(mk_kdev(FLOPPY_MAJOR, drive + (system << 2)));
 
 	unit[drive].dtype=&data_types[system];
 	unit[drive].blocks=unit[drive].type->heads*unit[drive].type->tracks*
diff -Nru a/drivers/block/ataflop.c b/drivers/block/ataflop.c
--- a/drivers/block/ataflop.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/ataflop.c	Thu Apr 24 03:30:41 2003
@@ -364,7 +364,7 @@
 static __inline__ int get_head_settle_flag( void );
 static void floppy_irq (int irq, void *dummy, struct pt_regs *fp);
 static void fd_error( void );
-static int do_format(kdev_t drive, struct atari_format_descr *desc);
+static int do_format(int drive, int type, struct atari_format_descr *desc);
 static void do_fd_action( int drive );
 static void fd_calibrate( void );
 static void fd_calibrate_done( int status );
@@ -656,12 +656,11 @@
 	p += n;			\
     } while(0)
 
-static int do_format(kdev_t device, struct atari_format_descr *desc)
+static int do_format(int drive, int type, struct atari_format_descr *desc)
 {
 	unsigned char	*p;
 	int sect, nsect;
 	unsigned long	flags;
-	int type, drive = minor(device) & 3;
 
 	DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n",
 		drive, desc->track, desc->head, desc->sect_offset ));
@@ -673,7 +672,6 @@
 	atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */
 	local_irq_restore(flags);
 
-	type = minor(device) >> 2;
 	if (type) {
 		if (--type >= NUM_DISK_MINORS ||
 		    minor2disktype[type].drive_types > DriveType) {
@@ -1690,7 +1688,7 @@
 			return -EBUSY;
 		if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc)))
 			return -EFAULT;
-		return do_format(device, &fmt_desc);
+		return do_format(drive, type, &fmt_desc);
 	case FDCLRPRM:
 		UDT = NULL;
 		/* MSch: invalidate default_params */
@@ -1863,9 +1861,6 @@
 		fd_ref[drive]++;
 
 	fd_device[drive] = type;
-
-	if (old_dev && old_dev != type)
-		invalidate_buffers(mk_kdev(FLOPPY_MAJOR, drive + (type<<2)));
 
 	if (filp->f_flags & O_NDELAY)
 		return 0;
diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c
--- a/drivers/block/cciss.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/cciss.c	Sun Apr 20 22:32:59 2003
@@ -599,9 +599,12 @@
  		luninfo.num_opens = drv->usage_count;
  		luninfo.num_parts = 0;
  		/* count partitions 1 to 15 with sizes > 0 */
- 		for(i=1; i <MAX_PART; i++)
- 			if (disk->part[i].nr_sects != 0)
- 				luninfo.num_parts++;
+ 		for(i=1; i <MAX_PART; i++) {
+			if (!disk->part[i])
+				continue;
+			if (disk->part[i]->nr_sects != 0)
+				luninfo.num_parts++;
+		}
  		if (copy_to_user((void *) arg, &luninfo,
  				sizeof(LogvolInfo_struct)))
  			return -EFAULT;
@@ -1962,7 +1965,7 @@
 	start_io(h);
 }
 
-static void do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	ctlr_info_t *h = dev_id;
 	CommandList_struct *c;
@@ -1972,7 +1975,7 @@
 
 	/* Is this interrupt for us? */
 	if ( h->access.intr_pending(h) == 0)
-		return;
+		return IRQ_NONE;
 
 	/*
 	 * If there are completed commands in the completion queue,
@@ -2020,6 +2023,7 @@
 	 */
 	spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
 	blk_start_queue(&h->queue);
+	return IRQ_HANDLED;
 }
 /* 
  *  We cannot read the structure directly, for portablity we must use 
diff -Nru a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
--- a/drivers/block/cpqarray.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/block/cpqarray.c	Sun Apr 20 22:06:44 2003
@@ -144,7 +144,7 @@
 static inline void complete_buffers(struct bio *bio, int ok);
 static inline void complete_command(cmdlist_t *cmd, int timeout);
 
-static void do_ida_intr(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t do_ida_intr(int irq, void *dev_id, struct pt_regs * regs);
 static void ida_timer(unsigned long tdata);
 static int ida_revalidate(struct gendisk *disk);
 static int revalidate_allvol(kdev_t dev);
@@ -929,7 +929,7 @@
  *  Find the command on the completion queue, remove it, tell the OS and
  *  try to queue up more IO
  */
-static void do_ida_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_ida_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	ctlr_info_t *h = dev_id;
 	cmdlist_t *c;
@@ -940,7 +940,7 @@
 	istat = h->access.intr_pending(h);
 	/* Is this interrupt for us? */
 	if (istat == 0)
-		return;
+		return IRQ_NONE;
 
 	/*
 	 * If there are completed commands in the completion queue,
@@ -991,6 +991,7 @@
 	 */
 	do_ida_request(&h->queue);
 	spin_unlock_irqrestore(IDA_LOCK(h->ctlr), flags); 
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c
--- a/drivers/block/floppy.c	Thu Apr  3 14:36:23 2003
+++ b/drivers/block/floppy.c	Thu Apr 24 03:30:41 2003
@@ -217,7 +217,7 @@
 static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED;
 
 static unsigned short virtual_dma_port=0x3f0;
-void floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs);
 static int set_dor(int fdc, char mask, char data);
 static void register_devfs_entries (int drive) __init;
 
@@ -283,12 +283,6 @@
 static unsigned long fake_change;
 static int initialising=1;
 
-static inline int TYPE(kdev_t x) {
-	return  (minor(x)>>2) & 0x1f;
-}
-static inline int DRIVE(kdev_t x) {
-	return (minor(x)&0x03) | ((minor(x)&0x80) >> 5);
-}
 #define ITYPE(x) (((x)>>2) & 0x1f)
 #define TOMINOR(x) ((x & 3) | ((x & 4) << 5))
 #define UNIT(x) ((x) & 0x03)		/* drive on fdc */
@@ -415,6 +409,8 @@
 static struct floppy_write_errors write_errors[N_DRIVE];
 static struct timer_list motor_off_timer[N_DRIVE];
 static struct gendisk *disks[N_DRIVE];
+static struct block_device *opened_bdev[N_DRIVE];
+static DECLARE_MUTEX(open_lock);
 static struct floppy_raw_cmd *raw_cmd, default_raw_cmd;
 
 /*
@@ -1743,7 +1739,7 @@
 }
 
 /* interrupt handler. Note that this can be called externally on the Sparc */
-void floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	void (*handler)(void) = do_floppy;
 	int do_print;
@@ -1764,7 +1760,7 @@
 		printk("floppy interrupt on bizarre fdc %d\n",fdc);
 		printk("handler=%p\n", handler);
 		is_alive("bizarre fdc");
-		return;
+		return IRQ_NONE;
 	}
 
 	FDCS->reset = 0;
@@ -1797,6 +1793,9 @@
 	} else
 		FDCS->reset = 1;
 	is_alive("normal interrupt end");
+
+	/* FIXME! Was it really for us? */
+	return IRQ_HANDLED;
 }
 
 static void recalibrate_floppy(void)
@@ -2263,10 +2262,9 @@
 	bad_flp_intr,
 	generic_done };
 
-static int do_format(kdev_t device, struct format_descr *tmp_format_req)
+static int do_format(int drive, struct format_descr *tmp_format_req)
 {
 	int ret;
-	int drive=DRIVE(device);
 
 	LOCK_FDC(drive,1);
 	set_floppy(drive);
@@ -2293,7 +2291,7 @@
  * =============================
  */
 
-static inline void end_request(struct request *req, int uptodate)
+static void floppy_end_request(struct request *req, int uptodate)
 {
 	if (end_that_request_first(req, uptodate, current_count_sectors))
 		return;
@@ -2334,7 +2332,7 @@
 
 		/* unlock chained buffers */
 		spin_lock_irqsave(q->queue_lock, flags);
-		end_request(req, 1);
+		floppy_end_request(req, 1);
 		spin_unlock_irqrestore(q->queue_lock, flags);
 	} else {
 		if (rq_data_dir(req) == WRITE) {
@@ -2348,7 +2346,7 @@
 			DRWE->last_error_generation = DRS->generation;
 		}
 		spin_lock_irqsave(q->queue_lock, flags);
-		end_request(req, 0);
+		floppy_end_request(req, 0);
 		spin_unlock_irqrestore(q->queue_lock, flags);
 	}
 }
@@ -3330,25 +3328,21 @@
 	if (type){
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
+		down(&open_lock);
 		LOCK_FDC(drive,1);
-		for (cnt = 0; cnt < N_DRIVE; cnt++){
-			if (ITYPE(drive_state[cnt].fd_device) == type &&
-			    drive_state[cnt].fd_ref)
-				set_bit(drive, &fake_change);
-		}
 		floppy_type[type] = *g;
 		floppy_type[type].name="user format";
 		for (cnt = type << 2; cnt < (type << 2) + 4; cnt++)
 			floppy_sizes[cnt]= floppy_sizes[cnt+0x80]=
 				floppy_type[type].size+1;
 		process_fd_request();
-		for (cnt = 0; cnt < N_DRIVE; cnt++){
-			if (ITYPE(drive_state[cnt].fd_device) == type &&
-			    drive_state[cnt].fd_ref)
-				__check_disk_change(
-					MKDEV(FLOPPY_MAJOR,
-					      drive_state[cnt].fd_device));
+		for (cnt = 0; cnt < N_DRIVE; cnt++) {
+			struct block_device *bdev = opened_bdev[cnt];
+			if (!bdev || ITYPE(drive_state[cnt].fd_device) != type)
+				continue;
+			__invalidate_device(bdev, 0);
 		}
+		up(&open_lock);
 	} else {
 		LOCK_FDC(drive,1);
 		if (cmd != FDDEFPRM)
@@ -3446,8 +3440,8 @@
 #define OUT(c,x) case c: outparam = (const char *) (x); break
 #define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0
 
-	int i,drive,type;
-	kdev_t device;
+	int drive = (long)inode->i_bdev->bd_disk->private_data;
+	int i, type = ITYPE(UDRS->fd_device);
 	int ret;
 	int size;
 	union inparam {
@@ -3458,9 +3452,6 @@
 	} inparam; /* parameters coming from user space */
 	const char *outparam; /* parameters passed back to user space */
 
-	device = inode->i_rdev;
-	type = TYPE(device);
-	drive = DRIVE(device);
 
 	/* convert compatibility eject ioctls into floppy eject ioctl.
 	 * We do this in order to provide a means to eject floppy disks before
@@ -3556,7 +3547,7 @@
 		case FDFMTTRK:
 			if (UDRS->fd_ref != 1)
 				return -EBUSY;
-			return do_format(device, &inparam.f);
+			return do_format(drive, &inparam.f);
 		case FDFMTEND:
 		case FDFLUSH:
 			LOCK_FDC(drive,1);
@@ -3673,15 +3664,19 @@
 
 static int floppy_release(struct inode * inode, struct file * filp)
 {
-	int drive = DRIVE(inode->i_rdev);
+	int drive = (long)inode->i_bdev->bd_disk->private_data;
 
+	down(&open_lock);
 	if (UDRS->fd_ref < 0)
 		UDRS->fd_ref=0;
 	else if (!UDRS->fd_ref--) {
 		DPRINT("floppy_release with fd_ref == 0");
 		UDRS->fd_ref = 0;
 	}
+	if (!UDRS->fd_ref)
+		opened_bdev[drive] = NULL;
 	floppy_release_irq_and_dma();
+	up(&open_lock);
 	return 0;
 }
 
@@ -3690,28 +3685,19 @@
  * /dev/PS0 etc), and disallows simultaneous access to the same
  * drive with different device numbers.
  */
-#define RETERR(x) do{floppy_release(inode,filp); return -(x);}while(0)
-
 static int floppy_open(struct inode * inode, struct file * filp)
 {
-	int drive;
+	int drive = (long)inode->i_bdev->bd_disk->private_data;
 	int old_dev;
 	int try;
+	int res = -EBUSY;
 	char *tmp;
 
 	filp->private_data = (void*) 0;
-
-	drive = DRIVE(inode->i_rdev);
-	if (drive >= N_DRIVE ||
-	    !(allowed_drive_mask & (1 << drive)) ||
-	    fdc_state[FDC(drive)].version == FDC_NONE)
-		return -ENXIO;
-
-	if (TYPE(inode->i_rdev) >= NUMBER(floppy_type))
-		return -ENXIO;
+	down(&open_lock);
 	old_dev = UDRS->fd_device;
-	if (UDRS->fd_ref && old_dev != minor(inode->i_rdev))
-		return -EBUSY;
+	if (opened_bdev[drive] && opened_bdev[drive] != inode->i_bdev)
+		goto out2;
 
 	if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)){
 		USETF(FD_DISK_CHANGED);
@@ -3720,16 +3706,20 @@
 
 	if (UDRS->fd_ref == -1 ||
 	   (UDRS->fd_ref && (filp->f_flags & O_EXCL)))
-		return -EBUSY;
+		goto out2;
 
 	if (floppy_grab_irq_and_dma())
-		return -EBUSY;
+		goto out2;
 
 	if (filp->f_flags & O_EXCL)
 		UDRS->fd_ref = -1;
 	else
 		UDRS->fd_ref++;
 
+	opened_bdev[drive] = inode->i_bdev;
+
+	res = -ENXIO;
+
 	if (!floppy_track_buffer){
 		/* if opening an ED drive, reserve a big buffer,
 		 * else reserve a small one */
@@ -3749,7 +3739,7 @@
 		}
 		if (!tmp && !floppy_track_buffer) {
 			DPRINT("Unable to allocate DMA memory\n");
-			RETERR(ENXIO);
+			goto out;
 		}
 		if (floppy_track_buffer) {
 			if (tmp)
@@ -3766,8 +3756,6 @@
 	if (old_dev != -1 && old_dev != minor(inode->i_rdev)) {
 		if (buffer_drive == drive)
 			buffer_track = -1;
-		/* umm, invalidate_buffers() in ->open??  --hch */
-		invalidate_buffers(mk_kdev(FLOPPY_MAJOR,old_dev));
 	}
 
 	/* Allow ioctls if we have write-permissions even if read-only open.
@@ -3780,18 +3768,30 @@
 	if (UFDCS->rawcmd == 1)
 		UFDCS->rawcmd = 2;
 
-	if (filp->f_flags & O_NDELAY)
-		return 0;
-	if (filp->f_mode & 3) {
-		UDRS->last_checked = 0;
-		check_disk_change(inode->i_bdev);
-		if (UTESTF(FD_DISK_CHANGED))
-			RETERR(ENXIO);
+	if (!filp->f_flags & O_NDELAY) {
+		if (filp->f_mode & 3) {
+			UDRS->last_checked = 0;
+			check_disk_change(inode->i_bdev);
+			if (UTESTF(FD_DISK_CHANGED))
+				goto out;
+		}
+		res = -EROFS;
+		if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE)))
+			goto out;
 	}
-	if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE)))
-		RETERR(EROFS);
+	up(&open_lock);
 	return 0;
-#undef RETERR
+out:
+	if (UDRS->fd_ref < 0)
+		UDRS->fd_ref=0;
+	else
+		UDRS->fd_ref--;
+	if (!UDRS->fd_ref)
+		opened_bdev[drive] = NULL;
+	floppy_release_irq_and_dma();
+out2:
+	up(&open_lock);
+	return res;
 }
 
 /*
@@ -3965,21 +3965,19 @@
 
 static void __init register_devfs_entries (int drive)
 {
-    int base_minor, i;
+	int base_minor = (drive < 4) ? drive : (124 + drive);
 
-    base_minor = (drive < 4) ? drive : (124 + drive);
-    if (UDP->cmos < NUMBER(default_drive_params)) {
-	i = 0;
-	do {
-	    char name[16];
-
-	    sprintf(name, "floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]);
-	    devfs_register(NULL, name, DEVFS_FL_DEFAULT, FLOPPY_MAJOR,
-			    base_minor + (table_sup[UDP->cmos][i] << 2),
-			    S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP,
-			    &floppy_fops, NULL);
-	} while (table_sup[UDP->cmos][i++]);
-    }
+	if (UDP->cmos < NUMBER(default_drive_params)) {
+		int i = 0;
+		do {
+			int minor = base_minor + (table_sup[UDP->cmos][i] << 2);
+
+			devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), 
+					S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP,
+					"floppy/%d%s",
+					drive, table[table_sup[UDP->cmos][i]]);
+		} while (table_sup[UDP->cmos][i++]);
+	}
 }
 
 /*
@@ -4215,6 +4213,8 @@
 	if (drive >= N_DRIVE ||
 	    !(allowed_drive_mask & (1 << drive)) ||
 	    fdc_state[FDC(drive)].version == FDC_NONE)
+		return NULL;
+	if (((*part >> 2) & 0x1f) >= NUMBER(floppy_type))
 		return NULL;
 	*part = 0;
 	return get_disk(disks[drive]);
diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c
--- a/drivers/block/floppy98.c	Thu Apr  3 14:42:27 2003
+++ b/drivers/block/floppy98.c	Thu Apr 24 03:30:41 2003
@@ -318,12 +318,6 @@
 static unsigned long fake_change;
 static int initialising=1;
 
-static inline int TYPE(kdev_t x) {
-	return  (minor(x)>>2) & 0x1f;
-}
-static inline int DRIVE(kdev_t x) {
-	return (minor(x)&0x03) | ((minor(x)&0x80) >> 5);
-}
 #define ITYPE(x) (((x)>>2) & 0x1f)
 #define TOMINOR(x) ((x & 3) | ((x & 4) << 5))
 #define UNIT(x) ((x) & 0x03)		/* drive on fdc */
@@ -450,6 +444,8 @@
 static struct floppy_write_errors write_errors[N_DRIVE];
 static struct timer_list motor_off_timer[N_DRIVE];
 static struct gendisk *disks[N_DRIVE];
+static struct block_device *opened_bdev[N_DRIVE];
+static DECLARE_MUTEX(open_lock);
 static struct floppy_raw_cmd *raw_cmd, default_raw_cmd;
 
 /*
@@ -2318,10 +2314,9 @@
 	bad_flp_intr,
 	generic_done };
 
-static int do_format(kdev_t device, struct format_descr *tmp_format_req)
+static int do_format(int drive, struct format_descr *tmp_format_req)
 {
 	int ret;
-	int drive=DRIVE(device);
 
 	LOCK_FDC(drive,1);
 	set_floppy(drive);
@@ -2348,7 +2343,7 @@
  * =============================
  */
 
-static inline void end_request(struct request *req, int uptodate)
+static void floppy_end_request(struct request *req, int uptodate)
 {
 	if (end_that_request_first(req, uptodate, current_count_sectors))
 		return;
@@ -2389,7 +2384,7 @@
 
 		/* unlock chained buffers */
 		spin_lock_irqsave(q->queue_lock, flags);
-		end_request(req, 1);
+		floppy_end_request(req, 1);
 		spin_unlock_irqrestore(q->queue_lock, flags);
 	} else {
 		if (rq_data_dir(req) == WRITE) {
@@ -2403,7 +2398,7 @@
 			DRWE->last_error_generation = DRS->generation;
 		}
 		spin_lock_irqsave(q->queue_lock, flags);
-		end_request(req, 0);
+		floppy_end_request(req, 0);
 		spin_unlock_irqrestore(q->queue_lock, flags);
 	}
 }
@@ -3385,25 +3380,21 @@
 	if (type){
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
+		down(&open_lock);
 		LOCK_FDC(drive,1);
-		for (cnt = 0; cnt < N_DRIVE; cnt++){
-			if (ITYPE(drive_state[cnt].fd_device) == type &&
-			    drive_state[cnt].fd_ref)
-				set_bit(drive, &fake_change);
-		}
 		floppy_type[type] = *g;
 		floppy_type[type].name="user format";
 		for (cnt = type << 2; cnt < (type << 2) + 4; cnt++)
 			floppy_sizes[cnt]= floppy_sizes[cnt+0x80]=
 				floppy_type[type].size+1;
 		process_fd_request();
-		for (cnt = 0; cnt < N_DRIVE; cnt++){
-			if (ITYPE(drive_state[cnt].fd_device) == type &&
-			    drive_state[cnt].fd_ref)
-				__check_disk_change(
-					MKDEV(FLOPPY_MAJOR,
-					      drive_state[cnt].fd_device));
+		for (cnt = 0; cnt < N_DRIVE; cnt++) {
+			struct block_device *bdev = opened_bdev[cnt];
+			if (!bdev || ITYPE(drive_state[cnt].fd_device) != type)
+				continue;
+			__invalidate_device(bdev, 0);
 		}
+		up(&open_lock);
 	} else {
 		LOCK_FDC(drive,1);
 		if (cmd != FDDEFPRM)
@@ -3501,8 +3492,8 @@
 #define OUT(c,x) case c: outparam = (const char *) (x); break
 #define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0
 
-	int i,drive,type;
-	kdev_t device;
+	int drive = (long)inode->i_bdev->bd_disk->private_data;
+	int i, type = ITYPE(UDRS->fd_device);
 	int ret;
 	int size;
 	union inparam {
@@ -3513,10 +3504,6 @@
 	} inparam; /* parameters coming from user space */
 	const char *outparam; /* parameters passed back to user space */
 
-	device = inode->i_rdev;
-	type = TYPE(device);
-	drive = DRIVE(device);
-
 	/* convert compatibility eject ioctls into floppy eject ioctl.
 	 * We do this in order to provide a means to eject floppy disks before
 	 * installing the new fdutils package */
@@ -3635,7 +3622,7 @@
 		case FDFMTTRK:
 			if (UDRS->fd_ref != 1)
 				return -EBUSY;
-			return do_format(device, &inparam.f);
+			return do_format(drive, &inparam.f);
 		case FDFMTEND:
 		case FDFLUSH:
 			LOCK_FDC(drive,1);
@@ -3751,15 +3738,19 @@
 
 static int floppy_release(struct inode * inode, struct file * filp)
 {
-	int drive = DRIVE(inode->i_rdev);
+	int drive = (long)inode->i_bdev->bd_disk->private_data;
 
+	down(&open_lock);
 	if (UDRS->fd_ref < 0)
 		UDRS->fd_ref=0;
 	else if (!UDRS->fd_ref--) {
 		DPRINT("floppy_release with fd_ref == 0");
 		UDRS->fd_ref = 0;
 	}
+	if (!UDRS->fd_ref)
+		opened_bdev[drive] = NULL;
 	floppy_release_irq_and_dma();
+	up(&open_lock);
 	return 0;
 }
 
@@ -3772,9 +3763,10 @@
 
 static int floppy_open(struct inode * inode, struct file * filp)
 {
-	int drive;
+	int drive = (long)inode->i_bdev->bd_disk->private_data;
 	int old_dev;
 	int try;
+	int res = -EBUSY;
 	char *tmp;
 
 #ifdef PC9800_DEBUG_FLOPPY
@@ -3782,7 +3774,6 @@
 #endif
 	filp->private_data = (void*) 0;
 
-	drive = DRIVE(inode->i_rdev);
 #ifdef PC9800_DEBUG_FLOPPY
 	printk("floppy open: drive=%d, current_drive=%d, UDP->cmos=%d\n"
 		   "floppy open: FDCS={spec1=%d, spec2=%d, dtr=%d, version=%d, dor=%d, address=%lu}\n",
@@ -3797,16 +3788,10 @@
 	}
 #endif /* PC9800_DEBUG_FLOPPY */
 
-	if (drive >= N_DRIVE ||
-	    !(allowed_drive_mask & (1 << drive)) ||
-	    fdc_state[FDC(drive)].version == FDC_NONE)
-		return -ENXIO;
-
-	if (TYPE(inode->i_rdev) >= NUMBER(floppy_type))
-		return -ENXIO;
+	down(&open_lock);
 	old_dev = UDRS->fd_device;
-	if (UDRS->fd_ref && old_dev != minor(inode->i_rdev))
-		return -EBUSY;
+	if (opened_bdev[drive] && opened_bdev[drive] != inode->i_bdev)
+		goto out2;
 
 	if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)){
 		USETF(FD_DISK_CHANGED);
@@ -3815,16 +3800,20 @@
 
 	if (UDRS->fd_ref == -1 ||
 	   (UDRS->fd_ref && (filp->f_flags & O_EXCL)))
-		return -EBUSY;
+		goto out2;
 
 	if (floppy_grab_irq_and_dma())
-		return -EBUSY;
+		goto out2;
 
 	if (filp->f_flags & O_EXCL)
 		UDRS->fd_ref = -1;
 	else
 		UDRS->fd_ref++;
 
+	opened_bdev[drive] = inode->i_bdev;
+
+	res = -ENXIO;
+
 	if (!floppy_track_buffer){
 		/* if opening an ED drive, reserve a big buffer,
 		 * else reserve a small one */
@@ -3844,7 +3833,7 @@
 		}
 		if (!tmp && !floppy_track_buffer) {
 			DPRINT("Unable to allocate DMA memory\n");
-			RETERR(ENXIO);
+			goto out;
 		}
 		if (floppy_track_buffer) {
 			if (tmp)
@@ -3861,8 +3850,6 @@
 	if (old_dev != -1 && old_dev != minor(inode->i_rdev)) {
 		if (buffer_drive == drive)
 			buffer_track = -1;
-		/* umm, invalidate_buffers() in ->open??  --hch */
-		invalidate_buffers(mk_kdev(FLOPPY_MAJOR,old_dev));
 	}
 
 #ifdef PC9800_DEBUG_FLOPPY
@@ -3884,22 +3871,33 @@
 	printk("floppy open: floppy.c:%d passed\n", __LINE__);
 #endif
 
-	if (filp->f_flags & O_NDELAY)
-		return 0;
-	if (filp->f_mode & 3) {
-		UDRS->last_checked = 0;
-		check_disk_change(inode->i_bdev);
-		if (UTESTF(FD_DISK_CHANGED))
-			RETERR(ENXIO);
-	}
-	if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE)))
-		RETERR(EROFS);
+	if (!(filp->f_flags & O_NDELAY)) {
+		if (filp->f_mode & 3) {
+			UDRS->last_checked = 0;
+			check_disk_change(inode->i_bdev);
+			if (UTESTF(FD_DISK_CHANGED))
+				goto out;
+		}
+		res = -EROFS;
+		if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE)))
+			goto out;
 #ifdef PC9800_DEBUG_FLOPPY
-	printk("floppy open: end normally\n");
+		printk("floppy open: end normally\n");
 #endif
-
+	}
+	up(&open_lock);
 	return 0;
-#undef RETERR
+out:
+	if (UDRS->fd_ref < 0)
+		UDRS->fd_ref=0;
+	else
+		UDRS->fd_ref--;
+	if (!UDRS->fd_ref)
+		opened_bdev[drive] = NULL;
+	floppy_release_irq_and_dma();
+out2:
+	up(&open_lock);
+	return res;
 }
 
 /*
@@ -4084,21 +4082,19 @@
 
 static void __init register_devfs_entries (int drive)
 {
-    int base_minor, i;
+	int base_minor = (drive < 4) ? drive : (124 + drive);
 
-    base_minor = (drive < 4) ? drive : (124 + drive);
-    if (UDP->cmos < NUMBER(default_drive_params)) {
-	i = 0;
-	do {
-	    char name[16];
-
-	    sprintf(name, "floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]);
-	    devfs_register(NULL, name, DEVFS_FL_DEFAULT, FLOPPY_MAJOR,
-			    base_minor + (table_sup[UDP->cmos][i] << 2),
-			    S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP,
-			    &floppy_fops, NULL);
-	} while (table_sup[UDP->cmos][i++]);
-    }
+	if (UDP->cmos < NUMBER(default_drive_params)) {
+		int i = 0;
+		do {
+			int minor = base_minor + (table_sup[UDP->cmos][i] << 2);
+
+			devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), 
+					S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP,
+					"floppy/%d%s",
+					drive, table[table_sup[UDP->cmos][i]]);
+		} while (table_sup[UDP->cmos][i++]);
+	}
 }
 
 /*
@@ -4256,6 +4252,8 @@
 	if (drive >= N_DRIVE ||
 	    !(allowed_drive_mask & (1 << drive)) ||
 	    fdc_state[FDC(drive)].version == FDC_NONE)
+		return NULL;
+	if (((*part>>2) & 0x1f) >= NUMBER(floppy_type))
 		return NULL;
 	return get_disk(disks[drive]);
 }
diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c
--- a/drivers/block/genhd.c	Fri Apr  4 17:15:46 2003
+++ b/drivers/block/genhd.c	Wed Apr 23 03:13:03 2003
@@ -365,11 +365,13 @@
 		(unsigned long long)get_capacity(sgp) >> 1,
 		disk_name(sgp, 0, buf));
 	for (n = 0; n < sgp->minors - 1; n++) {
-		if (sgp->part[n].nr_sects == 0)
+		if (!sgp->part[n])
+			continue;
+		if (sgp->part[n]->nr_sects == 0)
 			continue;
 		seq_printf(part, "%4d  %4d %10llu %s\n",
 			sgp->major, n + 1 + sgp->first_minor,
-			(unsigned long long)sgp->part[n].nr_sects >> 1 ,
+			(unsigned long long)sgp->part[n]->nr_sects >> 1 ,
 			disk_name(sgp, n + 1, buf));
 	}
 
@@ -542,6 +544,92 @@
 static decl_subsys(block, &ktype_block, &block_hotplug_ops);
 
 
+/*
+ * aggregate disk stat collector.  Uses the same stats that the sysfs
+ * entries do, above, but makes them available through one seq_file.
+ * Watching a few disks may be efficient through sysfs, but watching
+ * all of them will be more efficient through this interface.
+ *
+ * The output looks suspiciously like /proc/partitions with a bunch of
+ * extra fields.
+ */
+
+/* iterator */
+static void *diskstats_start(struct seq_file *part, loff_t *pos)
+{
+	loff_t k = *pos;
+	struct list_head *p;
+
+	down_read(&block_subsys.rwsem);
+	list_for_each(p, &block_subsys.kset.list)
+		if (!k--)
+			return list_entry(p, struct gendisk, kobj.entry);
+	return NULL;
+}
+
+static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos)
+{
+	struct list_head *p = ((struct gendisk *)v)->kobj.entry.next;
+	++*pos;
+	return p==&block_subsys.kset.list ? NULL :
+		list_entry(p, struct gendisk, kobj.entry);
+}
+
+static void diskstats_stop(struct seq_file *part, void *v)
+{
+	up_read(&block_subsys.rwsem);
+}
+
+static int diskstats_show(struct seq_file *s, void *v)
+{
+	struct gendisk *gp = v;
+	char buf[64];
+	int n = 0;
+
+	/*
+	if (&sgp->kobj.entry == block_subsys.kset.list.next)
+		seq_puts(s,	"major minor name"
+				"     rio rmerge rsect ruse wio wmerge "
+				"wsect wuse running use aveq"
+				"\n\n");
+	*/
+ 
+	disk_round_stats(gp);
+	seq_printf(s, "%4d %4d %s %u %u %llu %u %u %u %llu %u %u %u %u\n",
+		gp->major, n + gp->first_minor, disk_name(gp, n, buf),
+		disk_stat_read(gp, reads), disk_stat_read(gp, read_merges),
+		(unsigned long long)disk_stat_read(gp, read_sectors),
+		jiffies_to_msec(disk_stat_read(gp, read_ticks)),
+		disk_stat_read(gp, writes), disk_stat_read(gp, write_merges),
+		(unsigned long long)disk_stat_read(gp, write_sectors),
+		jiffies_to_msec(disk_stat_read(gp, write_ticks)),
+		disk_stat_read(gp, in_flight),
+		jiffies_to_msec(disk_stat_read(gp, io_ticks)),
+		jiffies_to_msec(disk_stat_read(gp, time_in_queue)));
+
+	/* now show all non-0 size partitions of it */
+	for (n = 0; n < gp->minors - 1; n++) {
+		struct hd_struct *hd = gp->part[n];
+
+		if (hd && hd->nr_sects)
+			seq_printf(s, "%4d %4d %s %u %u %u %u\n",
+				gp->major, n + gp->first_minor + 1,
+				disk_name(gp, n + 1, buf),
+				hd->reads, hd->read_sectors,
+				hd->writes, hd->write_sectors);
+	}
+ 
+	return 0;
+}
+
+struct seq_operations diskstats_op = {
+	.start	= diskstats_start,
+	.next	= diskstats_next,
+	.stop	= diskstats_stop,
+	.show	= diskstats_show
+};
+
+
 struct gendisk *alloc_disk(int minors)
 {
 	struct gendisk *disk = kmalloc(sizeof(struct gendisk), GFP_KERNEL);
@@ -552,7 +640,7 @@
 			return NULL;
 		}
 		if (minors > 1) {
-			int size = (minors - 1) * sizeof(struct hd_struct);
+			int size = (minors - 1) * sizeof(struct hd_struct *);
 			disk->part = kmalloc(size, GFP_KERNEL);
 			if (!disk->part) {
 				kfree(disk);
@@ -604,8 +692,8 @@
 	struct gendisk *disk = bdev->bd_disk;
 	if (bdev->bd_contains != bdev) {
 		int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor);
-		struct hd_struct *p = &disk->part[part-1];
-		p->policy = flag;
+		struct hd_struct *p = disk->part[part-1];
+		if (p) p->policy = flag;
 	} else
 		disk->policy = flag;
 }
@@ -615,7 +703,7 @@
 	int i;
 	disk->policy = flag;
 	for (i = 0; i < disk->minors - 1; i++)
-		disk->part[i].policy = flag;
+		if (disk->part[i]) disk->part[i]->policy = flag;
 }
 
 int bdev_read_only(struct block_device *bdev)
@@ -626,8 +714,9 @@
 	disk = bdev->bd_disk;
 	if (bdev->bd_contains != bdev) {
 		int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor);
-		struct hd_struct *p = &disk->part[part-1];
-		return p->policy;
+		struct hd_struct *p = disk->part[part-1];
+		if (p) return p->policy;
+		return 0;
 	} else
 		return disk->policy;
 }
diff -Nru a/drivers/block/initrd.c b/drivers/block/initrd.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/block/initrd.c	Sun Apr 20 20:11:06 2003
@@ -0,0 +1,100 @@
+
+#include <linux/blkdev.h>
+#include <linux/genhd.h>
+#include <linux/initrd.h>
+#include <linux/init.h>
+#include <linux/major.h>
+#include <linux/module.h>
+#include <linux/spinlock.h>
+#include <asm/uaccess.h>
+
+
+unsigned long initrd_start, initrd_end;
+int initrd_below_start_ok;
+
+static int initrd_users;
+static spinlock_t initrd_users_lock = SPIN_LOCK_UNLOCKED;
+
+static struct gendisk *initrd_disk;
+
+static ssize_t initrd_read(struct file *file, char *buf,
+			   size_t count, loff_t *ppos)
+{
+	int left = initrd_end - initrd_start - *ppos;
+
+	if (count > left)
+		count = left;
+	if (count == 0)
+		return 0;
+	if (copy_to_user(buf, (char *)initrd_start + *ppos, count))
+		return -EFAULT;
+
+	*ppos += count;
+	return count;
+}
+
+static int initrd_release(struct inode *inode,struct file *file)
+{
+
+	blkdev_put(inode->i_bdev, BDEV_FILE);
+
+	spin_lock(&initrd_users_lock);
+	if (!--initrd_users) {
+		spin_unlock(&initrd_users_lock);
+		del_gendisk(initrd_disk);
+		free_initrd_mem(initrd_start, initrd_end);
+		initrd_start = 0;
+	} else
+		spin_unlock(&initrd_users_lock);
+
+	return 0;
+}
+
+static struct file_operations initrd_fops = {
+	.read =		initrd_read,
+	.release =	initrd_release,
+};
+
+static int initrd_open(struct inode *inode, struct file *filp)
+{
+	if (!initrd_start) 
+		return -ENODEV;
+
+	spin_lock(&initrd_users_lock);
+	initrd_users++;
+	spin_unlock(&initrd_users_lock);
+
+	filp->f_op = &initrd_fops;
+	return 0;
+}
+
+static struct block_device_operations initrd_bdops = {
+	.owner =	THIS_MODULE,
+	.open =		initrd_open,
+};
+
+static int __init initrd_init(void)
+{
+	initrd_disk = alloc_disk(1);
+	if (!initrd_disk)
+		return -ENOMEM;
+
+	initrd_disk->major = RAMDISK_MAJOR;
+	initrd_disk->first_minor = INITRD_MINOR;
+	initrd_disk->fops = &initrd_bdops;	
+
+	sprintf(initrd_disk->disk_name, "initrd");
+	sprintf(initrd_disk->devfs_name, "rd/initrd");
+
+	set_capacity(initrd_disk, (initrd_end-initrd_start+511) >> 9);
+	add_disk(initrd_disk);
+	return 0;
+}
+
+static void __exit initrd_exit(void)
+{
+	put_disk(initrd_disk);
+}
+
+module_init(initrd_init);
+module_exit(initrd_exit);
diff -Nru a/drivers/block/ioctl.c b/drivers/block/ioctl.c
--- a/drivers/block/ioctl.c	Sun Jan 12 06:10:40 2003
+++ b/drivers/block/ioctl.c	Sat Apr 19 23:22:49 2003
@@ -41,11 +41,14 @@
 					return -EINVAL;
 			}
 			/* partition number in use? */
-			if (disk->part[part - 1].nr_sects != 0)
+			if (disk->part[part - 1])
 				return -EBUSY;
 			/* overlap? */
 			for (i = 0; i < disk->minors - 1; i++) {
-				struct hd_struct *s = &disk->part[i];
+				struct hd_struct *s = disk->part[i];
+
+				if (!s)
+					continue;
 				if (!(start+length <= s->start_sect ||
 				      start >= s->start_sect + s->nr_sects))
 					return -EBUSY;
@@ -54,7 +57,9 @@
 			add_partition(disk, part, start, length);
 			return 0;
 		case BLKPG_DEL_PARTITION:
-			if (disk->part[part - 1].nr_sects == 0)
+			if (!disk->part[part-1])
+				return -ENXIO;
+			if (disk->part[part - 1]->nr_sects == 0)
 				return -ENXIO;
 			/* partition in use? Incomplete check for now. */
 			bdevp = bdget(MKDEV(disk->major, disk->first_minor) + part);
diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
--- a/drivers/block/ll_rw_blk.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/ll_rw_blk.c	Thu Apr 24 03:23:09 2003
@@ -1078,10 +1078,14 @@
  * blk_run_queue - run a single device queue
  * @q	The queue to run
  */
-void __blk_run_queue(request_queue_t *q)
+void blk_run_queue(struct request_queue *q)
 {
+	unsigned long flags;
+
+	spin_lock_irqsave(q->queue_lock, flags);
 	blk_remove_plug(q);
 	q->request_fn(q);
+	spin_unlock_irqrestore(q->queue_lock, flags);
 }
 
 /**
@@ -1841,7 +1845,7 @@
 	if (bdev == bdev->bd_contains)
 		return;
 
-	p = &disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1];
+	p = disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1];
 	switch (bio->bi_rw) {
 	case READ:
 		p->read_sectors += bio_sectors(bio);
@@ -2160,8 +2164,7 @@
 void end_that_request_last(struct request *req)
 {
 	struct gendisk *disk = req->rq_disk;
-	if (req->waiting)
-		complete(req->waiting);
+	struct completion *waiting = req->waiting;
 
 	if (disk) {
 		unsigned long duration = jiffies - req->start_time;
@@ -2179,6 +2182,33 @@
 		disk_stat_dec(disk, in_flight);
 	}
 	__blk_put_request(req->q, req);
+	/* Do this LAST! The structure may be freed immediately afterwards */
+	if (waiting)
+		complete(waiting);
+}
+
+void end_request(struct request *req, int uptodate)
+{
+	if (!end_that_request_first(req, uptodate, req->hard_cur_sectors)) {
+		add_disk_randomness(req->rq_disk);
+		blkdev_dequeue_request(req);
+		end_that_request_last(req);
+	}
+}
+
+void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio)
+{
+	/* first three bits are identical in rq->flags and bio->bi_rw */
+	rq->flags |= (bio->bi_rw & 7);
+
+	rq->nr_phys_segments = bio_phys_segments(q, bio);
+	rq->nr_hw_segments = bio_hw_segments(q, bio);
+	rq->current_nr_sectors = bio_cur_sectors(bio);
+	rq->hard_cur_sectors = rq->current_nr_sectors;
+	rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio);
+	rq->buffer = bio_data(bio);
+
+	rq->bio = rq->biotail = bio;
 }
 
 int __init blk_dev_init(void)
@@ -2223,6 +2253,7 @@
 EXPORT_SYMBOL(end_that_request_first);
 EXPORT_SYMBOL(end_that_request_chunk);
 EXPORT_SYMBOL(end_that_request_last);
+EXPORT_SYMBOL(end_request);
 EXPORT_SYMBOL(blk_init_queue);
 EXPORT_SYMBOL(blk_cleanup_queue);
 EXPORT_SYMBOL(blk_queue_make_request);
@@ -2267,5 +2298,7 @@
 EXPORT_SYMBOL(blk_start_queue);
 EXPORT_SYMBOL(blk_stop_queue);
 EXPORT_SYMBOL(__blk_stop_queue);
-EXPORT_SYMBOL(__blk_run_queue);
+EXPORT_SYMBOL(blk_run_queue);
 EXPORT_SYMBOL(blk_run_queues);
+
+EXPORT_SYMBOL(blk_rq_bio_prep);
diff -Nru a/drivers/block/loop.c b/drivers/block/loop.c
--- a/drivers/block/loop.c	Fri Apr 18 17:08:13 2003
+++ b/drivers/block/loop.c	Sat Apr 19 14:18:27 2003
@@ -1143,7 +1143,6 @@
 	}
 
 	for (i = 0; i < max_loop; i++) {
-		char name[16];
 		struct loop_device *lo = &loop_dev[i];
 		struct gendisk *disk = disks[i];
 		memset(lo, 0, sizeof(*lo));
@@ -1156,14 +1155,10 @@
 		disk->first_minor = i;
 		disk->fops = &lo_fops;
 		sprintf(disk->disk_name, "loop%d", i);
+		sprintf(disk->devfs_name, "loop/%d", i);
 		disk->private_data = lo;
 		disk->queue = &lo->lo_queue;
 		add_disk(disk);
-		sprintf(name, "loop/%d", i);
-		devfs_register(NULL, name, DEVFS_FL_DEFAULT,
-			      disk->major, disk->first_minor,
-			      S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP,
-			      disk->fops, NULL);
 	}
 	printk(KERN_INFO "loop: loaded (max %d devices)\n", max_loop);
 	return 0;
@@ -1184,7 +1179,6 @@
 	for (i = 0; i < max_loop; i++) {
 		del_gendisk(disks[i]);
 		put_disk(disks[i]);
-		devfs_remove("loop/%d", i);
 	}
 	devfs_remove("loop");
 	if (unregister_blkdev(LOOP_MAJOR, "loop"))
diff -Nru a/drivers/block/nbd.c b/drivers/block/nbd.c
--- a/drivers/block/nbd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/nbd.c	Sat Apr 19 14:18:27 2003
@@ -568,7 +568,6 @@
 	devfs_mk_dir("nbd");
 	for (i = 0; i < MAX_NBD; i++) {
 		struct gendisk *disk = nbd_dev[i].disk;
-		char name[16];
 		nbd_dev[i].refcnt = 0;
 		nbd_dev[i].file = NULL;
 		nbd_dev[i].magic = LO_MAGIC;
@@ -585,13 +584,9 @@
 		disk->private_data = &nbd_dev[i];
 		disk->queue = &nbd_queue;
 		sprintf(disk->disk_name, "nbd%d", i);
+		sprintf(disk->devfs_name, "nbd/%d", i);
 		set_capacity(disk, 0x3ffffe);
 		add_disk(disk);
-		sprintf(name, "nbd/%d", i);
-		devfs_register(NULL, name, DEVFS_FL_DEFAULT,
-			       disk->major, disk->first_minor,
-			       S_IFBLK | S_IRUSR | S_IWUSR,
-			       disk->fops, NULL);
 	}
 
 	return 0;
@@ -607,7 +602,6 @@
 	for (i = 0; i < MAX_NBD; i++) {
 		del_gendisk(nbd_dev[i].disk);
 		put_disk(nbd_dev[i].disk);
-		devfs_remove("nbd/%d", i);
 	}
 	devfs_remove("nbd");
 	blk_cleanup_queue(&nbd_queue);
diff -Nru a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
--- a/drivers/block/paride/pcd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/paride/pcd.c	Thu Apr 24 05:17:29 2003
@@ -761,7 +761,7 @@
 
 static inline void next_request(int success)
 {
-	long saved_flags;
+	unsigned long saved_flags;
 
 	spin_lock_irqsave(&pcd_lock, saved_flags);
 	end_request(pcd_req, success);
diff -Nru a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
--- a/drivers/block/paride/pd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/paride/pd.c	Thu Apr 24 05:17:29 2003
@@ -757,7 +757,7 @@
 
 static int pd_next_buf(void)
 {
-	long saved_flags;
+	unsigned long saved_flags;
 
 	pd_count--;
 	pd_run--;
@@ -777,7 +777,7 @@
 
 static inline void next_request(int success)
 {
-	long saved_flags;
+	unsigned long saved_flags;
 
 	spin_lock_irqsave(&pd_lock, saved_flags);
 	end_request(pd_req, success);
diff -Nru a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
--- a/drivers/block/paride/pf.c	Mon Apr  7 02:02:18 2003
+++ b/drivers/block/paride/pf.c	Thu Apr 24 05:17:29 2003
@@ -812,7 +812,7 @@
 
 static int pf_next_buf(void)
 {
-	long saved_flags;
+	unsigned long saved_flags;
 
 	pf_count--;
 	pf_run--;
@@ -832,7 +832,8 @@
 
 static inline void next_request(int success)
 {
-	long saved_flags;
+	unsigned long saved_flags;
+
 	spin_lock_irqsave(&pf_spin_lock, saved_flags);
 	end_request(pf_req, success);
 	pf_busy = 0;
diff -Nru a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
--- a/drivers/block/paride/pt.c	Sat Mar 22 07:38:04 2003
+++ b/drivers/block/paride/pt.c	Thu Apr 24 03:30:41 2003
@@ -661,8 +661,6 @@
 	int unit;
 	struct mtop mtop;
 
-        if (!inode || kdev_none(inode->i_rdev))
-		return -EINVAL;
         unit = DEVICE_NR(inode->i_rdev);
         if (unit >= PT_UNITS)
 		return -EINVAL;
diff -Nru a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
--- a/drivers/block/ps2esdi.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/ps2esdi.c	Thu Apr 24 05:25:35 2003
@@ -77,7 +77,7 @@
 
 static void ps2esdi_prep_dma(char *buffer, u_short length, u_char dma_xmode);
 
-static void ps2esdi_interrupt_handler(int irq, void *dev_id,
+static irqreturn_t ps2esdi_interrupt_handler(int irq, void *dev_id,
 				      struct pt_regs *regs);
 static void (*current_int_handler) (u_int) = NULL;
 static void ps2esdi_normal_interrupt_handler(u_int);
@@ -613,18 +613,21 @@
 static int ps2esdi_out_cmd_blk(u_short * cmd_blk)
 {
 
-	int i, j;
+	int i;
+	unsigned long jif;
 	u_char status;
 
 	/* enable interrupts */
 	outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
 
 	/* do not write to the controller, if it is busy */
-	for (i = jiffies + ESDI_STAT_TIMEOUT; time_after(i, jiffies) && (inb(ESDI_STATUS) &
-							  STATUS_BUSY););
+	for (jif = jiffies + ESDI_STAT_TIMEOUT;
+		time_after(jif, jiffies) &&
+			(inb(ESDI_STATUS) & STATUS_BUSY); )
+		;
 
 #if 0
-	printk("%s: i(1)=%d\n", DEVICE_NAME, i);
+	printk("%s: i(1)=%ld\n", DEVICE_NAME, jif);
 #endif
 
 	/* if device is still busy - then just time out */
@@ -642,8 +645,8 @@
 	/* one by one send each word out */
 	for (i = (((*cmd_blk) >> 14) + 1) << 1; i; i--) {
 		status = inb(ESDI_STATUS);
-		for (j = jiffies + ESDI_STAT_TIMEOUT;
-		     time_after(j, jiffies) && (status & STATUS_BUSY) &&
+		for (jif = jiffies + ESDI_STAT_TIMEOUT;
+		     time_after(jif, jiffies) && (status & STATUS_BUSY) &&
 		   (status & STATUS_CMD_INF); status = inb(ESDI_STATUS));
 		if ((status & (STATUS_BUSY | STATUS_CMD_INF)) == STATUS_BUSY) {
 #if 0
@@ -681,7 +684,7 @@
 
 
 
-static void ps2esdi_interrupt_handler(int irq, void *dev_id,
+static irqreturn_t ps2esdi_interrupt_handler(int irq, void *dev_id,
 				      struct pt_regs *regs)
 {
 	u_int int_ret_code;
@@ -695,8 +698,9 @@
 		} else
 			printk("%s: help ! No interrupt handler.\n", DEVICE_NAME);
 	} else {
-		return;
+		return IRQ_NONE;
 	}
+	return IRQ_HANDLED;
 }
 
 static void ps2esdi_initial_reset_int_handler(u_int int_ret_code)
diff -Nru a/drivers/block/rd.c b/drivers/block/rd.c
--- a/drivers/block/rd.c	Sat Mar 22 07:38:05 2003
+++ b/drivers/block/rd.c	Sun Apr 20 16:29:25 2003
@@ -50,22 +50,18 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/devfs_fs_kernel.h>
+#include <linux/pagemap.h>
+#include <linux/blkdev.h>
+#include <linux/genhd.h>
+#include <linux/bio.h>
 #include <linux/buffer_head.h>		/* for invalidate_bdev() */
 #include <linux/backing-dev.h>
-#include <linux/blk.h>
 #include <linux/blkpg.h>
 #include <asm/uaccess.h>
 
 /* The RAM disk size is now a parameter */
 #define NUM_RAMDISKS 16		/* This cannot be overridden (yet) */ 
 
-#ifdef CONFIG_BLK_DEV_INITRD
-static int initrd_users;
-static spinlock_t initrd_users_lock = SPIN_LOCK_UNLOCKED;
-unsigned long initrd_start, initrd_end;
-int initrd_below_start_ok;
-#endif
-
 /* Various static variables go here.  Most are used only in the RAM disk code.
  */
 
@@ -265,53 +261,6 @@
 	return error;
 }
 
-
-#ifdef CONFIG_BLK_DEV_INITRD
-
-static struct block_device_operations rd_bd_op;
-static struct gendisk *initrd_disk;
-
-static ssize_t initrd_read(struct file *file, char *buf,
-			   size_t count, loff_t *ppos)
-{
-	int left;
-
-	left = initrd_end - initrd_start - *ppos;
-	if (count > left) count = left;
-	if (count == 0) return 0;
-	if (copy_to_user(buf, (char *)initrd_start + *ppos, count))
-		return -EFAULT;
-	*ppos += count;
-	return count;
-}
-
-
-static int initrd_release(struct inode *inode,struct file *file)
-{
-	extern void free_initrd_mem(unsigned long, unsigned long);
-
-	blkdev_put(inode->i_bdev, BDEV_FILE);
-
-	spin_lock(&initrd_users_lock);
-	if (!--initrd_users) {
-		spin_unlock(&initrd_users_lock);
-		del_gendisk(initrd_disk);
-		free_initrd_mem(initrd_start, initrd_end);
-		initrd_start = 0;
-	} else {
-		spin_unlock(&initrd_users_lock);
-	}
-	return 0;
-}
-
-
-static struct file_operations initrd_fops = {
-	.read =		initrd_read,
-	.release =	initrd_release,
-};
-
-#endif
-
 static struct backing_dev_info rd_backing_dev_info = {
 	.ra_pages	= 0,	/* No readahead */
 	.memory_backed	= 1,	/* Does not contribute to dirty memory */
@@ -321,18 +270,6 @@
 {
 	int unit = minor(inode->i_rdev);
 
-#ifdef CONFIG_BLK_DEV_INITRD
-	if (unit == INITRD_MINOR) {
-		spin_lock(&initrd_users_lock);
-		initrd_users++;
-		spin_unlock(&initrd_users_lock);
-		if (!initrd_start) 
-			return -ENODEV;
-		filp->f_op = &initrd_fops;
-		return 0;
-	}
-#endif
-
 	/*
 	 * Immunize device against invalidate_buffers() and prune_icache().
 	 */
@@ -370,12 +307,8 @@
 		}
 		del_gendisk(rd_disks[i]);
 		put_disk(rd_disks[i]);
-		devfs_remove("rd/%d", i);
 	}
-#ifdef CONFIG_BLK_DEV_INITRD
-	put_disk(initrd_disk);
-	devfs_remove("rd/initrd");
-#endif
+
 	devfs_remove("rd");
 	unregister_blkdev(RAMDISK_MAJOR, "ramdisk" );
 }
@@ -394,15 +327,6 @@
 		rd_blocksize = BLOCK_SIZE;
 	}
 
-#ifdef CONFIG_BLK_DEV_INITRD
-	initrd_disk = alloc_disk(1);
-	if (!initrd_disk)
-		return -ENOMEM;
-	initrd_disk->major = RAMDISK_MAJOR;
-	initrd_disk->first_minor = INITRD_MINOR;
-	initrd_disk->fops = &rd_bd_op;	
-	sprintf(initrd_disk->disk_name, "initrd");
-#endif
 	for (i = 0; i < NUM_RAMDISKS; i++) {
 		rd_disks[i] = alloc_disk(1);
 		if (!rd_disks[i])
@@ -420,31 +344,17 @@
 
 	for (i = 0; i < NUM_RAMDISKS; i++) {
 		struct gendisk *disk = rd_disks[i];
-		char name[16];
+
 		/* rd_size is given in kB */
 		disk->major = RAMDISK_MAJOR;
 		disk->first_minor = i;
 		disk->fops = &rd_bd_op;
 		disk->queue = &rd_queue;
 		sprintf(disk->disk_name, "ram%d", i);
+		sprintf(disk->devfs_name, "rd/%d", i);
 		set_capacity(disk, rd_size * 2);
-		sprintf(name, "rd/%d", i);
-		devfs_register(NULL, name, DEVFS_FL_DEFAULT,
-			       disk->major, disk->first_minor,
-			       S_IFBLK | S_IRUSR | S_IWUSR,
-			       disk->fops, NULL);
-	}
-
-	for (i = 0; i < NUM_RAMDISKS; i++)
 		add_disk(rd_disks[i]);
-
-#ifdef CONFIG_BLK_DEV_INITRD
-	/* We ought to separate initrd operations here */
-	set_capacity(initrd_disk, (initrd_end-initrd_start+511)>>9);
-	add_disk(initrd_disk);
-	devfs_register(NULL, "rd/initrd", DEVFS_FL_DEFAULT, RAMDISK_MAJOR,
-			INITRD_MINOR, S_IFBLK | S_IRUSR, &rd_bd_op, NULL);
-#endif
+	}
 
 	/* rd_size is given in kB */
 	printk("RAMDISK driver initialized: "
@@ -455,9 +365,6 @@
 out:
 	while (i--)
 		put_disk(rd_disks[i]);
-#ifdef CONFIG_BLK_DEV_INITRD
-	put_disk(initrd_disk);
-#endif
 	return err;
 }
 
diff -Nru a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
--- a/drivers/block/scsi_ioctl.c	Wed Mar 26 01:44:50 2003
+++ b/drivers/block/scsi_ioctl.c	Thu Apr 24 10:36:15 2003
@@ -183,9 +183,11 @@
 		}
 
 		uaddr = (unsigned long) hdr.dxferp;
-		if (writing && !access_ok(VERIFY_WRITE, uaddr, bytes))
+		/* writing to device -> reading from vm */
+		if (writing && !access_ok(VERIFY_READ, uaddr, bytes))
 			return -EFAULT;
-		else if (reading && !access_ok(VERIFY_READ, uaddr, bytes))
+		/* reading from device -> writing to vm */
+		else if (reading && !access_ok(VERIFY_WRITE, uaddr, bytes))
 			return -EFAULT;
 
 		/*
@@ -193,18 +195,6 @@
 		 * be a write to vm.
 		 */
 		bio = bio_map_user(bdev, uaddr, hdr.dxfer_len, reading);
-		if (bio) {
-			if (writing)
-				bio->bi_rw |= (1 << BIO_RW);
-
-			nr_sectors = (bio->bi_size + 511) >> 9;
-
-			if (bio->bi_size < hdr.dxfer_len) {
-				bio_endio(bio, bio->bi_size, 0);
-				bio_unmap_user(bio, 0);
-				bio = NULL;
-			}
-		}
 
 		/*
 		 * if bio setup failed, fall back to slow approach
@@ -243,21 +233,10 @@
 	rq->hard_nr_sectors = rq->nr_sectors = nr_sectors;
 	rq->hard_cur_sectors = rq->current_nr_sectors = nr_sectors;
 
-	if (bio) {
-		/*
-		 * subtle -- if bio_map_user() ended up bouncing a bio, it
-		 * would normally disappear when its bi_end_io is run.
-		 * however, we need it for the unmap, so grab an extra
-		 * reference to it
-		 */
-		bio_get(bio);
+	rq->bio = rq->biotail = bio;
 
-		rq->nr_phys_segments = bio_phys_segments(q, bio);
-		rq->nr_hw_segments = bio_hw_segments(q, bio);
-		rq->current_nr_sectors = bio_cur_sectors(bio);
-		rq->hard_cur_sectors = rq->current_nr_sectors;
-		rq->buffer = bio_data(bio);
-	}
+	if (bio)
+		blk_rq_bio_prep(q, rq, bio);
 
 	rq->data_len = hdr.dxfer_len;
 	rq->data = buffer;
@@ -268,8 +247,6 @@
 	if (!rq->timeout)
 		rq->timeout = BLK_DEFAULT_TIMEOUT;
 
-	rq->bio = rq->biotail = bio;
-
 	start_time = jiffies;
 
 	/* ignore return value. All information is passed back to caller
@@ -277,11 +254,9 @@
 	 * N.B. a non-zero SCSI status is _not_ necessarily an error.
 	 */
 	blk_do_rq(q, bdev, rq);
-	
-	if (bio) {
+
+	if (bio)
 		bio_unmap_user(bio, reading);
-		bio_put(bio);
-	}
 
 	/* write to all output members */
 	hdr.status = rq->errors;	
diff -Nru a/drivers/block/swim3.c b/drivers/block/swim3.c
--- a/drivers/block/swim3.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/swim3.c	Sat Apr 19 14:18:27 2003
@@ -971,15 +971,13 @@
 	.revalidate_disk= floppy_revalidate,
 };
 
-static devfs_handle_t floppy_devfs_handle;
-
 int swim3_init(void)
 {
 	struct device_node *swim;
 	int err = -ENOMEM;
 	int i;
 
-	floppy_devfs_handle = devfs_mk_dir("floppy");
+	devfs_mk_dir("floppy");
 
 	swim = find_devices("floppy");
 	while (swim && (floppy_count < MAX_FLOPPIES))
@@ -1017,6 +1015,7 @@
 		disk->private_data = &floppy_states[i];
 		disk->queue = &swim3_queue;
 		sprintf(disk->disk_name, "fd%d", i);
+		sprintf(disk->devfs_name, "floppy/%d", i);
 		set_capacity(disk, 2880);
 		add_disk(disk);
 	}
@@ -1033,8 +1032,6 @@
 {
 	struct device_node *mediabay;
 	struct floppy_state *fs = &floppy_states[floppy_count];
-	char floppy_name[16];
-	devfs_handle_t floppy_handle;
 
 	if (swim->n_addrs < 2)
 	{
@@ -1095,12 +1092,6 @@
 
 	printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count,
 		mediabay ? "in media bay" : "");
-
-	sprintf(floppy_name, "floppy/%d", floppy_count);
-	floppy_handle = devfs_register(NULL, floppy_name, 
-			DEVFS_FL_DEFAULT, FLOPPY_MAJOR, floppy_count, 
-			S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP, 
-			&floppy_fops, NULL);
 
 	floppy_count++;
 	
diff -Nru a/drivers/block/umem.c b/drivers/block/umem.c
--- a/drivers/block/umem.c	Sat Mar 22 07:38:05 2003
+++ b/drivers/block/umem.c	Mon Apr 21 01:32:33 2003
@@ -52,6 +52,7 @@
 
 #include <linux/fcntl.h>        /* O_ACCMODE */
 #include <linux/hdreg.h>  /* HDIO_GETGEO */
+#include <linux/devfs_fs_kernel.h>
 
 #include <linux/umem.h>
 
@@ -149,6 +150,7 @@
 	spinlock_t 	lock;
 	int		check_batteries;
 
+	int		flags;
 };
 
 static struct cardinfo cards[MM_MAXCARDS];
@@ -573,7 +575,7 @@
 --                              mm_interrupt
 -----------------------------------------------------------------------------------
 */
-static void mm_interrupt(int irq, void *__card, struct pt_regs *regs)
+static irqreturn_t mm_interrupt(int irq, void *__card, struct pt_regs *regs)
 {
 	struct cardinfo *card = (struct cardinfo *) __card;
 	unsigned int dma_status;
@@ -585,13 +587,16 @@
 
 	if (!(dma_status & (DMASCR_ERROR_MASK | DMASCR_CHAIN_COMPLETE))) {
 		/* interrupt wasn't for me ... */
-		return;
+		return IRQ_NONE;
         }
 
 	/* clear COMPLETION interrupts */
-	writel(cpu_to_le32(DMASCR_DMA_COMPLETE|DMASCR_CHAIN_COMPLETE),
-	       card->csr_remap+ DMA_STATUS_CTRL);
-
+	if (card->flags & UM_FLAG_NO_BYTE_STATUS)
+		writel(cpu_to_le32(DMASCR_DMA_COMPLETE|DMASCR_CHAIN_COMPLETE),
+		       card->csr_remap+ DMA_STATUS_CTRL);
+	else
+		writeb((DMASCR_DMA_COMPLETE|DMASCR_CHAIN_COMPLETE) >> 16,
+		       card->csr_remap+ DMA_STATUS_CTRL + 2);
 	
 	/* log errors and clear interrupt status */
 	if (dma_status & DMASCR_ANY_ERR) {
@@ -663,6 +668,7 @@
 
 HW_TRACE(0x36);
 
+	return IRQ_HANDLED; 
 }
 /*
 -----------------------------------------------------------------------------------
@@ -755,15 +761,16 @@
 {
 	int i;
 
-	for (i = 0; i < num_cards; i++) {
-		struct cardinfo *card = &cards[i];
-		spin_lock_bh(&card->lock);
-		if (card->Active >= 0)
-			card->check_batteries = 1;
-		else
-			check_batteries(card);
-		spin_unlock_bh(&card->lock);
-	}
+	for (i = 0; i < num_cards; i++) 
+		if (!(cards[i].flags & UM_FLAG_NO_BATT)) {
+			struct cardinfo *card = &cards[i];
+			spin_lock_bh(&card->lock);
+			if (card->Active >= 0)
+				card->check_batteries = 1;
+			else
+				check_batteries(card);
+			spin_unlock_bh(&card->lock);
+		}
 
 	init_battery_timer();
 }
@@ -869,6 +876,7 @@
 	unsigned char	mem_present;
 	unsigned char	batt_status;
 	unsigned int	saved_bar, data;
+	int		magic_number;
 
 	if (pci_enable_device(dev) < 0)
 		return -ENODEV;
@@ -933,12 +941,33 @@
 	printk(KERN_INFO "MM%d: MEM area not remapped (CONFIG_MM_MAP_MEMORY not set)\n",
 	       card->card_number);
 #endif
-	if (readb(card->csr_remap + MEMCTRLSTATUS_MAGIC) != MM_MAGIC_VALUE) {
+	switch(card->dev->device) {
+	case 0x5415:
+		card->flags |= UM_FLAG_NO_BYTE_STATUS | UM_FLAG_NO_BATTREG;
+		magic_number = 0x59;
+		break;
+
+	case 0x5425:
+		card->flags |= UM_FLAG_NO_BYTE_STATUS;
+		magic_number = 0x5C;
+		break;
+
+	case 0x6155:
+		card->flags |= UM_FLAG_NO_BYTE_STATUS | UM_FLAG_NO_BATTREG | UM_FLAG_NO_BATT;
+		magic_number = 0x99;
+		break;
+
+	default:
+		magic_number = 0x100;
+		break;
+	}
+
+	if (readb(card->csr_remap + MEMCTRLSTATUS_MAGIC) != magic_number) {
 		printk(KERN_ERR "MM%d: Magic number invalid\n", card->card_number);
 		ret = -ENOMEM;
-
 		goto failed_magic;
 	}
+
 	card->mm_pages[0].desc = pci_alloc_consistent(card->dev,
 						      PAGE_SIZE*2,
 						      &card->mm_pages[0].page_dma);
@@ -997,14 +1026,19 @@
 	card->battery[1].good = !(batt_status & BATTERY_2_FAILURE);
 	card->battery[0].last_change = card->battery[1].last_change = jiffies;
 
-	printk(KERN_INFO "MM%d: Size %d KB, Battery 1 %s (%s), Battery 2 %s (%s)\n",
-	       card->card_number, card->mm_size,
-	       (batt_status & BATTERY_1_DISABLED ? "Disabled" : "Enabled"),
-	       card->battery[0].good ? "OK" : "FAILURE",
-	       (batt_status & BATTERY_2_DISABLED ? "Disabled" : "Enabled"),
-	       card->battery[1].good ? "OK" : "FAILURE");
+	if (card->flags & UM_FLAG_NO_BATT) 
+		printk(KERN_INFO "MM%d: Size %d KB\n",
+		       card->card_number, card->mm_size);
+	else {
+		printk(KERN_INFO "MM%d: Size %d KB, Battery 1 %s (%s), Battery 2 %s (%s)\n",
+		       card->card_number, card->mm_size,
+		       (batt_status & BATTERY_1_DISABLED ? "Disabled" : "Enabled"),
+		       card->battery[0].good ? "OK" : "FAILURE",
+		       (batt_status & BATTERY_2_DISABLED ? "Disabled" : "Enabled"),
+		       card->battery[1].good ? "OK" : "FAILURE");
 
-	set_fault_to_battery_status(card);
+		set_fault_to_battery_status(card);
+	}
 
 	pci_read_config_dword(dev, PCI_BASE_ADDRESS_1, &saved_bar);
 	data = 0xffffffff;
@@ -1117,6 +1151,16 @@
 	}, {
 	.vendor =	PCI_VENDOR_ID_MICRO_MEMORY,
 	.device =	PCI_DEVICE_ID_MICRO_MEMORY_5425CN,
+	}, {
+	.vendor =	PCI_VENDOR_ID_MICRO_MEMORY,
+	.device =	PCI_DEVICE_ID_MICRO_MEMORY_6155,
+	}, {
+	.vendor	=	0x8086,
+	.device	=	0xB555,
+	.subvendor=	0x1332,
+	.subdevice=	0x5460,
+	.class	=	0x050000,
+	.class_mask=	0,
 	}, { /* end: all zeroes */ }
 };
 
diff -Nru a/drivers/block/xd.c b/drivers/block/xd.c
--- a/drivers/block/xd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/block/xd.c	Thu Apr 24 05:17:29 2003
@@ -446,17 +446,20 @@
 }
 
 /* xd_interrupt_handler: interrupt service routine */
-static void xd_interrupt_handler(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t xd_interrupt_handler(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	if (inb(XD_STATUS) & STAT_INTERRUPT) {							/* check if it was our device */
 #ifdef DEBUG_OTHER
 		printk("xd_interrupt_handler: interrupt detected\n");
 #endif /* DEBUG_OTHER */
 		outb(0,XD_CONTROL);								/* acknowledge interrupt */
-		wake_up(&xd_wait_int);								/* and wake up sleeping processes */
+		wake_up(&xd_wait_int);	/* and wake up sleeping processes */
+		return IRQ_HANDLED;
 	}
 	else
 		printk("xd: unexpected interrupt\n");
+	return IRQ_NONE;
 }
 
 /* xd_setup_dma: set up the DMA controller for a data transfer */
diff -Nru a/drivers/block/xd.h b/drivers/block/xd.h
--- a/drivers/block/xd.h	Mon Oct 28 11:57:51 2002
+++ b/drivers/block/xd.h	Thu Apr 24 05:17:29 2003
@@ -13,6 +13,8 @@
  * Also thanks to: Salvador Abreu, Dave Thaler, Risto Kankkunen and Wim Van Dorst.
  */
 
+#include <linux/interrupt.h>
+
 /* XT hard disk controller registers */
 #define XD_DATA		(xd_iobase + 0x00)	/* data RW register */
 #define XD_RESET	(xd_iobase + 0x01)	/* reset WO register */
@@ -107,7 +109,8 @@
 static int xd_readwrite (u_char operation,XD_INFO *disk,char *buffer,u_int block,u_int count);
 static void xd_recalibrate (u_char drive);
 
-static void xd_interrupt_handler (int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t xd_interrupt_handler(int irq, void *dev_id,
+					struct pt_regs *regs);
 static u_char xd_setup_dma (u_char opcode,u_char *buffer,u_int count);
 static u_char *xd_build (u_char *cmdblk,u_char command,u_char drive,u_char head,u_short cylinder,u_char sector,u_char count,u_char control);
 static void xd_watchdog (unsigned long unused);
diff -Nru a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
--- a/drivers/bluetooth/hci_ldisc.c	Tue Dec 17 18:19:21 2002
+++ b/drivers/bluetooth/hci_ldisc.c	Mon Apr 21 20:58:40 2003
@@ -145,7 +145,7 @@
 		int len;
 	
 		set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-		len = tty->driver.write(tty, 0, skb->data, skb->len);
+		len = tty->driver->write(tty, 0, skb->data, skb->len);
 		hdev->stat.byte_tx += len;
 
 		skb_pull(skb, len);
@@ -193,8 +193,8 @@
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 
 	if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
 		hu->proto->flush(hu);
@@ -286,8 +286,8 @@
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 
 	return 0;
 }
@@ -384,8 +384,8 @@
 	hu->hdev.stat.byte_rx += count;
 	spin_unlock(&hu->rx_lock);
 
-	if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver.unthrottle)
-		tty->driver.unthrottle(tty);
+	if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver->unthrottle)
+		tty->driver->unthrottle(tty);
 }
 
 static int hci_uart_register_dev(struct hci_uart *hu)
diff -Nru a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
--- a/drivers/cdrom/aztcd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/cdrom/aztcd.c	Sat Apr 19 14:18:27 2003
@@ -180,7 +180,6 @@
 #include <linux/ioport.h>
 #include <linux/string.h>
 #include <linux/major.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <linux/init.h>
 
@@ -1922,12 +1921,9 @@
 	azt_disk->first_minor = 0;
 	azt_disk->fops = &azt_fops;
 	sprintf(azt_disk->disk_name, "aztcd");
+	sprintf(azt_disk->devfs_name, "aztcd");
 	azt_disk->queue = &azt_queue;
 	add_disk(azt_disk);
-	devfs_register(NULL, "aztcd", DEVFS_FL_DEFAULT,
-		       azt_disk->major, azt_disk->first_minor,
-		       S_IFBLK | S_IRUGO | S_IWUGO, azt_disk->fops, NULL);
-
 	azt_invalidate_buffers();
 	aztPresent = 1;
 	aztCloseDoor();
@@ -1946,7 +1942,6 @@
 
 static void __exit aztcd_exit(void)
 {
-	devfs_remove("aztcd");
 	del_gendisk(azt_disk);
 	put_disk(azt_disk);
 	if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL)) {
diff -Nru a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c
--- a/drivers/cdrom/cdu31a.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/cdrom/cdu31a.c	Thu Apr 24 05:17:29 2003
@@ -451,7 +451,7 @@
  */
 static int scd_reset(struct cdrom_device_info *cdi)
 {
-	int retry_count;
+	unsigned long retry_count;
 
 	reset_drive();
 
@@ -511,7 +511,7 @@
 	outb(cmd, sony_cd_cmd_reg);
 }
 
-static void cdu31a_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t cdu31a_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned char val;
 
@@ -545,6 +545,7 @@
 		printk
 		    ("CDU31A: Got an interrupt but nothing was waiting\n");
 	}
+	return IRQ_HANDLED;
 }
 
 /*
@@ -712,7 +713,7 @@
 {
 	unsigned char res_reg[12];
 	unsigned int res_size;
-	unsigned int retry_count;
+	unsigned long retry_count;
 
 
 	printk("cdu31a: Resetting drive on error\n");
@@ -772,7 +773,7 @@
 {
 	unsigned char a, b;
 	int i;
-	unsigned int retry_count;
+	unsigned long retry_count;
 
 
 	while (handle_sony_cd_attention());
@@ -900,7 +901,7 @@
 	       unsigned int num_params,
 	       unsigned char *result_buffer, unsigned int *result_size)
 {
-	unsigned int retry_count;
+	unsigned long retry_count;
 	int num_retries;
 	int recursive_call;
 	unsigned long flags;
@@ -1148,7 +1149,7 @@
 {
 	unsigned char params[6];
 	unsigned int read_size;
-	unsigned int retry_count;
+	unsigned long retry_count;
 
 
 #if DEBUG
@@ -1339,7 +1340,7 @@
 		unsigned int nblocks,
 		unsigned char res_reg[], int *res_size)
 {
-	unsigned int retry_count;
+	unsigned long retry_count;
 	unsigned int bytesleft;
 	unsigned int offset;
 	unsigned int skip;
@@ -2372,7 +2373,7 @@
 static void
 read_audio_data(char *buffer, unsigned char res_reg[], int *res_size)
 {
-	unsigned int retry_count;
+	unsigned long retry_count;
 	int result_read;
 
 
@@ -3206,7 +3207,7 @@
 get_drive_configuration(unsigned short base_io,
 			unsigned char res_reg[], unsigned int *res_size)
 {
-	int retry_count;
+	unsigned long retry_count;
 
 
 	/* Set the base address */
diff -Nru a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
--- a/drivers/cdrom/cm206.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/cdrom/cm206.c	Thu Apr 24 05:17:29 2003
@@ -360,8 +360,7 @@
    as there seems so reason for this to happen.
 */
 
-static void cm206_interrupt(int sig, void *dev_id, struct pt_regs *regs)
-/* you rang? */
+static irqreturn_t cm206_interrupt(int sig, void *dev_id, struct pt_regs *regs)
 {
 	volatile ush fool;
 	cd->intr_ds = inw(r_data_status);	/* resets data_ready, data_error,
@@ -436,6 +435,7 @@
 		|| cd->fifo_overflowed))
 		tasklet_schedule(&cm206_tasklet);	/* issue a stop read command */
 	stats(interrupt);
+	return IRQ_HANDLED;
 }
 
 /* we have put the address of the wait queue in who */
diff -Nru a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c
--- a/drivers/cdrom/gscd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/cdrom/gscd.c	Sat Apr 19 14:18:27 2003
@@ -63,7 +63,6 @@
 #include <linux/major.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -883,7 +882,6 @@
 {
 	CLEAR_TIMER;
 
-	devfs_remove("gscd");
 	del_gendisk(gscd_disk);
 	put_disk(gscd_disk);
 	if ((unregister_blkdev(MAJOR_NR, "gscd") == -EINVAL)) {
@@ -958,14 +956,12 @@
 	gscd_disk->first_minor = 0;
 	gscd_disk->fops = &gscd_fops;
 	sprintf(gscd_disk->disk_name, "gscd");
+	sprintf(gscd_disk->devfs_name, "gscd");
 
 	if (register_blkdev(MAJOR_NR, "gscd")) {
 		ret = -EIO;
 		goto err_out2;
 	}
-
-	devfs_register(NULL, "gscd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,
-		       S_IFBLK | S_IRUGO | S_IWUGO, &gscd_fops, NULL);
 
 	blk_init_queue(&gscd_queue, do_gscd_request, &gscd_lock);
 
diff -Nru a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c
--- a/drivers/cdrom/mcd.c	Mon Apr  7 06:36:31 2003
+++ b/drivers/cdrom/mcd.c	Thu Apr 24 05:17:29 2003
@@ -623,7 +623,7 @@
  * Just take the interrupt and clear out the status reg.
  */
 
-static void mcd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t mcd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int st;
 
@@ -635,6 +635,7 @@
 		if ((st & 0xFF) != 0xFF)
 			mcd_error = st ? st & 0xFF : -1;
 	}
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
--- a/drivers/cdrom/mcdx.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/cdrom/mcdx.c	Thu Apr 24 05:17:29 2003
@@ -260,9 +260,6 @@
 	addresses, such as mcdx_open and mcdx_close in the
 	structure mcdx_dops. */
 
-/* ???  exported by the mcdx_sigaction struct */
-static void mcdx_intr(int, void *, struct pt_regs *);
-
 /* exported by file_ops */
 static int mcdx_open(struct cdrom_device_info *cdi, int purpose);
 static void mcdx_close(struct cdrom_device_info *cdi);
@@ -854,7 +851,7 @@
 	}
 }
 
-static void mcdx_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct s_drive_stuff *stuffp;
 	unsigned char b;
@@ -863,7 +860,7 @@
 
 	if (stuffp == NULL) {
 		xwarn("mcdx: no device for intr %d\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 #ifdef AK2
 	if (!stuffp->busy && stuffp->pending)
@@ -895,6 +892,7 @@
 
 	stuffp->busy = 0;
 	wake_up_interruptible(&stuffp->busyq);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
--- a/drivers/cdrom/optcd.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/cdrom/optcd.c	Sat Apr 19 14:18:27 2003
@@ -71,7 +71,6 @@
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <asm/io.h>
 #include <linux/blk.h>
@@ -2033,6 +2032,8 @@
 	optcd_disk->first_minor = 0;
 	optcd_disk->fops = &opt_fops;
 	sprintf(optcd_disk->disk_name, "optcd");
+	sprintf(optcd_disk->devfs_name, "optcd");
+
 	if (!request_region(optcd_port, 4, "optcd")) {
 		printk(KERN_ERR "optcd: conflict, I/O port 0x%x already used\n",
 			optcd_port);
@@ -2065,8 +2066,8 @@
 		put_disk(optcd_disk);
 		return -EIO;
 	}
-	devfs_register (NULL, "optcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,
-			S_IFBLK | S_IRUGO | S_IWUGO, &opt_fops, NULL);
+
+
 	blk_init_queue(&opt_queue, do_optcd_request, &optcd_lock);
 	blk_queue_hardsect_size(&opt_queue, 2048);
 	optcd_disk->queue = &opt_queue;
@@ -2079,7 +2080,6 @@
 
 static void __exit optcd_exit(void)
 {
-	devfs_remove("optcd");
 	del_gendisk(optcd_disk);
 	put_disk(optcd_disk);
 	if (unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) {
diff -Nru a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c
--- a/drivers/cdrom/sjcd.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/cdrom/sjcd.c	Sat Apr 19 14:18:27 2003
@@ -70,7 +70,6 @@
 #include <linux/string.h>
 #include <linux/major.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -1692,6 +1691,7 @@
 	sjcd_disk->first_minor = 0,
 	sjcd_disk->fops = &sjcd_fops,
 	sprintf(sjcd_disk->disk_name, "sjcd");
+	sprintf(sjcd_disk->devfs_name, "sjcd");
 
 	if (check_region(sjcd_base, 4)) {
 		printk
@@ -1778,8 +1778,6 @@
 	}
 
 	printk(KERN_INFO "SJCD: Status: port=0x%x.\n", sjcd_base);
-	devfs_register(NULL, "sjcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,
-		       S_IFBLK | S_IRUGO | S_IWUGO, &sjcd_fops, NULL);
 	sjcd_disk->queue = &sjcd_queue;
 	add_disk(sjcd_disk);
 
@@ -1798,7 +1796,6 @@
 
 static void __exit sjcd_exit(void)
 {
-	devfs_remove("sjcd");
 	del_gendisk(sjcd_disk);
 	put_disk(sjcd_disk);
 	release_region(sjcd_base, 4);
diff -Nru a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
--- a/drivers/cdrom/sonycd535.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/cdrom/sonycd535.c	Thu Apr 24 05:17:29 2003
@@ -125,7 +125,6 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
 
 #define REALLY_SLOW_IO
 #include <asm/system.h>
@@ -318,15 +317,17 @@
 #endif
 }
 
-static void
+static irqreturn_t
 cdu535_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	disable_interrupts();
-	if (waitqueue_active(&cdu535_irq_wait))
+	if (waitqueue_active(&cdu535_irq_wait)) {
 		wake_up(&cdu535_irq_wait);
-	else
-		printk(CDU535_MESSAGE_NAME
-				": Got an interrupt but nothing was waiting\n");
+		return IRQ_HANDLED;
+	}
+	printk(CDU535_MESSAGE_NAME
+			": Got an interrupt but nothing was waiting\n");
+	return IRQ_NONE;
 }
 
 
@@ -1579,6 +1580,7 @@
 	cdu_disk->first_minor = 0;
 	cdu_disk->fops = &cdu_fops;
 	sprintf(cdu_disk->disk_name, "cdu");
+	sprintf(cdu_disk->devfs_name, "cdu535");
 
 	if (!request_region(sony535_cd_base_io, 4, CDU535_HANDLE)) {
 		printk(KERN_WARNING"sonycd535: Unable to request region 0x%x\n",
@@ -1587,10 +1589,6 @@
 	}
 	cdu_disk->queue = &sonycd535_queue;
 	add_disk(cdu_disk);
-	devfs_register (NULL, CDU535_HANDLE, DEVFS_FL_DEFAULT,
-			cdu_disk->major, cdu_disk->first_minor,
-			S_IFBLK | S_IRUGO | S_IWUGO,
-			cdu_disk->fops, NULL);
 	return 0;
 
 out7:
@@ -1666,7 +1664,6 @@
 	kfree(sony_buffer);
 	kfree(last_sony_subcode);
 	kfree(sony_toc);
-	devfs_remove(CDU535_HANDLE);
 	del_gendisk(cdu_disk);
 	put_disk(cdu_disk);
 	blk_cleanup_queue(&sonycd535_queue);
diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig
--- a/drivers/char/Kconfig	Tue Mar 18 08:57:58 2003
+++ b/drivers/char/Kconfig	Sun Apr 20 12:56:51 2003
@@ -487,7 +487,7 @@
 	  box (as opposed to using a serial printer; if the connector at the
 	  printer has 9 or 25 holes ["female"], then it's serial), say Y.
 	  Also read the Printing-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  It is possible to share one parallel port among several devices
 	  (e.g. printer and ZIP drive) and it is safe to compile the
diff -Nru a/drivers/char/amiserial.c b/drivers/char/amiserial.c
--- a/drivers/char/amiserial.c	Tue Mar 18 07:40:48 2003
+++ b/drivers/char/amiserial.c	Thu Apr 24 03:30:40 2003
@@ -50,7 +50,7 @@
   
 #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
 #define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
- cdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
 #else
 #define DBG_CNT(s)
 #endif
@@ -153,7 +153,7 @@
 
 
 static inline int serial_paranoia_check(struct async_struct *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -162,11 +162,11 @@
 		"Warning: null async_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -208,7 +208,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 
 	local_irq_save(flags);
@@ -228,7 +228,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 
 	local_irq_save(flags);
@@ -881,7 +881,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty || !info->xmit.buf)
@@ -905,7 +905,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	if (info->xmit.head == info->xmit.tail
@@ -931,7 +931,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit.buf || !tmp_buf)
@@ -1009,7 +1009,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
 }
@@ -1018,7 +1018,7 @@
 {
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
 }
@@ -1028,7 +1028,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	local_irq_save(flags);
 	info->xmit.head = info->xmit.tail = 0;
@@ -1048,7 +1048,7 @@
 	struct async_struct *info = (struct async_struct *)tty->driver_data;
         unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_send_char"))
 		return;
 
 	info->x_char = ch;
@@ -1089,7 +1089,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 
 	if (I_IXOFF(tty))
@@ -1114,7 +1114,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 
 	if (I_IXOFF(tty)) {
@@ -1323,7 +1323,7 @@
 	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_break"))
+	if (serial_paranoia_check(info, tty->name, "rs_break"))
 		return;
 
 	local_irq_save(flags);
@@ -1344,7 +1344,7 @@
 	struct serial_icounter_struct icount;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1519,7 +1519,7 @@
 	struct serial_state *state;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	state = info->state;
@@ -1598,8 +1598,8 @@
 		rs_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1628,7 +1628,7 @@
 	unsigned long orig_jiffies, char_time;
 	int lsr;
 
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 	if (info->xmit_fifo_size == 0)
@@ -1689,7 +1689,7 @@
 	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	struct serial_state *state = info->state;
 
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	state = info->state;
@@ -1741,7 +1741,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1895,7 +1895,7 @@
 	unsigned long		page;
 
 	MOD_INC_USE_COUNT;
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS)) {
 		MOD_DEC_USE_COUNT;
 		return -ENODEV;
@@ -1907,12 +1907,11 @@
 	}
 	tty->driver_data = info;
 	info->tty = tty;
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->state->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->state->count);
 #endif
 	info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
 
@@ -1961,7 +1960,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else 
 			*tty->termios = info->state->callout_termios;
@@ -1971,7 +1970,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttys%d successful...", info->line);
+	printk("rs_open %s successful...", tty->name);
 #endif
 	return 0;
 }
@@ -2289,9 +2288,10 @@
 	custom.intena = IF_SETCLR | (intena & IF_TBE);
 }
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64);
+	*index = 0;
+	return &serial_driver;
 }
 
 static struct console sercons = {
diff -Nru a/drivers/char/applicom.c b/drivers/char/applicom.c
--- a/drivers/char/applicom.c	Thu Apr  3 15:03:46 2003
+++ b/drivers/char/applicom.c	Mon Apr 21 00:54:32 2003
@@ -108,7 +108,7 @@
 static ssize_t ac_write (struct file *, const char *, size_t, loff_t *);
 static int ac_ioctl(struct inode *, struct file *, unsigned int,
 		    unsigned long);
-static void ac_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t ac_interrupt(int, void *, struct pt_regs *);
 
 static struct file_operations ac_fops = {
 	.owner = THIS_MODULE,
@@ -606,11 +606,12 @@
 	} 
 }
 
-static void ac_interrupt(int vec, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t ac_interrupt(int vec, void *dev_instance, struct pt_regs *regs)
 {
 	unsigned int i;
 	unsigned int FlagInt;
 	unsigned int LoopCount;
+	int handled = 0;
 
 	//    printk("Applicom interrupt on IRQ %d occurred\n", vec);
 
@@ -632,6 +633,7 @@
 				continue;
 			}
 
+			handled = 1;
 			FlagInt = 1;
 			writeb(0, apbs[i].RamIO + RAM_IT_TO_PC);
 
@@ -675,6 +677,7 @@
 		else
 			LoopCount++;
 	} while(LoopCount < 2);
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c
--- a/drivers/char/cyclades.c	Mon Mar 17 15:42:15 2003
+++ b/drivers/char/cyclades.c	Thu Apr 24 05:17:30 2003
@@ -892,7 +892,7 @@
 
 static inline int
 serial_paranoia_check(struct cyclades_port *info,
-                        kdev_t device, const char *routine)
+                        char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
     static const char *badmagic =
@@ -903,18 +903,18 @@
         "cyc Warning: cyclades_port out of range for (%s) in %s\n";
 
     if (!info) {
-        printk(badinfo, cdevname(device), routine);
+        printk(badinfo, name, routine);
         return 1;
     }
 
     if( (long)info < (long)(&cy_port[0])
     || (long)(&cy_port[NR_PORTS]) < (long)info ){
-        printk(badrange, cdevname(device), routine);
+        printk(badrange, name, routine);
         return 1;
     }
 
     if (info->magic != CYCLADES_MAGIC) {
-        printk(badmagic, cdevname(device), routine);
+        printk(badmagic, name, routine);
         return 1;
     }
 #endif
@@ -1090,7 +1090,7 @@
    whenever the card wants its hand held--chars
    received, out buffer empty, modem change, etc.
  */
-static void
+static irqreturn_t
 cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
   struct tty_struct *tty;
@@ -1113,7 +1113,7 @@
 #ifdef CY_DEBUG_INTERRUPTS
 	printk("cyy_interrupt: spurious interrupt %d\n\r", irq);
 #endif
-        return; /* spurious interrupt */
+        return IRQ_NONE; /* spurious interrupt */
     }
 
     card_base_addr = (unsigned char *)cinfo->base_addr;
@@ -1500,6 +1500,7 @@
    cy_writeb((u_long)card_base_addr + (Cy_ClrIntr<<index), 0);
                                 /* Cy_ClrIntr is 0x1800 */
    spin_unlock(&cinfo->card_lock);
+   return IRQ_HANDLED;
 } /* cyy_interrupt */
 
 /***********************************************************/
@@ -1881,7 +1882,7 @@
 }
 
 #ifdef CONFIG_CYZ_INTR
-static void
+static irqreturn_t
 cyz_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
   struct cyclades_card *cinfo;
@@ -1890,20 +1891,20 @@
 #ifdef CY_DEBUG_INTERRUPTS
 	printk("cyz_interrupt: spurious interrupt %d\n\r", irq);
 #endif
-        return; /* spurious interrupt */
+        return IRQ_NONE; /* spurious interrupt */
     }
 
     if (!ISZLOADED(*cinfo)) {
 #ifdef CY_DEBUG_INTERRUPTS
 	printk("cyz_interrupt: board not yet loaded (IRQ%d).\n\r", irq);
 #endif
-	return;
+	return IRQ_NONE;
     }
 
     /* Handle the interrupts */
     cyz_handle_cmd(cinfo);
 
-    return;
+    return IRQ_HANDLED;
 } /* cyz_interrupt */
 
 static void
@@ -2378,7 +2379,7 @@
      * If this is a callout device, then just make sure the normal
      * device isn't being used.
      */
-    if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+    if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
         if (info->flags & ASYNC_NORMAL_ACTIVE){
             return -EBUSY;
         }
@@ -2579,7 +2580,7 @@
   unsigned long page;
 
     MOD_INC_USE_COUNT;
-    line = minor(tty->device) - tty->driver.minor_start;
+    line = tty->index;
     if ((line < 0) || (NR_PORTS <= line)){
 	MOD_DEC_USE_COUNT;
         return -ENODEV;
@@ -2634,7 +2635,7 @@
 #endif
     tty->driver_data = info;
     info->tty = tty;
-    if (serial_paranoia_check(info, tty->device, "cy_open")){
+    if (serial_paranoia_check(info, tty->name, "cy_open")){
         return -ENODEV;
     }
 #ifdef CY_DEBUG_OPEN
@@ -2683,7 +2684,7 @@
     }
 
     if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
-        if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+        if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
             *tty->termios = info->normal_termios;
         else 
             *tty->termios = info->callout_termios;
@@ -2711,7 +2712,7 @@
   int card,chip,channel,index;
   unsigned long orig_jiffies, char_time;
 	
-    if (serial_paranoia_check(info, tty->device, "cy_wait_until_sent"))
+    if (serial_paranoia_check(info, tty->name, "cy_wait_until_sent"))
 	return;
 
     if (info->xmit_fifo_size == 0)
@@ -2795,7 +2796,7 @@
     printk("cyc:cy_close ttyC%d\n", info->line);
 #endif
 
-    if (!info || serial_paranoia_check(info, tty->device, "cy_close")){
+    if (!info || serial_paranoia_check(info, tty->name, "cy_close")){
         return;
     }
 
@@ -2904,8 +2905,8 @@
 
     CY_UNLOCK(info, flags);
     shutdown(info);
-    if (tty->driver.flush_buffer)
-        tty->driver.flush_buffer(tty);
+    if (tty->driver->flush_buffer)
+        tty->driver->flush_buffer(tty);
     if (tty->ldisc.flush_buffer)
         tty->ldisc.flush_buffer(tty);
     CY_LOCK(info, flags);
@@ -2961,7 +2962,7 @@
     printk("cyc:cy_write ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_write")){
+    if (serial_paranoia_check(info, tty->name, "cy_write")){
         return 0;
     }
         
@@ -3047,7 +3048,7 @@
     printk("cyc:cy_put_char ttyC%d\n", info->line);
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_put_char"))
+    if (serial_paranoia_check(info, tty->name, "cy_put_char"))
         return;
 
     if (!tty || !info->xmit_buf)
@@ -3081,7 +3082,7 @@
     printk("cyc:cy_flush_chars ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_flush_chars"))
+    if (serial_paranoia_check(info, tty->name, "cy_flush_chars"))
         return;
 
     if (info->xmit_cnt <= 0 || tty->stopped
@@ -3108,7 +3109,7 @@
     printk("cyc:cy_write_room ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_write_room"))
+    if (serial_paranoia_check(info, tty->name, "cy_write_room"))
         return 0;
     ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
     if (ret < 0)
@@ -3123,7 +3124,7 @@
   struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
   int card, channel;
                                 
-    if (serial_paranoia_check(info, tty->device, "cy_chars_in_buffer"))
+    if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer"))
         return 0;
 
     card = info->card;
@@ -4012,7 +4013,7 @@
     struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
     unsigned long flags;
 
-    if (serial_paranoia_check(info, tty->device, "cy_break"))
+    if (serial_paranoia_check(info, tty->name, "cy_break"))
 	return;
 
     CY_LOCK(info, flags);
@@ -4231,7 +4232,7 @@
   int ret_val = 0;
   unsigned long flags;
 
-    if (serial_paranoia_check(info, tty->device, "cy_ioctl"))
+    if (serial_paranoia_check(info, tty->name, "cy_ioctl"))
 	return -ENODEV;
 
 #ifdef CY_DEBUG_OTHER
@@ -4469,7 +4470,7 @@
            tty->ldisc.chars_in_buffer(tty), info->line);
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_throttle")){
+    if (serial_paranoia_check(info, tty->name, "cy_throttle")){
             return;
     }
 
@@ -4525,7 +4526,7 @@
            tty->ldisc.chars_in_buffer(tty), info->line);
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_unthrottle")){
+    if (serial_paranoia_check(info, tty->name, "cy_unthrottle")){
             return;
     }
 
@@ -4579,7 +4580,7 @@
     printk("cyc:cy_stop ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_stop"))
+    if (serial_paranoia_check(info, tty->name, "cy_stop"))
         return;
         
     cinfo = &cy_card[info->card];
@@ -4619,7 +4620,7 @@
     printk("cyc:cy_start ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_start"))
+    if (serial_paranoia_check(info, tty->name, "cy_start"))
         return;
         
     cinfo = &cy_card[info->card];
@@ -4657,7 +4658,7 @@
     printk("cyc:cy_flush_buffer ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_flush_buffer"))
+    if (serial_paranoia_check(info, tty->name, "cy_flush_buffer"))
         return;
 
     card = info->card;
@@ -4696,7 +4697,7 @@
     printk("cyc:cy_hangup ttyC%d\n", info->line); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_hangup"))
+    if (serial_paranoia_check(info, tty->name, "cy_hangup"))
         return;
 
     cy_flush_buffer(tty);
diff -Nru a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
--- a/drivers/char/drm/drmP.h	Wed Apr  9 21:45:21 2003
+++ b/drivers/char/drm/drmP.h	Thu Apr 24 03:34:21 2003
@@ -48,7 +48,6 @@
 #include <linux/init.h>
 #include <linux/file.h>
 #include <linux/pci.h>
-#include <linux/wrapper.h>
 #include <linux/version.h>
 #include <linux/jiffies.h>
 #include <linux/smp_lock.h>	/* For (un)lock_kernel */
@@ -837,7 +836,7 @@
 				   unsigned int cmd, unsigned long arg );
 extern int           DRM(irq_install)( drm_device_t *dev, int irq );
 extern int           DRM(irq_uninstall)( drm_device_t *dev );
-extern void          DRM(dma_service)( int irq, void *device,
+extern irqreturn_t   DRM(dma_service)( int irq, void *device,
 				       struct pt_regs *regs );
 extern void          DRM(driver_irq_preinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_postinstall)( drm_device_t *dev );
diff -Nru a/drivers/char/drm/drm_memory.h b/drivers/char/drm/drm_memory.h
--- a/drivers/char/drm/drm_memory.h	Thu Mar 13 16:52:15 2003
+++ b/drivers/char/drm/drm_memory.h	Thu Apr 24 03:34:48 2003
@@ -31,7 +31,6 @@
 
 #include <linux/config.h>
 #include "drmP.h"
-#include <linux/wrapper.h>
 
 typedef struct drm_mem_stats {
 	const char	  *name;
@@ -251,7 +250,7 @@
 	for (addr = address, sz = bytes;
 	     sz > 0;
 	     addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-		mem_map_reserve(virt_to_page(addr));
+		SetPageReserved(virt_to_page(addr));
 	}
 
 	return address;
@@ -272,7 +271,7 @@
 		for (addr = address, sz = bytes;
 		     sz > 0;
 		     addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-			mem_map_unreserve(virt_to_page(addr));
+			ClearPageReserved(virt_to_page(addr));
 		}
 		free_pages(address, order);
 	}
diff -Nru a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c
--- a/drivers/char/drm/i830_dma.c	Wed Apr  9 21:45:21 2003
+++ b/drivers/char/drm/i830_dma.c	Sun Apr 20 14:12:17 2003
@@ -52,14 +52,6 @@
 #define up_write up
 #endif
 
-#ifndef LockPage
-#define LockPage(page)		set_bit(PG_locked, &(page)->flags)
-#endif
-#ifndef UnlockPage
-#define UnlockPage(page)	unlock_page(page)
-#endif
-
-
 static inline void i830_print_status_page(drm_device_t *dev)
 {
    	drm_device_dma_t *dma = dev->dma;
@@ -176,10 +168,10 @@
 					    buf->bus_address);
 	dev_priv->mmap_buffer = NULL;
 	filp->f_op = old_fops;
-	if ((unsigned long)buf_priv->virtual > -1024UL) {
+	if (IS_ERR(buf_priv->virtual)) {
 		/* Real error */
 		DRM_ERROR("mmap error\n");
-		retcode = (signed int)buf_priv->virtual;
+		retcode = PTR_ERR(buf_priv->virtual);
 		buf_priv->virtual = 0;
 	}
 	up_write( &current->mm->mmap_sem );
@@ -454,7 +446,7 @@
    	memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE);
 	DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
    
-   	I830_WRITE(0x02080, virt_to_bus((void *)dev_priv->hw_status_page));
+   	I830_WRITE(0x02080, dev_priv->dma_status_page);
 	DRM_DEBUG("Enabled hardware status page\n");
    
    	/* Now we need to init our freelist */
diff -Nru a/drivers/char/drm/mga_irq.c b/drivers/char/drm/mga_irq.c
--- a/drivers/char/drm/mga_irq.c	Wed Dec 18 09:56:28 2002
+++ b/drivers/char/drm/mga_irq.c	Mon Apr 21 00:57:06 2003
@@ -36,7 +36,7 @@
 #include "mga_drm.h"
 #include "mga_drv.h"
 
-void mga_dma_service( DRM_IRQ_ARGS )
+irqreturn_t mga_dma_service( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_mga_private_t *dev_priv = 
@@ -51,7 +51,9 @@
 		atomic_inc(&dev->vbl_received);
 		DRM_WAKEUP(&dev->vbl_queue);
 		DRM(vbl_send_signals)( dev );
+		return IRQ_HANDLED;
 	}
+	return IRQ_NONE;
 }
 
 int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
diff -Nru a/drivers/char/drm/r128_irq.c b/drivers/char/drm/r128_irq.c
--- a/drivers/char/drm/r128_irq.c	Wed Dec 18 09:56:28 2002
+++ b/drivers/char/drm/r128_irq.c	Mon Apr 21 00:58:08 2003
@@ -36,7 +36,7 @@
 #include "r128_drm.h"
 #include "r128_drv.h"
 
-void r128_dma_service( DRM_IRQ_ARGS )
+irqreturn_t r128_dma_service( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_r128_private_t *dev_priv = 
@@ -51,7 +51,9 @@
 		atomic_inc(&dev->vbl_received);
 		DRM_WAKEUP(&dev->vbl_queue);
 		DRM(vbl_send_signals)( dev );
+		return IRQ_HANDLED;
 	}
+	return IRQ_NONE;
 }
 
 int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
diff -Nru a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
--- a/drivers/char/drm/radeon_irq.c	Sat Mar 29 22:34:33 2003
+++ b/drivers/char/drm/radeon_irq.c	Sun Apr 20 14:14:28 2003
@@ -54,7 +54,7 @@
  * tied to dma at all, this is just a hangover from dri prehistory.
  */
 
-void DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_radeon_private_t *dev_priv = 
@@ -67,7 +67,7 @@
 	stat = RADEON_READ(RADEON_GEN_INT_STATUS)
 	     & (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT);
 	if (!stat)
-		return;
+		return IRQ_NONE;
 
 	/* SW interrupt */
 	if (stat & RADEON_SW_INT_TEST) {
@@ -83,6 +83,7 @@
 
 	/* Acknowledge interrupts we handle */
 	RADEON_WRITE(RADEON_GEN_INT_STATUS, stat);
+	return IRQ_HANDLED;
 }
 
 static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
diff -Nru a/drivers/char/dz.c b/drivers/char/dz.c
--- a/drivers/char/dz.c	Sun Dec 29 23:18:11 2002
+++ b/drivers/char/dz.c	Thu Apr 24 03:30:40 2003
@@ -1112,8 +1112,8 @@
 	 */
 	shutdown(info);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer (tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer (tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer (tty);
 	tty->closing = 0;
@@ -1183,7 +1183,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & DZ_NORMAL_ACTIVE)
 			return -EBUSY;
     
@@ -1271,7 +1271,7 @@
 	struct dz_serial *info;
 	int retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 
 	/*
 	 * The dz lines for the mouse/keyboard must be opened using their
@@ -1301,7 +1301,7 @@
 		return retval;
 
 	if ((info->count == 1) && (info->flags & DZ_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -1335,7 +1335,7 @@
 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
 	serial_driver.name = "ttyS";
 #else
-	serial_driver.name = "tts/%d";
+	serial_driver.name = "tts/";
 #endif
 	serial_driver.major = TTY_MAJOR;
 	serial_driver.minor_start = 64;
@@ -1376,7 +1376,7 @@
 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
 	callout_driver.name = "cua";
 #else
-	callout_driver.name = "cua/%d";
+	callout_driver.name = "cua/";
 #endif
 	callout_driver.major = TTYAUX_MAJOR;
 	callout_driver.subtype = SERIAL_TYPE_CALLOUT;
@@ -1425,10 +1425,8 @@
 		printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,
 		       info->port, SERIAL);
 
-		tty_register_device(&serial_driver,
-		                   serial_driver.minor_start + info->line);
-		tty_register_device(&callout_driver,
-		                   callout_driver.minor_start + info->line);
+		tty_register_device(&serial_driver, info->line);
+		tty_register_device(&callout_driver, info->line);
 	}
 
 	/* Reset the chip */
@@ -1504,9 +1502,10 @@
 	}
 }
 
-static kdev_t dz_console_device(struct console *c)
+static struct tty_driver *dz_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 static int __init dz_console_setup(struct console *co, char *options)
diff -Nru a/drivers/char/epca.c b/drivers/char/epca.c
--- a/drivers/char/epca.c	Mon Mar 31 15:55:30 2003
+++ b/drivers/char/epca.c	Mon Apr 21 20:58:41 2003
@@ -503,7 +503,7 @@
 	struct channel *ch;
 	unsigned long flags;
 
-	if (tty->driver.subtype == SERIAL_TYPE_INFO) 
+	if (tty->driver->subtype == SERIAL_TYPE_INFO) 
 	{
 		return;
 	}
@@ -574,8 +574,8 @@
 			tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */
 		}
 	
-		if (tty->driver.flush_buffer)
-			tty->driver.flush_buffer(tty);
+		if (tty->driver->flush_buffer)
+			tty->driver->flush_buffer(tty);
 
 		if (tty->ldisc.flush_buffer)
 			tty->ldisc.flush_buffer(tty);
@@ -681,8 +681,8 @@
 
 		save_flags(flags);
 		cli();
-		if (tty->driver.flush_buffer)
-			tty->driver.flush_buffer(tty);
+		if (tty->driver->flush_buffer)
+			tty->driver->flush_buffer(tty);
 
 		if (tty->ldisc.flush_buffer)
 			tty->ldisc.flush_buffer(tty);
@@ -729,7 +729,7 @@
 
 	/* Stop users from hurting themselves on control minor */
 
-	if (tty->driver.subtype == SERIAL_TYPE_INFO) 
+	if (tty->driver->subtype == SERIAL_TYPE_INFO) 
 	{
 		return (0) ;
 	}
@@ -1238,7 +1238,7 @@
 	   device isn't being used.
 	-------------------------------------------------------------------- */
 
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) 
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) 
 	{ /* A cud device has been opened */
 		if (ch->asyncflags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
@@ -1368,12 +1368,12 @@
 
 	/* Nothing "real" happens in open of control device */
 
-	if (tty->driver.subtype == SERIAL_TYPE_INFO) 
+	if (tty->driver->subtype == SERIAL_TYPE_INFO) 
 	{
 		return (0) ;
 	}
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if (line < 0 || line >= nbdevs) 
 	{
 		printk(KERN_ERR "<Error> - pc_open : line out of range in pc_open\n");
@@ -1453,7 +1453,7 @@
 	/* Should this be here except for SPLIT termios ? */
 	if (ch->count == 1) 
 	{
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = ch->normal_termios;
 		else 
 			*tty->termios = ch->callout_termios;
@@ -2712,7 +2712,7 @@
 			the driver will wait on carrier detect.
 		------------------------------------------------------------------- */
 
-		if ((ts->c_cflag & CLOCAL) || (tty->driver.subtype == SERIAL_TYPE_CALLOUT))
+		if ((ts->c_cflag & CLOCAL) || (tty->driver->subtype == SERIAL_TYPE_CALLOUT))
 		{ /* Begin it is a cud device or a ttyD device with CLOCAL on */
 			ch->asyncflags &= ~ASYNC_CHECK_CD;
 		} /* End it is a cud device or a ttyD device with CLOCAL on */
@@ -2888,7 +2888,7 @@
 	if (bc->orun) 
 	{
 		bc->orun = 0;
-		printk(KERN_WARNING "overrun! DigiBoard device minor = %d\n",minor(tty->device));
+		printk(KERN_WARNING "overrun! DigiBoard device %s\n",tty->name);
 	}
 
 	rxwinon(ch);
@@ -2960,7 +2960,7 @@
 	struct channel *ch = (struct channel *) tty->driver_data;
 	
 	/* The control device has it's own set of commands */
-	if (tty->driver.subtype == SERIAL_TYPE_INFO) 
+	if (tty->driver->subtype == SERIAL_TYPE_INFO) 
 	{ /* Begin if subtype is the control device */
 
 		switch (cmd) 
diff -Nru a/drivers/char/esp.c b/drivers/char/esp.c
--- a/drivers/char/esp.c	Mon Feb  3 05:47:46 2003
+++ b/drivers/char/esp.c	Thu Apr 24 05:17:30 2003
@@ -135,7 +135,7 @@
   
 #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
 #define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
- cdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
 #else
 #define DBG_CNT(s)
 #endif
@@ -175,7 +175,7 @@
 static DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int serial_paranoia_check(struct esp_struct *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char badmagic[] = KERN_WARNING
@@ -184,11 +184,11 @@
 		"Warning: null esp_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != ESP_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -219,7 +219,7 @@
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -237,7 +237,7 @@
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 	
 	save_flags(flags); cli();
@@ -653,7 +653,8 @@
 /*
  * This is the serial driver's interrupt routine
  */
-static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t rs_interrupt_single(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	struct esp_struct * info;
 	unsigned err_status;
@@ -670,7 +671,7 @@
 	
 	if (!info->tty) {
 		sti();
-		return;
+		return IRQ_NONE;
 	}
 
 	if (scratch & 0x04) { /* error */
@@ -753,6 +754,7 @@
 	printk("end.\n");
 #endif
 	sti();
+	return IRQ_HANDLED;
 }
 
 /*
@@ -1256,7 +1258,7 @@
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty || !info->xmit_buf)
@@ -1279,7 +1281,7 @@
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	if (info->xmit_cnt <= 0 || tty->stopped || !info->xmit_buf)
@@ -1301,7 +1303,7 @@
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf || !tmp_buf)
@@ -1368,7 +1370,7 @@
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 	int	ret;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	ret = ESP_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -1380,7 +1382,7 @@
 {
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -1389,7 +1391,7 @@
 {
 	struct esp_struct *info = (struct esp_struct *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	cli();
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1418,7 +1420,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	cli();
@@ -1440,7 +1442,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	cli();
@@ -1841,7 +1843,7 @@
 	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "esp_break"))
+	if (serial_paranoia_check(info, tty->name, "esp_break"))
 		return;
 
 	save_flags(flags); cli();
@@ -1864,7 +1866,7 @@
 	struct async_icount cprev, cnow;	/* kernel counter temps */
 	struct serial_icounter_struct *p_cuser;	/* user space */
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -2037,7 +2039,7 @@
 	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 	
 	save_flags(flags); cli();
@@ -2112,8 +2114,8 @@
 		rs_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -2140,7 +2142,7 @@
 	unsigned long orig_jiffies, char_time;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 	orig_jiffies = jiffies;
@@ -2179,7 +2181,7 @@
 {
 	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
 	
-	if (serial_paranoia_check(info, tty->device, "esp_hangup"))
+	if (serial_paranoia_check(info, tty->name, "esp_hangup"))
 		return;
 	
 	rs_flush_buffer(tty);
@@ -2226,7 +2228,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -2354,7 +2356,7 @@
 	struct esp_struct	*info;
 	int 			retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS))
 		return -ENODEV;
 
@@ -2366,13 +2368,12 @@
 		info = info->next_port;
 
 	if (!info) {
-		serial_paranoia_check(info, tty->device, "esp_open");
+		serial_paranoia_check(info, tty->name, "esp_open");
 		return -ENODEV;
 	}
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("esp_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->count);
+	printk("esp_open %s, count = %d\n", tty->name, info->count);
 #endif
 	MOD_INC_USE_COUNT;
 	info->count++;
@@ -2402,7 +2403,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -2413,7 +2414,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("esp_open ttys%d successful...", info->line);
+	printk("esp_open %s successful...", tty->name);
 #endif
 	return 0;
 }
diff -Nru a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c
--- a/drivers/char/ftape/lowlevel/fdc-io.c	Fri Feb  7 07:59:17 2003
+++ b/drivers/char/ftape/lowlevel/fdc-io.c	Thu Apr 24 05:17:29 2003
@@ -1298,18 +1298,20 @@
 	TRACE_EXIT 0;
 }
 
-static void ftape_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ftape_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	void (*handler) (void) = *fdc.hook;
+	int handled = 0;
 	TRACE_FUN(ft_t_any);
 
 	*fdc.hook = NULL;
 	if (handler) {
+		handled = 1;
 		handler();
 	} else {
 		TRACE(ft_t_bug, "Unexpected ftape interrupt");
 	}
-	TRACE_EXIT;
+	return IRQ_RETVAL(handled);
 }
 
 int fdc_grab_irq_and_dma(void)
diff -Nru a/drivers/char/ftape/lowlevel/ftape-buffer.c b/drivers/char/ftape/lowlevel/ftape-buffer.c
--- a/drivers/char/ftape/lowlevel/ftape-buffer.c	Tue Feb  5 07:23:05 2002
+++ b/drivers/char/ftape/lowlevel/ftape-buffer.c	Thu Apr 24 03:34:53 2003
@@ -27,7 +27,6 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
-#include <linux/wrapper.h>
 #include <asm/dma.h>
 
 #include <linux/ftape.h>
@@ -50,7 +49,7 @@
 		struct page *page;
 
 		for (page = virt_to_page(addr); page < virt_to_page(addr+size); page++)
-			mem_map_reserve(page);
+			SetPageReserved(page);
 	}
 	return (void *)addr;
 }
@@ -62,7 +61,7 @@
 
 		for (page = virt_to_page((unsigned long)addr);
 		     page < virt_to_page((unsigned long)addr+size); page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		free_pages((unsigned long) addr, get_order(size));
 	}
 }
diff -Nru a/drivers/char/ftape/lowlevel/ftape-ctl.c b/drivers/char/ftape/lowlevel/ftape-ctl.c
--- a/drivers/char/ftape/lowlevel/ftape-ctl.c	Tue Jan  7 16:00:25 2003
+++ b/drivers/char/ftape/lowlevel/ftape-ctl.c	Thu Apr 24 03:34:55 2003
@@ -29,7 +29,6 @@
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
-#include <linux/wrapper.h>
 
 #include <linux/ftape.h>
 #include <linux/qic117.h>
diff -Nru a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
--- a/drivers/char/ftape/zftape/zftape-init.c	Mon Feb  3 12:19:37 2003
+++ b/drivers/char/ftape/zftape/zftape-init.c	Thu Apr 24 03:34:57 2003
@@ -33,7 +33,6 @@
 #include <linux/kmod.h>
 #endif
 #include <linux/fcntl.h>
-#include <linux/wrapper.h>
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
 
diff -Nru a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
--- a/drivers/char/generic_serial.c	Mon Feb 24 07:24:05 2003
+++ b/drivers/char/generic_serial.c	Mon Apr 21 20:58:42 2003
@@ -112,7 +112,7 @@
 
 	if (!tty) return 0;
 
-	port = tty->driver;
+	port = tty->driver_data;
 
 	if (!port) return 0;
 
@@ -622,7 +622,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == GS_TYPE_CALLOUT) {
+	if (tty->driver->subtype == GS_TYPE_CALLOUT) {
 		if (port->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((port->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -794,8 +794,8 @@
 
 	port->flags &= ~GS_ACTIVE;
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
diff -Nru a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
--- a/drivers/char/hvc_console.c	Fri Feb 14 15:14:16 2003
+++ b/drivers/char/hvc_console.c	Thu Apr 24 03:30:40 2003
@@ -69,7 +69,7 @@
 
 static int hvc_open(struct tty_struct *tty, struct file * filp)
 {
-	int line = minor(tty->device) - tty->driver.minor_start;
+	int line = tty->index;
 	struct hvc_struct *hp;
 	unsigned long flags;
 
@@ -253,7 +253,7 @@
 
 	hvc_driver.magic = TTY_DRIVER_MAGIC;
 	hvc_driver.driver_name = "hvc";
-	hvc_driver.name = "hvc/%d";
+	hvc_driver.name = "hvc/";
 	hvc_driver.major = HVC_MAJOR;
 	hvc_driver.minor_start = HVC_MINOR;
 	hvc_driver.num = hvc_count(&hvc_offset);
@@ -277,7 +277,7 @@
 	for (i = 0; i < hvc_driver.num; i++) {
 		hvc_struct[i].lock = SPIN_LOCK_UNLOCKED;
 		hvc_struct[i].index = i;
-		tty_register_device(&hvc_driver, hvc_driver.minor_start + i);
+		tty_register_device(&hvc_driver, i);
 	}
 
 	if (tty_register_driver(&hvc_driver))
@@ -324,9 +324,10 @@
 	}
 }
 
-static kdev_t hvc_console_device(struct console *c)
+static struct tty_driver *hvc_console_device(struct console *c, int *index)
 {
-	return mk_kdev(HVC_MAJOR, HVC_MINOR + c->index);
+	*index = c->index;
+	return &hvc_driver;
 }
 
 static int __init hvc_console_setup(struct console *co, char *options)
diff -Nru a/drivers/char/ip2main.c b/drivers/char/ip2main.c
--- a/drivers/char/ip2main.c	Mon Feb  3 05:47:46 2003
+++ b/drivers/char/ip2main.c	Thu Apr 24 05:17:30 2003
@@ -274,7 +274,7 @@
 
 static void set_irq(int, int);
 static void ip2_interrupt_bh(i2eBordStrPtr pB);
-static void ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs);
 static void ip2_poll(unsigned long arg);
 static inline void service_all_boards(void);
 static void do_input(void *p);
@@ -366,7 +366,7 @@
 
 #if defined(MODULE) && defined(IP2DEBUG_OPEN)
 #define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] refc=%d, ttyc=%d, modc=%x -> %s\n", \
-		    cdevname(tty->device),(pCh->flags),ref_count, \
+		    tty->name,(pCh->flags),ref_count, \
 		    tty->count,/*GET_USE_COUNT(module)*/0,s)
 #else
 #define DBG_CNT(s)
@@ -1339,11 +1339,12 @@
 /*                                                                            */
 /*                                                                            */
 /******************************************************************************/
-static void
+static irqreturn_t
 ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	int i;
 	i2eBordStrPtr  pB;
+	int handled = 0;
 
 	ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq );
 
@@ -1355,6 +1356,7 @@
 //			IRQ = 0 for polled boards, we won't poll "IRQ" boards
 
 		if ( pB && (pB->i2eUsingIrq == irq) ) {
+			handled = 1;
 #ifdef USE_IQI
 
 		    if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
@@ -1379,6 +1381,7 @@
 	++irq_counter;
 
 	ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
+	return IRQ_RETVAL(handled);
 }
 
 /******************************************************************************/
@@ -1564,9 +1567,9 @@
 	wait_queue_t wait;
 	int rc = 0;
 	int do_clocal = 0;
-	i2ChanStrPtr  pCh = DevTable[minor(tty->device)];
+	i2ChanStrPtr  pCh = DevTable[tty->index];
 
-	ip2trace (minor(tty->device), ITRC_OPEN, ITRC_ENTER, 0 );
+	ip2trace (tty->index, ITRC_OPEN, ITRC_ENTER, 0 );
 
 	if ( pCh == NULL ) {
 		return -ENODEV;
@@ -1578,9 +1581,8 @@
 
 #ifdef IP2DEBUG_OPEN
 	printk(KERN_DEBUG \
-			"IP2:open(tty=%p,pFile=%p):dev=%x,maj=%d,min=%d,ch=%d,idx=%d\n",
-	       tty, pFile, tty->device, major(tty->device), minor(tty->device),
-			 pCh->infl.hd.i2sChannel, pCh->port_index);
+			"IP2:open(tty=%p,pFile=%p):dev=%s,ch=%d,idx=%d\n",
+	       tty, pFile, tty->name, pCh->infl.hd.i2sChannel, pCh->port_index);
 	open_sanity_check ( pCh, pCh->pMyBord );
 #endif
 
@@ -1616,7 +1618,7 @@
 	 *    (These are the only tests the standard serial driver makes for
 	 *    callout devices.)
 	 */
-	if ( tty->driver.subtype == SERIAL_TYPE_CALLOUT ) {
+	if ( tty->driver->subtype == SERIAL_TYPE_CALLOUT ) {
 		if ( pCh->flags & ASYNC_NORMAL_ACTIVE ) {
 			return -EBUSY;
 		}
@@ -1719,7 +1721,7 @@
 	if ( tty->count == 1 ) {
 		i2QueueCommands(PTYPE_INLINE, pCh, 0, 2, CMD_CTSFL_DSAB, CMD_RTSFL_DSAB);
 		if ( pCh->flags & ASYNC_SPLIT_TERMIOS ) {
-			if ( tty->driver.subtype == SERIAL_TYPE_NORMAL ) {
+			if ( tty->driver->subtype == SERIAL_TYPE_NORMAL ) {
 				*tty->termios = pCh->NormalTermios;
 			} else {
 				*tty->termios = pCh->CalloutTermios;
@@ -1771,7 +1773,7 @@
 	ip2trace (CHANN, ITRC_CLOSE, ITRC_ENTER, 0 );
 
 #ifdef IP2DEBUG_OPEN
-	printk(KERN_DEBUG "IP2:close ttyF%02X:\n",minor(tty->device));
+	printk(KERN_DEBUG "IP2:close %s:\n",tty->name);
 #endif
 
 	if ( tty_hung_up_p ( pFile ) ) {
@@ -1827,8 +1829,8 @@
 
 	serviceOutgoingFifo ( pCh->pMyBord );
 
-	if ( tty->driver.flush_buffer ) 
-		tty->driver.flush_buffer(tty);
+	if ( tty->driver->flush_buffer ) 
+		tty->driver->flush_buffer(tty);
 	if ( tty->ldisc.flush_buffer )  
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -2180,7 +2182,7 @@
 static void
 ip2_start ( PTTY tty )
 {
- 	i2ChanStrPtr  pCh = DevTable[minor(tty->device)];
+ 	i2ChanStrPtr  pCh = DevTable[tty->index];
 
  	i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_RESUME);
  	i2QueueCommands(PTYPE_BYPASS, pCh, 100, 1, CMD_UNSUSPEND);
@@ -2193,7 +2195,7 @@
 static void
 ip2_stop ( PTTY tty )
 {
- 	i2ChanStrPtr  pCh = DevTable[minor(tty->device)];
+ 	i2ChanStrPtr  pCh = DevTable[tty->index];
 
  	i2QueueCommands(PTYPE_BYPASS, pCh, 100, 1, CMD_SUSPEND);
 #ifdef IP2DEBUG_WRITE
@@ -2221,7 +2223,7 @@
 ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 {
 	wait_queue_t wait;
-	i2ChanStrPtr pCh = DevTable[minor(tty->device)];
+	i2ChanStrPtr pCh = DevTable[tty->index];
 	struct async_icount cprev, cnow;	/* kernel counter temps */
 	struct serial_icounter_struct *p_cuser;	/* user space */
 	int rc = 0;
diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
--- a/drivers/char/ipmi/ipmi_devintf.c	Thu Apr 17 12:39:33 2003
+++ b/drivers/char/ipmi/ipmi_devintf.c	Fri Apr 18 11:01:14 2003
@@ -437,10 +437,7 @@
 static int ipmi_major = 0;
 MODULE_PARM(ipmi_major, "i");
 
-static devfs_handle_t devfs_handle;
-
 #define MAX_DEVICES 10
-static devfs_handle_t handles[MAX_DEVICES];
 
 static void ipmi_new_smi(int if_num)
 {
@@ -451,10 +448,9 @@
 
 	snprintf(name, sizeof(name), "ipmidev/%d", if_num);
 
-	handles[if_num] = devfs_register(NULL, name, DEVFS_FL_NONE,
-					 ipmi_major, if_num,
-					 S_IFCHR | S_IRUSR | S_IWUSR,
-					 &ipmi_fops, NULL);
+	devfs_register(NULL, name, 0, ipmi_major, if_num,
+			S_IFCHR | S_IRUSR | S_IWUSR,
+			&ipmi_fops, NULL);
 }
 
 static void ipmi_smi_gone(int if_num)
@@ -462,7 +458,7 @@
 	if (if_num > MAX_DEVICES)
 		return;
 
-	devfs_unregister(handles[if_num]);
+	devfs_remove("ipmidev/%d", if_num);
 }
 
 static struct ipmi_smi_watcher smi_watcher =
@@ -488,7 +484,7 @@
 		ipmi_major = rv;
 	}
 
-	devfs_handle = devfs_mk_dir(DEVICE_NAME);
+	devfs_mk_dir(DEVICE_NAME);
 
 	rv = ipmi_smi_watcher_register(&smi_watcher);
 	if (rv) {
@@ -507,7 +503,7 @@
 static __exit void cleanup_ipmi(void)
 {
 	ipmi_smi_watcher_unregister(&smi_watcher);
-	devfs_unregister(devfs_handle);
+	devfs_remove(DEVICE_NAME);
 	unregister_chrdev(ipmi_major, DEVICE_NAME);
 }
 module_exit(cleanup_ipmi);
diff -Nru a/drivers/char/ipmi/ipmi_kcs_intf.c b/drivers/char/ipmi/ipmi_kcs_intf.c
--- a/drivers/char/ipmi/ipmi_kcs_intf.c	Mon Apr  7 16:44:29 2003
+++ b/drivers/char/ipmi/ipmi_kcs_intf.c	Mon Apr 21 00:44:13 2003
@@ -629,6 +629,7 @@
 	atomic_set(&kcs_info->req_events, 1);
 }
 
+#if 0
 static int new_user(void *send_info)
 {
 	if (!try_module_get(THIS_MODULE))
@@ -640,6 +641,7 @@
 {
 	module_put(THIS_MODULE);
 }
+#endif
 
 static int initialized = 0;
 
@@ -740,7 +742,7 @@
 	spin_unlock_irqrestore(&(kcs_info->kcs_lock), flags);
 }
 
-static void kcs_irq_handler(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t kcs_irq_handler(int irq, void *data, struct pt_regs *regs)
 {
 	struct kcs_info *kcs_info = (struct kcs_info *) data;
 	unsigned long   flags;
@@ -759,6 +761,7 @@
 	kcs_event_handler(kcs_info, 0);
  out:
 	spin_unlock_irqrestore(&(kcs_info->kcs_lock), flags);
+	return IRQ_HANDLED;
 }
 
 static struct ipmi_smi_handlers handlers =
diff -Nru a/drivers/char/isicom.c b/drivers/char/isicom.c
--- a/drivers/char/isicom.c	Mon Feb  3 05:47:46 2003
+++ b/drivers/char/isicom.c	Thu Apr 24 05:17:30 2003
@@ -338,7 +338,7 @@
  *
  */
  
-static inline int isicom_paranoia_check(struct isi_port const * port, kdev_t dev, 
+static inline int isicom_paranoia_check(struct isi_port const * port, char *name, 
 					const char * routine)
 {
 #ifdef ISICOM_DEBUG 
@@ -347,11 +347,11 @@
 	static const char * badport = 
 			KERN_WARNING "ISICOM: Warning: NULL isicom port for dev %s in %s.\n";		
 	if (!port) {
-		printk(badport, cdevname(dev), routine);
+		printk(badport, name, routine);
 		return 1;
 	}
 	if (port->magic != ISICOM_MAGIC) {
-		printk(badmagic, cdevname(dev), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}	
 #endif	
@@ -509,7 +509,8 @@
 } 		
  		
 /* main interrupt handler routine */ 		
-static void isicom_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+static irqreturn_t isicom_interrupt(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	struct isi_board * card;
 	struct isi_port * port;
@@ -534,7 +535,7 @@
 
 	if (!card || !(card->status & FIRMWARE_LOADED)) {
 /*		printk(KERN_DEBUG "ISICOM: interrupt: not handling irq%d!.\n", irq);*/
-		return;
+		return IRQ_NONE;
 	}
 	
 	base = card->base;
@@ -561,7 +562,7 @@
 			ClearInterrupt(base);
 		else
 			outw(0x0000, base+0x04); /* enable interrupts */		
-		return;			
+		return IRQ_HANDLED;			
 	}
 	port = card->ports + channel;
 	if (!(port->flags & ASYNC_INITIALIZED)) {
@@ -569,7 +570,7 @@
 			ClearInterrupt(base);
 		else
 			outw(0x0000, base+0x04); /* enable interrupts */
-		return;
+		return IRQ_HANDLED;
 	}	
 		
 	tty = port->tty;
@@ -702,7 +703,7 @@
 		ClearInterrupt(base);
 	else
 		outw(0x0000, base+0x04); /* enable interrupts */	
-	return;
+	return IRQ_HANDLED;
 } 
 
  /* called with interrupts disabled */ 
@@ -907,7 +908,7 @@
 	
 	/* trying to open a callout device... check for constraints */
 	
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 #ifdef ISICOM_DEBUG
 		printk(KERN_DEBUG "ISICOM: bl_ti_rdy: callout open.\n");	
 #endif		
@@ -1021,7 +1022,7 @@
 #ifdef ISICOM_DEBUG	
 	printk(KERN_DEBUG "ISICOM: open start!!!.\n");
 #endif	
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	
 #ifdef ISICOM_DEBUG	
 	printk(KERN_DEBUG "line = %d.\n", line);
@@ -1049,7 +1050,7 @@
 		return -ENODEV;
 	}	
 	port = &isi_ports[line];	
-	if (isicom_paranoia_check(port, tty->device, "isicom_open"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_open"))
 		return -ENODEV;
 		
 #ifdef ISICOM_DEBUG		
@@ -1072,7 +1073,7 @@
 		return error;
 		
 	if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = port->normal_termios;
 		else 
 			*tty->termios = port->callout_termios;
@@ -1146,7 +1147,7 @@
 	
 	if (!port)
 		return;
-	if (isicom_paranoia_check(port, tty->device, "isicom_close"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_close"))
 		return;
 	
 #ifdef ISICOM_DEBUG		
@@ -1196,8 +1197,8 @@
 		outw(card->port_status, card->base + 0x02);
 	}	
 	isicom_shutdown_port(port);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1232,7 +1233,7 @@
 	printk(KERN_DEBUG "ISICOM: isicom_write for port%d: %d bytes.\n",
 			port->channel+1, count);
 #endif	  	
-	if (isicom_paranoia_check(port, tty->device, "isicom_write"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_write"))
 		return 0;
 	
 	if (!tty || !port->xmit_buf || !tmp_buf)
@@ -1290,7 +1291,7 @@
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	unsigned long flags;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_put_char"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_put_char"))
 		return;
 	
 	if (!tty || !port->xmit_buf)
@@ -1317,7 +1318,7 @@
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_flush_chars"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_flush_chars"))
 		return;
 	
 	if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1334,7 +1335,7 @@
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	int free;
-	if (isicom_paranoia_check(port, tty->device, "isicom_write_room"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_write_room"))
 		return 0;
 	
 	free = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1347,7 +1348,7 @@
 static int isicom_chars_in_buffer(struct tty_struct * tty)
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
-	if (isicom_paranoia_check(port, tty->device, "isicom_chars_in_buffer"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_chars_in_buffer"))
 		return 0;
 	return port->xmit_cnt;
 }
@@ -1495,7 +1496,7 @@
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	int retval;
 
-	if (isicom_paranoia_check(port, tty->device, "isicom_ioctl"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
 		return -ENODEV;
 
 	switch(cmd) {
@@ -1556,7 +1557,7 @@
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	unsigned long flags;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_set_termios"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_set_termios"))
 		return;
 	
 	if (tty->termios->c_cflag == old_termios->c_cflag &&
@@ -1581,7 +1582,7 @@
 	struct isi_board * card = port->card;
 	unsigned long flags;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_throttle"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_throttle"))
 		return;
 	
 	/* tell the card that this port cannot handle any more data for now */
@@ -1598,7 +1599,7 @@
 	struct isi_board * card = port->card;
 	unsigned long flags;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_unthrottle"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_unthrottle"))
 		return;
 	
 	/* tell the card that this port is ready to accept more data */
@@ -1613,7 +1614,7 @@
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 
-	if (isicom_paranoia_check(port, tty->device, "isicom_stop"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_stop"))
 		return;
 	
 	/* this tells the transmitter not to consider this port for
@@ -1626,7 +1627,7 @@
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_start"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_start"))
 		return;
 	
 	/* this tells the transmitter to consider this port for
@@ -1650,7 +1651,7 @@
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_hangup"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_hangup"))
 		return;
 	
 	isicom_shutdown_port(port);
@@ -1666,7 +1667,7 @@
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
 	unsigned long flags;
 	
-	if (isicom_paranoia_check(port, tty->device, "isicom_flush_buffer"))
+	if (isicom_paranoia_check(port, tty->name, "isicom_flush_buffer"))
 		return;
 	
 	save_flags(flags); cli();
diff -Nru a/drivers/char/istallion.c b/drivers/char/istallion.c
--- a/drivers/char/istallion.c	Sat Mar 22 07:38:05 2003
+++ b/drivers/char/istallion.c	Mon Apr 21 20:58:42 2003
@@ -1031,11 +1031,11 @@
 	int		brdnr, portnr, rc;
 
 #if DEBUG
-	printk("stli_open(tty=%x,filp=%x): device=%x\n", (int) tty,
-		(int) filp, tty->device);
+	printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty,
+		(int) filp, tty->name);
 #endif
 
-	minordev = minor(tty->device);
+	minordev = tty->index;
 	brdnr = MINOR2BRD(minordev);
 	if (brdnr >= stli_nrbrds)
 		return(-ENODEV);
@@ -1115,7 +1115,7 @@
  *	previous opens still in effect. If we are a normal serial device
  *	then also we might have to wait for carrier.
  */
-	if (tty->driver.subtype == STL_DRVTYPCALLOUT) {
+	if (tty->driver->subtype == STL_DRVTYPCALLOUT) {
 		if (portp->flags & ASYNC_NORMAL_ACTIVE)
 			return(-EBUSY);
 		if (portp->flags & ASYNC_CALLOUT_ACTIVE) {
@@ -1139,7 +1139,7 @@
 	}
 
 	if ((portp->refcount == 1) && (portp->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == STL_DRVTYPSERIAL)
+		if (tty->driver->subtype == STL_DRVTYPSERIAL)
 			*tty->termios = portp->normaltermios;
 		else
 			*tty->termios = portp->callouttermios;
diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c
--- a/drivers/char/keyboard.c	Wed Feb 12 01:49:20 2003
+++ b/drivers/char/keyboard.c	Mon Apr 21 20:58:40 2003
@@ -601,7 +601,7 @@
 		return;
 	if ((kbd->kbdmode == VC_RAW || 
 	     kbd->kbdmode == VC_MEDIUMRAW) && 
-	     value != K_SAK)
+	     value != KVAL(K_SAK))
 		return;		/* SAK is allowed even in raw mode */
 	fn_handler[value](vc, regs);
 }
@@ -1089,7 +1089,7 @@
 		clear_bit(keycode, key_down);
 
 	if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || (tty && 
-		(!L_ECHO(tty) && tty->driver.chars_in_buffer(tty))))) {
+		(!L_ECHO(tty) && tty->driver->chars_in_buffer(tty))))) {
 		/*
 		 * Don't repeat a key if the input buffers are not empty and the
 		 * characters get aren't echoed locally. This makes key repeat 
diff -Nru a/drivers/char/lp.c b/drivers/char/lp.c
--- a/drivers/char/lp.c	Sat Mar 22 07:38:04 2003
+++ b/drivers/char/lp.c	Thu Apr 24 03:30:40 2003
@@ -733,15 +733,9 @@
 	parport_release (dev);
 }
 
-static kdev_t lp_console_device (struct console *c)
-{
-	return mk_kdev(LP_MAJOR, CONSOLE_LP);
-}
-
 static struct console lpcons = {
 	.name		= "lp",
 	.write		= lp_console_write,
-	.device		= lp_console_device,
 	.flags		= CON_PRINTBUFFER,
 };
 
diff -Nru a/drivers/char/lp_old98.c b/drivers/char/lp_old98.c
--- a/drivers/char/lp_old98.c	Thu Mar 13 17:23:19 2003
+++ b/drivers/char/lp_old98.c	Thu Apr 24 03:30:40 2003
@@ -441,15 +441,9 @@
 	}
 }
 
-static kdev_t lp_old98_console_device(struct console *console)
-{
-	return mk_kdev(LP_MAJOR, 0);
-}
-
 static struct console lp_old98_console = {
 	.name	= "lp_old98",
 	.write	= lp_old98_console_write,
-	.device	= lp_old98_console_device,
 	.flags	= CON_PRINTBUFFER,
 	.index	= -1,
 };
diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c	Sun Dec 29 10:28:56 2002
+++ b/drivers/char/mem.c	Sun Apr 20 16:21:18 2003
@@ -22,6 +22,7 @@
 #include <linux/tty.h>
 #include <linux/capability.h>
 #include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c
--- a/drivers/char/misc.c	Fri Apr 18 08:56:44 2003
+++ b/drivers/char/misc.c	Sat Apr 19 02:56:45 2003
@@ -167,7 +167,6 @@
 int misc_register(struct miscdevice * misc)
 {
 	struct miscdevice *c;
-	char buf[256];
 	
 	if (misc->next || misc->prev)
 		return -EBUSY;
@@ -197,14 +196,21 @@
 		misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
 
 
-	/* yuck, yet another stupid special-casing.  We should rather
-	   add ->devfs_name to avoid this mess. */
-	snprintf(buf, sizeof(buf), strchr(misc->name, '/') ?
-			"%s" : "misc/%s", misc->name);
-	misc->devfs_handle = devfs_register(NULL, buf, 0,
-			MISC_MAJOR, misc->minor,
-			S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,
-			misc->fops, NULL);
+	/*
+	 * please use it if you want to do fancy things with your
+	 * name...
+	 */
+	if (misc->devfs_name[0] == '\0') {
+		/* yuck, yet another stupid special-casing.
+		   whos actually using this?  Please switch over
+		   to ->devfs_name ASAP */
+		snprintf(misc->devfs_name, sizeof(misc->devfs_name),
+				strchr(misc->name, '/') ?
+				  "%s" : "misc/%s", misc->name);
+	}
+
+	devfs_register(NULL, misc->devfs_name, 0, MISC_MAJOR, misc->minor,
+			S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, misc->fops, NULL);
 
 	/*
 	 * Add it to the front, so that later devices can "override"
@@ -238,7 +244,7 @@
 	misc->next->prev = misc->prev;
 	misc->next = NULL;
 	misc->prev = NULL;
-	devfs_unregister (misc->devfs_handle);
+	devfs_remove(misc->devfs_name);
 	if (i < DYNAMIC_MINORS && i>0) {
 		misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
 	}
diff -Nru a/drivers/char/moxa.c b/drivers/char/moxa.c
--- a/drivers/char/moxa.c	Tue Feb 11 05:51:13 2003
+++ b/drivers/char/moxa.c	Mon Apr 21 20:58:42 2003
@@ -189,7 +189,7 @@
 
 #define WAKEUP_CHARS		256
 
-#define PORTNO(x)		(minor((x)->device) - (x)->driver.minor_start)
+#define PORTNO(x)		((x)->index)
 
 static int verbose = 0;
 static int ttymajor = MOXAMAJOR;
@@ -585,7 +585,7 @@
 	tty->driver_data = ch;
 	ch->tty = tty;
 	if (ch->count == 1 && (ch->asyncflags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = ch->normal_termios;
 		else
 			*tty->termios = ch->callout_termios;
@@ -644,8 +644,8 @@
 		ch->count = 1;
 	}
 	if (--ch->count < 0) {
-		printk("moxa_close: bad serial port count, minor=%d\n",
-		       minor(tty->device));
+		printk("moxa_close: bad serial port count, device=%s\n",
+		       tty->name);
 		ch->count = 0;
 	}
 	if (ch->count) {
@@ -671,8 +671,8 @@
 	shut_down(ch);
 	MoxaPortFlushData(port, 2);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1094,7 +1094,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (ch->asyncflags & ASYNC_NORMAL_ACTIVE)
 			return (-EBUSY);
 		if ((ch->asyncflags & ASYNC_CALLOUT_ACTIVE) &&
diff -Nru a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
--- a/drivers/char/mwave/tp3780i.c	Sun Nov 17 11:34:12 2002
+++ b/drivers/char/mwave/tp3780i.c	Mon Apr 21 00:55:57 2003
@@ -96,13 +96,14 @@
 }
 
 
-static void UartInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t UartInterrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	PRINTK_3(TRACE_TP3780I,
 		"tp3780i::UartInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+	return IRQ_HANDLED;
 }
 
-static void DspInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t DspInterrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
 	DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings;
@@ -150,6 +151,7 @@
 			"tp3780i::DspInterrupt, return false from dsp3780i_GetIPCSource\n");
 	}
 	PRINTK_1(TRACE_TP3780I, "tp3780i::DspInterrupt exit\n");
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/char/mxser.c b/drivers/char/mxser.c
--- a/drivers/char/mxser.c	Tue Feb 11 05:51:13 2003
+++ b/drivers/char/mxser.c	Thu Apr 24 05:17:30 2003
@@ -94,7 +94,7 @@
 #define 	UART_MCR_AFE		0x20
 #define 	UART_LSR_SPECIAL	0x1E
 
-#define PORTNO(x)		(minor((x)->device) - (x)->driver.minor_start)
+#define PORTNO(x)		((x)->index)
 
 #define RELEVANT_IFLAG(iflag)	(iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
 
@@ -348,7 +348,7 @@
 static void mxser_stop(struct tty_struct *);
 static void mxser_start(struct tty_struct *);
 static void mxser_hangup(struct tty_struct *);
-static void mxser_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t mxser_interrupt(int, void *, struct pt_regs *);
 static inline void mxser_receive_chars(struct mxser_struct *, int *);
 static inline void mxser_transmit_chars(struct mxser_struct *);
 static inline void mxser_check_modem_status(struct mxser_struct *, int);
@@ -758,7 +758,7 @@
 		return (retval);
 
 	if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else
 			*tty->termios = info->callout_termios;
@@ -862,8 +862,8 @@
 		}
 	}
 	mxser_shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1362,13 +1362,14 @@
 /*
  * This is the serial driver's generic interrupt routine
  */
-static void mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int status, i;
 	struct mxser_struct *info;
 	struct mxser_struct *port;
 	int max, irqbits, bits, msr;
 	int pass_counter = 0;
+	int handled = 0;
 
 	port = 0;
 	for (i = 0; i < MXSER_BOARDS; i++) {
@@ -1379,15 +1380,16 @@
 	}
 
 	if (i == MXSER_BOARDS)
-		return;
+		return IRQ_NONE;
 	if (port == 0)
-		return;
+		return IRQ_NONE;
 	max = mxser_numports[mxsercfg[i].board_type];
 
 	while (1) {
 		irqbits = inb(port->vector) & port->vectormask;
 		if (irqbits == port->vectormask)
 			break;
+		handled = 1;
 		for (i = 0, bits = 1; i < max; i++, irqbits |= bits, bits <<= 1) {
 			if (irqbits == port->vectormask)
 				break;
@@ -1417,6 +1419,7 @@
 			break;	/* Prevent infinite loops */
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 static inline void mxser_receive_chars(struct mxser_struct *info,
@@ -1574,7 +1577,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return (-EBUSY);
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
diff -Nru a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
--- a/drivers/char/n_hdlc.c	Tue Feb 25 02:08:20 2003
+++ b/drivers/char/n_hdlc.c	Mon Apr 21 20:58:41 2003
@@ -9,7 +9,7 @@
  *	Al Longyear <longyear@netcom.com>, Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>
  *
  * Original release 01/11/99
- * $Id: n_hdlc.c,v 4.2 2002/10/10 14:52:41 paulkf Exp $
+ * $Id: n_hdlc.c,v 4.6 2003/04/21 19:14:07 paulkf Exp $
  *
  * This code is released under the GNU General Public License (GPL)
  *
@@ -78,7 +78,7 @@
  */
 
 #define HDLC_MAGIC 0x239e
-#define HDLC_VERSION "$Revision: 4.2 $"
+#define HDLC_VERSION "$Revision: 4.6 $"
 
 #include <linux/version.h>
 #include <linux/config.h>
@@ -171,9 +171,9 @@
 /*
  * HDLC buffer list manipulation functions
  */
-void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list);
-void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf);
-N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list);
+static void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list);
+static void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf);
+static N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list);
 
 /* Local functions */
 
@@ -299,7 +299,6 @@
 			n_hdlc->tty = n_hdlc->backup_tty;
 		} else {
 			n_hdlc_release (n_hdlc);
-			MOD_DEC_USE_COUNT;
 		}
 	}
 	
@@ -320,9 +319,9 @@
 	struct n_hdlc *n_hdlc = tty2n_hdlc (tty);
 
 	if (debuglevel >= DEBUG_LEVEL_INFO)	
-		printk("%s(%d)n_hdlc_tty_open() called (major=%u,minor=%u)\n",
+		printk("%s(%d)n_hdlc_tty_open() called (device=%s)\n",
 		__FILE__,__LINE__,
-		major(tty->device), minor(tty->device));
+		tty->name);
 		
 	/* There should not be an existing table for this slot. */
 	if (n_hdlc) {
@@ -339,8 +338,6 @@
 	tty->disc_data = n_hdlc;
 	n_hdlc->tty    = tty;
 	
-	MOD_INC_USE_COUNT;
-	
 #if defined(TTY_NO_WRITE_SPLIT)
 	/* change tty_io write() to not split large writes into 8K chunks */
 	set_bit(TTY_NO_WRITE_SPLIT,&tty->flags);
@@ -351,8 +348,8 @@
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer (tty);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer (tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer (tty);
 		
 	if (debuglevel >= DEBUG_LEVEL_INFO)	
 		printk("%s(%d)n_hdlc_tty_open() success\n",__FILE__,__LINE__);
@@ -406,7 +403,7 @@
 			
 		/* Send the next block of data to device */
 		tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
-		actual = tty->driver.write(tty, 0, tbuf->buf, tbuf->count);
+		actual = tty->driver->write(tty, 0, tbuf->buf, tbuf->count);
 		    
 		/* if transmit error, throw frame away by */
 		/* pretending it was accepted by driver */
@@ -783,8 +780,8 @@
 
 	case TIOCOUTQ:
 		/* get the pending tx byte count in the driver */
-		count = tty->driver.chars_in_buffer ?
-				tty->driver.chars_in_buffer(tty) : 0;
+		count = tty->driver->chars_in_buffer ?
+				tty->driver->chars_in_buffer(tty) : 0;
 		/* add size of next output frame in queue */
 		spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock,flags);
 		if (n_hdlc->tx_buf_list.head)
@@ -903,7 +900,7 @@
  * Arguments:	 	list	pointer to buffer list
  * Return Value:	None	
  */
-void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list)
+static void n_hdlc_buf_list_init(N_HDLC_BUF_LIST *list)
 {
 	memset(list,0,sizeof(N_HDLC_BUF_LIST));
 	spin_lock_init(&list->spinlock);
@@ -920,7 +917,7 @@
  * 
  * Return Value:	None	
  */
-void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf)
+static void n_hdlc_buf_put(N_HDLC_BUF_LIST *list,N_HDLC_BUF *buf)
 {
 	unsigned long flags;
 	spin_lock_irqsave(&list->spinlock,flags);
@@ -950,7 +947,7 @@
  * 
  * 	pointer to HDLC buffer if available, otherwise NULL
  */
-N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list)
+static N_HDLC_BUF* n_hdlc_buf_get(N_HDLC_BUF_LIST *list)
 {
 	unsigned long flags;
 	N_HDLC_BUF *buf;
@@ -971,7 +968,25 @@
 
 static int __init n_hdlc_init(void)
 {
-	static struct tty_ldisc	n_hdlc_ldisc;
+	static struct tty_ldisc	n_hdlc_ldisc = {
+		TTY_LDISC_MAGIC,    /* magic */
+		"hdlc",             /* name */
+		0,                  /* num */
+		0,                  /* flags */
+		n_hdlc_tty_open,    /* open */
+		n_hdlc_tty_close,   /* close */
+		0,                  /* flush_buffer */
+		0,                  /* chars_in_buffer */
+		n_hdlc_tty_read,    /* read */
+		n_hdlc_tty_write,   /* write */
+		n_hdlc_tty_ioctl,   /* ioctl */
+		0,                  /* set_termios */
+		n_hdlc_tty_poll,    /* poll */
+		n_hdlc_tty_receive, /* receive_buf */
+		n_hdlc_tty_room,    /* receive_room */
+		n_hdlc_tty_wakeup,  /* write_wakeup */
+		THIS_MODULE         /* owner */
+	};
 	int    status;
 
 	/* range check maxframe arg */
@@ -982,21 +997,6 @@
 
 	printk("HDLC line discipline: version %s, maxframe=%u\n", 
 		szVersion, maxframe);
-
-	/* Register the tty discipline */
-	
-	memset(&n_hdlc_ldisc, 0, sizeof (n_hdlc_ldisc));
-	n_hdlc_ldisc.magic		= TTY_LDISC_MAGIC;
-	n_hdlc_ldisc.name          	= "hdlc";
-	n_hdlc_ldisc.open		= n_hdlc_tty_open;
-	n_hdlc_ldisc.close		= n_hdlc_tty_close;
-	n_hdlc_ldisc.read		= n_hdlc_tty_read;
-	n_hdlc_ldisc.write		= n_hdlc_tty_write;
-	n_hdlc_ldisc.ioctl		= n_hdlc_tty_ioctl;
-	n_hdlc_ldisc.poll		= n_hdlc_tty_poll;
-	n_hdlc_ldisc.receive_room	= n_hdlc_tty_room;
-	n_hdlc_ldisc.receive_buf	= n_hdlc_tty_receive;
-	n_hdlc_ldisc.write_wakeup	= n_hdlc_tty_wakeup;
 
 	status = tty_register_ldisc(N_HDLC, &n_hdlc_ldisc);
 	if (!status)
diff -Nru a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
--- a/drivers/char/n_r3964.c	Sat Oct 12 15:45:41 2002
+++ b/drivers/char/n_r3964.c	Mon Apr 21 20:58:40 2003
@@ -418,9 +418,9 @@
    if(tty==NULL)
       return;
 
-   if(tty->driver.put_char)
+   if(tty->driver->put_char)
    {
-      tty->driver.put_char(tty, ch);
+      tty->driver->put_char(tty, ch);
    }
    pInfo->bcc ^= ch;
 }
@@ -432,9 +432,9 @@
    if(tty==NULL)
       return;
 
-   if(tty->driver.flush_chars)
+   if(tty->driver->flush_chars)
    {
-      tty->driver.flush_chars(tty);
+      tty->driver->flush_chars(tty);
    }
 }
 
@@ -507,8 +507,8 @@
       return;
    }
 
-   if(tty->driver.write_room)
-      room=tty->driver.write_room(tty);
+   if(tty->driver->write_room)
+      room=tty->driver->write_room(tty);
 
    TRACE_PS("transmit_block %x, room %d, length %d", 
           (int)pBlock, room, pBlock->length);
diff -Nru a/drivers/char/n_tty.c b/drivers/char/n_tty.c
--- a/drivers/char/n_tty.c	Sat Mar 22 12:27:06 2003
+++ b/drivers/char/n_tty.c	Mon Apr 21 20:58:40 2003
@@ -117,8 +117,8 @@
 {
 	if (tty->count &&
 	    test_and_clear_bit(TTY_THROTTLED, &tty->flags) && 
-	    tty->driver.unthrottle)
-		tty->driver.unthrottle(tty);
+	    tty->driver->unthrottle)
+		tty->driver->unthrottle(tty);
 }
 
 /*
@@ -183,7 +183,7 @@
 {
 	int	space, spaces;
 
-	space = tty->driver.write_room(tty);
+	space = tty->driver->write_room(tty);
 	if (!space)
 		return -1;
 
@@ -195,7 +195,7 @@
 			if (O_ONLCR(tty)) {
 				if (space < 2)
 					return -1;
-				tty->driver.put_char(tty, '\r');
+				tty->driver->put_char(tty, '\r');
 				tty->column = 0;
 			}
 			tty->canon_column = tty->column;
@@ -217,7 +217,7 @@
 				if (space < spaces)
 					return -1;
 				tty->column += spaces;
-				tty->driver.write(tty, 0, "        ", spaces);
+				tty->driver->write(tty, 0, "        ", spaces);
 				return 0;
 			}
 			tty->column += spaces;
@@ -234,7 +234,7 @@
 			break;
 		}
 	}
-	tty->driver.put_char(tty, c);
+	tty->driver->put_char(tty, c);
 	return 0;
 }
 
@@ -250,7 +250,7 @@
 	int 	i;
 	char	*cp;
 
-	space = tty->driver.write_room(tty);
+	space = tty->driver->write_room(tty);
 	if (!space)
 		return 0;
 	if (nr > space)
@@ -296,9 +296,9 @@
 		}
 	}
 break_out:
-	if (tty->driver.flush_chars)
-		tty->driver.flush_chars(tty);
-	i = tty->driver.write(tty, 0, buf, i);	
+	if (tty->driver->flush_chars)
+		tty->driver->flush_chars(tty);
+	i = tty->driver->write(tty, 0, buf, i);	
 	return i;
 }
 
@@ -306,7 +306,7 @@
 
 static inline void put_char(unsigned char c, struct tty_struct *tty)
 {
-	tty->driver.put_char(tty, c);
+	tty->driver->put_char(tty, c);
 }
 
 /* Must be called only when L_ECHO(tty) is true. */
@@ -452,8 +452,8 @@
 		kill_pg(tty->pgrp, sig, 1);
 	if (flush || !L_NOFLSH(tty)) {
 		n_tty_flush_buffer(tty);
-		if (tty->driver.flush_buffer)
-			tty->driver.flush_buffer(tty);
+		if (tty->driver->flush_buffer)
+			tty->driver->flush_buffer(tty);
 	}
 }
 
@@ -782,8 +782,8 @@
 				break;
 			}
 		}
-		if (tty->driver.flush_chars)
-			tty->driver.flush_chars(tty);
+		if (tty->driver->flush_chars)
+			tty->driver->flush_chars(tty);
 	}
 
 	if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) {
@@ -800,8 +800,8 @@
 	if (n_tty_receive_room(tty) < TTY_THRESHOLD_THROTTLE) {
 		/* check TTY_THROTTLED first so it indicates our state */
 		if (!test_and_set_bit(TTY_THROTTLED, &tty->flags) &&
-		    tty->driver.throttle)
-			tty->driver.throttle(tty);
+		    tty->driver->throttle)
+			tty->driver->throttle(tty);
 	}
 }
 
@@ -869,7 +869,7 @@
 		tty->raw = 1;
 		if ((I_IGNBRK(tty) || (!I_BRKINT(tty) && !I_PARMRK(tty))) &&
 		    (I_IGNPAR(tty) || !I_INPCK(tty)) &&
-		    (tty->driver.flags & TTY_DRIVER_REAL_RAW))
+		    (tty->driver->flags & TTY_DRIVER_REAL_RAW))
 			tty->real_raw = 1;
 		else
 			tty->real_raw = 0;
@@ -1205,10 +1205,10 @@
 					break;
 				b++; nr--;
 			}
-			if (tty->driver.flush_chars)
-				tty->driver.flush_chars(tty);
+			if (tty->driver->flush_chars)
+				tty->driver->flush_chars(tty);
 		} else {
-			c = tty->driver.write(tty, 1, b, nr);
+			c = tty->driver->write(tty, 1, b, nr);
 			if (c < 0) {
 				retval = c;
 				goto break_out;
@@ -1251,7 +1251,7 @@
 		else
 			tty->minimum_to_wake = 1;
 	}
-	if (tty->driver.chars_in_buffer(tty) < WAKEUP_CHARS)
+	if (tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS)
 		mask |= POLLOUT | POLLWRNORM;
 	return mask;
 }
diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
--- a/drivers/char/pcmcia/synclink_cs.c	Mon Mar 17 07:43:03 2003
+++ b/drivers/char/pcmcia/synclink_cs.c	Mon Apr 21 20:58:42 2003
@@ -1,7 +1,7 @@
 /*
  * linux/drivers/char/pcmcia/synclink_cs.c
  *
- * $Id: synclink_cs.c,v 4.4 2002/10/10 14:53:37 paulkf Exp $
+ * $Id: synclink_cs.c,v 4.6 2003/04/21 17:46:55 paulkf Exp $
  *
  * Device driver for Microgate SyncLink PC Card
  * multiprotocol serial adapter.
@@ -442,9 +442,9 @@
 /*
  * ioctl handlers
  */
-static int set_modem_info(MGSLPC_INFO *info, unsigned int cmd,
-			  unsigned int *value);
-static int get_modem_info(MGSLPC_INFO *info, unsigned int *value);
+static int tiocmget(struct tty_struct *tty, struct file *file);
+static int tiocmset(struct tty_struct *tty, struct file *file,
+		    unsigned int set, unsigned int clear);
 static int get_stats(MGSLPC_INFO *info, struct mgsl_icount *user_icount);
 static int get_params(MGSLPC_INFO *info, MGSL_PARAMS *user_params);
 static int set_params(MGSLPC_INFO *info, MGSL_PARAMS *new_params);
@@ -496,7 +496,7 @@
 MODULE_LICENSE("GPL");
 
 static char *driver_name = "SyncLink PC Card driver";
-static char *driver_version = "$Revision: 4.4 $";
+static char *driver_version = "$Revision: 4.6 $";
 
 static struct tty_driver serial_driver, callout_driver;
 static int serial_refcount;
@@ -848,7 +848,7 @@
 }
 
 static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef MGSLPC_PARANOIA_CHECK
 	static const char *badmagic =
@@ -857,11 +857,11 @@
 		"Warning: null mgslpc_info for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != MGSLPC_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -901,7 +901,7 @@
 	MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
 	unsigned long flags;
 	
-	if (mgslpc_paranoia_check(info, tty->device, "tx_pause"))
+	if (mgslpc_paranoia_check(info, tty->name, "tx_pause"))
 		return;
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("tx_pause(%s)\n",info->device_name);	
@@ -917,7 +917,7 @@
 	MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
 	unsigned long flags;
 	
-	if (mgslpc_paranoia_check(info, tty->device, "tx_release"))
+	if (mgslpc_paranoia_check(info, tty->name, "tx_release"))
 		return;
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("tx_release(%s)\n",info->device_name);	
@@ -1703,7 +1703,7 @@
 			__FILE__,__LINE__,ch,info->device_name);
 	}
 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_put_char"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char"))
 		return;
 
 	if (!tty || !info->tx_buf)
@@ -1734,7 +1734,7 @@
 		printk( "%s(%d):mgslpc_flush_chars() entry on %s tx_count=%d\n",
 			__FILE__,__LINE__,info->device_name,info->tx_count);
 	
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_flush_chars"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_chars"))
 		return;
 
 	if (info->tx_count <= 0 || tty->stopped ||
@@ -1773,7 +1773,7 @@
 		printk( "%s(%d):mgslpc_write(%s) count=%d\n",
 			__FILE__,__LINE__,info->device_name,count);
 	
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_write") ||
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write") ||
 	    !tty || !info->tx_buf)
 		goto cleanup;
 
@@ -1835,7 +1835,7 @@
 	MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
 	int ret;
 				
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_write_room"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write_room"))
 		return 0;
 
 	if (info->params.mode == MGSL_MODE_HDLC) {
@@ -1867,7 +1867,7 @@
 		printk("%s(%d):mgslpc_chars_in_buffer(%s)\n",
 			 __FILE__,__LINE__, info->device_name );
 			 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_chars_in_buffer"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_chars_in_buffer"))
 		return 0;
 		
 	if (info->params.mode == MGSL_MODE_HDLC)
@@ -1893,7 +1893,7 @@
 		printk("%s(%d):mgslpc_flush_buffer(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
 	
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_flush_buffer"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_buffer"))
 		return;
 		
 	spin_lock_irqsave(&info->lock,flags); 
@@ -1918,7 +1918,7 @@
 		printk("%s(%d):mgslpc_send_xchar(%s,%d)\n",
 			 __FILE__,__LINE__, info->device_name, ch );
 			 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_send_xchar"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_send_xchar"))
 		return;
 
 	info->x_char = ch;
@@ -1941,7 +1941,7 @@
 		printk("%s(%d):mgslpc_throttle(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_throttle"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1966,7 +1966,7 @@
 		printk("%s(%d):mgslpc_unthrottle(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_unthrottle"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -2326,94 +2326,56 @@
 	return rc;
 }
 
-/* Return state of the serial control/status signals
- * 	
- * Arguments:	 	info	pointer to device instance data
- * 			value	pointer to int to hold returned info
- * 	
- * Return Value:	0 if success, otherwise error code
+/* return the state of the serial control and status signals
  */
-static int get_modem_info(MGSLPC_INFO * info, unsigned int *value)
+static int tiocmget(struct tty_struct *tty, struct file *file)
 {
+	MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
 	unsigned int result;
  	unsigned long flags;
-	int err;
- 
+
 	spin_lock_irqsave(&info->lock,flags);
  	get_signals(info);
 	spin_unlock_irqrestore(&info->lock,flags);
 
-	result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) |
-		 ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) |
-		 ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) |
-		 ((info->serial_signals & SerialSignal_RI)  ? TIOCM_RNG:0) |
-		 ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) |
-		 ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0);
+	result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) +
+		((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) +
+		((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) +
+		((info->serial_signals & SerialSignal_RI)  ? TIOCM_RNG:0) +
+		((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) +
+		((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0);
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
-		printk("mgslpc_get_modem_info %s value=%08X\n", info->device_name, result);
-			
-	PUT_USER(err,result,value);
-	return err ? -EFAULT : 0;
+		printk("%s(%d):%s tiocmget() value=%08X\n",
+			 __FILE__,__LINE__, info->device_name, result );
+	return result;
 }
 
-/* Set the state of the modem control signals (DTR/RTS)
- * 	
- * Arguments:
- * 
- * 	info	pointer to device instance data
- * 	cmd	signal command: TIOCMBIS = set bit TIOCMBIC = clear bit
- *		TIOCMSET = set/clear signal values
- * 	value	bit mask for command
- * 	
- * Return Value:	0 if success, otherwise error code
+/* set modem control signals (DTR/RTS)
  */
-static int set_modem_info(MGSLPC_INFO * info, unsigned int cmd,
-			  unsigned int *value)
+static int tiocmset(struct tty_struct *tty, struct file *file,
+		    unsigned int set, unsigned int clear)
 {
- 	int error;
- 	unsigned int arg;
+	MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
  	unsigned long flags;
- 
+
 	if (debug_level >= DEBUG_LEVEL_INFO)
-		printk("mgslpc_set_modem_info %s\n", info->device_name);
-			
- 	GET_USER(error,arg,value);
- 	if (error)
- 		return error;
-		
- 	switch (cmd) {
- 	case TIOCMBIS: 
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals |= SerialSignal_RTS;
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals |= SerialSignal_DTR;
- 		break;
- 	case TIOCMBIC:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals &= ~SerialSignal_RTS;
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals &= ~SerialSignal_DTR;
- 		break;
- 	case TIOCMSET:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals |= SerialSignal_RTS;
-		else
- 			info->serial_signals &= ~SerialSignal_RTS;
-		
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals |= SerialSignal_DTR;
-		else
- 			info->serial_signals &= ~SerialSignal_DTR;
- 		break;
- 	default:
- 		return -EINVAL;
- 	}
-	
+		printk("%s(%d):%s tiocmset(%x,%x)\n",
+			__FILE__,__LINE__,info->device_name, set, clear);
+
+	if (set & TIOCM_RTS)
+		info->serial_signals |= SerialSignal_RTS;
+	if (set & TIOCM_DTR)
+		info->serial_signals |= SerialSignal_DTR;
+	if (clear & TIOCM_RTS)
+		info->serial_signals &= ~SerialSignal_RTS;
+	if (clear & TIOCM_DTR)
+		info->serial_signals &= ~SerialSignal_DTR;
+
 	spin_lock_irqsave(&info->lock,flags);
  	set_signals(info);
 	spin_unlock_irqrestore(&info->lock,flags);
-	
+
 	return 0;
 }
 
@@ -2431,7 +2393,7 @@
 		printk("%s(%d):mgslpc_break(%s,%d)\n",
 			 __FILE__,__LINE__, info->device_name, break_state);
 			 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_break"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_break"))
 		return;
 
 	spin_lock_irqsave(&info->lock,flags);
@@ -2462,7 +2424,7 @@
 		printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
 			info->device_name, cmd );
 	
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_ioctl"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -2482,12 +2444,6 @@
 	unsigned long flags;
 	
 	switch (cmd) {
-	case TIOCMGET:
-		return get_modem_info(info, (unsigned int *) arg);
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		return set_modem_info(info, cmd, (unsigned int *) arg);
 	case MGSL_IOCGPARAMS:
 		return get_params(info,(MGSL_PARAMS *)arg);
 	case MGSL_IOCSPARAMS:
@@ -2560,7 +2516,7 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):mgslpc_set_termios %s\n", __FILE__,__LINE__,
-			tty->driver.name );
+			tty->driver->name );
 	
 	/* just return if nothing has changed */
 	if ((tty->termios->c_cflag == old_termios->c_cflag)
@@ -2604,7 +2560,7 @@
 {
 	MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
 
-	if (!info || mgslpc_paranoia_check(info, tty->device, "mgslpc_close"))
+	if (!info || mgslpc_paranoia_check(info, tty->name, "mgslpc_close"))
 		return;
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2659,8 +2615,8 @@
  	if (info->flags & ASYNC_INITIALIZED)
  		mgslpc_wait_until_sent(tty, info->timeout);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 		
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
@@ -2686,8 +2642,7 @@
 cleanup:			
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):mgslpc_close(%s) exit, count=%d\n", __FILE__,__LINE__,
-			tty->driver.name, info->count);
-	MOD_DEC_USE_COUNT;
+			tty->driver->name, info->count);
 }
 
 /* Wait until the transmitter is empty.
@@ -2704,7 +2659,7 @@
 		printk("%s(%d):mgslpc_wait_until_sent(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
       
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_wait_until_sent"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_wait_until_sent"))
 		return;
 
 	if (!(info->flags & ASYNC_INITIALIZED))
@@ -2766,7 +2721,7 @@
 		printk("%s(%d):mgslpc_hangup(%s)\n",
 			 __FILE__,__LINE__, info->device_name );
 			 
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_hangup"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_hangup"))
 		return;
 
 	mgslpc_flush_buffer(tty);
@@ -2792,9 +2747,9 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):block_til_ready on %s\n",
-			 __FILE__,__LINE__, tty->driver.name );
+			 __FILE__,__LINE__, tty->driver->name );
 
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		/* this is a callout device */
 		/* just verify that normal device is not in use */
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
@@ -2840,7 +2795,7 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):block_til_ready before block on %s count=%d\n",
-			 __FILE__,__LINE__, tty->driver.name, info->count );
+			 __FILE__,__LINE__, tty->driver->name, info->count );
 
 	spin_lock_irqsave(&info->lock, flags);
 	if (!tty_hung_up_p(filp)) {
@@ -2884,7 +2839,7 @@
 		
 		if (debug_level >= DEBUG_LEVEL_INFO)
 			printk("%s(%d):block_til_ready blocking on %s count=%d\n",
-				 __FILE__,__LINE__, tty->driver.name, info->count );
+				 __FILE__,__LINE__, tty->driver->name, info->count );
 				 
 		schedule();
 	}
@@ -2898,7 +2853,7 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):block_til_ready after blocking on %s count=%d\n",
-			 __FILE__,__LINE__, tty->driver.name, info->count );
+			 __FILE__,__LINE__, tty->driver->name, info->count );
 			 
 	if (!retval)
 		info->flags |= ASYNC_NORMAL_ACTIVE;
@@ -2913,7 +2868,7 @@
 	unsigned long flags;
 
 	/* verify range of specified line number */	
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= mgslpc_device_count)) {
 		printk("%s(%d):mgslpc_open with illegal line #%d.\n",
 			__FILE__,__LINE__,line);
@@ -2932,15 +2887,13 @@
 	
 	tty->driver_data = info;
 	info->tty = tty;
-	if (mgslpc_paranoia_check(info, tty->device, "mgslpc_open"))
+	if (mgslpc_paranoia_check(info, tty->name, "mgslpc_open"))
 		return -ENODEV;
 		
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):mgslpc_open(%s), old ref count = %d\n",
-			 __FILE__,__LINE__,tty->driver.name, info->count);
+			 __FILE__,__LINE__,tty->driver->name, info->count);
 
-	MOD_INC_USE_COUNT;
-	
 	/* If port is closing, signal caller to try again */
 	if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){
 		if (info->flags & ASYNC_CLOSING)
@@ -2978,7 +2931,7 @@
 
 	if ((info->count == 1) &&
 	    info->flags & ASYNC_SPLIT_TERMIOS) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -2995,7 +2948,6 @@
 	
 cleanup:			
 	if (retval) {
-		MOD_DEC_USE_COUNT;
 		if(info->count)
 			info->count--;
 	}
@@ -3247,6 +3199,7 @@
 	
     memset(&serial_driver, 0, sizeof(struct tty_driver));
     serial_driver.magic = TTY_DRIVER_MAGIC;
+    serial_driver.owner = THIS_MODULE;
     serial_driver.driver_name = "synclink_cs";
     serial_driver.name = "ttySLP";
     serial_driver.major = ttymajor;
@@ -3282,6 +3235,8 @@
     serial_driver.stop = tx_pause;
     serial_driver.start = tx_release;
     serial_driver.hangup = mgslpc_hangup;
+    serial_driver.tiocmget = tiocmget;
+    serial_driver.tiocmset = tiocmset;
 	
     /*
      * The callout device is just like normal device except for
@@ -4386,7 +4341,7 @@
 {
 	MGSLPC_INFO *info = d->priv;
 	int err;
-	long flags;
+	unsigned long flags;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("mgslpc_sppp_open(%s)\n",info->netname);	
@@ -4398,7 +4353,6 @@
 		return -EBUSY;
 	}
 	info->netcount=1;
-	MOD_INC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 
 	/* claim resources and init adapter */
@@ -4421,7 +4375,6 @@
 open_fail:
 	spin_lock_irqsave(&info->netlock, flags);
 	info->netcount=0;
-	MOD_DEC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 	return err;
 }
@@ -4429,7 +4382,7 @@
 void mgslpc_sppp_tx_timeout(struct net_device *dev)
 {
 	MGSLPC_INFO *info = dev->priv;
-	long flags;
+	unsigned long flags;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("mgslpc_sppp_tx_timeout(%s)\n",info->netname);	
@@ -4491,7 +4444,6 @@
 
 	spin_lock_irqsave(&info->netlock, flags);
 	info->netcount=0;
-	MOD_DEC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 	return 0;
 }
diff -Nru a/drivers/char/pcxx.c b/drivers/char/pcxx.c
--- a/drivers/char/pcxx.c	Mon Oct  7 07:38:26 2002
+++ b/drivers/char/pcxx.c	Mon Apr 21 20:58:42 2003
@@ -405,7 +405,7 @@
 	int boardnum;
 	int retval;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 
 	if(line < 0 || line >= nbdevs) {
 		printk("line out of range in pcxe_open\n");
@@ -482,7 +482,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (ch->asyncflags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if (ch->asyncflags & ASYNC_CALLOUT_ACTIVE) {
@@ -517,7 +517,7 @@
 	save_flags(flags);
 	cli();
 	if((ch->count == 1) && (ch->asyncflags & ASYNC_SPLIT_TERMIOS)) {
-		if(tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if(tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = ch->normal_termios;
 		else 
 			*tty->termios = ch->callout_termios;
@@ -617,8 +617,8 @@
 			tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */
 		}
 	
-		if(tty->driver.flush_buffer)
-			tty->driver.flush_buffer(tty);
+		if(tty->driver->flush_buffer)
+			tty->driver->flush_buffer(tty);
 		if(tty->ldisc.flush_buffer)
 			tty->ldisc.flush_buffer(tty);
 		shutdown(info);
@@ -2070,7 +2070,7 @@
 
 	if(bc->orun) {
 		bc->orun = 0;
-		printk("overrun! DigiBoard device minor=%d\n",minor(tty->device));
+		printk("overrun! DigiBoard device %s\n", tty->name);
 	}
 
 	rxwinon(ch);
diff -Nru a/drivers/char/pty.c b/drivers/char/pty.c
--- a/drivers/char/pty.c	Mon Mar 31 00:16:19 2003
+++ b/drivers/char/pty.c	Mon Apr 21 20:58:43 2003
@@ -52,23 +52,23 @@
 
 #ifdef CONFIG_UNIX98_PTYS
 /* These are global because they are accessed in tty_io.c */
-struct tty_driver ptm_driver[UNIX98_NR_MAJORS];
-struct tty_driver pts_driver[UNIX98_NR_MAJORS];
+struct tty_driver ptm_driver;
+struct tty_driver pts_driver;
 
-static struct tty_struct *ptm_table[UNIX98_NR_MAJORS][NR_PTYS];
-static struct termios *ptm_termios[UNIX98_NR_MAJORS][NR_PTYS];
-static struct termios *ptm_termios_locked[UNIX98_NR_MAJORS][NR_PTYS];
-static struct tty_struct *pts_table[UNIX98_NR_MAJORS][NR_PTYS];
-static struct termios *pts_termios[UNIX98_NR_MAJORS][NR_PTYS];
-static struct termios *pts_termios_locked[UNIX98_NR_MAJORS][NR_PTYS];
-static struct pty_struct ptm_state[UNIX98_NR_MAJORS][NR_PTYS];
+static struct tty_struct *ptm_table[UNIX98_NR_MAJORS*NR_PTYS];
+static struct termios *ptm_termios[UNIX98_NR_MAJORS*NR_PTYS];
+static struct termios *ptm_termios_locked[UNIX98_NR_MAJORS*NR_PTYS];
+static struct tty_struct *pts_table[UNIX98_NR_MAJORS*NR_PTYS];
+static struct termios *pts_termios[UNIX98_NR_MAJORS*NR_PTYS];
+static struct termios *pts_termios_locked[UNIX98_NR_MAJORS*NR_PTYS];
+static struct pty_struct ptm_state[UNIX98_NR_MAJORS*NR_PTYS];
 #endif
 
 static void pty_close(struct tty_struct * tty, struct file * filp)
 {
 	if (!tty)
 		return;
-	if (tty->driver.subtype == PTY_TYPE_MASTER) {
+	if (tty->driver->subtype == PTY_TYPE_MASTER) {
 		if (tty->count > 1)
 			printk("master pty_close: count = %d!!\n", tty->count);
 	} else {
@@ -84,18 +84,12 @@
 	wake_up_interruptible(&tty->link->read_wait);
 	wake_up_interruptible(&tty->link->write_wait);
 	set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
-	if (tty->driver.subtype == PTY_TYPE_MASTER) {
+	if (tty->driver->subtype == PTY_TYPE_MASTER) {
 		set_bit(TTY_OTHER_CLOSED, &tty->flags);
 #ifdef CONFIG_UNIX98_PTYS
-		{
-			unsigned int major = major(tty->device) - UNIX98_PTY_MASTER_MAJOR;
-			if ( major < UNIX98_NR_MAJORS ) {
-				devpts_pty_kill( minor(tty->device)
-			  - tty->driver.minor_start + tty->driver.name_base );
-			}
-		}
+		if (tty->driver == &ptm_driver)
+			devpts_pty_kill(tty->index);
 #endif
-		tty_unregister_device (&tty->link->driver, minor(tty->device));
 		tty_vhangup(tty->link);
 	}
 }
@@ -221,7 +215,7 @@
 	/* The ldisc must report 0 if no characters available to be read */
 	count = to->ldisc.chars_in_buffer(to);
 
-	if (tty->driver.subtype == PTY_TYPE_SLAVE) return count;
+	if (tty->driver->subtype == PTY_TYPE_SLAVE) return count;
 
 	/* Master side driver ... if the other side's read buffer is less than 
 	 * half full, return 0 to allow writers to proceed; otherwise return
@@ -239,8 +233,7 @@
 #ifdef CONFIG_UNIX98_PTYS
 static int pty_get_device_number(struct tty_struct *tty, unsigned int *value)
 {
-	unsigned int result = minor(tty->device)
-		- tty->driver.minor_start + tty->driver.name_base;
+	unsigned int result = tty->index;
 	return put_user(result, value);
 }
 #endif
@@ -314,10 +307,8 @@
 	retval = -ENODEV;
 	if (!tty || !tty->link)
 		goto out;
-	line = minor(tty->device) - tty->driver.minor_start;
-	if ((line < 0) || (line >= NR_PTYS))
-		goto out;
-	pty = (struct pty_struct *)(tty->driver.driver_state) + line;
+	line = tty->index;
+	pty = (struct pty_struct *)(tty->driver->driver_state) + line;
 	tty->driver_data = pty;
 
 	retval = -EIO;
@@ -357,7 +348,7 @@
 	pty_driver.owner = THIS_MODULE;
 	pty_driver.driver_name = "pty_master";
 #ifdef CONFIG_DEVFS_FS
-	pty_driver.name = "pty/m%d";
+	pty_driver.name = "pty/m";
 #else
 	pty_driver.name = "pty";
 #endif
@@ -392,7 +383,7 @@
 	pty_slave_driver.driver_name = "pty_slave";
 	pty_slave_driver.proc_entry = 0;
 #ifdef CONFIG_DEVFS_FS
-	pty_slave_driver.name = "pty/s%d";
+	pty_slave_driver.name = "pty/s";
 #else
 	pty_slave_driver.name = "ttyp";
 #endif
@@ -427,52 +418,41 @@
 #ifdef CONFIG_UNIX98_PTYS
 	devfs_mk_dir("pts");
 	printk("pty: %d Unix98 ptys configured\n", UNIX98_NR_MAJORS*NR_PTYS);
-	for ( i = 0 ; i < UNIX98_NR_MAJORS ; i++ ) {
-		int j;
+	ptm_driver = pty_driver;
+	ptm_driver.name = "ptm";
+	ptm_driver.proc_entry = 0;
+	ptm_driver.major = UNIX98_PTY_MASTER_MAJOR;
+	ptm_driver.minor_start = 0;
+	ptm_driver.num = UNIX98_NR_MAJORS * NR_PTYS;
+	ptm_driver.other = &pts_driver;
+	ptm_driver.flags |= TTY_DRIVER_NO_DEVFS;
+	ptm_driver.table = ptm_table;
+	ptm_driver.termios = ptm_termios;
+	ptm_driver.termios_locked = ptm_termios_locked;
+	ptm_driver.driver_state = ptm_state;
 
-		ptm_driver[i] = pty_driver;
-		ptm_driver[i].name = "ptm";
-		ptm_driver[i].proc_entry = 0;
-		ptm_driver[i].major = UNIX98_PTY_MASTER_MAJOR+i;
-		ptm_driver[i].minor_start = 0;
-		ptm_driver[i].name_base = i*NR_PTYS;
-		ptm_driver[i].num = NR_PTYS;
-		ptm_driver[i].other = &pts_driver[i];
-		ptm_driver[i].flags |= TTY_DRIVER_NO_DEVFS;
-		ptm_driver[i].table = ptm_table[i];
-		ptm_driver[i].termios = ptm_termios[i];
-		ptm_driver[i].termios_locked = ptm_termios_locked[i];
-		ptm_driver[i].driver_state = ptm_state[i];
-
-		for (j = 0; j < NR_PTYS; j++)
-			init_waitqueue_head(&ptm_state[i][j].open_wait);
-		
-		pts_driver[i] = pty_slave_driver;
-#ifdef CONFIG_DEVFS_FS
-		pts_driver[i].name = "pts/%d";
-#else
-		pts_driver[i].name = "pts";
-#endif
-		pts_driver[i].proc_entry = 0;
-		pts_driver[i].major = UNIX98_PTY_SLAVE_MAJOR+i;
-		pts_driver[i].minor_start = 0;
-		pts_driver[i].name_base = i*NR_PTYS;
-		pts_driver[i].num = ptm_driver[i].num;
-		pts_driver[i].other = &ptm_driver[i];
-		pts_driver[i].table = pts_table[i];
-		pts_driver[i].termios = pts_termios[i];
-		pts_driver[i].termios_locked = pts_termios_locked[i];
-		pts_driver[i].driver_state = ptm_state[i];
-		
-		ptm_driver[i].ioctl = pty_unix98_ioctl;
-		
-		if (tty_register_driver(&ptm_driver[i]))
-			panic("Couldn't register Unix98 ptm driver major %d",
-			      ptm_driver[i].major);
-		if (tty_register_driver(&pts_driver[i]))
-			panic("Couldn't register Unix98 pts driver major %d",
-			      pts_driver[i].major);
-	}
+	for (i = 0; i < UNIX98_NR_MAJORS*NR_PTYS; i++)
+		init_waitqueue_head(&ptm_state[i].open_wait);
+	
+	pts_driver = pty_slave_driver;
+	pts_driver.name = "pts";
+	pts_driver.proc_entry = 0;
+	pts_driver.major = UNIX98_PTY_SLAVE_MAJOR;
+	pts_driver.minor_start = 0;
+	pts_driver.num = UNIX98_NR_MAJORS * NR_PTYS;
+	pts_driver.other = &ptm_driver;
+	pts_driver.flags |= TTY_DRIVER_NO_DEVFS;
+	pts_driver.table = pts_table;
+	pts_driver.termios = pts_termios;
+	pts_driver.termios_locked = pts_termios_locked;
+	pts_driver.driver_state = ptm_state;
+	
+	ptm_driver.ioctl = pty_unix98_ioctl;
+	
+	if (tty_register_driver(&ptm_driver))
+		panic("Couldn't register Unix98 ptm driver");
+	if (tty_register_driver(&pts_driver))
+		panic("Couldn't register Unix98 pts driver");
 #endif
 	return 0;
 }
diff -Nru a/drivers/char/rio/func.h b/drivers/char/rio/func.h
--- a/drivers/char/rio/func.h	Mon Jun 17 05:10:09 2002
+++ b/drivers/char/rio/func.h	Mon Apr 21 20:58:42 2003
@@ -139,7 +139,7 @@
 int riotopen(struct tty_struct * tty, struct file * filp);
 int riotclose(void  *ptr);
 int RIOCookMode(struct ttystatics *);
-int riotioctl(struct rio_info *, dev_t, register int, register caddr_t); 
+int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t); 
 void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
 
 /* riotable.c */
@@ -166,8 +166,8 @@
 #endif
 
 extern int    rio_pcicopy(char *src, char *dst, int n);
-extern int rio_minor (kdev_t device);
-extern int rio_ismodem (kdev_t device);
+extern int rio_minor (struct tty_struct *tty);
+extern int rio_ismodem (struct tty_struct *tty);
 extern void rio_udelay (int usecs);
 
 extern void rio_start_card_running (struct Host * HostP);
diff -Nru a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
--- a/drivers/char/rio/rio_linux.c	Thu Apr 17 12:37:32 2003
+++ b/drivers/char/rio/rio_linux.c	Thu Apr 24 05:17:30 2003
@@ -293,7 +293,7 @@
 /* This doesn't work. Who's paranoid around here? Not me! */
 
 static inline int rio_paranoia_check(struct rio_port const * port,
-				    kdev_t device, const char *routine)
+				    char *name, const char *routine)
 {
 
   static const char *badmagic =
@@ -302,11 +302,11 @@
     KERN_ERR "rio: Warning: null rio port for device %s in %s\n";
  
   if (!port) {
-    printk (badinfo, cdevname(device), routine);
+    printk (badinfo, name, routine);
     return 1;
   }
   if (port->magic != RIO_MAGIC) {
-    printk (badmagic, cdevname(device), routine);
+    printk (badmagic, name, routine);
     return 1;
   }
 
@@ -372,18 +372,15 @@
 }
 
 
-int rio_minor (kdev_t device)
+int rio_minor(struct tty_struct *tty)
 {
-  return minor (device) + 
-    256 * ((major (device) == RIO_NORMAL_MAJOR1) ||
-	   (major (device) == RIO_CALLOUT_MAJOR1));
+	return tty->index + (tty->driver->termios - rio_termios);
 }
 
 
-int rio_ismodem (kdev_t device)
+int rio_ismodem(struct tty_struct *tty)
 {
-  return (major (device) == RIO_NORMAL_MAJOR0) ||
-         (major (device) == RIO_NORMAL_MAJOR1);
+	return tty->driver == &rio_driver || tty->driver == &rio_driver2;
 }
 
 
@@ -423,7 +420,7 @@
 
   tty = ((struct Port *)ptr)->gs.tty;
 
-  modem = (major(tty->device) == RIO_NORMAL_MAJOR0) || (major(tty->device) == RIO_NORMAL_MAJOR1);
+  modem = rio_ismodem(tty);
 
   rv = RIOParam( (struct Port *) ptr, CONFIG, modem, 1);
 
@@ -448,7 +445,7 @@
 }
 
 
-static void rio_interrupt (int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t rio_interrupt (int irq, void *ptr, struct pt_regs *regs)
 {
   struct Host *HostP;
   func_enter ();
@@ -509,7 +506,7 @@
   if (test_and_set_bit (RIO_BOARD_INTR_LOCK, &HostP->locks)) {
     printk (KERN_ERR "Recursive interrupt! (host %d/irq%d)\n", 
             (int) ptr, HostP->Ivec);
-    return;
+    return IRQ_HANDLED;
   }
 
   RIOServiceHost(p, HostP, irq);
@@ -521,6 +518,7 @@
   rio_dprintk (RIO_DEBUG_IFLOW, "rio: exit rio_interrupt (%d/%d)\n", 
                irq, HostP->Ivec); 
   func_exit ();
+  return IRQ_HANDLED;
 }
 
 
@@ -942,7 +940,9 @@
   rio_driver.hangup = gs_hangup;
 
   rio_driver2 = rio_driver;
-  rio_driver.major = RIO_NORMAL_MAJOR1;
+  rio_driver2.major = RIO_NORMAL_MAJOR1;
+  rio_driver2.termios += 256;
+  rio_driver2.termios_locked += 256;
 
   rio_callout_driver = rio_driver;
   rio_callout_driver.name = "cusr";
@@ -951,6 +951,8 @@
 
   rio_callout_driver2 = rio_callout_driver;
   rio_callout_driver2.major = RIO_CALLOUT_MAJOR1;
+  rio_callout_driver2.termios += 256;
+  rio_callout_driver2.termios_locked += 256;
 
   rio_dprintk (RIO_DEBUG_INIT, "set_termios = %p\n", gs_set_termios);
 
diff -Nru a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
--- a/drivers/char/rio/riotty.c	Tue Mar 18 08:58:24 2003
+++ b/drivers/char/rio/riotty.c	Mon Apr 21 20:58:42 2003
@@ -159,8 +159,8 @@
 	*/
 	tty->driver_data = NULL;
         
-	SysPort = rio_minor (tty->device);
-	Modem   = rio_ismodem (tty->device);
+	SysPort = rio_minor(tty);
+	Modem   = rio_ismodem(tty);
 
 	if ( p->RIOFailed ) {
 		rio_dprintk (RIO_DEBUG_TTY, "System initialisation failed\n");
@@ -549,7 +549,7 @@
 	else 
 		end_time = jiffies + MAX_SCHEDULE_TIMEOUT;
 
-	Modem = rio_ismodem(tty->device);
+	Modem = rio_ismodem(tty);
 #if 0
 	/* What F.CKING cache? Even then, a higly idle multiprocessor,
 	   system with large caches this won't work . Better find out when 
@@ -882,11 +882,7 @@
 ** its all about.
 */
 int
-riotioctl(p, dev, cmd, arg)
-struct rio_info *		p;
-dev_t dev;
-register int cmd;
-register caddr_t arg;
+riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg)
 {
 	register struct		Port *PortP;
 	register struct		ttystatics *tp;
@@ -898,8 +894,8 @@
 	short				vpix_cflag;
 	short				divisor;
 	int					baud;
-	uint				SysPort = dev;
-	int					Modem = rio_ismodem(dev);
+	uint				SysPort = rio_minor(tty);
+	int				Modem = rio_ismodem(tty);
 	int					ioctl_processed;
 
 	rio_dprintk (RIO_DEBUG_TTY, "port ioctl SysPort %d command 0x%x argument 0x%x %s\n",
diff -Nru a/drivers/char/riscom8.c b/drivers/char/riscom8.c
--- a/drivers/char/riscom8.c	Mon Feb  3 05:47:46 2003
+++ b/drivers/char/riscom8.c	Thu Apr 24 05:17:30 2003
@@ -131,7 +131,7 @@
 
 
 static inline int rc_paranoia_check(struct riscom_port const * port,
-				    kdev_t device, const char *routine)
+				    char *name, const char *routine)
 {
 #ifdef RISCOM_PARANOIA_CHECK
 	static const char badmagic[] = KERN_INFO
@@ -140,11 +140,11 @@
 		"rc: Warning: null riscom port for device %s in %s\n";
 
 	if (!port) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (port->magic != RISCOM8_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -590,23 +590,24 @@
 }
 
 /* The main interrupt processing routine */
-static void rc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+static irqreturn_t rc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 {
 	unsigned char status;
 	unsigned char ack;
 	struct riscom_board *bp;
 	unsigned long loop = 0;
-	
+	int handled = 0;
+
 	bp = IRQ_to_board[irq];
 	
 	if (!bp || !(bp->flags & RC_BOARD_ACTIVE))  {
-		return;
+		return IRQ_NONE;
 	}
 	
 	while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) &
 				 (RC_BSR_TOUT | RC_BSR_TINT |
 				  RC_BSR_MINT | RC_BSR_RINT))) {
-	
+		handled = 1;
 		if (status & RC_BSR_TOUT) 
 			printk(KERN_WARNING "rc%d: Got timeout. Hardware "
 					    "error?\n", board_No(bp));
@@ -648,6 +649,7 @@
 		rc_out(bp, CD180_EOIR, 0);   /* Mark end of interrupt */
 		rc_out(bp, RC_CTOUT, 0);     /* Clear timeout flag    */
 	}
+	return IRQ_RETVAL(handled);
 }
 
 /*
@@ -991,7 +993,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == RISCOM_TYPE_CALLOUT) {
+	if (tty->driver->subtype == RISCOM_TYPE_CALLOUT) {
 		if (port->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((port->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1089,13 +1091,13 @@
 	struct riscom_board * bp;
 	unsigned long flags;
 	
-	board = RC_BOARD(minor(tty->device));
+	board = RC_BOARD(tty->index);
 	if (board >= RC_NBOARD || !(rc_board[board].flags & RC_BOARD_PRESENT))
 		return -ENODEV;
 	
 	bp = &rc_board[board];
-	port = rc_port + board * RC_NPORT + RC_PORT(minor(tty->device));
-	if (rc_paranoia_check(port, tty->device, "rc_open"))
+	port = rc_port + board * RC_NPORT + RC_PORT(tty->index);
+	if (rc_paranoia_check(port, tty->name, "rc_open"))
 		return -ENODEV;
 	
 	if ((error = rc_setup_board(bp))) 
@@ -1112,7 +1114,7 @@
 		return error;
 	
 	if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == RISCOM_TYPE_NORMAL)
+		if (tty->driver->subtype == RISCOM_TYPE_NORMAL)
 			*tty->termios = port->normal_termios;
 		else
 			*tty->termios = port->callout_termios;
@@ -1134,7 +1136,7 @@
 	unsigned long flags;
 	unsigned long timeout;
 	
-	if (!port || rc_paranoia_check(port, tty->device, "close"))
+	if (!port || rc_paranoia_check(port, tty->name, "close"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1198,8 +1200,8 @@
 		}
 	}
 	rc_shutdown_port(bp, port);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1226,7 +1228,7 @@
 	int c, total = 0;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_write"))
+	if (rc_paranoia_check(port, tty->name, "rc_write"))
 		return 0;
 	
 	bp = port_Board(port);
@@ -1302,7 +1304,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	unsigned long flags;
 
-	if (rc_paranoia_check(port, tty->device, "rc_put_char"))
+	if (rc_paranoia_check(port, tty->name, "rc_put_char"))
 		return;
 
 	if (!tty || !port->xmit_buf)
@@ -1324,7 +1326,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_flush_chars"))
+	if (rc_paranoia_check(port, tty->name, "rc_flush_chars"))
 		return;
 	
 	if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1343,7 +1345,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	int	ret;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_write_room"))
+	if (rc_paranoia_check(port, tty->name, "rc_write_room"))
 		return 0;
 
 	ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1356,7 +1358,7 @@
 {
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_chars_in_buffer"))
+	if (rc_paranoia_check(port, tty->name, "rc_chars_in_buffer"))
 		return 0;
 	
 	return port->xmit_cnt;
@@ -1367,7 +1369,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_flush_buffer"))
+	if (rc_paranoia_check(port, tty->name, "rc_flush_buffer"))
 		return;
 
 	save_flags(flags); cli();
@@ -1531,7 +1533,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	int retval;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_ioctl"))
+	if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
 		return -ENODEV;
 	
 	switch (cmd) {
@@ -1581,7 +1583,7 @@
 	struct riscom_board *bp;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_throttle"))
+	if (rc_paranoia_check(port, tty->name, "rc_throttle"))
 		return;
 	
 	bp = port_Board(port);
@@ -1604,7 +1606,7 @@
 	struct riscom_board *bp;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_unthrottle"))
+	if (rc_paranoia_check(port, tty->name, "rc_unthrottle"))
 		return;
 	
 	bp = port_Board(port);
@@ -1627,7 +1629,7 @@
 	struct riscom_board *bp;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_stop"))
+	if (rc_paranoia_check(port, tty->name, "rc_stop"))
 		return;
 	
 	bp = port_Board(port);
@@ -1645,7 +1647,7 @@
 	struct riscom_board *bp;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_start"))
+	if (rc_paranoia_check(port, tty->name, "rc_start"))
 		return;
 	
 	bp = port_Board(port);
@@ -1684,7 +1686,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	struct riscom_board *bp;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_hangup"))
+	if (rc_paranoia_check(port, tty->name, "rc_hangup"))
 		return;
 	
 	bp = port_Board(port);
@@ -1702,7 +1704,7 @@
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
 	unsigned long flags;
 				
-	if (rc_paranoia_check(port, tty->device, "rc_set_termios"))
+	if (rc_paranoia_check(port, tty->name, "rc_set_termios"))
 		return;
 	
 	if (tty->termios->c_cflag == old_termios->c_cflag &&
diff -Nru a/drivers/char/rocket.c b/drivers/char/rocket.c
--- a/drivers/char/rocket.c	Thu Nov 21 09:57:44 2002
+++ b/drivers/char/rocket.c	Mon Apr 21 20:58:42 2003
@@ -176,15 +176,15 @@
 static void rp_start(struct tty_struct *tty);
 
 static inline int rocket_paranoia_check(struct r_port *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef ROCKET_PARANOIA_CHECK
 	static const char *badmagic =
-		"Warning: bad magic number for rocketport struct (%d, %d) in %s\n";
+		"Warning: bad magic number for rocketport struct %s in %s\n";
 	if (!info)
 		return 1;
 	if (info->magic != RPORT_MAGIC) {
-		printk(badmagic, major(device), minor(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -710,7 +710,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ROCKET_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ROCKET_CALLOUT_ACTIVE) &&
@@ -822,7 +822,7 @@
 	CHANNEL_t	*cp;
 	unsigned long page;
 	
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= MAX_RP_PORTS))
 		return -ENODEV;
 	if (!tmp_buf) {
@@ -946,7 +946,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ROCKET_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -963,7 +963,7 @@
 	int timeout;
 	CHANNEL_t	*cp;
 
-	if (rocket_paranoia_check(info, tty->device, "rp_close"))
+	if (rocket_paranoia_check(info, tty->name, "rp_close"))
 		return;
 
 #ifdef ROCKET_DEBUG_OPEN
@@ -1048,8 +1048,8 @@
 	if (C_HUPCL(tty)) {
 		sClrDTR(cp);
 	}
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
@@ -1093,7 +1093,7 @@
 	unsigned cflag;
 	
 
-	if (rocket_paranoia_check(info, tty->device, "rp_set_termios"))
+	if (rocket_paranoia_check(info, tty->name, "rp_set_termios"))
 		return;
 
 	cflag = tty->termios->c_cflag;
@@ -1145,7 +1145,7 @@
 	struct r_port * info = (struct r_port *)tty->driver_data;
 	unsigned long flags;
 	
-	if (rocket_paranoia_check(info, tty->device, "rp_break"))
+	if (rocket_paranoia_check(info, tty->name, "rp_break"))
 		return;
 
 	save_flags(flags); cli();
@@ -1295,7 +1295,7 @@
 	struct r_port * info = (struct r_port *)tty->driver_data;
 
 	if (cmd != RCKP_GET_PORTS &&
-	    rocket_paranoia_check(info, tty->device, "rp_ioctl"))
+	    rocket_paranoia_check(info, tty->name, "rp_ioctl"))
 		return -ENODEV;
 
 	switch (cmd) {
@@ -1325,25 +1325,12 @@
 	return 0;
 }
 
-#if (defined(ROCKET_DEBUG_FLOW) || defined(ROCKET_DEBUG_THROTTLE))
-static char *rp_tty_name(struct tty_struct *tty, char *buf)
-{
-	if (tty)
-		sprintf(buf, "%s%d", tty->driver.name,
-			minor(tty->device) - tty->driver.minor_start +
-			tty->driver.name_base);
-	else
-		strcpy(buf, "NULL tty");
-	return buf;
-}
-#endif
-
 static void rp_send_xchar(struct tty_struct *tty, char ch)
 {
 	struct r_port *info = (struct r_port *)tty->driver_data;
 	CHANNEL_t *cp;
 
-	if (rocket_paranoia_check(info, tty->device, "rp_send_xchar"))
+	if (rocket_paranoia_check(info, tty->name, "rp_send_xchar"))
 		return;
 
 	cp = &info->channel;
@@ -1360,11 +1347,11 @@
 #ifdef ROCKET_DEBUG_THROTTLE
 	char	buf[64];
 	
-	printk("throttle %s: %d....\n", rp_tty_name(tty, buf),
+	printk("throttle %s: %d....\n", tty->name,
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (rocket_paranoia_check(info, tty->device, "rp_throttle"))
+	if (rocket_paranoia_check(info, tty->name, "rp_throttle"))
 		return;
 
 	cp = &info->channel;
@@ -1381,11 +1368,11 @@
 #ifdef ROCKET_DEBUG_THROTTLE
 	char	buf[64];
 	
-	printk("unthrottle %s: %d....\n", rp_tty_name(tty, buf),
+	printk("unthrottle %s: %d....\n", tty->name,
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (rocket_paranoia_check(info, tty->device, "rp_throttle"))
+	if (rocket_paranoia_check(info, tty->name, "rp_throttle"))
 		return;
 
 	cp = &info->channel;
@@ -1409,11 +1396,11 @@
 #ifdef ROCKET_DEBUG_FLOW
 	char	buf[64];
 	
-	printk("stop %s: %d %d....\n", rp_tty_name(tty, buf),
+	printk("stop %s: %d %d....\n", tty->name,
 	       info->xmit_cnt, info->xmit_fifo_room);
 #endif
 
-	if (rocket_paranoia_check(info, tty->device, "rp_stop"))
+	if (rocket_paranoia_check(info, tty->name, "rp_stop"))
 		return;
 
 	if (sGetTxCnt(&info->channel))
@@ -1426,11 +1413,11 @@
 #ifdef ROCKET_DEBUG_FLOW
 	char	buf[64];
 	
-	printk("start %s: %d %d....\n", rp_tty_name(tty, buf),
+	printk("start %s: %d %d....\n", tty->name,
 	       info->xmit_cnt, info->xmit_fifo_room);
 #endif
 
-	if (rocket_paranoia_check(info, tty->device, "rp_stop"))
+	if (rocket_paranoia_check(info, tty->name, "rp_stop"))
 		return;
 
 	sEnTransmit(&info->channel);
@@ -1448,7 +1435,7 @@
 	int check_time, exit_time;
 	int txcnt;
 	
-	if (rocket_paranoia_check(info, tty->device, "rp_wait_until_sent"))
+	if (rocket_paranoia_check(info, tty->name, "rp_wait_until_sent"))
 		return;
 
 	cp = &info->channel;
@@ -1498,7 +1485,7 @@
 	CHANNEL_t	*cp;
 	struct r_port * info = (struct r_port *)tty->driver_data;
 	
-	if (rocket_paranoia_check(info, tty->device, "rp_hangup"))
+	if (rocket_paranoia_check(info, tty->name, "rp_hangup"))
 		return;
 
 #if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_HANGUP))
@@ -1553,7 +1540,7 @@
 	struct r_port * info = (struct r_port *)tty->driver_data;
 	CHANNEL_t	*cp;
 
-	if (rocket_paranoia_check(info, tty->device, "rp_put_char"))
+	if (rocket_paranoia_check(info, tty->name, "rp_put_char"))
 		return;
 
 #ifdef ROCKET_DEBUG_WRITE
@@ -1586,7 +1573,7 @@
 	int		c, retval = 0;
 	unsigned long	flags;
 
-	if (count <= 0 || rocket_paranoia_check(info, tty->device, "rp_write"))
+	if (count <= 0 || rocket_paranoia_check(info, tty->name, "rp_write"))
 		return 0;
 
 #ifdef ROCKET_DEBUG_WRITE
@@ -1687,7 +1674,7 @@
 	struct r_port * info = (struct r_port *)tty->driver_data;
 	int	ret;
 
-	if (rocket_paranoia_check(info, tty->device, "rp_write_room"))
+	if (rocket_paranoia_check(info, tty->name, "rp_write_room"))
 		return 0;
 
 	ret = XMIT_BUF_SIZE - info->xmit_cnt - 1;
@@ -1708,7 +1695,7 @@
 	struct r_port * info = (struct r_port *)tty->driver_data;
 	CHANNEL_t	*cp;
 
-	if (rocket_paranoia_check(info, tty->device, "rp_chars_in_buffer"))
+	if (rocket_paranoia_check(info, tty->name, "rp_chars_in_buffer"))
 		return 0;
 
 	cp = &info->channel;
@@ -1724,7 +1711,7 @@
 	struct r_port * info = (struct r_port *)tty->driver_data;
 	CHANNEL_t	*cp;
 
-	if (rocket_paranoia_check(info, tty->device, "rp_flush_buffer"))
+	if (rocket_paranoia_check(info, tty->name, "rp_flush_buffer"))
 		return;
 
 	cli();
@@ -2026,7 +2013,7 @@
 	memset(&rocket_driver, 0, sizeof(struct tty_driver));
 	rocket_driver.magic = TTY_DRIVER_MAGIC;
 #ifdef CONFIG_DEVFS_FS
-	rocket_driver.name = "tts/R%d";
+	rocket_driver.name = "tts/R";
 #else
 	rocket_driver.name = "ttyR";
 #endif
@@ -2068,7 +2055,7 @@
 	 */
 	callout_driver = rocket_driver;
 #ifdef CONFIG_DEVFS_FS
-	callout_driver.name = "cua/R%d";
+	callout_driver.name = "cua/R";
 #else
 	callout_driver.name = "cur";
 #endif
diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c
--- a/drivers/char/rtc.c	Tue Mar 18 08:58:24 2003
+++ b/drivers/char/rtc.c	Mon Apr 21 10:36:31 2003
@@ -180,7 +180,7 @@
  *	(See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
  */
 
-static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
 	 *	Can be an alarm interrupt, update complete interrupt,
@@ -207,6 +207,8 @@
 	wake_up_interruptible(&rtc_wait);	
 
 	kill_fasync (&rtc_async_queue, SIGIO, POLL_IN);
+
+	return IRQ_HANDLED;
 }
 #endif
 
diff -Nru a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
--- a/drivers/char/ser_a2232.c	Mon Feb 24 10:14:21 2003
+++ b/drivers/char/ser_a2232.c	Mon Apr 21 20:58:42 2003
@@ -456,7 +456,7 @@
 	int retval;
 	struct a2232_port *port;
 
-	line = minor(tty->device);
+	line = tty->index;
 	port = &a2232_ports[line];
 	
 	tty->driver_data = port;
@@ -480,7 +480,7 @@
 	}
 
 	if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)){
-		if (tty->driver.subtype == A2232_TTY_SUBTYPE_NORMAL)
+		if (tty->driver->subtype == A2232_TTY_SUBTYPE_NORMAL)
 			*tty->termios = port->gs.normal_termios;
 		else 
 			*tty->termios = port->gs.callout_termios;
diff -Nru a/drivers/char/serial167.c b/drivers/char/serial167.c
--- a/drivers/char/serial167.c	Tue Mar 18 07:43:19 2003
+++ b/drivers/char/serial167.c	Thu Apr 24 03:30:40 2003
@@ -237,30 +237,30 @@
 }
 
 static inline int
-serial_paranoia_check(struct cyclades_port *info, kdev_t device,
+serial_paranoia_check(struct cyclades_port *info, char *name,
 		      const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
     static const char *badmagic =
-	"Warning: bad magic number for serial struct (%d, %d) in %s\n";
+	"Warning: bad magic number for serial struct (%s) in %s\n";
     static const char *badinfo =
-	"Warning: null cyclades_port for (%d, %d) in %s\n";
+	"Warning: null cyclades_port for (%s) in %s\n";
     static const char *badrange =
-	"Warning: cyclades_port out of range for (%d, %d) in %s\n";
+	"Warning: cyclades_port out of range for (%s) in %s\n";
 
     if (!info) {
-	printk(badinfo, major(device), minor(device), routine);
+	printk(badinfo, name, routine);
 	return 1;
     }
 
     if( (long)info < (long)(&cy_port[0])
     || (long)(&cy_port[NR_PORTS]) < (long)info ){
-	printk(badrange, major(device), minor(device), routine);
+	printk(badrange, name, routine);
 	return 1;
     }
 
     if (info->magic != CYCLADES_MAGIC) {
-	printk(badmagic, major(device), minor(device), routine);
+	printk(badmagic, name, routine);
 	return 1;
     }
 #endif
@@ -339,10 +339,10 @@
   unsigned long flags;
 
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_stop ttyS%d\n", info->line); /* */
+    printk("cy_stop %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_stop"))
+    if (serial_paranoia_check(info, tty->name, "cy_stop"))
 	return;
 	
     channel = info->line;
@@ -364,10 +364,10 @@
   unsigned long flags;
 
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_start ttyS%d\n", info->line); /* */
+    printk("cy_start %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_start"))
+    if (serial_paranoia_check(info, tty->name, "cy_start"))
 	return;
 	
     channel = info->line;
@@ -1171,10 +1171,10 @@
   unsigned long flags;
 
 #ifdef SERIAL_DEBUG_IO
-    printk("cy_put_char ttyS%d(0x%02x)\n", info->line, ch);
+    printk("cy_put_char %s(0x%02x)\n", tty->name, ch);
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_put_char"))
+    if (serial_paranoia_check(info, tty->name, "cy_put_char"))
 	return;
 
     if (!tty || !info->xmit_buf)
@@ -1202,10 +1202,10 @@
   int channel;
 				
 #ifdef SERIAL_DEBUG_IO
-    printk("cy_flush_chars ttyS%d\n", info->line); /* */
+    printk("cy_flush_chars %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_flush_chars"))
+    if (serial_paranoia_check(info, tty->name, "cy_flush_chars"))
 	return;
 
     if (info->xmit_cnt <= 0 || tty->stopped
@@ -1236,10 +1236,10 @@
   int c, total = 0;
 
 #ifdef SERIAL_DEBUG_IO
-    printk("cy_write ttyS%d\n", info->line); /* */
+    printk("cy_write %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_write")){
+    if (serial_paranoia_check(info, tty->name, "cy_write")){
 	return 0;
     }
 	
@@ -1312,10 +1312,10 @@
   int	ret;
 				
 #ifdef SERIAL_DEBUG_IO
-    printk("cy_write_room ttyS%d\n", info->line); /* */
+    printk("cy_write_room %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_write_room"))
+    if (serial_paranoia_check(info, tty->name, "cy_write_room"))
 	return 0;
     ret = PAGE_SIZE - info->xmit_cnt - 1;
     if (ret < 0)
@@ -1330,10 +1330,10 @@
   struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
 				
 #ifdef SERIAL_DEBUG_IO
-    printk("cy_chars_in_buffer ttyS%d %d\n", info->line, info->xmit_cnt); /* */
+    printk("cy_chars_in_buffer %s %d\n", tty->name, info->xmit_cnt); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_chars_in_buffer"))
+    if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer"))
 	return 0;
 
     return info->xmit_cnt;
@@ -1347,10 +1347,10 @@
   unsigned long flags;
 				
 #ifdef SERIAL_DEBUG_IO
-    printk("cy_flush_buffer ttyS%d\n", info->line); /* */
+    printk("cy_flush_buffer %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_flush_buffer"))
+    if (serial_paranoia_check(info, tty->name, "cy_flush_buffer"))
 	return;
     local_irq_save(flags);
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1379,10 +1379,10 @@
 	
     printk("throttle %s: %d....\n", tty_name(tty, buf),
 	   tty->ldisc.chars_in_buffer(tty));
-    printk("cy_throttle ttyS%d\n", info->line);
+    printk("cy_throttle %s\n", tty->name);
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_nthrottle")){
+    if (serial_paranoia_check(info, tty->name, "cy_nthrottle")){
 	    return;
     }
 
@@ -1415,10 +1415,10 @@
 	
     printk("throttle %s: %d....\n", tty_name(tty, buf),
 	   tty->ldisc.chars_in_buffer(tty));
-    printk("cy_unthrottle ttyS%d\n", info->line);
+    printk("cy_unthrottle %s\n", tty->name);
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_nthrottle")){
+    if (serial_paranoia_check(info, tty->name, "cy_nthrottle")){
 	    return;
     }
 
@@ -1743,7 +1743,7 @@
   int ret_val = 0;
 
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_ioctl ttyS%d, cmd = %x arg = %lx\n", info->line, cmd, arg); /* */
+    printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */
 #endif
 
     switch (cmd) {
@@ -1836,7 +1836,7 @@
   struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
 
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_set_termios ttyS%d\n", info->line);
+    printk("cy_set_termios %s\n", tty->name);
 #endif
 
     if (tty->termios->c_cflag == old_termios->c_cflag)
@@ -1865,15 +1865,15 @@
 
 /* CP('C'); */
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_close ttyS%d\n", info->line);
+    printk("cy_close %s\n", tty->name);
 #endif
 
     if (!info
-    || serial_paranoia_check(info, tty->device, "cy_close")){
+    || serial_paranoia_check(info, tty->name, "cy_close")){
         return;
     }
 #ifdef SERIAL_DEBUG_OPEN
-    printk("cy_close ttyS%d, count = %d\n", info->line, info->count);
+    printk("cy_close %s, count = %d\n", tty->name, info->count);
 #endif
 
     if ((tty->count == 1) && (info->count != 1)) {
@@ -1913,8 +1913,8 @@
     if (info->flags & ASYNC_INITIALIZED)
 	tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */
     shutdown(info);
-    if (tty->driver.flush_buffer)
-	tty->driver.flush_buffer(tty);
+    if (tty->driver->flush_buffer)
+	tty->driver->flush_buffer(tty);
     if (tty->ldisc.flush_buffer)
 	tty->ldisc.flush_buffer(tty);
     info->event = 0;
@@ -1954,10 +1954,10 @@
   struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
 	
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_hangup ttyS%d\n", info->line); /* */
+    printk("cy_hangup %s\n", tty->name); /* */
 #endif
 
-    if (serial_paranoia_check(info, tty->device, "cy_hangup"))
+    if (serial_paranoia_check(info, tty->name, "cy_hangup"))
 	return;
     
     shutdown(info);
@@ -2008,7 +2008,7 @@
      * If this is a callout device, then just make sure the normal
      * device isn't being used.
      */
-    if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+    if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 	if (info->flags & ASYNC_NORMAL_ACTIVE){
 	    return -EBUSY;
 	}
@@ -2048,8 +2048,8 @@
     retval = 0;
     add_wait_queue(&info->open_wait, &wait);
 #ifdef SERIAL_DEBUG_OPEN
-    printk("block_til_ready before block: ttyS%d, count = %d\n",
-	   info->line, info->count);/**/
+    printk("block_til_ready before block: %s, count = %d\n",
+	   tty->name, info->count);/**/
 #endif
     info->count--;
 #ifdef SERIAL_DEBUG_COUNT
@@ -2098,8 +2098,8 @@
 	    break;
 	}
 #ifdef SERIAL_DEBUG_OPEN
-	printk("block_til_ready blocking: ttyS%d, count = %d\n",
-	       info->line, info->count);/**/
+	printk("block_til_ready blocking: %s, count = %d\n",
+	       tty->name, info->count);/**/
 #endif
 	schedule();
     }
@@ -2113,8 +2113,8 @@
     }
     info->blocked_open--;
 #ifdef SERIAL_DEBUG_OPEN
-    printk("block_til_ready after blocking: ttyS%d, count = %d\n",
-	   info->line, info->count);/**/
+    printk("block_til_ready after blocking: %s, count = %d\n",
+	   tty->name, info->count);/**/
 #endif
     if (retval)
 	    return retval;
@@ -2133,7 +2133,7 @@
   int retval, line;
 
 /* CP('O'); */
-    line = minor(tty->device) - tty->driver.minor_start;
+    line = tty->index;
     if ((line < 0) || (NR_PORTS <= line)){
         return -ENODEV;
     }
@@ -2142,13 +2142,13 @@
         return -ENODEV;
     }
 #ifdef SERIAL_DEBUG_OTHER
-    printk("cy_open ttyS%d\n", info->line); /* */
+    printk("cy_open %s\n", tty->name); /* */
 #endif
-    if (serial_paranoia_check(info, tty->device, "cy_open")){
+    if (serial_paranoia_check(info, tty->name, "cy_open")){
         return -ENODEV;
     }
 #ifdef SERIAL_DEBUG_OPEN
-    printk("cy_open ttyS%d, count = %d\n", info->line, info->count);/**/
+    printk("cy_open %s, count = %d\n", tty->name, info->count);/**/
 #endif
     info->count++;
 #ifdef SERIAL_DEBUG_COUNT
@@ -2165,7 +2165,7 @@
     }
 
     if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
-	if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+	if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 	    *tty->termios = info->normal_termios;
 	else 
 	    *tty->termios = info->callout_termios;
@@ -2396,7 +2396,7 @@
     memset(&cy_serial_driver, 0, sizeof(struct tty_driver));
     cy_serial_driver.magic = TTY_DRIVER_MAGIC;
 #ifdef CONFIG_DEVFS_FS
-    cy_serial_driver.name = "tts/%d";
+    cy_serial_driver.name = "tts/";
 #else
     cy_serial_driver.name = "ttyS";
 #endif
@@ -2435,7 +2435,7 @@
      */
     cy_callout_driver = cy_serial_driver;
 #ifdef CONFIG_DEVFS_FS
-    cy_callout_driver.name = "cua/%d";
+    cy_callout_driver.name = "cua/";
 #else
     cy_callout_driver.name = "cua";
 #endif
@@ -2814,9 +2814,10 @@
 	local_irq_restore(flags);
 }
 
-static kdev_t serial167_console_device(struct console *c)
+static struct tty_driver *serial167_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &cy_serial_driver;
 }
 
 
diff -Nru a/drivers/char/serial_tx3912.c b/drivers/char/serial_tx3912.c
--- a/drivers/char/serial_tx3912.c	Tue Mar 18 07:43:35 2003
+++ b/drivers/char/serial_tx3912.c	Thu Apr 24 03:30:40 2003
@@ -547,7 +547,7 @@
 		return -EIO;
 	}
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	rs_dprintk (TX3912_UART_DEBUG_OPEN, "%d: opening line %d. tty=%p ctty=%p)\n", 
 	            (int) current->pid, line, tty, current->tty);
 
@@ -602,7 +602,7 @@
 	/* tty->low_latency = 1; */
 
 	if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = port->gs.normal_termios;
 		else 
 			*tty->termios = port->gs.callout_termios;
@@ -1004,9 +1004,10 @@
     	}
 }
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &rs_driver;
 }
 
 static __init int serial_console_setup(struct console *co, char *options)
diff -Nru a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c
--- a/drivers/char/sh-sci.c	Tue Mar 18 07:43:51 2003
+++ b/drivers/char/sh-sci.c	Thu Apr 24 03:30:40 2003
@@ -812,7 +812,7 @@
 	struct sci_port *port;
 	int retval, line;
 
-	line = minor(tty->device) - SCI_MINOR_START;
+	line = tty->index;
 
 	if ((line < 0) || (line >= SCI_NPORTS))
 		return -ENODEV;
@@ -853,7 +853,7 @@
 	}
 
 	if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = port->gs.normal_termios;
 		else 
 			*tty->termios = port->gs.callout_termios;
@@ -1021,7 +1021,7 @@
 	sci_driver.magic = TTY_DRIVER_MAGIC;
 	sci_driver.driver_name = "sci";
 #ifdef CONFIG_DEVFS_FS
-	sci_driver.name = "ttsc/%d";
+	sci_driver.name = "ttsc/";
 #else
 	sci_driver.name = "ttySC";
 #endif
@@ -1060,7 +1060,7 @@
 
 	sci_callout_driver = sci_driver;
 #ifdef CONFIG_DEVFS_FS
-	sci_callout_driver.name = "cusc/%d";
+	sci_callout_driver.name = "cusc/";
 #else
 	sci_callout_driver.name = "cusc";
 #endif
@@ -1179,9 +1179,10 @@
 	put_string(sercons_port, s, count);
 }
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return mk_kdev(SCI_MAJOR, SCI_MINOR_START + c->index);
+	*index = c->index;
+	return &sci_driver;
 }
 
 /*
diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c
--- a/drivers/char/sonypi.c	Tue Apr  1 13:08:01 2003
+++ b/drivers/char/sonypi.c	Mon Apr 21 00:53:24 2003
@@ -305,7 +305,7 @@
 }
 
 /* Interrupt handler: some event is available */
-void sonypi_irq(int irq, void *dev_id, struct pt_regs *regs) {
+static irqreturn_t sonypi_irq(int irq, void *dev_id, struct pt_regs *regs) {
 	u8 v1, v2, event = 0;
 	int i, j;
 
@@ -334,7 +334,7 @@
 	if (verbose)
 		printk(KERN_WARNING 
 		       "sonypi: unknown event port1=0x%02x,port2=0x%02x\n",v1,v2);
-	return;
+	return IRQ_NONE;
 
 found:
 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
@@ -354,6 +354,7 @@
 	}
 #endif /* CONFIG_INPUT || CONFIG_INPUT_MODULE */
 	sonypi_pushq(event);
+	return IRQ_HANDLED;
 }
 
 /* External camera command (exported to the motion eye v4l driver) */
diff -Nru a/drivers/char/specialix.c b/drivers/char/specialix.c
--- a/drivers/char/specialix.c	Mon Feb  3 05:47:46 2003
+++ b/drivers/char/specialix.c	Thu Apr 24 05:17:30 2003
@@ -204,13 +204,13 @@
 
 #ifdef SPECIALIX_TIMER
 static struct timer_list missed_irq_timer;
-static void sx_interrupt(int irq, void * dev_id, struct pt_regs * regs);
+static irqreturn_t sx_interrupt(int irq, void * dev_id, struct pt_regs * regs);
 #endif
 
 
 
 static inline int sx_paranoia_check(struct specialix_port const * port,
-				    kdev_t device, const char *routine)
+				    char *name, const char *routine)
 {
 #ifdef SPECIALIX_PARANOIA_CHECK
 	static const char *badmagic =
@@ -219,11 +219,11 @@
 		KERN_ERR "sx: Warning: null specialix port for device %s in %s\n";
  
 	if (!port) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (port->magic != SPECIALIX_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -876,7 +876,7 @@
 
 
 /* The main interrupt processing routine */
-static void sx_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+static irqreturn_t sx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned char status;
 	unsigned char ack;
@@ -890,7 +890,7 @@
 #ifdef SPECIALIX_DEBUG 
 		printk (KERN_DEBUG "sx: False interrupt. irq %d.\n", irq);
 #endif
-		return;
+		return IRQ_NONE;
 	}
 
 	saved_reg = bp->reg;
@@ -933,6 +933,7 @@
 	}
 	bp->reg = saved_reg;
 	outb (bp->reg, bp->base + SX_ADDR_REG);
+	return IRQ_HANDLED;
 }
 
 
@@ -1349,7 +1350,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SPECIALIX_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SPECIALIX_TYPE_CALLOUT) {
 		if (port->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((port->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1454,20 +1455,20 @@
 	struct specialix_board * bp;
 	unsigned long flags;
 	
-	board = SX_BOARD(minor(tty->device));
+	board = SX_BOARD(tty->index);
 
 	if (board >= SX_NBOARD || !(sx_board[board].flags & SX_BOARD_PRESENT))
 		return -ENODEV;
 	
 	bp = &sx_board[board];
-	port = sx_port + board * SX_NPORT + SX_PORT(minor(tty->device));
+	port = sx_port + board * SX_NPORT + SX_PORT(tty->index);
 
 #ifdef DEBUG_SPECIALIX
 	printk (KERN_DEBUG "Board = %d, bp = %p, port = %p, portno = %d.\n", 
-	        board, bp, port, SX_PORT(minor(tty->device)));
+	        board, bp, port, SX_PORT(tty->index));
 #endif
 
-	if (sx_paranoia_check(port, tty->device, "sx_open"))
+	if (sx_paranoia_check(port, tty->name, "sx_open"))
 		return -ENODEV;
 
 	if ((error = sx_setup_board(bp)))
@@ -1484,7 +1485,7 @@
 		return error;
 
 	if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SPECIALIX_TYPE_NORMAL)
+		if (tty->driver->subtype == SPECIALIX_TYPE_NORMAL)
 			*tty->termios = port->normal_termios;
 		else
 			*tty->termios = port->callout_termios;
@@ -1506,7 +1507,7 @@
 	unsigned long flags;
 	unsigned long timeout;
 	
-	if (!port || sx_paranoia_check(port, tty->device, "close"))
+	if (!port || sx_paranoia_check(port, tty->name, "close"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1576,8 +1577,8 @@
 
 	}
 	sx_shutdown_port(bp, port);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1605,7 +1606,7 @@
 	int c, total = 0;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_write"))
+	if (sx_paranoia_check(port, tty->name, "sx_write"))
 		return 0;
 	
 	bp = port_Board(port);
@@ -1679,7 +1680,7 @@
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	unsigned long flags;
 
-	if (sx_paranoia_check(port, tty->device, "sx_put_char"))
+	if (sx_paranoia_check(port, tty->name, "sx_put_char"))
 		return;
 
 	if (!tty || !port->xmit_buf)
@@ -1704,7 +1705,7 @@
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_flush_chars"))
+	if (sx_paranoia_check(port, tty->name, "sx_flush_chars"))
 		return;
 	
 	if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1724,7 +1725,7 @@
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	int	ret;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_write_room"))
+	if (sx_paranoia_check(port, tty->name, "sx_write_room"))
 		return 0;
 
 	ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1738,7 +1739,7 @@
 {
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_chars_in_buffer"))
+	if (sx_paranoia_check(port, tty->name, "sx_chars_in_buffer"))
 		return 0;
 	
 	return port->xmit_cnt;
@@ -1750,7 +1751,7 @@
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_flush_buffer"))
+	if (sx_paranoia_check(port, tty->name, "sx_flush_buffer"))
 		return;
 
 	save_flags(flags); cli();
@@ -1976,7 +1977,7 @@
 	int error;
 	int retval;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_ioctl"))
+	if (sx_paranoia_check(port, tty->name, "sx_ioctl"))
 		return -ENODEV;
 	
 	switch (cmd) {
@@ -2035,7 +2036,7 @@
 	struct specialix_board *bp;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_throttle"))
+	if (sx_paranoia_check(port, tty->name, "sx_throttle"))
 		return;
 	
 	bp = port_Board(port);
@@ -2070,7 +2071,7 @@
 	struct specialix_board *bp;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_unthrottle"))
+	if (sx_paranoia_check(port, tty->name, "sx_unthrottle"))
 		return;
 	
 	bp = port_Board(port);
@@ -2098,7 +2099,7 @@
 	struct specialix_board *bp;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_stop"))
+	if (sx_paranoia_check(port, tty->name, "sx_stop"))
 		return;
 	
 	bp = port_Board(port);
@@ -2117,7 +2118,7 @@
 	struct specialix_board *bp;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_start"))
+	if (sx_paranoia_check(port, tty->name, "sx_start"))
 		return;
 	
 	bp = port_Board(port);
@@ -2158,7 +2159,7 @@
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	struct specialix_board *bp;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_hangup"))
+	if (sx_paranoia_check(port, tty->name, "sx_hangup"))
 		return;
 	
 	bp = port_Board(port);
@@ -2177,7 +2178,7 @@
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
 	unsigned long flags;
 				
-	if (sx_paranoia_check(port, tty->device, "sx_set_termios"))
+	if (sx_paranoia_check(port, tty->name, "sx_set_termios"))
 		return;
 	
 	if (tty->termios->c_cflag == old_termios->c_cflag &&
diff -Nru a/drivers/char/stallion.c b/drivers/char/stallion.c
--- a/drivers/char/stallion.c	Sat Mar 22 07:38:05 2003
+++ b/drivers/char/stallion.c	Thu Apr 24 05:17:30 2003
@@ -530,7 +530,6 @@
 static int	stl_getbrdstruct(unsigned long arg);
 static int	stl_waitcarrier(stlport_t *portp, struct file *filp);
 static void	stl_delay(int len);
-static void	stl_intr(int irq, void *dev_id, struct pt_regs *regs);
 static void	stl_eiointr(stlbrd_t *brdp);
 static void	stl_echatintr(stlbrd_t *brdp);
 static void	stl_echmcaintr(stlbrd_t *brdp);
@@ -1017,11 +1016,11 @@
 	int		brdnr, panelnr, portnr, rc;
 
 #if DEBUG
-	printk("stl_open(tty=%x,filp=%x): device=%x\n", (int) tty,
-		(int) filp, tty->device);
+	printk("stl_open(tty=%x,filp=%x): device=%s\n", (int) tty,
+		(int) filp, tty->name);
 #endif
 
-	minordev = minor(tty->device);
+	minordev = tty->index;
 	brdnr = MINOR2BRD(minordev);
 	if (brdnr >= stl_nrbrds)
 		return(-ENODEV);
@@ -1090,7 +1089,7 @@
  *	previous opens still in effect. If we are a normal serial device
  *	then also we might have to wait for carrier.
  */
-	if (tty->driver.subtype == STL_DRVTYPCALLOUT) {
+	if (tty->driver->subtype == STL_DRVTYPCALLOUT) {
 		if (portp->flags & ASYNC_NORMAL_ACTIVE)
 			return(-EBUSY);
 		if (portp->flags & ASYNC_CALLOUT_ACTIVE) {
@@ -1114,7 +1113,7 @@
 	}
 
 	if ((portp->refcount == 1) && (portp->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == STL_DRVTYPSERIAL)
+		if (tty->driver->subtype == STL_DRVTYPSERIAL)
 			*tty->termios = portp->normaltermios;
 		else
 			*tty->termios = portp->callouttermios;
@@ -2085,10 +2084,11 @@
  *	calls off to the approrpriate board interrupt handlers.
  */
 
-static void stl_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t stl_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	stlbrd_t	*brdp;
 	int		i;
+	int handled = 0;
 
 #if DEBUG
 	printk("stl_intr(irq=%d,regs=%x)\n", irq, (int) regs);
@@ -2099,8 +2099,10 @@
 			continue;
 		if (brdp->state == 0)
 			continue;
+		handled = 1;
 		(* brdp->isr)(brdp);
 	}
+	return IRQ_RETVAL(handled);
 }
 
 /*****************************************************************************/
diff -Nru a/drivers/char/sx.c b/drivers/char/sx.c
--- a/drivers/char/sx.c	Thu Apr 17 12:38:02 2003
+++ b/drivers/char/sx.c	Thu Apr 24 05:17:30 2003
@@ -441,7 +441,7 @@
 /* This doesn't work. Who's paranoid around here? Not me! */
 
 static inline int sx_paranoia_check(struct sx_port const * port,
-				    kdev_t device, const char *routine)
+				    char *name, const char *routine)
 {
 
 	static const char *badmagic =
@@ -450,11 +450,11 @@
 	  KERN_ERR "sx: Warning: null sx port for device %s in %s\n";
  
 	if (!port) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (port->magic != SX_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 
@@ -1202,7 +1202,7 @@
  * Small, elegant, clear.
  */
 
-static void sx_interrupt (int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t sx_interrupt (int irq, void *ptr, struct pt_regs *regs)
 {
 	struct sx_board *board = ptr;
 	struct sx_port *port;
@@ -1269,12 +1269,14 @@
 		}
 	}
 
-	if (!sx_initialized) return;
-	if (!(board->flags & SX_BOARD_INITIALIZED)) return;
+	if (!sx_initialized)
+		return IRQ_HANDLED;
+	if (!(board->flags & SX_BOARD_INITIALIZED))
+		return IRQ_HANDLED;
 
 	if (test_and_set_bit (SX_BOARD_INTR_LOCK, &board->locks)) {
 		printk (KERN_ERR "Recursive interrupt! (%d)\n", board->irq);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	 for (i=0;i<board->nports;i++) {
@@ -1298,6 +1300,7 @@
 
 	sx_dprintk (SX_DEBUG_FLOW, "sx: exit sx_interrupt (%d/%d)\n", irq, board->irq); 
 	/*  func_exit ();  */
+	return IRQ_HANDLED;
 }
 
 
@@ -1434,7 +1437,7 @@
 		return -EIO;
 	}
 
-	line = minor(tty->device);
+	line = tty->index;
 	sx_dprintk (SX_DEBUG_OPEN, "%d: opening line %d. tty=%p ctty=%p, np=%d)\n", 
 	            current->pid, line, tty, current->tty, sx_nports);
 
@@ -1500,7 +1503,7 @@
 	/* tty->low_latency = 1; */
 
 	if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = port->gs.normal_termios;
 		else 
 			*tty->termios = port->gs.callout_termios;
diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c
--- a/drivers/char/synclink.c	Tue Feb 25 09:44:33 2003
+++ b/drivers/char/synclink.c	Thu Apr 24 05:17:30 2003
@@ -1,7 +1,7 @@
 /*
  * linux/drivers/char/synclink.c
  *
- * $Id: synclink.c,v 4.4 2002/10/10 14:53:36 paulkf Exp $
+ * $Id: synclink.c,v 4.6 2003/04/21 17:46:54 paulkf Exp $
  *
  * Device driver for Microgate SyncLink ISA and PCI
  * high speed multiprotocol serial adapters.
@@ -854,9 +854,9 @@
 /*
  * ioctl call handlers
  */
-static int set_modem_info(struct mgsl_struct * info, unsigned int cmd,
-			  unsigned int *value);
-static int get_modem_info(struct mgsl_struct * info, unsigned int *value);
+static int tiocmget(struct tty_struct *tty, struct file *file);
+static int tiocmset(struct tty_struct *tty, struct file *file,
+		    unsigned int set, unsigned int clear);
 static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount
 	*user_icount);
 static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS *user_params);
@@ -917,7 +917,7 @@
 MODULE_PARM(txholdbufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
 
 static char *driver_name = "SyncLink serial driver";
-static char *driver_version = "$Revision: 4.4 $";
+static char *driver_version = "$Revision: 4.6 $";
 
 static int synclink_init_one (struct pci_dev *dev,
 				     const struct pci_device_id *ent);
@@ -978,7 +978,7 @@
 static DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int mgsl_paranoia_check(struct mgsl_struct *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef MGSL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -987,11 +987,11 @@
 		"Warning: null mgsl_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != MGSL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -1008,7 +1008,7 @@
 	struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_stop"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_stop"))
 		return;
 	
 	if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1031,7 +1031,7 @@
 	struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
 	unsigned long flags;
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_start"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_start"))
 		return;
 	
 	if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1704,7 +1704,7 @@
  * 	
  * Return Value: None
  */
-static void mgsl_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t mgsl_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct mgsl_struct * info;
 	u16 UscVector;
@@ -1716,7 +1716,7 @@
 
 	info = (struct mgsl_struct *)dev_id;	
 	if (!info)
-		return;
+		return IRQ_NONE;
 		
 	spin_lock(&info->irq_spinlock);
 
@@ -1766,7 +1766,7 @@
 	if ( debug_level >= DEBUG_LEVEL_ISR )	
 		printk("%s(%d):mgsl_interrupt(%d)exit.\n",
 			__FILE__,__LINE__,irq);
-
+	return IRQ_HANDLED;
 }	/* end of mgsl_interrupt() */
 
 /* startup()
@@ -2048,7 +2048,7 @@
 			__FILE__,__LINE__,ch,info->device_name);
 	}		
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_put_char"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char"))
 		return;
 
 	if (!tty || !info->xmit_buf)
@@ -2086,7 +2086,7 @@
 		printk( "%s(%d):mgsl_flush_chars() entry on %s xmit_cnt=%d\n",
 			__FILE__,__LINE__,info->device_name,info->xmit_cnt);
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_flush_chars"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_chars"))
 		return;
 
 	if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -2139,7 +2139,7 @@
 		printk( "%s(%d):mgsl_write(%s) count=%d\n",
 			__FILE__,__LINE__,info->device_name,count);
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_write"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_write"))
 		goto cleanup;
 
 	if (!tty || !info->xmit_buf || !tmp_buf)
@@ -2315,7 +2315,7 @@
 	struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
 	int	ret;
 				
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_write_room"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -2353,7 +2353,7 @@
 		printk("%s(%d):mgsl_chars_in_buffer(%s)\n",
 			 __FILE__,__LINE__, info->device_name );
 			 
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_chars_in_buffer"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_chars_in_buffer"))
 		return 0;
 		
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2388,7 +2388,7 @@
 		printk("%s(%d):mgsl_flush_buffer(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_flush_buffer"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_buffer"))
 		return;
 		
 	spin_lock_irqsave(&info->irq_spinlock,flags); 
@@ -2420,7 +2420,7 @@
 		printk("%s(%d):mgsl_send_xchar(%s,%d)\n",
 			 __FILE__,__LINE__, info->device_name, ch );
 			 
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_send_xchar"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_send_xchar"))
 		return;
 
 	info->x_char = ch;
@@ -2449,7 +2449,7 @@
 		printk("%s(%d):mgsl_throttle(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_throttle"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -2479,7 +2479,7 @@
 		printk("%s(%d):mgsl_unthrottle(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_unthrottle"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -2921,110 +2921,58 @@
 	return rc;
 }
 
-/* get_modem_info()
- * 
- * 	Read the state of the serial control and
- * 	status signals and return to caller.
- * 	
- * Arguments:	 	info	pointer to device instance data
- * 			value	pointer to int to hold returned info
- * 	
- * Return Value:	0 if success, otherwise error code
+/* return the state of the serial control and status signals
  */
-static int get_modem_info(struct mgsl_struct * info, unsigned int *value)
+static int tiocmget(struct tty_struct *tty, struct file *file)
 {
-	unsigned int result = 0;
+	struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
+	unsigned int result;
  	unsigned long flags;
-	int err;
- 
+
 	spin_lock_irqsave(&info->irq_spinlock,flags);
  	usc_get_serial_signals(info);
 	spin_unlock_irqrestore(&info->irq_spinlock,flags);
 
-	if (info->serial_signals & SerialSignal_RTS)
-		result |= TIOCM_RTS;
-	if (info->serial_signals & SerialSignal_DTR)
-		result |= TIOCM_DTR;
-	if (info->serial_signals & SerialSignal_DCD)
-		result |= TIOCM_CAR;
-	if (info->serial_signals & SerialSignal_RI)
-		result |= TIOCM_RNG;
-	if (info->serial_signals & SerialSignal_DSR)
-		result |= TIOCM_DSR;
-	if (info->serial_signals & SerialSignal_CTS)
-		result |= TIOCM_CTS;
+	result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) +
+		((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) +
+		((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) +
+		((info->serial_signals & SerialSignal_RI)  ? TIOCM_RNG:0) +
+		((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) +
+		((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0);
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
-		printk("%s(%d):mgsl_get_modem_info %s value=%08X\n",
+		printk("%s(%d):%s tiocmget() value=%08X\n",
 			 __FILE__,__LINE__, info->device_name, result );
-			
-	PUT_USER(err,result,value);
-	return err;
-}	/* end of get_modem_info() */
+	return result;
+}
 
-/* set_modem_info()
- * 
- * 	Set the state of the modem control signals (DTR/RTS)
- * 	
- * Arguments:
- * 
- * 	info	pointer to device instance data
- * 	cmd	signal command: TIOCMBIS = set bit TIOCMBIC = clear bit
- *		TIOCMSET = set/clear signal values
- * 	value	bit mask for command
- * 	
- * Return Value:	0 if success, otherwise error code
+/* set modem control signals (DTR/RTS)
  */
-static int set_modem_info(struct mgsl_struct * info, unsigned int cmd,
-			  unsigned int *value)
+static int tiocmset(struct tty_struct *tty, struct file *file,
+		    unsigned int set, unsigned int clear)
 {
- 	int error;
- 	unsigned int arg;
+	struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
  	unsigned long flags;
- 
+
 	if (debug_level >= DEBUG_LEVEL_INFO)
-		printk("%s(%d):mgsl_set_modem_info %s\n", __FILE__,__LINE__,
-			info->device_name );
-			
- 	GET_USER(error,arg,value);
- 	if (error)
- 		return error;
-		
- 	switch (cmd) {
- 	case TIOCMBIS: 
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals |= SerialSignal_RTS;
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals |= SerialSignal_DTR;
- 		break;
- 	case TIOCMBIC:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals &= ~SerialSignal_RTS;
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals &= ~SerialSignal_DTR;
- 		break;
- 	case TIOCMSET:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals |= SerialSignal_RTS;
-		else
- 			info->serial_signals &= ~SerialSignal_RTS;
-		
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals |= SerialSignal_DTR;
-		else
- 			info->serial_signals &= ~SerialSignal_DTR;
- 		break;
- 	default:
- 		return -EINVAL;
- 	}
-	
+		printk("%s(%d):%s tiocmset(%x,%x)\n",
+			__FILE__,__LINE__,info->device_name, set, clear);
+
+	if (set & TIOCM_RTS)
+		info->serial_signals |= SerialSignal_RTS;
+	if (set & TIOCM_DTR)
+		info->serial_signals |= SerialSignal_DTR;
+	if (clear & TIOCM_RTS)
+		info->serial_signals &= ~SerialSignal_RTS;
+	if (clear & TIOCM_DTR)
+		info->serial_signals &= ~SerialSignal_DTR;
+
 	spin_lock_irqsave(&info->irq_spinlock,flags);
  	usc_set_serial_signals(info);
 	spin_unlock_irqrestore(&info->irq_spinlock,flags);
-	
+
 	return 0;
-	
-}	/* end of set_modem_info() */
+}
 
 /* mgsl_break()		Set or clear transmit break condition
  *
@@ -3041,7 +2989,7 @@
 		printk("%s(%d):mgsl_break(%s,%d)\n",
 			 __FILE__,__LINE__, info->device_name, break_state);
 			 
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_break"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_break"))
 		return;
 
 	spin_lock_irqsave(&info->irq_spinlock,flags);
@@ -3073,7 +3021,7 @@
 		printk("%s(%d):mgsl_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
 			info->device_name, cmd );
 	
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_ioctl"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -3093,12 +3041,6 @@
 	unsigned long flags;
 	
 	switch (cmd) {
-		case TIOCMGET:
-			return get_modem_info(info, (unsigned int *) arg);
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			return set_modem_info(info, cmd, (unsigned int *) arg);
 		case MGSL_IOCGPARAMS:
 			return mgsl_get_params(info,(MGSL_PARAMS *)arg);
 		case MGSL_IOCSPARAMS:
@@ -3183,7 +3125,7 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):mgsl_set_termios %s\n", __FILE__,__LINE__,
-			tty->driver.name );
+			tty->driver->name );
 	
 	/* just return if nothing has changed */
 	if ((tty->termios->c_cflag == old_termios->c_cflag)
@@ -3240,7 +3182,7 @@
 {
 	struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data;
 
-	if (!info || mgsl_paranoia_check(info, tty->device, "mgsl_close"))
+	if (!info || mgsl_paranoia_check(info, tty->name, "mgsl_close"))
 		return;
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -3295,8 +3237,8 @@
  	if (info->flags & ASYNC_INITIALIZED)
  		mgsl_wait_until_sent(tty, info->timeout);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 		
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
@@ -3322,8 +3264,7 @@
 cleanup:			
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):mgsl_close(%s) exit, count=%d\n", __FILE__,__LINE__,
-			tty->driver.name, info->count);
-	MOD_DEC_USE_COUNT;
+			tty->driver->name, info->count);
 			
 }	/* end of mgsl_close() */
 
@@ -3350,7 +3291,7 @@
 		printk("%s(%d):mgsl_wait_until_sent(%s) entry\n",
 			 __FILE__,__LINE__, info->device_name );
       
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_wait_until_sent"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_wait_until_sent"))
 		return;
 
 	if (!(info->flags & ASYNC_INITIALIZED))
@@ -3419,7 +3360,7 @@
 		printk("%s(%d):mgsl_hangup(%s)\n",
 			 __FILE__,__LINE__, info->device_name );
 			 
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_hangup"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_hangup"))
 		return;
 
 	mgsl_flush_buffer(tty);
@@ -3456,9 +3397,9 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):block_til_ready on %s\n",
-			 __FILE__,__LINE__, tty->driver.name );
+			 __FILE__,__LINE__, tty->driver->name );
 
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		/* this is a callout device */
 		/* just verify that normal device is not in use */
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
@@ -3504,7 +3445,7 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):block_til_ready before block on %s count=%d\n",
-			 __FILE__,__LINE__, tty->driver.name, info->count );
+			 __FILE__,__LINE__, tty->driver->name, info->count );
 
 	spin_lock_irqsave(&info->irq_spinlock, flags);
 	if (!tty_hung_up_p(filp)) {
@@ -3548,7 +3489,7 @@
 		
 		if (debug_level >= DEBUG_LEVEL_INFO)
 			printk("%s(%d):block_til_ready blocking on %s count=%d\n",
-				 __FILE__,__LINE__, tty->driver.name, info->count );
+				 __FILE__,__LINE__, tty->driver->name, info->count );
 				 
 		schedule();
 	}
@@ -3562,7 +3503,7 @@
 	
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):block_til_ready after blocking on %s count=%d\n",
-			 __FILE__,__LINE__, tty->driver.name, info->count );
+			 __FILE__,__LINE__, tty->driver->name, info->count );
 			 
 	if (!retval)
 		info->flags |= ASYNC_NORMAL_ACTIVE;
@@ -3589,7 +3530,7 @@
 	unsigned long flags;
 
 	/* verify range of specified line number */	
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= mgsl_device_count)) {
 		printk("%s(%d):mgsl_open with illegal line #%d.\n",
 			__FILE__,__LINE__,line);
@@ -3608,15 +3549,13 @@
 	
 	tty->driver_data = info;
 	info->tty = tty;
-	if (mgsl_paranoia_check(info, tty->device, "mgsl_open"))
+	if (mgsl_paranoia_check(info, tty->name, "mgsl_open"))
 		return -ENODEV;
 		
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):mgsl_open(%s), old ref count = %d\n",
-			 __FILE__,__LINE__,tty->driver.name, info->count);
+			 __FILE__,__LINE__,tty->driver->name, info->count);
 
-	MOD_INC_USE_COUNT;
-	
 	/* If port is closing, signal caller to try again */
 	if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){
 		if (info->flags & ASYNC_CLOSING)
@@ -3666,7 +3605,7 @@
 
 	if ((info->count == 1) &&
 	    info->flags & ASYNC_SPLIT_TERMIOS) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -3683,7 +3622,6 @@
 	
 cleanup:			
 	if (retval) {
-		MOD_DEC_USE_COUNT;
 		if(info->count)
 			info->count--;
 	}
@@ -4571,6 +4509,7 @@
 	
 	memset(&serial_driver, 0, sizeof(struct tty_driver));
 	serial_driver.magic = TTY_DRIVER_MAGIC;
+	serial_driver.owner = THIS_MODULE;
 	serial_driver.driver_name = "synclink";
 	serial_driver.name = "ttySL";
 	serial_driver.major = ttymajor;
@@ -4606,6 +4545,8 @@
 	serial_driver.stop = mgsl_stop;
 	serial_driver.start = mgsl_start;
 	serial_driver.hangup = mgsl_hangup;
+	serial_driver.tiocmget = tiocmget;
+	serial_driver.tiocmset = tiocmset;
 	
 	/*
 	 * The callout device is just like normal device except for
@@ -4667,7 +4608,7 @@
 		/* Copy user configuration info to device instance data */
 		info->io_base = (unsigned int)io[i];
 		info->irq_level = (unsigned int)irq[i];
-		info->irq_level = irq_cannonicalize(info->irq_level);
+		info->irq_level = irq_canonicalize(info->irq_level);
 		info->dma_level = (unsigned int)dma[i];
 		info->bus_type = MGSL_BUS_TYPE_ISA;
 		info->io_addr_size = 16;
@@ -8003,7 +7944,6 @@
 		return -EBUSY;
 	}
 	info->netcount=1;
-	MOD_INC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 
 	/* claim resources and init adapter */
@@ -8026,7 +7966,6 @@
 open_fail:
 	spin_lock_irqsave(&info->netlock, flags);
 	info->netcount=0;
-	MOD_DEC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 	return err;
 }
@@ -8092,7 +8031,6 @@
 
 	spin_lock_irqsave(&info->netlock, flags);
 	info->netcount=0;
-	MOD_DEC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 	return 0;
 }
diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
--- a/drivers/char/synclinkmp.c	Tue Feb 25 02:18:16 2003
+++ b/drivers/char/synclinkmp.c	Thu Apr 24 05:17:30 2003
@@ -1,5 +1,5 @@
 /*
- * $Id: synclinkmp.c,v 4.6 2002/10/10 14:50:47 paulkf Exp $
+ * $Id: synclinkmp.c,v 4.8 2003/04/21 17:46:55 paulkf Exp $
  *
  * Device driver for Microgate SyncLink Multiport
  * high speed multiprotocol serial adapter.
@@ -503,7 +503,7 @@
 MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICES) "i");
 
 static char *driver_name = "SyncLink MultiPort driver";
-static char *driver_version = "$Revision: 4.6 $";
+static char *driver_version = "$Revision: 4.8 $";
 
 static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);
 static void synclinkmp_remove_one(struct pci_dev *dev);
@@ -592,8 +592,9 @@
 static int  map_status(int signals);
 static int  modem_input_wait(SLMP_INFO *info,int arg);
 static int  wait_mgsl_event(SLMP_INFO *info, int *mask_ptr);
-static int  get_modem_info(SLMP_INFO *info, unsigned int *value);
-static int  set_modem_info(SLMP_INFO *info, unsigned int cmd,unsigned int *value);
+static int  tiocmget(struct tty_struct *tty, struct file *file);
+static int  tiocmset(struct tty_struct *tty, struct file *file,
+		     unsigned int set, unsigned int clear);
 static void set_break(struct tty_struct *tty, int break_state);
 
 static void add_device(SLMP_INFO *info);
@@ -651,7 +652,6 @@
 static void isr_txdmaok(SLMP_INFO *info);
 static void isr_txdmaerror(SLMP_INFO *info);
 static void isr_io_pin(SLMP_INFO *info, u16 status);
-static void synclinkmp_interrupt(int irq, void *dev_id, struct pt_regs * regs);
 
 static int  alloc_dma_bufs(SLMP_INFO *info);
 static void free_dma_bufs(SLMP_INFO *info);
@@ -709,7 +709,7 @@
 static void* synclinkmp_get_text_ptr() {return synclinkmp_get_text_ptr;}
 
 static inline int sanity_check(SLMP_INFO *info,
-			       kdev_t device, const char *routine)
+			       char *name, const char *routine)
 {
 #ifdef SANITY_CHECK
 	static const char *badmagic =
@@ -718,11 +718,11 @@
 		"Warning: null synclinkmp_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != MGSL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -739,7 +739,7 @@
 	int retval, line;
 	unsigned long flags;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= synclinkmp_device_count)) {
 		printk("%s(%d): open with illegal line #%d.\n",
 			__FILE__,__LINE__,line);
@@ -763,14 +763,12 @@
 
 	tty->driver_data = info;
 	info->tty = tty;
-	if (sanity_check(info, tty->device, "open"))
+	if (sanity_check(info, tty->name, "open"))
 		return -ENODEV;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s open(), old ref count = %d\n",
-			 __FILE__,__LINE__,tty->driver.name, info->count);
-
-	MOD_INC_USE_COUNT;
+			 __FILE__,__LINE__,tty->driver->name, info->count);
 
 	/* If port is closing, signal caller to try again */
 	if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){
@@ -809,7 +807,7 @@
 
 	if ((info->count == 1) &&
 	    info->flags & ASYNC_SPLIT_TERMIOS) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else
 			*tty->termios = info->callout_termios;
@@ -826,7 +824,6 @@
 
 cleanup:
 	if (retval) {
-		MOD_DEC_USE_COUNT;
 		if(info->count)
 			info->count--;
 	}
@@ -841,7 +838,7 @@
 {
 	SLMP_INFO * info = (SLMP_INFO *)tty->driver_data;
 
-	if (!info || sanity_check(info, tty->device, "close"))
+	if (!info || sanity_check(info, tty->name, "close"))
 		return;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -897,8 +894,8 @@
  	if (info->flags & ASYNC_INITIALIZED)
  		wait_until_sent(tty, info->timeout);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
@@ -924,8 +921,7 @@
 cleanup:
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s close() exit, count=%d\n", __FILE__,__LINE__,
-			tty->driver.name, info->count);
-	MOD_DEC_USE_COUNT;
+			tty->driver->name, info->count);
 }
 
 /* Called by tty_hangup() when a hangup is signaled.
@@ -939,7 +935,7 @@
 		printk("%s(%d):%s hangup()\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (sanity_check(info, tty->device, "hangup"))
+	if (sanity_check(info, tty->name, "hangup"))
 		return;
 
 	flush_buffer(tty);
@@ -961,7 +957,7 @@
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s set_termios()\n", __FILE__,__LINE__,
-			tty->driver.name );
+			tty->driver->name );
 
 	/* just return if nothing has changed */
 	if ((tty->termios->c_cflag == old_termios->c_cflag)
@@ -1023,7 +1019,7 @@
 		printk("%s(%d):%s write() count=%d\n",
 		       __FILE__,__LINE__,info->device_name,count);
 
-	if (sanity_check(info, tty->device, "write"))
+	if (sanity_check(info, tty->name, "write"))
 		goto cleanup;
 
 	if (!tty || !info->tx_buf)
@@ -1112,7 +1108,7 @@
 			__FILE__,__LINE__,info->device_name,ch);
 	}
 
-	if (sanity_check(info, tty->device, "put_char"))
+	if (sanity_check(info, tty->name, "put_char"))
 		return;
 
 	if (!tty || !info->tx_buf)
@@ -1145,7 +1141,7 @@
 		printk("%s(%d):%s send_xchar(%d)\n",
 			 __FILE__,__LINE__, info->device_name, ch );
 
-	if (sanity_check(info, tty->device, "send_xchar"))
+	if (sanity_check(info, tty->name, "send_xchar"))
 		return;
 
 	info->x_char = ch;
@@ -1172,7 +1168,7 @@
 		printk("%s(%d):%s wait_until_sent() entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (sanity_check(info, tty->device, "wait_until_sent"))
+	if (sanity_check(info, tty->name, "wait_until_sent"))
 		return;
 
 	if (!(info->flags & ASYNC_INITIALIZED))
@@ -1231,7 +1227,7 @@
 	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
 	int ret;
 
-	if (sanity_check(info, tty->device, "write_room"))
+	if (sanity_check(info, tty->name, "write_room"))
 		return 0;
 
 	if (info->params.mode == MGSL_MODE_HDLC) {
@@ -1260,7 +1256,7 @@
 		printk( "%s(%d):%s flush_chars() entry tx_count=%d\n",
 			__FILE__,__LINE__,info->device_name,info->tx_count);
 
-	if (sanity_check(info, tty->device, "flush_chars"))
+	if (sanity_check(info, tty->name, "flush_chars"))
 		return;
 
 	if (info->tx_count <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1299,7 +1295,7 @@
 		printk("%s(%d):%s flush_buffer() entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (sanity_check(info, tty->device, "flush_buffer"))
+	if (sanity_check(info, tty->name, "flush_buffer"))
 		return;
 
 	spin_lock_irqsave(&info->lock,flags);
@@ -1320,7 +1316,7 @@
 	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
 	unsigned long flags;
 
-	if (sanity_check(info, tty->device, "tx_hold"))
+	if (sanity_check(info, tty->name, "tx_hold"))
 		return;
 
 	if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1340,7 +1336,7 @@
 	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
 	unsigned long flags;
 
-	if (sanity_check(info, tty->device, "tx_release"))
+	if (sanity_check(info, tty->name, "tx_release"))
 		return;
 
 	if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1377,7 +1373,7 @@
 		printk("%s(%d):%s ioctl() cmd=%08X\n", __FILE__,__LINE__,
 			info->device_name, cmd );
 
-	if (sanity_check(info, tty->device, "ioctl"))
+	if (sanity_check(info, tty->name, "ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1387,12 +1383,6 @@
 	}
 
 	switch (cmd) {
-	case TIOCMGET:
-		return get_modem_info(info, (unsigned int *) arg);
-	case TIOCMBIS:
-	case TIOCMBIC:
-	case TIOCMSET:
-		return set_modem_info(info, cmd, (unsigned int *) arg);
 	case MGSL_IOCGPARAMS:
 		return get_params(info,(MGSL_PARAMS *)arg);
 	case MGSL_IOCSPARAMS:
@@ -1575,7 +1565,7 @@
 {
 	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
 
-	if (sanity_check(info, tty->device, "chars_in_buffer"))
+	if (sanity_check(info, tty->name, "chars_in_buffer"))
 		return 0;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -1596,7 +1586,7 @@
 		printk("%s(%d):%s throttle() entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (sanity_check(info, tty->device, "throttle"))
+	if (sanity_check(info, tty->name, "throttle"))
 		return;
 
 	if (I_IXOFF(tty))
@@ -1621,7 +1611,7 @@
 		printk("%s(%d):%s unthrottle() entry\n",
 			 __FILE__,__LINE__, info->device_name );
 
-	if (sanity_check(info, tty->device, "unthrottle"))
+	if (sanity_check(info, tty->name, "unthrottle"))
 		return;
 
 	if (I_IXOFF(tty)) {
@@ -1652,7 +1642,7 @@
 		printk("%s(%d):%s set_break(%d)\n",
 			 __FILE__,__LINE__, info->device_name, break_state);
 
-	if (sanity_check(info, tty->device, "set_break"))
+	if (sanity_check(info, tty->name, "set_break"))
 		return;
 
 	spin_lock_irqsave(&info->lock,flags);
@@ -1717,7 +1707,7 @@
 {
 	SLMP_INFO *info = d->priv;
 	int err;
-	long flags;
+	unsigned long flags;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("sppp_cb_open(%s)\n",info->netname);
@@ -1729,7 +1719,6 @@
 		return -EBUSY;
 	}
 	info->netcount=1;
-	MOD_INC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 
 	/* claim resources and init adapter */
@@ -1752,7 +1741,6 @@
 open_fail:
 	spin_lock_irqsave(&info->netlock, flags);
 	info->netcount=0;
-	MOD_DEC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 	return err;
 }
@@ -1760,7 +1748,7 @@
 static void sppp_cb_tx_timeout(struct net_device *dev)
 {
 	SLMP_INFO *info = dev->priv;
-	long flags;
+	unsigned long flags;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("sppp_tx_timeout(%s)\n",info->netname);
@@ -1818,7 +1806,6 @@
 
 	spin_lock_irqsave(&info->netlock, flags);
 	info->netcount=0;
-	MOD_DEC_USE_COUNT;
 	spin_unlock_irqrestore(&info->netlock, flags);
 	return 0;
 }
@@ -2458,7 +2445,8 @@
  * 	dev_id		device ID supplied during interrupt registration
  * 	regs		interrupted processor context
  */
-static void synclinkmp_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	SLMP_INFO * info;
 	unsigned char status, status0, status1=0;
@@ -2474,7 +2462,7 @@
 
 	info = (SLMP_INFO *)dev_id;
 	if (!info)
-		return;
+		return IRQ_NONE;
 
 	spin_lock(&info->lock);
 
@@ -2576,6 +2564,7 @@
 	if ( debug_level >= DEBUG_LEVEL_ISR )
 		printk("%s(%d):synclinkmp_interrupt(%d)exit.\n",
 			__FILE__,__LINE__,irq);
+	return IRQ_HANDLED;
 }
 
 /* Initialize and start device.
@@ -3146,11 +3135,11 @@
 
 /* return the state of the serial control and status signals
  */
-static int get_modem_info(SLMP_INFO * info, unsigned int *value)
+static int tiocmget(struct tty_struct *tty, struct file *file)
 {
+	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
 	unsigned int result;
  	unsigned long flags;
-	int err;
 
 	spin_lock_irqsave(&info->lock,flags);
  	get_signals(info);
@@ -3164,61 +3153,31 @@
 		((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0);
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
-		printk("%s(%d):%s synclinkmp_get_modem_info() value=%08X\n",
+		printk("%s(%d):%s tiocmget() value=%08X\n",
 			 __FILE__,__LINE__, info->device_name, result );
-
-	PUT_USER(err,result,value);
-	return err;
+	return result;
 }
 
 /* set modem control signals (DTR/RTS)
- *
- * 	cmd	signal command: TIOCMBIS = set bit TIOCMBIC = clear bit
- *		TIOCMSET = set/clear signal values
- * 	value	bit mask for command
  */
-static int set_modem_info(SLMP_INFO * info, unsigned int cmd,
-			  unsigned int *value)
+static int tiocmset(struct tty_struct *tty, struct file *file,
+		    unsigned int set, unsigned int clear)
 {
- 	int error;
- 	unsigned int arg;
+	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
  	unsigned long flags;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
-		printk("%s(%d):%s synclinkmp_set_modem_info()\n",
-			__FILE__,__LINE__,info->device_name );
+		printk("%s(%d):%s tiocmset(%x,%x)\n",
+			__FILE__,__LINE__,info->device_name, set, clear);
 
- 	GET_USER(error,arg,value);
- 	if (error)
- 		return error;
-
- 	switch (cmd) {
- 	case TIOCMBIS:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals |= SerialSignal_RTS;
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals |= SerialSignal_DTR;
- 		break;
- 	case TIOCMBIC:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals &= ~SerialSignal_RTS;
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals &= ~SerialSignal_DTR;
- 		break;
- 	case TIOCMSET:
- 		if (arg & TIOCM_RTS)
- 			info->serial_signals |= SerialSignal_RTS;
-		else
- 			info->serial_signals &= ~SerialSignal_RTS;
-
- 		if (arg & TIOCM_DTR)
- 			info->serial_signals |= SerialSignal_DTR;
-		else
- 			info->serial_signals &= ~SerialSignal_DTR;
- 		break;
- 	default:
- 		return -EINVAL;
- 	}
+	if (set & TIOCM_RTS)
+		info->serial_signals |= SerialSignal_RTS;
+	if (set & TIOCM_DTR)
+		info->serial_signals |= SerialSignal_DTR;
+	if (clear & TIOCM_RTS)
+		info->serial_signals &= ~SerialSignal_RTS;
+	if (clear & TIOCM_DTR)
+		info->serial_signals &= ~SerialSignal_DTR;
 
 	spin_lock_irqsave(&info->lock,flags);
  	set_signals(info);
@@ -3241,9 +3200,9 @@
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s block_til_ready()\n",
-			 __FILE__,__LINE__, tty->driver.name );
+			 __FILE__,__LINE__, tty->driver->name );
 
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		/* this is a callout device */
 		/* just verify that normal device is not in use */
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
@@ -3289,7 +3248,7 @@
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s block_til_ready() before block, count=%d\n",
-			 __FILE__,__LINE__, tty->driver.name, info->count );
+			 __FILE__,__LINE__, tty->driver->name, info->count );
 
 	spin_lock_irqsave(&info->lock, flags);
 	if (!tty_hung_up_p(filp)) {
@@ -3333,7 +3292,7 @@
 
 		if (debug_level >= DEBUG_LEVEL_INFO)
 			printk("%s(%d):%s block_til_ready() count=%d\n",
-				 __FILE__,__LINE__, tty->driver.name, info->count );
+				 __FILE__,__LINE__, tty->driver->name, info->count );
 
 		schedule();
 	}
@@ -3347,7 +3306,7 @@
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s block_til_ready() after, count=%d\n",
-			 __FILE__,__LINE__, tty->driver.name, info->count );
+			 __FILE__,__LINE__, tty->driver->name, info->count );
 
 	if (!retval)
 		info->flags |= ASYNC_NORMAL_ACTIVE;
@@ -3875,6 +3834,7 @@
 
 	memset(&serial_driver, 0, sizeof(struct tty_driver));
 	serial_driver.magic = TTY_DRIVER_MAGIC;
+	serial_driver.owner = THIS_MODULE;
 	serial_driver.driver_name = "synclinkmp";
 	serial_driver.name = "ttySLM";
 	serial_driver.major = ttymajor;
@@ -3910,6 +3870,8 @@
 	serial_driver.stop = tx_hold;
 	serial_driver.start = tx_release;
 	serial_driver.hangup = hangup;
+	serial_driver.tiocmget = tiocmget;
+	serial_driver.tiocmset = tiocmset;
 
 	/*
 	 * The callout device is just like normal device except for
diff -Nru a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
--- a/drivers/char/tpqic02.c	Mon Feb  3 05:47:46 2003
+++ b/drivers/char/tpqic02.c	Thu Apr 24 05:25:35 2003
@@ -509,7 +509,7 @@
 static int wait_for_ready(time_t timeout)
 {
 	int stat;
-	time_t spin_t;
+	unsigned long spin_t;
 
 	/* Wait for ready or exception, without driving the loadavg up too much.
 	 * In most cases, the tape drive already has READY asserted,
@@ -1604,7 +1604,7 @@
  * When we are finished, set flags to indicate end, disable timer.
  * NOTE: This *must* be fast! 
  */
-static void qic02_tape_interrupt(int irq, void *dev_id,
+static irqreturn_t qic02_tape_interrupt(int irq, void *dev_id,
 				 struct pt_regs *regs)
 {
 	int stat, r, i;
@@ -1622,7 +1622,7 @@
 			if (((stat & (AR_STAT_DMADONE)) == 0) &&
 			    ((stat & (QIC02_STAT_EXCEPTION)) != 0)) {
 				TIMERCONT;
-				return;	/* "Linux with IRQ sharing" */
+				return IRQ_NONE;/* "Linux with IRQ sharing" */
 			}
 		}
 
@@ -1642,7 +1642,7 @@
 			dma_mode = 0;	/* wake up rw() */
 			status_expect_int = NO;
 			wake_up(&qic02_tape_transfer);
-			return;
+			return IRQ_HANDLED;
 		}
 		/* return if tape controller not ready, or
 		 * if dma channel hasn't finished last byte yet.
@@ -1668,7 +1668,7 @@
 		release_dma_lock(flags);
 
 		if (r)
-			return;
+			return IRQ_HANDLED;
 
 		/* finish DMA cycle */
 
@@ -1688,6 +1688,7 @@
 	} else {
 		printk(TPQIC02_NAME ": Unexpected interrupt, stat == %x\n", inb(QIC02_STAT_PORT));
 	}
+	return IRQ_HANDLED;
 }				/* qic02_tape_interrupt */
 
 
diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c
--- a/drivers/char/tty_io.c	Sat Apr 19 16:24:04 2003
+++ b/drivers/char/tty_io.c	Thu Apr 24 03:30:40 2003
@@ -126,8 +126,8 @@
 struct tty_ldisc ldiscs[NR_LDISCS];	/* line disc dispatch table	*/
 
 #ifdef CONFIG_UNIX98_PTYS
-extern struct tty_driver ptm_driver[];	/* Unix98 pty masters; for /dev/ptmx */
-extern struct tty_driver pts_driver[];	/* Unix98 pty slaves;  for /dev/ptmx */
+extern struct tty_driver ptm_driver;	/* Unix98 pty masters; for /dev/ptmx */
+extern struct tty_driver pts_driver;	/* Unix98 pty slaves;  for /dev/ptmx */
 #endif
 
 extern void disable_early_printk(void);
@@ -172,31 +172,17 @@
 	kfree(tty);
 }
 
-/*
- * This routine returns the name of tty.
- */
-static char *
-_tty_make_name(struct tty_struct *tty, const char *name, char *buf)
-{
-	int idx = (tty)? minor(tty->device) - tty->driver.minor_start:0;
+#define TTY_NUMBER(tty) ((tty)->index + (tty)->driver->name_base)
 
+char *tty_name(struct tty_struct *tty, char *buf)
+{
 	if (!tty) /* Hmm.  NULL pointer.  That's fun. */
 		strcpy(buf, "NULL tty");
 	else
-		sprintf(buf, name,
-			idx + tty->driver.name_base);
-		
+		strcpy(buf, tty->name);
 	return buf;
 }
 
-#define TTY_NUMBER(tty) (minor((tty)->device) - (tty)->driver.minor_start + \
-			 (tty)->driver.name_base)
-
-char *tty_name(struct tty_struct *tty, char *buf)
-{
-	return _tty_make_name(tty, (tty)?tty->driver.name:NULL, buf);
-}
-
 EXPORT_SYMBOL(tty_name);
 
 inline int tty_paranoia_check(struct tty_struct *tty, kdev_t device,
@@ -231,14 +217,14 @@
 		count++;
 	}
 	file_list_unlock();
-	if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
-	    tty->driver.subtype == PTY_TYPE_SLAVE &&
+	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+	    tty->driver->subtype == PTY_TYPE_SLAVE &&
 	    tty->link && tty->link->count)
 		count++;
 	if (tty->count != count) {
 		printk(KERN_WARNING "Warning: dev (%s) tty->count(%d) "
 				    "!= #fd's(%d) in %s\n",
-		       cdevname(tty->device), tty->count, count, routine);
+		       tty->name, tty->count, count, routine);
 		return count;
        }	
 #endif
@@ -319,29 +305,23 @@
 		module_put(o_ldisc.owner);
 	}
 	
-	if (tty->ldisc.num != o_ldisc.num && tty->driver.set_ldisc)
-		tty->driver.set_ldisc(tty);
+	if (tty->ldisc.num != o_ldisc.num && tty->driver->set_ldisc)
+		tty->driver->set_ldisc(tty);
 	return retval;
 }
 
 /*
  * This routine returns a tty driver structure, given a device number
  */
-struct tty_driver *get_tty_driver(kdev_t device)
+struct tty_driver *get_tty_driver(dev_t device, int *index)
 {
-	int	major, minor;
 	struct tty_driver *p;
-	
-	minor = minor(device);
-	major = major(device);
 
 	list_for_each_entry(p, &tty_drivers, tty_drivers) {
-		if (p->major != major)
-			continue;
-		if (minor < p->minor_start)
-			continue;
-		if (minor >= p->minor_start + p->num)
+		dev_t base = MKDEV(p->major, p->minor_start);
+		if (device < base || device >= base + p->num)
 			continue;
+		*index = device - base;
 		return p;
 	}
 	return NULL;
@@ -466,8 +446,8 @@
 		local_irq_save(flags); // FIXME: is this safe?
 		if (tty->ldisc.flush_buffer)
 			tty->ldisc.flush_buffer(tty);
-		if (tty->driver.flush_buffer)
-			tty->driver.flush_buffer(tty);
+		if (tty->driver->flush_buffer)
+			tty->driver->flush_buffer(tty);
 		if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) &&
 		    tty->ldisc.write_wakeup)
 			(tty->ldisc.write_wakeup)(tty);
@@ -481,8 +461,8 @@
 	 * Shutdown the current line discipline, and reset it to
 	 * N_TTY.
 	 */
-	if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS)
-		*tty->termios = tty->driver.init_termios;
+	if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS)
+		*tty->termios = tty->driver->init_termios;
 	if (tty->ldisc.num != ldiscs[N_TTY].num) {
 		if (tty->ldisc.close)
 			(tty->ldisc.close)(tty);
@@ -525,11 +505,11 @@
 	 *	So we just call close() the right number of times.
 	 */
 	if (cons_filp) {
-		if (tty->driver.close)
+		if (tty->driver->close)
 			for (n = 0; n < closecount; n++)
-				tty->driver.close(tty, cons_filp);
-	} else if (tty->driver.hangup)
-		(tty->driver.hangup)(tty);
+				tty->driver->close(tty, cons_filp);
+	} else if (tty->driver->hangup)
+		(tty->driver->hangup)(tty);
 	unlock_kernel();
 }
 
@@ -589,7 +569,7 @@
 	tty = current->tty;
 	if (tty) {
 		tty_pgrp = tty->pgrp;
-		if (on_exit && tty->driver.type != TTY_DRIVER_TYPE_PTY)
+		if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY)
 			tty_vhangup(tty);
 	} else {
 		if (current->tty_old_pgrp) {
@@ -626,8 +606,8 @@
 		tty->ctrl_status |= TIOCPKT_STOP;
 		wake_up_interruptible(&tty->link->read_wait);
 	}
-	if (tty->driver.stop)
-		(tty->driver.stop)(tty);
+	if (tty->driver->stop)
+		(tty->driver->stop)(tty);
 }
 
 void start_tty(struct tty_struct *tty)
@@ -640,8 +620,8 @@
 		tty->ctrl_status |= TIOCPKT_START;
 		wake_up_interruptible(&tty->link->read_wait);
 	}
-	if (tty->driver.start)
-		(tty->driver.start)(tty);
+	if (tty->driver->start)
+		(tty->driver->start)(tty);
 	if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) &&
 	    tty->ldisc.write_wakeup)
 		(tty->ldisc.write_wakeup)(tty);
@@ -768,7 +748,7 @@
 		tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_write"))
 		return -EIO;
-	if (!tty || !tty->driver.write || (test_bit(TTY_IO_ERROR, &tty->flags)))
+	if (!tty || !tty->driver->write || (test_bit(TTY_IO_ERROR, &tty->flags)))
 		return -EIO;
 #if 0
 	if (!is_console && L_TOSTOP(tty) && (tty->pgrp > 0) &&
@@ -802,26 +782,24 @@
 
 static void release_mem(struct tty_struct *tty, int idx);
 
+static inline void tty_line_name(struct tty_driver *driver, int index, char *p)
+{
+	sprintf(p, "%s%d", driver->name, index + driver->name_base);
+}
+
 /*
  * WSH 06/09/97: Rewritten to remove races and properly clean up after a
  * failed open.  The new code protects the open with a semaphore, so it's
  * really quite straightforward.  The semaphore locking can probably be
  * relaxed for the (most common) case of reopening a tty.
  */
-static int init_dev(kdev_t device, struct tty_struct **ret_tty)
+static int init_dev(struct tty_driver *driver, int idx,
+	struct tty_struct **ret_tty)
 {
 	struct tty_struct *tty, *o_tty;
 	struct termios *tp, **tp_loc, *o_tp, **o_tp_loc;
 	struct termios *ltp, **ltp_loc, *o_ltp, **o_ltp_loc;
-	struct tty_driver *driver;	
 	int retval=0;
-	int idx;
-
-	driver = get_tty_driver(device);
-	if (!driver)
-		return -ENODEV;
-
-	idx = minor(device) - driver->minor_start;
 
 	/* 
 	 * Check whether we need to acquire the tty semaphore to avoid
@@ -854,8 +832,10 @@
 	if(!tty)
 		goto fail_no_mem;
 	initialize_tty_struct(tty);
-	tty->device = device;
-	tty->driver = *driver;
+	tty->device = MKDEV(driver->major, driver->minor_start) + idx;
+	tty->driver = driver;
+	tty->index = idx;
+	tty_line_name(driver, idx, tty->name);
 
 	tp_loc = &driver->termios[idx];
 	if (!*tp_loc) {
@@ -880,9 +860,11 @@
 		if (!o_tty)
 			goto free_mem_out;
 		initialize_tty_struct(o_tty);
-		o_tty->device = mk_kdev(driver->other->major,
-					driver->other->minor_start + idx);
-		o_tty->driver = *driver->other;
+		o_tty->device = MKDEV(driver->other->major,
+					driver->other->minor_start) + idx;
+		o_tty->driver = driver->other;
+		o_tty->index = idx;
+		tty_line_name(driver->other, idx, o_tty->name);
 
 		o_tp_loc  = &driver->other->termios[idx];
 		if (!*o_tp_loc) {
@@ -981,7 +963,7 @@
 		tty->link->count++;
 	}
 	tty->count++;
-	tty->driver = *driver; /* N.B. why do this every time?? */
+	tty->driver = driver; /* N.B. why do this every time?? */
 
 success:
 	*ret_tty = tty;
@@ -1026,32 +1008,32 @@
 	struct termios *tp;
 
 	if ((o_tty = tty->link) != NULL) {
-		o_tty->driver.table[idx] = NULL;
-		if (o_tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) {
-			tp = o_tty->driver.termios[idx];
-			o_tty->driver.termios[idx] = NULL;
+		o_tty->driver->table[idx] = NULL;
+		if (o_tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
+			tp = o_tty->driver->termios[idx];
+			o_tty->driver->termios[idx] = NULL;
 			kfree(tp);
 		}
 		o_tty->magic = 0;
-		(*o_tty->driver.refcount)--;
+		(*o_tty->driver->refcount)--;
 		file_list_lock();
 		list_del(&o_tty->tty_files);
 		file_list_unlock();
 		free_tty_struct(o_tty);
 	}
 
-	tty->driver.table[idx] = NULL;
-	if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) {
-		tp = tty->driver.termios[idx];
-		tty->driver.termios[idx] = NULL;
+	tty->driver->table[idx] = NULL;
+	if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
+		tp = tty->driver->termios[idx];
+		tty->driver->termios[idx] = NULL;
 		kfree(tp);
 	}
 	tty->magic = 0;
-	(*tty->driver.refcount)--;
+	(*tty->driver->refcount)--;
 	file_list_lock();
 	list_del(&tty->tty_files);
 	file_list_unlock();
-	module_put(tty->driver.owner);
+	module_put(tty->driver->owner);
 	free_tty_struct(tty);
 }
 
@@ -1078,32 +1060,32 @@
 
 	tty_fasync(-1, filp, 0);
 
-	idx = minor(tty->device) - tty->driver.minor_start;
-	pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
-		      tty->driver.subtype == PTY_TYPE_MASTER);
+	idx = tty->index;
+	pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+		      tty->driver->subtype == PTY_TYPE_MASTER);
 	o_tty = tty->link;
 
 #ifdef TTY_PARANOIA_CHECK
-	if (idx < 0 || idx >= tty->driver.num) {
+	if (idx < 0 || idx >= tty->driver->num) {
 		printk(KERN_DEBUG "release_dev: bad idx when trying to "
-				  "free (%s)\n", cdevname(tty->device));
+				  "free (%s)\n", tty->name);
 		return;
 	}
-	if (tty != tty->driver.table[idx]) {
+	if (tty != tty->driver->table[idx]) {
 		printk(KERN_DEBUG "release_dev: driver.table[%d] not tty "
-				  "for (%s)\n", idx, cdevname(tty->device));
+				  "for (%s)\n", idx, tty->name);
 		return;
 	}
-	if (tty->termios != tty->driver.termios[idx]) {
+	if (tty->termios != tty->driver->termios[idx]) {
 		printk(KERN_DEBUG "release_dev: driver.termios[%d] not termios "
 		       "for (%s)\n",
-		       idx, cdevname(tty->device));
+		       idx, tty->name);
 		return;
 	}
-	if (tty->termios_locked != tty->driver.termios_locked[idx]) {
+	if (tty->termios_locked != tty->driver->termios_locked[idx]) {
 		printk(KERN_DEBUG "release_dev: driver.termios_locked[%d] not "
 		       "termios_locked for (%s)\n",
-		       idx, cdevname(tty->device));
+		       idx, tty->name);
 		return;
 	}
 #endif
@@ -1114,24 +1096,24 @@
 #endif
 
 #ifdef TTY_PARANOIA_CHECK
-	if (tty->driver.other) {
-		if (o_tty != tty->driver.other->table[idx]) {
+	if (tty->driver->other) {
+		if (o_tty != tty->driver->other->table[idx]) {
 			printk(KERN_DEBUG "release_dev: other->table[%d] "
 					  "not o_tty for (%s)\n",
-			       idx, cdevname(tty->device));
+			       idx, tty->name);
 			return;
 		}
-		if (o_tty->termios != tty->driver.other->termios[idx]) {
+		if (o_tty->termios != tty->driver->other->termios[idx]) {
 			printk(KERN_DEBUG "release_dev: other->termios[%d] "
 					  "not o_termios for (%s)\n",
-			       idx, cdevname(tty->device));
+			       idx, tty->name);
 			return;
 		}
 		if (o_tty->termios_locked != 
-		      tty->driver.other->termios_locked[idx]) {
+		      tty->driver->other->termios_locked[idx]) {
 			printk(KERN_DEBUG "release_dev: other->termios_locked["
 					  "%d] not o_termios_locked for (%s)\n",
-			       idx, cdevname(tty->device));
+			       idx, tty->name);
 			return;
 		}
 		if (o_tty->link != tty) {
@@ -1141,8 +1123,8 @@
 	}
 #endif
 
-	if (tty->driver.close)
-		tty->driver.close(tty, filp);
+	if (tty->driver->close)
+		tty->driver->close(tty, filp);
 
 	/*
 	 * Sanity check: if tty->count is going to zero, there shouldn't be
@@ -1320,6 +1302,8 @@
 {
 	struct tty_struct *tty;
 	int noctty, retval;
+	struct tty_driver *driver;
+	int index;
 	kdev_t device;
 	unsigned short saved_flags;
 	char	buf[64];
@@ -1331,58 +1315,60 @@
 	if (IS_TTY_DEV(device)) {
 		if (!current->tty)
 			return -ENXIO;
-		device = current->tty->device;
+		driver = current->tty->driver;
+		index = current->tty->index;
 		filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */
 		/* noctty = 1; */
+		goto got_driver;
 	}
 #ifdef CONFIG_VT
 	if (IS_CONSOLE_DEV(device)) {
 		extern int fg_console;
-		device = mk_kdev(TTY_MAJOR, fg_console + 1);
+		extern struct tty_driver console_driver;
+		driver = &console_driver;
+		index = fg_console;
 		noctty = 1;
+		goto got_driver;
 	}
 #endif
 	if (IS_SYSCONS_DEV(device)) {
 		struct console *c = console_drivers;
-		while(c && !c->device)
-			c = c->next;
-		if (!c)
-                        return -ENODEV;
-                device = c->device(c);
-		filp->f_flags |= O_NONBLOCK; /* Don't let /dev/console block */
-		noctty = 1;
+		for (c = console_drivers; c; c = c->next) {
+			if (!c->device)
+				continue;
+			driver = c->device(c, &index);
+			if (!driver)
+				continue;
+			/* Don't let /dev/console block */
+			filp->f_flags |= O_NONBLOCK;
+			noctty = 1;
+			goto got_driver;
+		}
+		return -ENODEV;
 	}
 
 	if (IS_PTMX_DEV(device)) {
 #ifdef CONFIG_UNIX98_PTYS
-		/* find a free pty. */
-		int major, minor;
-		struct tty_driver *driver;
-
 		/* find a device that is not in use. */
 		retval = -1;
-		for (major = 0 ; major < UNIX98_NR_MAJORS ; major++) {
-			driver = &ptm_driver[major];
-			for (minor = driver->minor_start;
-			     minor < driver->minor_start + driver->num;
-			     minor++) {
-				device = mk_kdev(driver->major, minor);
-				if (!init_dev(device, &tty))
-					goto ptmx_found; /* ok! */
-			}
-		}
+		driver = &ptm_driver;
+		for (index = 0; index < driver->num ; index++)
+			if (!init_dev(driver, index, &tty))
+				goto ptmx_found; /* ok! */
 		return -EIO; /* no free ptys */
-
 	ptmx_found:
 		set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
-		minor -= driver->minor_start;
-		devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start));
+		devpts_pty_new(index, MKDEV(pts_driver.major, pts_driver.minor_start) + index);
 		noctty = 1;
 #else
 		return -ENODEV;
 #endif  /* CONFIG_UNIX_98_PTYS */
 	} else {
-		retval = init_dev(device, &tty);
+		driver = get_tty_driver(kdev_t_to_nr(device), &index);
+		if (!driver)
+			return -ENODEV;
+got_driver:
+		retval = init_dev(driver, index, &tty);
 		if (retval)
 			return retval;
 	}
@@ -1390,14 +1376,14 @@
 	filp->private_data = tty;
 	file_move(filp, &tty->tty_files);
 	check_tty_count(tty, "tty_open");
-	if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
-	    tty->driver.subtype == PTY_TYPE_MASTER)
+	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+	    tty->driver->subtype == PTY_TYPE_MASTER)
 		noctty = 1;
 #ifdef TTY_DEBUG_HANGUP
 	printk(KERN_DEBUG "opening %s...", tty_name(tty, buf));
 #endif
-	if (tty->driver.open)
-		retval = tty->driver.open(tty, filp);
+	if (tty->driver->open)
+		retval = tty->driver->open(tty, filp);
 	else
 		retval = -ENODEV;
 	filp->f_flags = saved_flags;
@@ -1434,8 +1420,8 @@
 		tty->session = current->session;
 		tty->pgrp = current->pgrp;
 	}
-	if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) &&
-	    (tty->driver.subtype == SERIAL_TYPE_CALLOUT) &&
+	if ((tty->driver->type == TTY_DRIVER_TYPE_SERIAL) &&
+	    (tty->driver->subtype == SERIAL_TYPE_CALLOUT) &&
 	    (tty->count == 1)) {
 		static int nr_warns;
 		if (nr_warns < 5) {
@@ -1527,8 +1513,8 @@
 	if (!memcmp(&tmp_ws, &tty->winsize, sizeof(*arg)))
 		return 0;
 #ifdef CONFIG_VT
-	if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) {
-		unsigned int currcons = minor(tty->device) - tty->driver.minor_start;
+	if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) {
+		unsigned int currcons = tty->index;
 		if (vc_resize(currcons, tmp_ws.ws_col, tmp_ws.ws_row))
 			return -ENXIO;
 	}
@@ -1674,10 +1660,10 @@
 {
 	set_current_state(TASK_INTERRUPTIBLE);
 
-	tty->driver.break_ctl(tty, -1);
+	tty->driver->break_ctl(tty, -1);
 	if (!signal_pending(current))
 		schedule_timeout(duration);
-	tty->driver.break_ctl(tty, 0);
+	tty->driver->break_ctl(tty, 0);
 	if (signal_pending(current))
 		return -EINTR;
 	return 0;
@@ -1688,8 +1674,8 @@
 {
 	int retval = -EINVAL;
 
-	if (tty->driver.tiocmget) {
-		retval = tty->driver.tiocmget(tty, file);
+	if (tty->driver->tiocmget) {
+		retval = tty->driver->tiocmget(tty, file);
 
 		if (retval >= 0)
 			retval = put_user(retval, (int *)arg);
@@ -1703,7 +1689,7 @@
 {
 	int retval = -EINVAL;
 
-	if (tty->driver.tiocmset) {
+	if (tty->driver->tiocmset) {
 		unsigned int set, clear, val;
 
 		retval = get_user(val, (unsigned int *)arg);
@@ -1724,10 +1710,10 @@
 			break;
 		}
 
-		set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2;
-		clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2;
+		set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP;
+		clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP;
 
-		retval = tty->driver.tiocmset(tty, file, set, clear);
+		retval = tty->driver->tiocmset(tty, file, set, clear);
 	}
 	return retval;
 }
@@ -1746,28 +1732,28 @@
 		return -EINVAL;
 
 	real_tty = tty;
-	if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
-	    tty->driver.subtype == PTY_TYPE_MASTER)
+	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+	    tty->driver->subtype == PTY_TYPE_MASTER)
 		real_tty = tty->link;
 
 	/*
 	 * Break handling by driver
 	 */
-	if (!tty->driver.break_ctl) {
+	if (!tty->driver->break_ctl) {
 		switch(cmd) {
 		case TIOCSBRK:
 		case TIOCCBRK:
-			if (tty->driver.ioctl)
-				return tty->driver.ioctl(tty, file, cmd, arg);
+			if (tty->driver->ioctl)
+				return tty->driver->ioctl(tty, file, cmd, arg);
 			return -EINVAL;
 			
 		/* These two ioctl's always return success; even if */
 		/* the driver doesn't support them. */
 		case TCSBRK:
 		case TCSBRKP:
-			if (!tty->driver.ioctl)
+			if (!tty->driver->ioctl)
 				return 0;
-			retval = tty->driver.ioctl(tty, file, cmd, arg);
+			retval = tty->driver->ioctl(tty, file, cmd, arg);
 			if (retval == -ENOIOCTLCMD)
 				retval = 0;
 			return retval;
@@ -1840,11 +1826,11 @@
 		 * Break handling
 		 */
 		case TIOCSBRK:	/* Turn break on, unconditionally */
-			tty->driver.break_ctl(tty, -1);
+			tty->driver->break_ctl(tty, -1);
 			return 0;
 			
 		case TIOCCBRK:	/* Turn break off, unconditionally */
-			tty->driver.break_ctl(tty, 0);
+			tty->driver->break_ctl(tty, 0);
 			return 0;
 		case TCSBRK:   /* SVID version: non-zero arg --> no break */
 			/*
@@ -1866,8 +1852,8 @@
 		case TIOCMBIS:
 			return tty_tiocmset(tty, file, cmd, arg);
 	}
-	if (tty->driver.ioctl) {
-		int retval = (tty->driver.ioctl)(tty, file, cmd, arg);
+	if (tty->driver->ioctl) {
+		int retval = (tty->driver->ioctl)(tty, file, cmd, arg);
 		if (retval != -ENOIOCTLCMD)
 			return retval;
 	}
@@ -1917,8 +1903,8 @@
 	session  = tty->session;
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	read_lock(&tasklist_lock);
 	for_each_task_pid(session, PIDTYPE_SID, p, l, pid) {
 		if (p->tty == tty || session > 0) {
@@ -2098,58 +2084,100 @@
  */
 static void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	tty->driver.write(tty, 0, &ch, 1);
+	tty->driver->write(tty, 0, &ch, 1);
 }
 
 #ifdef CONFIG_DEVFS_FS
-static void tty_register_devfs(struct tty_driver *driver, unsigned minor)
+static void tty_register_devfs(struct tty_driver *driver, unsigned index)
 {
-	umode_t mode = S_IFCHR | S_IRUSR | S_IWUSR;
-	kdev_t dev = mk_kdev(driver->major, minor);
-	int idx = minor - driver->minor_start;
+	dev_t dev = MKDEV(driver->major, driver->minor_start) + index;
 	char buf[32];
 
-	if ((minor < driver->minor_start) || 
-	    (minor >= driver->minor_start + driver->num)) {
-		printk(KERN_ERR "Attempt to register invalid minor number "
-		       "with devfs (%d:%d).\n", (int)driver->major,(int)minor);
+	if (index >= driver->num) {
+		printk(KERN_ERR "Attempt to register invalid tty line number "
+		       "with devfs (%d).\n", index);
 		return;
 	}
 
-	if (IS_TTY_DEV(dev) || IS_PTMX_DEV(dev)) 
-		mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-
-	sprintf(buf, driver->name, idx + driver->name_base);
-	devfs_register(NULL, buf, 0, driver->major, minor, mode,
-		       &tty_fops, NULL);
+	tty_line_name(driver, index, buf);
+	devfs_register(NULL, buf, 0, MAJOR(dev), MINOR(dev),
+		S_IFCHR | S_IRUSR | S_IWUSR, &tty_fops, NULL);
 }
 
-static void tty_unregister_devfs(struct tty_driver *driver, unsigned minor)
+static void tty_unregister_devfs(struct tty_driver *driver, int index)
 {
-	devfs_remove(driver->name,
-		     minor - driver->minor_start + driver->name_base);
+	char path[64];
+	tty_line_name(driver, index, path);
+	devfs_remove(path);
 }
 #else
-# define tty_register_devfs(driver, minor)	do { } while (0)
-# define tty_unregister_devfs(driver, minor)	do { } while (0)
+# define tty_register_devfs(driver, index)	do { } while (0)
+# define tty_unregister_devfs(driver, index)	do { } while (0)
 #endif /* CONFIG_DEVFS_FS */
 
 /*
  * Register a tty device described by <driver>, with minor number <minor>.
  */
-void tty_register_device(struct tty_driver *driver, unsigned minor)
+void tty_register_device(struct tty_driver *driver, unsigned index)
 {
-	tty_register_devfs(driver, minor);
+	tty_register_devfs(driver, index);
 }
 
-void tty_unregister_device(struct tty_driver *driver, unsigned minor)
+void tty_unregister_device(struct tty_driver *driver, unsigned index)
 {
-	tty_unregister_devfs(driver, minor);
+	tty_unregister_devfs(driver, index);
 }
 
 EXPORT_SYMBOL(tty_register_device);
 EXPORT_SYMBOL(tty_unregister_device);
 
+/* that should be handled by register_chrdev_region() */
+static int get_range(struct tty_driver *driver)
+{
+	dev_t from = MKDEV(driver->major, driver->minor_start);
+	dev_t to = from + driver->num;
+	dev_t n, next;
+	int error = 0;
+
+	for (n = from; MAJOR(n) < MAJOR(to); n = next) {
+		next = MKDEV(MAJOR(n)+1, 0);
+		error = register_chrdev_region(MAJOR(n), MINOR(n),
+			       next - n, driver->name, &tty_fops);
+		if (error)
+			goto fail;
+	}
+	if (n != to)
+		error = register_chrdev_region(MAJOR(n), MINOR(n),
+			       to - n, driver->name, &tty_fops);
+	if (!error)
+		return 0;
+fail:
+	to = n;
+	for (n = from; MAJOR(n) < MAJOR(to); n = next) {
+		next = MKDEV(MAJOR(n)+1, 0);
+		unregister_chrdev_region(MAJOR(n), MINOR(n),
+			       next - n, driver->name);
+	}
+	return error;
+}
+
+/* that should be handled by unregister_chrdev_region() */
+static void put_range(struct tty_driver *driver)
+{
+	dev_t from = MKDEV(driver->major, driver->minor_start);
+	dev_t to = from + driver->num;
+	dev_t n, next;
+
+	for (n = from; MAJOR(n) < MAJOR(to); n = next) {
+		next = MKDEV(MAJOR(n)+1, 0);
+		unregister_chrdev_region(MAJOR(n), MINOR(n),
+			       next - n, driver->name);
+	}
+	if (n != to)
+		unregister_chrdev_region(MAJOR(n), MINOR(n),
+			       to - n, driver->name);
+}
+
 /*
  * Called by a tty driver to register itself.
  */
@@ -2161,12 +2189,16 @@
 	if (driver->flags & TTY_DRIVER_INSTALLED)
 		return 0;
 
-	error = register_chrdev_region(driver->major, driver->minor_start,
+	if (!driver->major) {
+		error = register_chrdev_region(0, driver->minor_start,
 				       driver->num, driver->name, &tty_fops);
+		if (error > 0)
+			driver->major = error;
+	} else {
+		error = get_range(driver);
+	}
 	if (error < 0)
 		return error;
-	else if(driver->major == 0)
-		driver->major = error;
 
 	if (!driver->put_char)
 		driver->put_char = tty_default_put_char;
@@ -2175,7 +2207,7 @@
 	
 	if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) {
 		for(i = 0; i < driver->num; i++)
-		    tty_register_device(driver, driver->minor_start + i);
+		    tty_register_device(driver, i);
 	}
 	proc_tty_register_driver(driver);
 	return error;
@@ -2186,16 +2218,13 @@
  */
 int tty_unregister_driver(struct tty_driver *driver)
 {
-	int retval, i;
+	int i;
 	struct termios *tp;
 
 	if (*driver->refcount)
 		return -EBUSY;
 
-	retval = unregister_chrdev_region(driver->major, driver->minor_start,
-					  driver->num, driver->name);
-	if (retval)
-		return retval;
+	put_range(driver);
 
 	list_del(&driver->tty_drivers);
 
@@ -2215,7 +2244,8 @@
 			driver->termios_locked[i] = NULL;
 			kfree(tp);
 		}
-		tty_unregister_device(driver, driver->minor_start + i);
+		if (!(driver->flags & TTY_DRIVER_NO_DEVFS))
+			tty_unregister_device(driver, i);
 	}
 	proc_tty_unregister_driver(driver);
 	return 0;
@@ -2254,12 +2284,7 @@
 	}
 }
 
-static struct tty_driver dev_tty_driver, dev_syscons_driver;
-#ifdef CONFIG_UNIX98_PTYS
-static struct tty_driver dev_ptmx_driver;
-#endif
 #ifdef CONFIG_VT
-static struct tty_driver dev_console_driver;
 extern int vty_init(void);
 #endif
 
@@ -2281,64 +2306,37 @@
  */
 void __init tty_init(void)
 {
-	/*
-	 * dev_tty_driver and dev_console_driver are actually magic
-	 * devices which get redirected at open time.  Nevertheless,
-	 * we register them so that register_chrdev is called
-	 * appropriately.
-	 */
-	memset(&dev_tty_driver, 0, sizeof(struct tty_driver));
-	dev_tty_driver.magic = TTY_DRIVER_MAGIC;
-	dev_tty_driver.owner = THIS_MODULE;
-	dev_tty_driver.driver_name = "/dev/tty";
-	dev_tty_driver.name = dev_tty_driver.driver_name + 5;
-	dev_tty_driver.name_base = 0;
-	dev_tty_driver.major = TTYAUX_MAJOR;
-	dev_tty_driver.minor_start = 0;
-	dev_tty_driver.num = 1;
-	dev_tty_driver.type = TTY_DRIVER_TYPE_SYSTEM;
-	dev_tty_driver.subtype = SYSTEM_TYPE_TTY;
-	
-	if (tty_register_driver(&dev_tty_driver))
+	if (register_chrdev_region(TTYAUX_MAJOR, 0, 1,
+				   "/dev/tty", &tty_fops) < 0)
 		panic("Couldn't register /dev/tty driver\n");
 
-	dev_syscons_driver = dev_tty_driver;
-	dev_syscons_driver.owner = THIS_MODULE;
-	dev_syscons_driver.driver_name = "/dev/console";
-	dev_syscons_driver.name = dev_syscons_driver.driver_name + 5;
-	dev_syscons_driver.major = TTYAUX_MAJOR;
-	dev_syscons_driver.minor_start = 1;
-	dev_syscons_driver.type = TTY_DRIVER_TYPE_SYSTEM;
-	dev_syscons_driver.subtype = SYSTEM_TYPE_SYSCONS;
+	devfs_register (NULL, "tty", 0, TTYAUX_MAJOR, 0,
+			S_IFCHR | S_IRUGO | S_IWUGO, &tty_fops, NULL);
 
-	if (tty_register_driver(&dev_syscons_driver))
+	if (register_chrdev_region(TTYAUX_MAJOR, 1, 1,
+				   "/dev/console", &tty_fops) < 0)
 		panic("Couldn't register /dev/console driver\n");
 
-#ifdef CONFIG_UNIX98_PTYS
-	dev_ptmx_driver = dev_tty_driver;
-	dev_ptmx_driver.owner = THIS_MODULE;
-	dev_ptmx_driver.driver_name = "/dev/ptmx";
-	dev_ptmx_driver.name = dev_ptmx_driver.driver_name + 5;
-	dev_ptmx_driver.major= TTYAUX_MAJOR;
-	dev_ptmx_driver.minor_start = 2;
-	dev_ptmx_driver.type = TTY_DRIVER_TYPE_SYSTEM;
-	dev_ptmx_driver.subtype = SYSTEM_TYPE_SYSPTMX;
+	devfs_register (NULL, "console", 0, TTYAUX_MAJOR, 1,
+			S_IFCHR | S_IRUSR | S_IWUSR, &tty_fops, NULL);
 
-	if (tty_register_driver(&dev_ptmx_driver))
+#ifdef CONFIG_UNIX98_PTYS
+	if (register_chrdev_region(TTYAUX_MAJOR, 2, 1,
+				   "/dev/ptmx", &tty_fops) < 0)
 		panic("Couldn't register /dev/ptmx driver\n");
+
+	devfs_register (NULL, "ptmx", 0, TTYAUX_MAJOR, 2,
+			S_IFCHR | S_IRUGO | S_IWUGO, &tty_fops, NULL);
 #endif
 	
 #ifdef CONFIG_VT
-	dev_console_driver = dev_tty_driver;
-	dev_console_driver.owner = THIS_MODULE;
-	dev_console_driver.driver_name = "/dev/vc/0";
-	dev_console_driver.name = dev_console_driver.driver_name + 5;
-	dev_console_driver.major = TTY_MAJOR;
-	dev_console_driver.type = TTY_DRIVER_TYPE_SYSTEM;
-	dev_console_driver.subtype = SYSTEM_TYPE_CONSOLE;
-
-	if (tty_register_driver(&dev_console_driver))
+	if (register_chrdev_region(TTY_MAJOR, 0, 1,
+				   "/dev/vc/0", &tty_fops) < 0)
 		panic("Couldn't register /dev/tty0 driver\n");
+
+	devfs_register (NULL, "vc/0", 0, TTY_MAJOR, 0,
+			S_IFCHR | S_IRUSR | S_IWUSR, &tty_fops, NULL);
+
 	vty_init();
 #endif
 
diff -Nru a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
--- a/drivers/char/tty_ioctl.c	Tue Sep 17 11:07:45 2002
+++ b/drivers/char/tty_ioctl.c	Mon Apr 21 20:58:40 2003
@@ -45,7 +45,7 @@
 	
 	printk(KERN_DEBUG "%s wait until sent...\n", tty_name(tty, buf));
 #endif
-	if (!tty->driver.chars_in_buffer)
+	if (!tty->driver->chars_in_buffer)
 		return;
 	add_wait_queue(&tty->write_wait, &wait);
 	if (!timeout)
@@ -53,17 +53,17 @@
 	do {
 #ifdef TTY_DEBUG_WAIT_UNTIL_SENT
 		printk(KERN_DEBUG "waiting %s...(%d)\n", tty_name(tty, buf),
-		       tty->driver.chars_in_buffer(tty));
+		       tty->driver->chars_in_buffer(tty));
 #endif
 		set_current_state(TASK_INTERRUPTIBLE);
 		if (signal_pending(current))
 			goto stop_waiting;
-		if (!tty->driver.chars_in_buffer(tty))
+		if (!tty->driver->chars_in_buffer(tty))
 			break;
 		timeout = schedule_timeout(timeout);
 	} while (timeout);
-	if (tty->driver.wait_until_sent)
-		tty->driver.wait_until_sent(tty, timeout);
+	if (tty->driver->wait_until_sent)
+		tty->driver->wait_until_sent(tty, timeout);
 stop_waiting:
 	set_current_state(TASK_RUNNING);
 	remove_wait_queue(&tty->write_wait, &wait);
@@ -131,8 +131,8 @@
 		}
 	}
 
-	if (tty->driver.set_termios)
-		(*tty->driver.set_termios)(tty, &old_termios);
+	if (tty->driver->set_termios)
+		(*tty->driver->set_termios)(tty, &old_termios);
 
 	if (tty->ldisc.set_termios)
 		(*tty->ldisc.set_termios)(tty, &old_termios);
@@ -346,13 +346,13 @@
 {
 	int	was_stopped = tty->stopped;
 
-	if (tty->driver.send_xchar) {
-		tty->driver.send_xchar(tty, ch);
+	if (tty->driver->send_xchar) {
+		tty->driver->send_xchar(tty, ch);
 		return;
 	}
 	if (was_stopped)
 		start_tty(tty);
-	tty->driver.write(tty, 0, &ch, 1);
+	tty->driver->write(tty, 0, &ch, 1);
 	if (was_stopped)
 		stop_tty(tty);
 }
@@ -363,8 +363,8 @@
 	struct tty_struct * real_tty;
 	int retval;
 
-	if (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
-	    tty->driver.subtype == PTY_TYPE_MASTER)
+	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
+	    tty->driver->subtype == PTY_TYPE_MASTER)
 		real_tty = tty->link;
 	else
 		real_tty = tty;
@@ -450,16 +450,16 @@
 					tty->ldisc.flush_buffer(tty);
 				/* fall through */
 			case TCOFLUSH:
-				if (tty->driver.flush_buffer)
-					tty->driver.flush_buffer(tty);
+				if (tty->driver->flush_buffer)
+					tty->driver->flush_buffer(tty);
 				break;
 			default:
 				return -EINVAL;
 			}
 			return 0;
 		case TIOCOUTQ:
-			return put_user(tty->driver.chars_in_buffer ?
-					tty->driver.chars_in_buffer(tty) : 0,
+			return put_user(tty->driver->chars_in_buffer ?
+					tty->driver->chars_in_buffer(tty) : 0,
 					(int *) arg);
 		case TIOCINQ:
 			retval = tty->read_cnt;
@@ -482,8 +482,8 @@
 		{
 			int pktmode;
 
-			if (tty->driver.type != TTY_DRIVER_TYPE_PTY ||
-			    tty->driver.subtype != PTY_TYPE_MASTER)
+			if (tty->driver->type != TTY_DRIVER_TYPE_PTY ||
+			    tty->driver->subtype != PTY_TYPE_MASTER)
 				return -ENOTTY;
 			if (get_user(pktmode, (int *) arg))
 				return -EFAULT;
diff -Nru a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
--- a/drivers/char/vme_scc.c	Tue Mar 18 07:44:08 2003
+++ b/drivers/char/vme_scc.c	Thu Apr 24 03:30:40 2003
@@ -131,7 +131,7 @@
 	scc_driver.magic = TTY_DRIVER_MAGIC;
 	scc_driver.driver_name = "scc";
 #ifdef CONFIG_DEVFS_FS
-	scc_driver.name = "tts/%d";
+	scc_driver.name = "tts/";
 #else
 	scc_driver.name = "ttyS";
 #endif
@@ -168,7 +168,7 @@
 
 	scc_callout_driver = scc_driver;
 #ifdef CONFIG_DEVFS_FS
-	scc_callout_driver.name = "cua/%d";
+	scc_callout_driver.name = "cua/";
 #else
 	scc_callout_driver.name = "cua";
 #endif
@@ -842,7 +842,7 @@
 
 static int scc_open (struct tty_struct * tty, struct file * filp)
 {
-	int line = minor(tty->device) - SCC_MINOR_BASE;
+	int line = tty->index;
 	int retval;
 	struct scc_port *port = &scc_ports[line];
 	int i, channel = port->channel;
@@ -950,7 +950,7 @@
 	}
 
 	if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = port->gs.normal_termios;
 		else 
 			*tty->termios = port->gs.callout_termios;
@@ -1069,9 +1069,10 @@
 	local_irq_restore(flags);
 }
 
-static kdev_t scc_console_device(struct console *c)
+static struct tty_driver *scc_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, SCC_MINOR_BASE + c->index);
+	*index = c->index;
+	return &scc_driver;
 }
 
 
diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c
--- a/drivers/char/vt.c	Wed Apr  2 22:51:24 2003
+++ b/drivers/char/vt.c	Thu Apr 24 03:30:40 2003
@@ -2180,9 +2180,12 @@
 	clear_bit(0, &printing);
 }
 
-static kdev_t vt_console_device(struct console *c)
+struct tty_driver console_driver;
+
+static struct tty_driver *vt_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, c->index ? c->index : fg_console + 1);
+	*index = c->index ? c->index-1 : fg_console;
+	return &console_driver;
 }
 
 struct console vt_console_driver = {
@@ -2216,7 +2219,7 @@
 	int lines;
 	int ret;
 
-	if (tty->driver.type != TTY_DRIVER_TYPE_CONSOLE)
+	if (tty->driver->type != TTY_DRIVER_TYPE_CONSOLE)
 		return -EINVAL;
 	if (current->tty != tty && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
@@ -2345,7 +2348,7 @@
 	int console_num;
 	if (!tty)
 		return;
-	console_num = minor(tty->device) - (tty->driver.minor_start);
+	console_num = tty->index;
 	if (!vc_cons_allocated(console_num))
 		return;
 	set_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK);
@@ -2360,7 +2363,7 @@
 	int console_num;
 	if (!tty)
 		return;
-	console_num = minor(tty->device) - (tty->driver.minor_start);
+	console_num = tty->index;
 	if (!vc_cons_allocated(console_num))
 		return;
 	clr_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK);
@@ -2392,7 +2395,7 @@
 	unsigned int	currcons;
 	int i;
 
-	currcons = minor(tty->device) - tty->driver.minor_start;
+	currcons = tty->index;
 
 	i = vc_allocate(currcons);
 	if (i)
@@ -2418,7 +2421,7 @@
 	if (!tty)
 		return;
 	if (tty->count != 1) return;
-	vcs_make_devfs (minor(tty->device) - tty->driver.minor_start, 1);
+	vcs_make_devfs (tty->index, 1);
 	vt = (struct vt_struct*)tty->driver_data;
 	if (vt)
 		vc_cons[vt->vc_num].d->vc_tty = NULL;
@@ -2455,7 +2458,6 @@
  * the appropriate escape-sequence.
  */
 
-struct tty_driver console_driver;
 static int console_refcount;
 
 static int __init con_init(void)
@@ -2515,7 +2517,7 @@
 	memset(&console_driver, 0, sizeof(struct tty_driver));
 	console_driver.magic = TTY_DRIVER_MAGIC;
 	console_driver.owner = THIS_MODULE;
-	console_driver.name = "vc/%d";
+	console_driver.name = "vc/";
 	console_driver.name_base = 1;
 	console_driver.major = TTY_MAJOR;
 	console_driver.minor_start = 1;
@@ -2664,8 +2666,7 @@
 	int i;
 
 	for (i = 0; i < console_driver.num; i++)
-		tty_register_device (&console_driver,
-				    console_driver.minor_start + i);
+		tty_register_device (&console_driver, i);
 }
 
 /*
diff -Nru a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
--- a/drivers/char/watchdog/acquirewdt.c	Fri Feb 14 10:07:43 2003
+++ b/drivers/char/watchdog/acquirewdt.c	Thu Apr 24 05:36:57 2003
@@ -29,6 +29,7 @@
 #include <linux/watchdog.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
+#include <linux/fs.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
diff -Nru a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c
--- a/drivers/char/watchdog/advantechwdt.c	Mon Jan 13 20:46:05 2003
+++ b/drivers/char/watchdog/advantechwdt.c	Thu Apr 24 05:36:57 2003
@@ -29,6 +29,7 @@
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
diff -Nru a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
--- a/drivers/char/watchdog/eurotechwdt.c	Mon Jan 13 20:46:05 2003
+++ b/drivers/char/watchdog/eurotechwdt.c	Thu Apr 24 05:36:57 2003
@@ -46,6 +46,7 @@
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
@@ -187,7 +188,7 @@
  * Kernel methods.
  */
  
-void eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	printk(KERN_CRIT "timeout WDT timeout\n");
  
@@ -197,6 +198,7 @@
 	printk(KERN_CRIT "Initiating system reboot.\n");
 	machine_restart(NULL);
 #endif
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
--- a/drivers/char/watchdog/ib700wdt.c	Thu Mar  6 09:19:52 2003
+++ b/drivers/char/watchdog/ib700wdt.c	Thu Apr 24 05:36:57 2003
@@ -38,6 +38,7 @@
 #include <linux/watchdog.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
+#include <linux/fs.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
diff -Nru a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
--- a/drivers/char/watchdog/machzwd.c	Fri Feb 14 10:07:43 2003
+++ b/drivers/char/watchdog/machzwd.c	Thu Apr 24 05:36:57 2003
@@ -35,6 +35,7 @@
 #include <linux/jiffies.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
diff -Nru a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
--- a/drivers/char/watchdog/mixcomwd.c	Fri Feb 14 10:03:27 2003
+++ b/drivers/char/watchdog/mixcomwd.c	Thu Apr 24 05:36:57 2003
@@ -41,6 +41,7 @@
 #include <linux/miscdevice.h>
 #include <linux/ioport.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
diff -Nru a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
--- a/drivers/char/watchdog/pcwd.c	Fri Feb 14 10:07:43 2003
+++ b/drivers/char/watchdog/pcwd.c	Thu Apr 24 05:36:57 2003
@@ -52,6 +52,7 @@
 #include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
+#include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include <linux/init.h>
diff -Nru a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
--- a/drivers/char/watchdog/sbc60xxwdt.c	Thu Mar  6 09:20:38 2003
+++ b/drivers/char/watchdog/sbc60xxwdt.c	Thu Apr 24 05:36:57 2003
@@ -61,6 +61,7 @@
 #include <linux/jiffies.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
diff -Nru a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c
--- a/drivers/char/watchdog/sc520_wdt.c	Thu Mar  6 09:21:14 2003
+++ b/drivers/char/watchdog/sc520_wdt.c	Thu Apr 24 05:36:57 2003
@@ -53,6 +53,7 @@
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
diff -Nru a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
--- a/drivers/char/watchdog/softdog.c	Fri Feb 14 10:03:27 2003
+++ b/drivers/char/watchdog/softdog.c	Thu Apr 24 05:36:57 2003
@@ -41,6 +41,7 @@
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
diff -Nru a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
--- a/drivers/char/watchdog/w83877f_wdt.c	Wed Feb 19 12:17:46 2003
+++ b/drivers/char/watchdog/w83877f_wdt.c	Thu Apr 24 05:36:57 2003
@@ -47,6 +47,7 @@
 #include <linux/jiffies.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
diff -Nru a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c
--- a/drivers/char/watchdog/wafer5823wdt.c	Wed Feb 19 12:18:00 2003
+++ b/drivers/char/watchdog/wafer5823wdt.c	Thu Apr 24 05:36:57 2003
@@ -29,6 +29,7 @@
 #include <linux/module.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
diff -Nru a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
--- a/drivers/char/watchdog/wdt.c	Mon Feb 24 10:09:47 2003
+++ b/drivers/char/watchdog/wdt.c	Thu Apr 24 05:36:57 2003
@@ -37,6 +37,7 @@
 #include <linux/types.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/fs.h>
 #include <linux/ioport.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
@@ -178,7 +179,7 @@
  *	a failure condition occurring.
  */
  
-void wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
 	 *	Read the status register see what is up and
@@ -210,7 +211,8 @@
 #endif		
 #else
 		printk(KERN_CRIT "Reset in 5ms.\n");
-#endif		
+#endif
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
--- a/drivers/char/watchdog/wdt_pci.c	Thu Mar  6 09:21:14 2003
+++ b/drivers/char/watchdog/wdt_pci.c	Mon Apr 21 00:45:41 2003
@@ -161,7 +161,7 @@
  *	a failure condition occurring.
  */
  
-static void wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
 	 *	Read the status register see what is up and
@@ -193,7 +193,8 @@
 #endif		
 #else
 		printk(KERN_CRIT "Reset in 5ms.\n");
-#endif		
+#endif
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/fc4/soc.c b/drivers/fc4/soc.c
--- a/drivers/fc4/soc.c	Mon Dec 30 20:26:12 2002
+++ b/drivers/fc4/soc.c	Tue Apr 22 22:43:02 2003
@@ -40,7 +40,6 @@
 
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <asm/auxio.h>
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 
@@ -335,7 +334,7 @@
 	}
 }
 
-static void soc_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t soc_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	u32 cmd;
 	unsigned long flags;
@@ -349,6 +348,8 @@
 		if (cmd & SOC_CMD_REQ_QALL) soc_request (s, cmd);
 	}
 	spin_unlock_irqrestore(&s->lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 #define TOKEN(proto, port, token) (((proto)<<12)|(token)|(port))
diff -Nru a/drivers/fc4/socal.c b/drivers/fc4/socal.c
--- a/drivers/fc4/socal.c	Mon Dec 30 20:26:12 2002
+++ b/drivers/fc4/socal.c	Tue Apr 22 22:43:02 2003
@@ -36,7 +36,6 @@
 
 #include <asm/openprom.h>
 #include <asm/oplib.h>
-#include <asm/auxio.h>
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 
@@ -405,7 +404,7 @@
 	}
 }
 
-static void socal_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t socal_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	u32 cmd;
 	unsigned long flags;
@@ -429,6 +428,8 @@
 			socal_request (s, cmd);
 	}
 	spin_unlock_irqrestore(&s->lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 #define TOKEN(proto, port, token) (((proto)<<12)|(token)|(port))
diff -Nru a/drivers/hotplug/cpci_hotplug_core.c b/drivers/hotplug/cpci_hotplug_core.c
--- a/drivers/hotplug/cpci_hotplug_core.c	Tue Feb 11 14:57:50 2003
+++ b/drivers/hotplug/cpci_hotplug_core.c	Mon Apr 21 02:40:59 2003
@@ -446,7 +446,7 @@
 }
 
 /* This is the interrupt mode interrupt handler */
-void
+irqreturn_t
 cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
 {
 	dbg("entered cpci_hp_intr");
@@ -455,7 +455,7 @@
 	if((controller->irq_flags & SA_SHIRQ) &&
 	    !controller->ops->check_irq(controller->dev_id)) {
 		dbg("exited cpci_hp_intr, not our interrupt");
-		return;
+		return IRQ_NONE;
 	}
 
 	/* Disable ENUM interrupt */
@@ -465,6 +465,7 @@
 	dbg("Signal event_semaphore");
 	up(&event_semaphore);
 	dbg("exited cpci_hp_intr");
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/hotplug/cpqphp.h b/drivers/hotplug/cpqphp.h
--- a/drivers/hotplug/cpqphp.h	Mon Feb 24 08:18:12 2003
+++ b/drivers/hotplug/cpqphp.h	Mon Apr 21 02:40:59 2003
@@ -29,6 +29,7 @@
 #define _CPQPHP_H
 
 #include "pci_hotplug.h"
+#include <linux/interrupt.h>
 #include <asm/io.h>		/* for read? and write? functions */
 
 
@@ -408,7 +409,7 @@
 
 /* controller functions */
 extern void	cpqhp_pushbutton_thread		(unsigned long event_pointer);
-extern void	cpqhp_ctrl_intr			(int IRQ, struct controller *ctrl_input, struct pt_regs *regs);
+extern irqreturn_t cpqhp_ctrl_intr		(int IRQ, void *data, struct pt_regs *regs);
 extern int	cpqhp_find_available_resources	(struct controller *ctrl, void *rom_start);
 extern int	cpqhp_event_start_thread	(void);
 extern void	cpqhp_event_stop_thread		(void);
diff -Nru a/drivers/hotplug/cpqphp_core.c b/drivers/hotplug/cpqphp_core.c
--- a/drivers/hotplug/cpqphp_core.c	Mon Feb 24 08:18:12 2003
+++ b/drivers/hotplug/cpqphp_core.c	Mon Apr 21 02:40:59 2003
@@ -1148,8 +1148,7 @@
 
 	/* set up the interrupt */
 	dbg("HPC interrupt = %d \n", ctrl->interrupt);
-	if (request_irq(ctrl->interrupt,
-			(void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr,
+	if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
 			SA_SHIRQ, MY_NAME, ctrl)) {
 		err("Can't get irq %d for the hotplug pci controller\n", ctrl->interrupt);
 		rc = -ENODEV;
diff -Nru a/drivers/hotplug/cpqphp_ctrl.c b/drivers/hotplug/cpqphp_ctrl.c
--- a/drivers/hotplug/cpqphp_ctrl.c	Tue Feb 11 14:57:50 2003
+++ b/drivers/hotplug/cpqphp_ctrl.c	Mon Apr 21 02:40:59 2003
@@ -916,8 +916,9 @@
 }
 
 
-void cpqhp_ctrl_intr(int IRQ, struct controller * ctrl, struct pt_regs *regs)
+irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data, struct pt_regs *regs)
 {
+	struct controller *ctrl = data;
 	u8 schedule_flag = 0;
 	u16 misc;
 	u32 Diff;
@@ -929,7 +930,7 @@
 	// Check to see if it was our interrupt
 	//*********************************
 	if (!(misc & 0x000C)) {
-		return;
+		return IRQ_NONE;
 	}
 
 	if (misc & 0x0004) {
@@ -974,7 +975,7 @@
 		up(&event_semaphore);
 		dbg("Signal event_semaphore\n");
 	}
-
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
--- a/drivers/i2c/busses/i2c-viapro.c	Fri Apr 11 15:56:58 2003
+++ b/drivers/i2c/busses/i2c-viapro.c	Mon Apr 21 15:30:48 2003
@@ -42,23 +42,24 @@
 #include <linux/init.h>
 #include <asm/io.h>
 
-#define SMBBA1	    0x90
-#define SMBBA2      0x80
-#define SMBBA3      0xD0
+#define SMBBA1	   	 0x90
+#define SMBBA2     	 0x80
+#define SMBBA3     	 0xD0
 
 /* SMBus address offsets */
-#define SMBHSTSTS (0 + vt596_smba)
-#define SMBHSLVSTS (1 + vt596_smba)
-#define SMBHSTCNT (2 + vt596_smba)
-#define SMBHSTCMD (3 + vt596_smba)
-#define SMBHSTADD (4 + vt596_smba)
-#define SMBHSTDAT0 (5 + vt596_smba)
-#define SMBHSTDAT1 (6 + vt596_smba)
-#define SMBBLKDAT (7 + vt596_smba)
-#define SMBSLVCNT (8 + vt596_smba)
-#define SMBSHDWCMD (9 + vt596_smba)
-#define SMBSLVEVT (0xA + vt596_smba)
-#define SMBSLVDAT (0xC + vt596_smba)
+static unsigned short vt596_smba;
+#define SMBHSTSTS	(vt596_smba + 0)
+#define SMBHSLVSTS	(vt596_smba + 1)
+#define SMBHSTCNT	(vt596_smba + 2)
+#define SMBHSTCMD	(vt596_smba + 3)
+#define SMBHSTADD	(vt596_smba + 4)
+#define SMBHSTDAT0	(vt596_smba + 5)
+#define SMBHSTDAT1	(vt596_smba + 6)
+#define SMBBLKDAT	(vt596_smba + 7)
+#define SMBSLVCNT	(vt596_smba + 8)
+#define SMBSHDWCMD	(vt596_smba + 9)
+#define SMBSLVEVT	(vt596_smba + 0xA)
+#define SMBSLVDAT	(vt596_smba + 0xC)
 
 /* PCI Address Constants */
 
@@ -68,14 +69,14 @@
 static unsigned short smb_cf_hstcfg = 0xD2;
 
 #define SMBHSTCFG   (smb_cf_hstcfg)
-#define SMBSLVC     (SMBHSTCFG+1)
-#define SMBSHDW1    (SMBHSTCFG+2)
-#define SMBSHDW2    (SMBHSTCFG+3)
-#define SMBREV      (SMBHSTCFG+4)
+#define SMBSLVC     (smb_cf_hstcfg + 1)
+#define SMBSHDW1    (smb_cf_hstcfg + 2)
+#define SMBSHDW2    (smb_cf_hstcfg + 3)
+#define SMBREV      (smb_cf_hstcfg + 4)
 
 /* Other settings */
-#define MAX_TIMEOUT 500
-#define  ENABLE_INT9 0
+#define MAX_TIMEOUT	500
+#define ENABLE_INT9	0
 
 /* VT82C596 constants */
 #define VT596_QUICK      0x00
@@ -84,144 +85,33 @@
 #define VT596_WORD_DATA  0x0C
 #define VT596_BLOCK_DATA 0x14
 
-/* insmod parameters */
 
 /* If force is set to anything different from 0, we forcibly enable the
    VT596. DANGEROUS! */
-static int force = 0;
+static int force;
 MODULE_PARM(force, "i");
 MODULE_PARM_DESC(force, "Forcibly enable the SMBus. DANGEROUS!");
 
 /* If force_addr is set to anything different from 0, we forcibly enable
    the VT596 at the given address. VERY DANGEROUS! */
-static int force_addr = 0;
+static int force_addr;
 MODULE_PARM(force_addr, "i");
 MODULE_PARM_DESC(force_addr,
 		 "Forcibly enable the SMBus at the given address. "
 		 "EXTREMELY DANGEROUS!");
 
-static void vt596_do_pause(unsigned int amount);
-static int vt596_transaction(void);
-s32 vt596_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, 
-	char read_write, u8 command, int size, union i2c_smbus_data * data);
-u32 vt596_func(struct i2c_adapter *adapter);
-
-static struct i2c_algorithm smbus_algorithm = {
-	.name		= "Non-I2C SMBus adapter",
-	.id		= I2C_ALGO_SMBUS,
-	.smbus_xfer	= vt596_access,
-	.functionality	= vt596_func,
-};
-
-static struct i2c_adapter vt596_adapter = {
-	.owner		= THIS_MODULE,
-	.id		= I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2,
-	.algo		= &smbus_algorithm,
-	.dev		= {
-		.name	= "unset",
-	},
-};
-
-
-
-
-static unsigned short vt596_smba = 0;
-
-
-/* Detect whether a compatible device can be found, and initialize it. */
-int vt596_setup(struct pci_dev *VT596_dev, struct pci_device_id const *id)
-{
-	unsigned char temp;
-	
-	dev_info(&VT596_dev->dev, "Found Via %s device\n", VT596_dev->dev.name);
-
-	/* Determine the address of the SMBus areas */
-	if (force_addr) {
-		vt596_smba = force_addr & 0xfff0;
-		force = 0;
-	} else {
-		if ((pci_read_config_word(VT596_dev, id->driver_data, &vt596_smba))
-		    || !(vt596_smba & 0x1)) {
-			/* try 2nd address and config reg. for 596 */
-			if((id->device == PCI_DEVICE_ID_VIA_82C596_3) &&
-			   (!pci_read_config_word(VT596_dev, SMBBA2, &vt596_smba)) &&
-			   (vt596_smba & 0x1)) {
-				smb_cf_hstcfg = 0x84;
-			} else {
-			        /* no matches at all */
-			        dev_err(&VT596_dev->dev, "Cannot configure "
-					"SMBus I/O Base address\n");
-			        return(-ENODEV);
-			}
-		}
-		vt596_smba &= 0xfff0;
-		if(vt596_smba == 0) {
-			dev_err(&VT596_dev->dev, "SMBus base address "
-				"uninitialized - upgrade BIOS or use "
-				"force_addr=0xaddr\n");
-			return -ENODEV;
-		}
-	}
-
-	if (!request_region(vt596_smba, 8, "viapro-smbus")) {
-		dev_err(&VT596_dev->dev, "SMBus region 0x%x already in use!\n",
-		        vt596_smba);
-		return(-ENODEV);
-	}
-
-	pci_read_config_byte(VT596_dev, SMBHSTCFG, &temp);
-	/* If force_addr is set, we program the new address here. Just to make
-	   sure, we disable the VT596 first. */
-	if (force_addr) {
-		pci_write_config_byte(VT596_dev, SMBHSTCFG, temp & 0xfe);
-		pci_write_config_word(VT596_dev, id->driver_data, vt596_smba);
-		pci_write_config_byte(VT596_dev, SMBHSTCFG, temp | 0x01);
-		dev_warn(&VT596_dev->dev, "WARNING: SMBus interface set to new "
-		     "address 0x%04x!\n", vt596_smba);
-	} else if ((temp & 1) == 0) {
-		if (force) {
-			/* NOTE: This assumes I/O space and other allocations 
-			 * WERE done by the Bios!  Don't complain if your 
-			 * hardware does weird things after enabling this. 
-			 * :') Check for Bios updates before resorting to 
-			 * this.
-			 */
-			pci_write_config_byte(VT596_dev, SMBHSTCFG,
-					      temp | 1);
-			dev_info(&VT596_dev->dev, "Enabling SMBus device\n");
-		} else {
-			dev_err(&VT596_dev->dev, "SMBUS: Error: Host SMBus "
-				"controller not enabled! - upgrade BIOS or "
-				"use force=1\n");
-			return(-ENODEV);
-		}
-	}
-
-	if ((temp & 0x0E) == 8)
-		dev_dbg(&VT596_dev->dev, "using Interrupt 9 for SMBus.\n");
-	else if ((temp & 0x0E) == 0)
-		dev_dbg(&VT596_dev->dev, "using Interrupt SMI# for SMBus.\n");
-	else
-		dev_dbg(&VT596_dev->dev, "Illegal Interrupt configuration "
-			"(or code out of date)!\n");
-
-	pci_read_config_byte(VT596_dev, SMBREV, &temp);
-	dev_dbg(&VT596_dev->dev, "SMBREV = 0x%X\n", temp);
-	dev_dbg(&VT596_dev->dev, "VT596_smba = 0x%X\n", vt596_smba);
-
-	return(0);
-}
 
+static struct i2c_adapter vt596_adapter;
 
 /* Internally used pause function */
-void vt596_do_pause(unsigned int amount)
+static void vt596_do_pause(unsigned int amount)
 {
 	current->state = TASK_INTERRUPTIBLE;
 	schedule_timeout(amount);
 }
 
 /* Another internally used function */
-int vt596_transaction(void)
+static int vt596_transaction(void)
 {
 	int temp;
 	int result = 0;
@@ -296,15 +186,16 @@
 }
 
 /* Return -1 on error. */
-s32 vt596_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, 
-		char read_write, u8 command, int size, 
-		union i2c_smbus_data * data)
+static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
+		unsigned short flags,  char read_write, u8 command,
+		int size,  union i2c_smbus_data *data)
 {
 	int i, len;
 
 	switch (size) {
 	case I2C_SMBUS_PROC_CALL:
-		dev_info(&vt596_adapter.dev, "I2C_SMBUS_PROC_CALL not supported!\n");
+		dev_info(&vt596_adapter.dev,
+			 "I2C_SMBUS_PROC_CALL not supported!\n");
 		return -1;
 	case I2C_SMBUS_QUICK:
 		outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),
@@ -363,7 +254,6 @@
 	if ((read_write == I2C_SMBUS_WRITE) || (size == VT596_QUICK))
 		return 0;
 
-
 	switch (size) {
 	case VT596_BYTE:
 		/* Where is the result put? I assume here it is in
@@ -388,15 +278,127 @@
 	return 0;
 }
 
-
-u32 vt596_func(struct i2c_adapter *adapter)
+static u32 vt596_func(struct i2c_adapter *adapter)
 {
 	return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
 	    I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
 	    I2C_FUNC_SMBUS_BLOCK_DATA;
 }
 
+static struct i2c_algorithm smbus_algorithm = {
+	.name		= "Non-I2C SMBus adapter",
+	.id		= I2C_ALGO_SMBUS,
+	.smbus_xfer	= vt596_access,
+	.functionality	= vt596_func,
+};
+
+static struct i2c_adapter vt596_adapter = {
+	.owner		= THIS_MODULE,
+	.id		= I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2,
+	.algo		= &smbus_algorithm,
+	.dev		= {
+		.name	= "unset",
+	},
+};
+
+static int __devinit vt596_probe(struct pci_dev *pdev,
+				 const struct pci_device_id *id)
+{
+	unsigned char temp;
+	int error = -ENODEV;
+	
+	/* Determine the address of the SMBus areas */
+	if (force_addr) {
+		vt596_smba = force_addr & 0xfff0;
+		force = 0;
+		goto found;
+	}
+
+	if ((pci_read_config_word(pdev, id->driver_data, &vt596_smba)) ||
+	    !(vt596_smba & 0x1)) {
+		/* try 2nd address and config reg. for 596 */
+		if (id->device == PCI_DEVICE_ID_VIA_82C596_3 &&
+		    !pci_read_config_word(pdev, SMBBA2, &vt596_smba) &&
+		    (vt596_smba & 0x1)) {
+			smb_cf_hstcfg = 0x84;
+		} else {
+			/* no matches at all */
+			dev_err(&pdev->dev, "Cannot configure "
+				"SMBus I/O Base address\n");
+			return -ENODEV;
+		}
+	}
 
+	vt596_smba &= 0xfff0;
+	if (vt596_smba == 0) {
+		dev_err(&pdev->dev, "SMBus base address "
+			"uninitialized - upgrade BIOS or use "
+			"force_addr=0xaddr\n");
+		return -ENODEV;
+	}
+
+ found:
+	if (!request_region(vt596_smba, 8, "viapro-smbus")) {
+		dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n",
+		        vt596_smba);
+		return -ENODEV;
+	}
+
+	pci_read_config_byte(pdev, SMBHSTCFG, &temp);
+	/* If force_addr is set, we program the new address here. Just to make
+	   sure, we disable the VT596 first. */
+	if (force_addr) {
+		pci_write_config_byte(pdev, SMBHSTCFG, temp & 0xfe);
+		pci_write_config_word(pdev, id->driver_data, vt596_smba);
+		pci_write_config_byte(pdev, SMBHSTCFG, temp | 0x01);
+		dev_warn(&pdev->dev, "WARNING: SMBus interface set to new "
+		     "address 0x%04x!\n", vt596_smba);
+	} else if ((temp & 1) == 0) {
+		if (force) {
+			/* NOTE: This assumes I/O space and other allocations 
+			 * WERE done by the Bios!  Don't complain if your 
+			 * hardware does weird things after enabling this. 
+			 * :') Check for Bios updates before resorting to 
+			 * this.
+			 */
+			pci_write_config_byte(pdev, SMBHSTCFG, temp | 1);
+			dev_info(&pdev->dev, "Enabling SMBus device\n");
+		} else {
+			dev_err(&pdev->dev, "SMBUS: Error: Host SMBus "
+				"controller not enabled! - upgrade BIOS or "
+				"use force=1\n");
+			goto release_region;
+		}
+	}
+
+	if ((temp & 0x0E) == 8)
+		dev_dbg(&pdev->dev, "using Interrupt 9 for SMBus.\n");
+	else if ((temp & 0x0E) == 0)
+		dev_dbg(&pdev->dev, "using Interrupt SMI# for SMBus.\n");
+	else
+		dev_dbg(&pdev->dev, "Illegal Interrupt configuration "
+			"(or code out of date)!\n");
+
+	pci_read_config_byte(pdev, SMBREV, &temp);
+	dev_dbg(&pdev->dev, "SMBREV = 0x%X\n", temp);
+	dev_dbg(&pdev->dev, "VT596_smba = 0x%X\n", vt596_smba);
+
+	vt596_adapter.dev.parent = &pdev->dev;
+	snprintf(vt596_adapter.dev.name, DEVICE_NAME_SIZE,
+			"SMBus Via Pro adapter at %04x", vt596_smba);
+	
+	return i2c_add_adapter(&vt596_adapter);
+
+ release_region:
+	release_region(vt596_smba, 8);
+	return error;
+}
+
+static void __devexit vt596_remove(struct pci_dev *pdev)
+{
+	i2c_del_adapter(&vt596_adapter);
+	release_region(vt596_smba, 8);
+}
 
 static struct pci_device_id vt596_ids[] __devinitdata = {
 	{
@@ -451,29 +453,6 @@
 	{ 0, }
 };
 
-static int __devinit vt596_probe(struct pci_dev *dev, const struct pci_device_id *id)
-{
-	int retval;
-
-	retval = vt596_setup(dev, id);
-	if (retval)
-		return retval;
-
-	vt596_adapter.dev.parent = &dev->dev;
-
-	snprintf(vt596_adapter.dev.name, DEVICE_NAME_SIZE,
-			"SMBus Via Pro adapter at %04x", vt596_smba);
-	
-	retval = i2c_add_adapter(&vt596_adapter);
-
-	return retval;
-}
-
-static void __devexit vt596_remove(struct pci_dev *dev)
-{
-	i2c_del_adapter(&vt596_adapter);
-}
-
 static struct pci_driver vt596_driver = {
 	.name		= "vt596 smbus",
 	.id_table	= vt596_ids,
@@ -490,14 +469,12 @@
 static void __exit i2c_vt596_exit(void)
 {
 	pci_unregister_driver(&vt596_driver);
-	release_region(vt596_smba, 8);
 }
 
-
-
-MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock <phil@netroedge.com>");
+MODULE_AUTHOR(
+    "Frodo Looijaard <frodol@dds.nl> and "
+    "Philip Edelbrock <phil@netroedge.com>");
 MODULE_DESCRIPTION("vt82c596 SMBus driver");
-
 MODULE_LICENSE("GPL");
 
 module_init(i2c_vt596_init);
diff -Nru a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
--- a/drivers/i2c/chips/Kconfig	Mon Apr  7 09:28:35 2003
+++ b/drivers/i2c/chips/Kconfig	Thu Apr 24 09:43:04 2003
@@ -22,6 +22,16 @@
 	  in the lm_sensors package, which you can download at 
 	  http://www.lm-sensors.nu
 
+config SENSORS_IT87
+	tristate "  National Semiconductors IT87 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	help
+	  The module will be called it87.
+
+	  You will also need the latest user-space utilties: you can find them
+	  in the lm_sensors package, which you can download at 
+	  http://www.lm-sensors.nu
+
 config SENSORS_LM75
 	tristate "  National Semiconductors LM75 and compatibles"
 	depends on I2C && EXPERIMENTAL
@@ -66,8 +76,8 @@
 
 config I2C_SENSOR
 	tristate
-	default y if SENSORS_ADM1021=y || SENSORS_LM75=y || SENSORS_VIA686A=y || SENSORS_W83781D=y
-	default m if SENSORS_ADM1021=m || SENSORS_LM75=m || SENSORS_VIA686A=m || SENSORS_W83781D=m
+	default y if SENSORS_ADM1021=y || SENSORS_IT87=y || SENSORS_LM75=y || SENSORS_VIA686A=y || SENSORS_W83781D=y
+	default m if SENSORS_ADM1021=m || SENSORS_IT87=m || SENSORS_LM75=m || SENSORS_VIA686A=m || SENSORS_W83781D=m
 	default n
 
 endmenu
diff -Nru a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
--- a/drivers/i2c/chips/Makefile	Wed Apr  2 14:17:57 2003
+++ b/drivers/i2c/chips/Makefile	Thu Apr 24 09:43:13 2003
@@ -3,6 +3,7 @@
 #
 
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
+obj-$(CONFIG_SENSORS_IT87)	+= it87.o
 obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
diff -Nru a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c
--- a/drivers/i2c/chips/adm1021.c	Wed Apr  2 12:01:10 2003
+++ b/drivers/i2c/chips/adm1021.c	Thu Apr 24 06:36:20 2003
@@ -39,12 +39,12 @@
 #define ADM1021_ALARM_RTEMP_NA		0x04
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { SENSORS_I2C_END };
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
 static unsigned short normal_i2c_range[] = { 0x18, 0x1a, 0x29, 0x2b,
-	0x4c, 0x4e, SENSORS_I2C_END
+	0x4c, 0x4e, I2C_CLIENT_END
 };
-static unsigned int normal_isa[] = { SENSORS_ISA_END };
-static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
+static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
 SENSORS_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066);
@@ -414,128 +414,6 @@
 	}
 
 	up(&data->update_lock);
-}
-
-
-/* FIXME, remove these four functions, they are here to verify the sysfs
- * conversion is correct, or not */
-__attribute__((unused))
-static void adm1021_temp(struct i2c_client *client, int operation,
-			 int ctl_name, int *nrels_mag, long *results)
-{
-	struct adm1021_data *data = i2c_get_clientdata(client);
-
-	if (operation == SENSORS_PROC_REAL_INFO)
-		*nrels_mag = 0;
-	else if (operation == SENSORS_PROC_REAL_READ) {
-		adm1021_update_client(client);
-		results[0] = TEMP_FROM_REG(data->temp_max);
-		results[1] = TEMP_FROM_REG(data->temp_hyst);
-		results[2] = TEMP_FROM_REG(data->temp_input);
-		*nrels_mag = 3;
-	} else if (operation == SENSORS_PROC_REAL_WRITE) {
-		if (*nrels_mag >= 1) {
-			data->temp_max = TEMP_TO_REG(results[0]);
-			adm1021_write_value(client, ADM1021_REG_TOS_W,
-					    data->temp_max);
-		}
-		if (*nrels_mag >= 2) {
-			data->temp_hyst = TEMP_TO_REG(results[1]);
-			adm1021_write_value(client, ADM1021_REG_THYST_W,
-					    data->temp_hyst);
-		}
-	}
-}
-
-__attribute__((unused))
-static void adm1021_remote_temp(struct i2c_client *client, int operation,
-				int ctl_name, int *nrels_mag, long *results)
-{
-	struct adm1021_data *data = i2c_get_clientdata(client);
-	int prec = 0;
-
-	if (operation == SENSORS_PROC_REAL_INFO)
-		if (data->type == adm1023) { *nrels_mag = 3; }
-                 else { *nrels_mag = 0; }
-	else if (operation == SENSORS_PROC_REAL_READ) {
-		adm1021_update_client(client);
-		results[0] = TEMP_FROM_REG(data->remote_temp_max);
-		results[1] = TEMP_FROM_REG(data->remote_temp_hyst);
-		results[2] = TEMP_FROM_REG(data->remote_temp_input);
-		if (data->type == adm1023) {
-			results[0] = results[0]*1000 + ((data->remote_temp_os_prec >> 5) * 125);
-			results[1] = results[1]*1000 + ((data->remote_temp_hyst_prec >> 5) * 125);
-			results[2] = (TEMP_FROM_REG(data->remote_temp_offset)*1000) + ((data->remote_temp_offset_prec >> 5) * 125);
-			results[3] = (TEMP_FROM_REG(data->remote_temp_input)*1000) + ((data->remote_temp_prec >> 5) * 125);
-			*nrels_mag = 4;
-		} else {
- 			*nrels_mag = 3;
-		}
-	} else if (operation == SENSORS_PROC_REAL_WRITE) {
-		if (*nrels_mag >= 1) {
-			if (data->type == adm1023) {
-				prec = ((results[0]-((results[0]/1000)*1000))/125)<<5;
-				adm1021_write_value(client, ADM1021_REG_REM_TOS_PREC, prec);
-				results[0] = results[0]/1000;
-				data->remote_temp_os_prec=prec;
-			}
-			data->remote_temp_max = TEMP_TO_REG(results[0]);
-			adm1021_write_value(client, ADM1021_REG_REMOTE_TOS_W, data->remote_temp_max);
-		}
-		if (*nrels_mag >= 2) {
-			if (data->type == adm1023) {
-				prec = ((results[1]-((results[1]/1000)*1000))/125)<<5;
-				adm1021_write_value(client, ADM1021_REG_REM_THYST_PREC, prec);
-				results[1] = results[1]/1000;
-				data->remote_temp_hyst_prec=prec;
-			}
-			data->remote_temp_hyst = TEMP_TO_REG(results[1]);
-			adm1021_write_value(client, ADM1021_REG_REMOTE_THYST_W, data->remote_temp_hyst);
-		}
-		if (*nrels_mag >= 3) {
-			if (data->type == adm1023) {
-				prec = ((results[2]-((results[2]/1000)*1000))/125)<<5;
-				adm1021_write_value(client, ADM1021_REG_REM_OFFSET_PREC, prec);
-				results[2]=results[2]/1000;
-				data->remote_temp_offset_prec=prec;
-				data->remote_temp_offset=results[2];
-				adm1021_write_value(client, ADM1021_REG_REM_OFFSET, data->remote_temp_offset);
-			}
-		}
-	}
-}
-
-__attribute__((unused))
-static void adm1021_die_code(struct i2c_client *client, int operation,
-			     int ctl_name, int *nrels_mag, long *results)
-{
-	struct adm1021_data *data = i2c_get_clientdata(client);
-
-	if (operation == SENSORS_PROC_REAL_INFO)
-		*nrels_mag = 0;
-	else if (operation == SENSORS_PROC_REAL_READ) {
-		adm1021_update_client(client);
-		results[0] = data->die_code;
-		*nrels_mag = 1;
-	} else if (operation == SENSORS_PROC_REAL_WRITE) {
-		/* Can't write to it */
-	}
-}
-
-__attribute__((unused))
-static void adm1021_alarms(struct i2c_client *client, int operation,
-			   int ctl_name, int *nrels_mag, long *results)
-{
-	struct adm1021_data *data = i2c_get_clientdata(client);
-	if (operation == SENSORS_PROC_REAL_INFO)
-		*nrels_mag = 0;
-	else if (operation == SENSORS_PROC_REAL_READ) {
-		adm1021_update_client(client);
-		results[0] = data->alarms;
-		*nrels_mag = 1;
-	} else if (operation == SENSORS_PROC_REAL_WRITE) {
-		/* Can't write to it */
-	}
 }
 
 static int __init sensors_adm1021_init(void)
diff -Nru a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/i2c/chips/it87.c	Thu Apr 24 06:36:20 2003
@@ -0,0 +1,924 @@
+/*
+    it87.c - Part of lm_sensors, Linux kernel modules for hardware
+             monitoring.
+
+    Supports: IT8705F  Super I/O chip w/LPC interface
+              IT8712F  Super I/O chup w/LPC interface & SMbus
+              Sis950   A clone of the IT8705F
+
+    Copyright (c) 2001 Chris Gauthron <chrisg@0-in.com> 
+    Largely inspired by lm78.c of the same package
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/*
+    djg@pdp8.net David Gesswein 7/18/01
+    Modified to fix bug with not all alarms enabled.
+    Added ability to read battery voltage and select temperature sensor
+    type at module load time.
+*/
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/i2c-sensor.h>
+#include <asm/io.h>
+
+
+/* Addresses to scan */
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { 0x20, 0x2f, I2C_CLIENT_END };
+static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
+
+/* Insmod parameters */
+SENSORS_INSMOD_4(it87, it8705, it8712, sis950);
+
+
+/* Update battery voltage after every reading if true */
+static int update_vbat = 0;
+
+
+/* Enable Temp1 as thermal resistor */
+/* Enable Temp2 as thermal diode */
+/* Enable Temp3 as thermal resistor */
+static int temp_type = 0x2a;
+
+/* Many IT87 constants specified below */
+
+/* Length of ISA address segment */
+#define IT87_EXTENT 8
+
+/* Where are the ISA address/data registers relative to the base address */
+#define IT87_ADDR_REG_OFFSET 5
+#define IT87_DATA_REG_OFFSET 6
+
+/*----- The IT87 registers -----*/
+
+#define IT87_REG_CONFIG        0x00
+
+#define IT87_REG_ALARM1        0x01
+#define IT87_REG_ALARM2        0x02
+#define IT87_REG_ALARM3        0x03
+
+#define IT87_REG_VID           0x0a
+#define IT87_REG_FAN_DIV       0x0b
+
+/* Monitors: 9 voltage (0 to 7, battery), 3 temp (1 to 3), 3 fan (1 to 3) */
+
+#define IT87_REG_FAN(nr)       (0x0c + (nr))
+#define IT87_REG_FAN_MIN(nr)   (0x0f + (nr))
+#define IT87_REG_FAN_CTRL      0x13
+
+#define IT87_REG_VIN(nr)       (0x20 + (nr))
+#define IT87_REG_TEMP(nr)      (0x28 + (nr))
+
+#define IT87_REG_VIN_MAX(nr)   (0x30 + (nr) * 2)
+#define IT87_REG_VIN_MIN(nr)   (0x31 + (nr) * 2)
+#define IT87_REG_TEMP_HIGH(nr) (0x3e + (nr) * 2)
+#define IT87_REG_TEMP_LOW(nr)  (0x3f + (nr) * 2)
+
+#define IT87_REG_I2C_ADDR      0x48
+
+#define IT87_REG_VIN_ENABLE    0x50
+#define IT87_REG_TEMP_ENABLE   0x51
+
+#define IT87_REG_CHIPID        0x58
+
+static inline u8 IN_TO_REG(long val, int inNum)
+{
+	/* to avoid floating point, we multiply everything by 100.
+	 val is guaranteed to be positive, so we can achieve the effect of 
+	 rounding by (...*10+5)/10.  Note that the *10 is hidden in the 
+	 /250 (which should really be /2500).
+	 At the end, we need to /100 because we *100 everything and we need
+	 to /10 because of the rounding thing, so we /1000.   */
+	if (inNum <= 1)
+		return (u8)
+		    SENSORS_LIMIT(((val * 210240 - 13300) / 250 + 5) / 1000, 
+				  0, 255);
+	else if (inNum == 2)
+		return (u8)
+		    SENSORS_LIMIT(((val * 157370 - 13300) / 250 + 5) / 1000, 
+				  0, 255);
+	else if (inNum == 3)
+		return (u8)
+		    SENSORS_LIMIT(((val * 101080 - 13300) / 250 + 5) / 1000, 
+				  0, 255);
+	else
+		return (u8) SENSORS_LIMIT(((val * 41714 - 13300) / 250 + 5)
+					  / 1000, 0, 255);
+}
+
+static inline long IN_FROM_REG(u8 val, int inNum)
+{
+	/* to avoid floating point, we multiply everything by 100.
+	 val is guaranteed to be positive, so we can achieve the effect of
+	 rounding by adding 0.5.  Or, to avoid fp math, we do (...*10+5)/10.
+	 We need to scale with *100 anyway, so no need to /100 at the end. */
+	if (inNum <= 1)
+		return (long) (((250000 * val + 13300) / 210240 * 10 + 5) /10);
+	else if (inNum == 2)
+		return (long) (((250000 * val + 13300) / 157370 * 10 + 5) /10);
+	else if (inNum == 3)
+		return (long) (((250000 * val + 13300) / 101080 * 10 + 5) /10);
+	else
+		return (long) (((250000 * val + 13300) / 41714 * 10 + 5) /10);
+}
+
+static inline u8 FAN_TO_REG(long rpm, int div)
+{
+	if (rpm == 0)
+		return 255;
+	rpm = SENSORS_LIMIT(rpm, 1, 1000000);
+	return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1,
+			     254);
+}
+
+#define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div)))
+
+#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-5)/10):\
+					((val)+5)/10),0,255))
+#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10)
+
+#define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\
+				205-(val)*5)
+#define ALARMS_FROM_REG(val) (val)
+
+#define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1)
+#define DIV_FROM_REG(val) (1 << (val))
+
+/* Initial limits. Use the config file to set better limits. */
+#define IT87_INIT_IN_0 170
+#define IT87_INIT_IN_1 250
+#define IT87_INIT_IN_2 (330 / 2)
+#define IT87_INIT_IN_3 (((500)   * 100)/168)
+#define IT87_INIT_IN_4 (((1200)  * 10)/38)
+#define IT87_INIT_IN_5 (((1200)  * 10)/72)
+#define IT87_INIT_IN_6 (((500)   * 10)/56)
+#define IT87_INIT_IN_7 (((500)   * 100)/168)
+
+#define IT87_INIT_IN_PERCENTAGE 10
+
+#define IT87_INIT_IN_MIN_0 \
+	(IT87_INIT_IN_0 - IT87_INIT_IN_0 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_0 \
+	(IT87_INIT_IN_0 + IT87_INIT_IN_0 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_1 \
+	(IT87_INIT_IN_1 - IT87_INIT_IN_1 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_1 \
+	(IT87_INIT_IN_1 + IT87_INIT_IN_1 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_2 \
+	(IT87_INIT_IN_2 - IT87_INIT_IN_2 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_2 \
+	(IT87_INIT_IN_2 + IT87_INIT_IN_2 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_3 \
+	(IT87_INIT_IN_3 - IT87_INIT_IN_3 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_3 \
+	(IT87_INIT_IN_3 + IT87_INIT_IN_3 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_4 \
+	(IT87_INIT_IN_4 - IT87_INIT_IN_4 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_4 \
+	(IT87_INIT_IN_4 + IT87_INIT_IN_4 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_5 \
+	(IT87_INIT_IN_5 - IT87_INIT_IN_5 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_5 \
+	(IT87_INIT_IN_5 + IT87_INIT_IN_5 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_6 \
+	(IT87_INIT_IN_6 - IT87_INIT_IN_6 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_6 \
+	(IT87_INIT_IN_6 + IT87_INIT_IN_6 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MIN_7 \
+	(IT87_INIT_IN_7 - IT87_INIT_IN_7 * IT87_INIT_IN_PERCENTAGE / 100)
+#define IT87_INIT_IN_MAX_7 \
+	(IT87_INIT_IN_7 + IT87_INIT_IN_7 * IT87_INIT_IN_PERCENTAGE / 100)
+
+#define IT87_INIT_FAN_MIN_1 3000
+#define IT87_INIT_FAN_MIN_2 3000
+#define IT87_INIT_FAN_MIN_3 3000
+
+#define IT87_INIT_TEMP_HIGH_1 600
+#define IT87_INIT_TEMP_LOW_1  200
+#define IT87_INIT_TEMP_HIGH_2 600
+#define IT87_INIT_TEMP_LOW_2  200
+#define IT87_INIT_TEMP_HIGH_3 600 
+#define IT87_INIT_TEMP_LOW_3  200
+
+/* For each registered IT87, we need to keep some data in memory. That
+   data is pointed to by it87_list[NR]->data. The structure itself is
+   dynamically allocated, at the same time when a new it87 client is
+   allocated. */
+struct it87_data {
+	struct semaphore lock;
+	enum chips type;
+
+	struct semaphore update_lock;
+	char valid;		/* !=0 if following fields are valid */
+	unsigned long last_updated;	/* In jiffies */
+
+	u8 in[9];		/* Register value */
+	u8 in_max[9];		/* Register value */
+	u8 in_min[9];		/* Register value */
+	u8 fan[3];		/* Register value */
+	u8 fan_min[3];		/* Register value */
+	u8 temp[3];		/* Register value */
+	u8 temp_high[3];	/* Register value */
+	u8 temp_low[3];		/* Register value */
+	u8 fan_div[3];		/* Register encoding, shifted right */
+	u8 vid;			/* Register encoding, combined */
+	u32 alarms;		/* Register encoding, combined */
+};
+
+
+static int it87_attach_adapter(struct i2c_adapter *adapter);
+static int it87_detect(struct i2c_adapter *adapter, int address, int kind);
+static int it87_detach_client(struct i2c_client *client);
+
+static int it87_read_value(struct i2c_client *client, u8 register);
+static int it87_write_value(struct i2c_client *client, u8 register,
+			u8 value);
+static void it87_update_client(struct i2c_client *client);
+static void it87_init_client(struct i2c_client *client);
+
+
+static struct i2c_driver it87_driver = {
+	.owner		= THIS_MODULE,
+	.name		= "IT87xx",
+	.id		= I2C_DRIVERID_IT87,
+	.flags		= I2C_DF_NOTIFY,
+	.attach_adapter	= it87_attach_adapter,
+	.detach_client	= it87_detach_client,
+};
+
+static int it87_id = 0;
+
+static ssize_t show_in(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in[nr], nr)*10 );
+}
+
+static ssize_t show_in_min(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_min[nr], nr)*10 );
+}
+
+static ssize_t show_in_max(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_max[nr], nr)*10 );
+}
+
+static ssize_t set_in_min(struct device *dev, const char *buf, 
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	unsigned long val = simple_strtoul(buf, NULL, 10)/10;
+	data->in_min[nr] = IN_TO_REG(val,nr);
+	it87_write_value(client, IT87_REG_VIN_MIN(nr), 
+			data->in_min[nr]);
+	return count;
+}
+static ssize_t set_in_max(struct device *dev, const char *buf, 
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	unsigned long val = simple_strtoul(buf, NULL, 10)/10;
+	data->in_max[nr] = IN_TO_REG(val,nr);
+	it87_write_value(client, IT87_REG_VIN_MAX(nr), 
+			data->in_max[nr]);
+	return count;
+}
+
+#define show_in_offset(offset)					\
+static ssize_t							\
+	show_in##offset (struct device *dev, char *buf)		\
+{								\
+	return show_in(dev, buf, 0x##offset);			\
+}								\
+static ssize_t							\
+	show_in##offset##_min (struct device *dev, char *buf)	\
+{								\
+	return show_in_min(dev, buf, 0x##offset);		\
+}								\
+static ssize_t							\
+	show_in##offset##_max (struct device *dev, char *buf)	\
+{								\
+	return show_in_max(dev, buf, 0x##offset);		\
+}								\
+static ssize_t set_in##offset##_min (struct device *dev, 	\
+		const char *buf, size_t count) 			\
+{								\
+	return set_in_min(dev, buf, count, 0x##offset);		\
+}								\
+static ssize_t set_in##offset##_max (struct device *dev,	\
+			const char *buf, size_t count)		\
+{								\
+	return set_in_max(dev, buf, count, 0x##offset);		\
+}								\
+static DEVICE_ATTR(in_input##offset, S_IRUGO, show_in##offset, NULL) 	\
+static DEVICE_ATTR(in_min##offset, S_IRUGO | S_IWUSR, 		\
+		show_in##offset##_min, set_in##offset##_min)	\
+static DEVICE_ATTR(in_max##offset, S_IRUGO | S_IWUSR, 		\
+		show_in##offset##_max, set_in##offset##_max)
+
+show_in_offset(0);
+show_in_offset(1);
+show_in_offset(2);
+show_in_offset(3);
+show_in_offset(4);
+
+/* 3 temperatures */
+static ssize_t show_temp(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr])*10 );
+}
+/* more like overshoot temperature */
+static ssize_t show_temp_max(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr])*10);
+}
+/* more like hysteresis temperature */
+static ssize_t show_temp_min(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[nr])*10);
+}
+static ssize_t set_temp_max(struct device *dev, const char *buf, 
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	int val = simple_strtol(buf, NULL, 10)/10;
+	data->temp_high[nr] = TEMP_TO_REG(val);
+	it87_write_value(client, IT87_REG_TEMP_HIGH(nr), data->temp_high[nr]);
+	return count;
+}
+static ssize_t set_temp_min(struct device *dev, const char *buf, 
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	int val = simple_strtol(buf, NULL, 10)/10;
+	data->temp_low[nr] = TEMP_TO_REG(val);
+	it87_write_value(client, IT87_REG_TEMP_LOW(nr), data->temp_low[nr]);
+	return count;
+}
+#define show_temp_offset(offset)					\
+static ssize_t show_temp_##offset (struct device *dev, char *buf)	\
+{									\
+	return show_temp(dev, buf, 0x##offset - 1);			\
+}									\
+static ssize_t								\
+show_temp_##offset##_max (struct device *dev, char *buf)		\
+{									\
+	return show_temp_max(dev, buf, 0x##offset - 1);			\
+}									\
+static ssize_t								\
+show_temp_##offset##_min (struct device *dev, char *buf)		\
+{									\
+	return show_temp_min(dev, buf, 0x##offset - 1);			\
+}									\
+static ssize_t set_temp_##offset##_max (struct device *dev, 		\
+		const char *buf, size_t count) 				\
+{									\
+	return set_temp_max(dev, buf, count, 0x##offset - 1);		\
+}									\
+static ssize_t set_temp_##offset##_min (struct device *dev, 		\
+		const char *buf, size_t count) 				\
+{									\
+	return set_temp_min(dev, buf, count, 0x##offset - 1);		\
+}									\
+static DEVICE_ATTR(temp_input##offset, S_IRUGO, show_temp_##offset, NULL) \
+static DEVICE_ATTR(temp_max##offset, S_IRUGO | S_IWUSR, 		\
+		show_temp_##offset##_max, set_temp_##offset##_max) 	\
+static DEVICE_ATTR(temp_min##offset, S_IRUGO | S_IWUSR, 		\
+		show_temp_##offset##_min, set_temp_##offset##_min)	
+
+show_temp_offset(1);
+show_temp_offset(2);
+show_temp_offset(3);
+
+/* 2 Fans */
+static ssize_t show_fan(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], 
+				DIV_FROM_REG(data->fan_div[nr])) );
+}
+static ssize_t show_fan_min(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf,"%d\n",
+		FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])) );
+}
+static ssize_t show_fan_div(struct device *dev, char *buf, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf,"%d\n", DIV_FROM_REG(data->fan_div[nr]) );
+}
+static ssize_t set_fan_min(struct device *dev, const char *buf, 
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	int val = simple_strtol(buf, NULL, 10);
+	data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
+	it87_write_value(client, IT87_REG_FAN_MIN(nr+1), data->fan_min[nr]);
+	return count;
+}
+static ssize_t set_fan_div(struct device *dev, const char *buf, 
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	int val = simple_strtol(buf, NULL, 10);
+	int old = it87_read_value(client, IT87_REG_FAN_DIV);
+	data->fan_div[nr] = DIV_TO_REG(val);
+	old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4);
+	it87_write_value(client, IT87_REG_FAN_DIV, old);
+	return count;
+}
+
+#define show_fan_offset(offset)						\
+static ssize_t show_fan_##offset (struct device *dev, char *buf)	\
+{									\
+	return show_fan(dev, buf, 0x##offset - 1);			\
+}									\
+static ssize_t show_fan_##offset##_min (struct device *dev, char *buf)	\
+{									\
+	return show_fan_min(dev, buf, 0x##offset - 1);			\
+}									\
+static ssize_t show_fan_##offset##_div (struct device *dev, char *buf)	\
+{									\
+	return show_fan_div(dev, buf, 0x##offset - 1);			\
+}									\
+static ssize_t set_fan_##offset##_min (struct device *dev, 		\
+	const char *buf, size_t count) 					\
+{									\
+	return set_fan_min(dev, buf, count, 0x##offset - 1);		\
+}									\
+static ssize_t set_fan_##offset##_div (struct device *dev, 		\
+		const char *buf, size_t count) 				\
+{									\
+	return set_fan_div(dev, buf, count, 0x##offset - 1);		\
+}									\
+static DEVICE_ATTR(fan_input##offset, S_IRUGO, show_fan_##offset, NULL) \
+static DEVICE_ATTR(fan_min##offset, S_IRUGO | S_IWUSR, 			\
+		show_fan_##offset##_min, set_fan_##offset##_min) 	\
+static DEVICE_ATTR(fan_div##offset, S_IRUGO | S_IWUSR, 			\
+		show_fan_##offset##_div, set_fan_##offset##_div)
+
+show_fan_offset(1);
+show_fan_offset(2);
+
+/* Alarm */
+static ssize_t show_alarm(struct device *dev, char *buf)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	it87_update_client(client);
+	return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
+}
+static DEVICE_ATTR(alarm, S_IRUGO | S_IWUSR, show_alarm, NULL);
+
+/* This function is called when:
+     * it87_driver is inserted (when this module is loaded), for each
+       available adapter
+     * when a new adapter is inserted (and it87_driver is still present) */
+static int it87_attach_adapter(struct i2c_adapter *adapter)
+{
+	return i2c_detect(adapter, &addr_data, it87_detect);
+}
+
+/* This function is called by i2c_detect */
+int it87_detect(struct i2c_adapter *adapter, int address, int kind)
+{
+	int i;
+	struct i2c_client *new_client = NULL;
+	struct it87_data *data;
+	int err = 0;
+	const char *name = "";
+	const char *client_name = "";
+	int is_isa = i2c_is_isa_adapter(adapter);
+
+	if (!is_isa && 
+	    !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+		goto ERROR0;
+
+	/* Reserve the ISA region */
+	if (is_isa)
+		if (!request_region(address, IT87_EXTENT, name))
+			goto ERROR0;
+
+	/* Probe whether there is anything available on this address. Already
+	   done for SMBus clients */
+	if (kind < 0) {
+		if (is_isa) {
+
+#define REALLY_SLOW_IO
+			/* We need the timeouts for at least some IT87-like chips. But only
+			   if we read 'undefined' registers. */
+			i = inb_p(address + 1);
+			if (inb_p(address + 2) != i)
+				goto ERROR1;
+			if (inb_p(address + 3) != i)
+				goto ERROR1;
+			if (inb_p(address + 7) != i)
+				goto ERROR1;
+#undef REALLY_SLOW_IO
+
+			/* Let's just hope nothing breaks here */
+			i = inb_p(address + 5) & 0x7f;
+			outb_p(~i & 0x7f, address + 5);
+			if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) {
+				outb_p(i, address + 5);
+				return 0;
+			}
+		}
+	}
+
+	/* OK. For now, we presume we have a valid client. We now create the
+	   client structure, even though we cannot fill it completely yet.
+	   But it allows us to access it87_{read,write}_value. */
+
+	if (!(new_client = kmalloc((sizeof(struct i2c_client)) +
+					sizeof(struct it87_data),
+					GFP_KERNEL))) {
+		err = -ENOMEM;
+		goto ERROR1;
+	}
+
+	data = (struct it87_data *) (new_client + 1);
+	if (is_isa)
+		init_MUTEX(&data->lock);
+	i2c_set_clientdata(new_client, data);
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &it87_driver;
+	new_client->flags = 0;
+
+	/* Now, we do the remaining detection. */
+
+	if (kind < 0) {
+		if (it87_read_value(new_client, IT87_REG_CONFIG) & 0x80)
+			goto ERROR1;
+		if (!is_isa
+			&& (it87_read_value(new_client, IT87_REG_I2C_ADDR) !=
+			address)) goto ERROR1;
+	}
+
+	/* Determine the chip type. */
+	if (kind <= 0) {
+		i = it87_read_value(new_client, IT87_REG_CHIPID);
+		if (i == 0x90) {
+			kind = it87;
+		}
+		else {
+			if (kind == 0)
+				printk
+				    ("it87.o: Ignoring 'force' parameter for unknown chip at "
+				     "adapter %d, address 0x%02x\n",
+				     i2c_adapter_id(adapter), address);
+			goto ERROR1;
+		}
+	}
+
+	if (kind == it87) {
+		name = "it87";
+		client_name = "IT87 chip";
+	} /* else if (kind == it8712) {
+		name = "it8712";
+		client_name = "IT87-J chip";
+	} */ else {
+		dev_dbg(&adapter->dev, "Internal error: unknown kind (%d)?!?",
+			kind);
+		goto ERROR1;
+	}
+
+	/* Fill in the remaining client fields and put it into the global list */
+	strncpy(new_client->dev.name, name, DEVICE_NAME_SIZE);
+
+	data->type = kind;
+
+	new_client->id = it87_id++;
+	data->valid = 0;
+	init_MUTEX(&data->update_lock);
+
+	/* Tell the I2C layer a new client has arrived */
+	if ((err = i2c_attach_client(new_client)))
+		goto ERROR1;
+
+	/* register sysfs hooks */
+	device_create_file(&new_client->dev, &dev_attr_in_input0);
+	device_create_file(&new_client->dev, &dev_attr_in_input1);
+	device_create_file(&new_client->dev, &dev_attr_in_input2);
+	device_create_file(&new_client->dev, &dev_attr_in_input3);
+	device_create_file(&new_client->dev, &dev_attr_in_input4);
+	device_create_file(&new_client->dev, &dev_attr_in_min0);
+	device_create_file(&new_client->dev, &dev_attr_in_min1);
+	device_create_file(&new_client->dev, &dev_attr_in_min2);
+	device_create_file(&new_client->dev, &dev_attr_in_min3);
+	device_create_file(&new_client->dev, &dev_attr_in_min4);
+	device_create_file(&new_client->dev, &dev_attr_in_max0);
+	device_create_file(&new_client->dev, &dev_attr_in_max1);
+	device_create_file(&new_client->dev, &dev_attr_in_max2);
+	device_create_file(&new_client->dev, &dev_attr_in_max3);
+	device_create_file(&new_client->dev, &dev_attr_in_max4);
+	device_create_file(&new_client->dev, &dev_attr_temp_input1);
+	device_create_file(&new_client->dev, &dev_attr_temp_input2);
+	device_create_file(&new_client->dev, &dev_attr_temp_input3);
+	device_create_file(&new_client->dev, &dev_attr_temp_max1);
+	device_create_file(&new_client->dev, &dev_attr_temp_max2);
+	device_create_file(&new_client->dev, &dev_attr_temp_max3);
+	device_create_file(&new_client->dev, &dev_attr_temp_min1);
+	device_create_file(&new_client->dev, &dev_attr_temp_min2);
+	device_create_file(&new_client->dev, &dev_attr_temp_min3);
+	device_create_file(&new_client->dev, &dev_attr_fan_input1);
+	device_create_file(&new_client->dev, &dev_attr_fan_input2);
+	device_create_file(&new_client->dev, &dev_attr_fan_min1);
+	device_create_file(&new_client->dev, &dev_attr_fan_min2);
+	device_create_file(&new_client->dev, &dev_attr_fan_div1);
+	device_create_file(&new_client->dev, &dev_attr_fan_div2);
+	device_create_file(&new_client->dev, &dev_attr_alarm);
+
+	/* Initialize the IT87 chip */
+	it87_init_client(new_client);
+	return 0;
+
+ERROR1:
+	kfree(new_client);
+
+	if (is_isa)
+		release_region(address, IT87_EXTENT);
+ERROR0:
+	return err;
+}
+
+static int it87_detach_client(struct i2c_client *client)
+{
+	int err;
+
+	if ((err = i2c_detach_client(client))) {
+		dev_err(&client->dev,
+			"Client deregistration failed, client not detached.\n");
+		return err;
+	}
+
+	if(i2c_is_isa_client(client))
+		release_region(client->addr, IT87_EXTENT);
+	kfree(client);
+
+	return 0;
+}
+
+/* The SMBus locks itself, but ISA access must be locked explicitely! 
+   We don't want to lock the whole ISA bus, so we lock each client
+   separately.
+   We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
+   would slow down the IT87 access and should not be necessary. 
+   There are some ugly typecasts here, but the good new is - they should
+   nowhere else be necessary! */
+static int it87_read_value(struct i2c_client *client, u8 reg)
+{
+	struct it87_data *data = i2c_get_clientdata(client);
+
+	int res;
+	if (i2c_is_isa_client(client)) {
+		down(&data->lock);
+		outb_p(reg, client->addr + IT87_ADDR_REG_OFFSET);
+		res = inb_p(client->addr + IT87_DATA_REG_OFFSET);
+		up(&data->lock);
+		return res;
+	} else
+		return i2c_smbus_read_byte_data(client, reg);
+}
+
+/* The SMBus locks itself, but ISA access muse be locked explicitely! 
+   We don't want to lock the whole ISA bus, so we lock each client
+   separately.
+   We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
+   would slow down the IT87 access and should not be necessary. 
+   There are some ugly typecasts here, but the good new is - they should
+   nowhere else be necessary! */
+static int it87_write_value(struct i2c_client *client, u8 reg, u8 value)
+{
+	struct it87_data *data = i2c_get_clientdata(client);
+
+	if (i2c_is_isa_client(client)) {
+		down(&data->lock);
+		outb_p(reg, client->addr + IT87_ADDR_REG_OFFSET);
+		outb_p(value, client->addr + IT87_DATA_REG_OFFSET);
+		up(&data->lock);
+		return 0;
+	} else
+		return i2c_smbus_write_byte_data(client, reg, value);
+}
+
+/* Called when we have found a new IT87. It should set limits, etc. */
+static void it87_init_client(struct i2c_client *client)
+{
+	/* Reset all except Watchdog values and last conversion values
+	   This sets fan-divs to 2, among others */
+	it87_write_value(client, IT87_REG_CONFIG, 0x80);
+	it87_write_value(client, IT87_REG_VIN_MIN(0),
+			 IN_TO_REG(IT87_INIT_IN_MIN_0, 0));
+	it87_write_value(client, IT87_REG_VIN_MAX(0),
+			 IN_TO_REG(IT87_INIT_IN_MAX_0, 0));
+	it87_write_value(client, IT87_REG_VIN_MIN(1),
+			 IN_TO_REG(IT87_INIT_IN_MIN_1, 1));
+	it87_write_value(client, IT87_REG_VIN_MAX(1),
+			 IN_TO_REG(IT87_INIT_IN_MAX_1, 1));
+	it87_write_value(client, IT87_REG_VIN_MIN(2),
+			 IN_TO_REG(IT87_INIT_IN_MIN_2, 2));
+	it87_write_value(client, IT87_REG_VIN_MAX(2),
+			 IN_TO_REG(IT87_INIT_IN_MAX_2, 2));
+	it87_write_value(client, IT87_REG_VIN_MIN(3),
+			 IN_TO_REG(IT87_INIT_IN_MIN_3, 3));
+	it87_write_value(client, IT87_REG_VIN_MAX(3),
+			 IN_TO_REG(IT87_INIT_IN_MAX_3, 3));
+	it87_write_value(client, IT87_REG_VIN_MIN(4),
+			 IN_TO_REG(IT87_INIT_IN_MIN_4, 4));
+	it87_write_value(client, IT87_REG_VIN_MAX(4),
+			 IN_TO_REG(IT87_INIT_IN_MAX_4, 4));
+	it87_write_value(client, IT87_REG_VIN_MIN(5),
+			 IN_TO_REG(IT87_INIT_IN_MIN_5, 5));
+	it87_write_value(client, IT87_REG_VIN_MAX(5),
+			 IN_TO_REG(IT87_INIT_IN_MAX_5, 5));
+	it87_write_value(client, IT87_REG_VIN_MIN(6),
+			 IN_TO_REG(IT87_INIT_IN_MIN_6, 6));
+	it87_write_value(client, IT87_REG_VIN_MAX(6),
+			 IN_TO_REG(IT87_INIT_IN_MAX_6, 6));
+	it87_write_value(client, IT87_REG_VIN_MIN(7),
+			 IN_TO_REG(IT87_INIT_IN_MIN_7, 7));
+	it87_write_value(client, IT87_REG_VIN_MAX(7),
+			 IN_TO_REG(IT87_INIT_IN_MAX_7, 7));
+	/* Note: Battery voltage does not have limit registers */
+	it87_write_value(client, IT87_REG_FAN_MIN(1),
+			 FAN_TO_REG(IT87_INIT_FAN_MIN_1, 2));
+	it87_write_value(client, IT87_REG_FAN_MIN(2),
+			 FAN_TO_REG(IT87_INIT_FAN_MIN_2, 2));
+	it87_write_value(client, IT87_REG_FAN_MIN(3),
+			 FAN_TO_REG(IT87_INIT_FAN_MIN_3, 2));
+	it87_write_value(client, IT87_REG_TEMP_HIGH(1),
+			 TEMP_TO_REG(IT87_INIT_TEMP_HIGH_1));
+	it87_write_value(client, IT87_REG_TEMP_LOW(1),
+			 TEMP_TO_REG(IT87_INIT_TEMP_LOW_1));
+	it87_write_value(client, IT87_REG_TEMP_HIGH(2),
+			 TEMP_TO_REG(IT87_INIT_TEMP_HIGH_2));
+	it87_write_value(client, IT87_REG_TEMP_LOW(2),
+			 TEMP_TO_REG(IT87_INIT_TEMP_LOW_2));
+	it87_write_value(client, IT87_REG_TEMP_HIGH(3),
+			 TEMP_TO_REG(IT87_INIT_TEMP_HIGH_3));
+	it87_write_value(client, IT87_REG_TEMP_LOW(3),
+			 TEMP_TO_REG(IT87_INIT_TEMP_LOW_3));
+
+	/* Enable voltage monitors */
+	it87_write_value(client, IT87_REG_VIN_ENABLE, 0xff);
+
+	/* Enable Temp1-Temp3 */
+	it87_write_value(client, IT87_REG_TEMP_ENABLE,
+			(it87_read_value(client, IT87_REG_TEMP_ENABLE) & 0xc0)
+			| (temp_type & 0x3f));
+
+	/* Enable fans */
+	it87_write_value(client, IT87_REG_FAN_CTRL,
+			(it87_read_value(client, IT87_REG_FAN_CTRL) & 0x8f)
+			| 0x70);
+
+	/* Start monitoring */
+	it87_write_value(client, IT87_REG_CONFIG,
+			 (it87_read_value(client, IT87_REG_CONFIG) & 0xb7)
+			 | (update_vbat ? 0x41 : 0x01));
+}
+
+static void it87_update_client(struct i2c_client *client)
+{
+	struct it87_data *data = i2c_get_clientdata(client);
+	int i;
+
+	down(&data->update_lock);
+
+	if ((jiffies - data->last_updated > HZ + HZ / 2) ||
+	    (jiffies < data->last_updated) || !data->valid) {
+
+		if (update_vbat) {
+			/* Cleared after each update, so reenable.  Value
+		 	  returned by this read will be previous value */	
+			it87_write_value(client, IT87_REG_CONFIG,
+			   it87_read_value(client, IT87_REG_CONFIG) | 0x40);
+		}
+		for (i = 0; i <= 7; i++) {
+			data->in[i] =
+			    it87_read_value(client, IT87_REG_VIN(i));
+			data->in_min[i] =
+			    it87_read_value(client, IT87_REG_VIN_MIN(i));
+			data->in_max[i] =
+			    it87_read_value(client, IT87_REG_VIN_MAX(i));
+		}
+		data->in[8] =
+		    it87_read_value(client, IT87_REG_VIN(8));
+		/* Temperature sensor doesn't have limit registers, set
+		   to min and max value */
+		data->in_min[8] = 0;
+		data->in_max[8] = 255;
+
+		for (i = 1; i <= 3; i++) {
+			data->fan[i - 1] =
+			    it87_read_value(client, IT87_REG_FAN(i));
+			data->fan_min[i - 1] =
+			    it87_read_value(client, IT87_REG_FAN_MIN(i));
+		}
+		for (i = 1; i <= 3; i++) {
+			data->temp[i - 1] =
+			    it87_read_value(client, IT87_REG_TEMP(i));
+			data->temp_high[i - 1] =
+			    it87_read_value(client, IT87_REG_TEMP_HIGH(i));
+			data->temp_low[i - 1] =
+			    it87_read_value(client, IT87_REG_TEMP_LOW(i));
+		}
+
+		/* The 8705 does not have VID capability */
+		/*if (data->type == it8712) {
+			data->vid = it87_read_value(client, IT87_REG_VID);
+			data->vid &= 0x1f;
+		}
+		else */ {
+			data->vid = 0x1f;
+		}
+
+		i = it87_read_value(client, IT87_REG_FAN_DIV);
+		data->fan_div[0] = i & 0x07;
+		data->fan_div[1] = (i >> 3) & 0x07;
+		data->fan_div[2] = 1;
+
+		data->alarms =
+			it87_read_value(client, IT87_REG_ALARM1) |
+			(it87_read_value(client, IT87_REG_ALARM2) << 8) |
+			(it87_read_value(client, IT87_REG_ALARM3) << 16);
+
+		data->last_updated = jiffies;
+		data->valid = 1;
+	}
+
+	up(&data->update_lock);
+}
+
+static int __init sm_it87_init(void)
+{
+	return i2c_add_driver(&it87_driver);
+}
+
+static void __exit sm_it87_exit(void)
+{
+	i2c_del_driver(&it87_driver);
+}
+
+
+MODULE_AUTHOR("Chris Gauthron <chrisg@0-in.com>");
+MODULE_DESCRIPTION("IT8705F, IT8712F, Sis950 driver");
+MODULE_PARM(update_vbat, "i");
+MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value");
+MODULE_PARM(temp_type, "i");
+MODULE_PARM_DESC(temp_type, "Temperature sensor type, normally leave unset");
+MODULE_LICENSE("GPL");
+
+module_init(sm_it87_init);
+module_exit(sm_it87_exit);
diff -Nru a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
--- a/drivers/i2c/chips/lm75.c	Wed Apr  2 12:01:10 2003
+++ b/drivers/i2c/chips/lm75.c	Thu Apr 24 06:36:20 2003
@@ -28,10 +28,10 @@
 
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { SENSORS_I2C_END };
-static unsigned short normal_i2c_range[] = { 0x48, 0x4f, SENSORS_I2C_END };
-static unsigned int normal_isa[] = { SENSORS_ISA_END };
-static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { 0x48, 0x4f, I2C_CLIENT_END };
+static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
 SENSORS_INSMOD_1(lm75);
diff -Nru a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
--- a/drivers/i2c/chips/via686a.c	Mon Apr  7 09:38:39 2003
+++ b/drivers/i2c/chips/via686a.c	Thu Apr 24 06:36:20 2003
@@ -51,10 +51,10 @@
 /* Addresses to scan.
    Note that we can't determine the ISA address until we have initialized
    our module */
-static unsigned short normal_i2c[] = { SENSORS_I2C_END };
-static unsigned short normal_i2c_range[] = { SENSORS_I2C_END };
-static unsigned int normal_isa[] = { 0x0000, SENSORS_ISA_END };
-static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
+static unsigned int normal_isa[] = { 0x0000, I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
 SENSORS_INSMOD_1(via686a);
diff -Nru a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
--- a/drivers/i2c/chips/w83781d.c	Tue Apr  8 23:16:22 2003
+++ b/drivers/i2c/chips/w83781d.c	Thu Apr 24 06:36:20 2003
@@ -46,14 +46,14 @@
 #define W83781D_RT			1
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { SENSORS_I2C_END };
-static unsigned short normal_i2c_range[] = { 0x20, 0x2f, SENSORS_I2C_END };
-static unsigned int normal_isa[] = { 0x0290, SENSORS_ISA_END };
-static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { 0x20, 0x2f, I2C_CLIENT_END };
+static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
 SENSORS_INSMOD_6(w83781d, w83782d, w83783s, w83627hf, as99127f, w83697hf);
-SENSORS_MODULE_PARM(force_subclients, "List of subclient addresses: "
+I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "
 		    "{bus, clientaddr, subclientaddr1, subclientaddr2}");
 
 static int init = 1;
diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c	Wed Apr  2 13:54:35 2003
+++ b/drivers/i2c/i2c-core.c	Thu Apr 24 04:11:42 2003
@@ -618,8 +618,8 @@
  * ----------------------------------------------------
  */
 int i2c_probe(struct i2c_adapter *adapter,
-                   struct i2c_client_address_data *address_data,
-                   i2c_client_found_addr_proc *found_proc)
+	      struct i2c_client_address_data *address_data,
+	      int (*found_proc) (struct i2c_adapter *, int, int))
 {
 	int addr,i,found,err;
 	int adap_id = i2c_adapter_id(adapter);
@@ -644,7 +644,7 @@
 			     (addr == address_data->force[i+1])) {
 				DEB2(printk(KERN_DEBUG "i2c-core.o: found force parameter for adapter %d, addr %04x\n",
 				            adap_id,addr));
-				if ((err = found_proc(adapter,addr,0,0)))
+				if ((err = found_proc(adapter,addr,0)))
 					return err;
 				found = 1;
 			}
@@ -732,7 +732,7 @@
 		/* OK, so we really should examine this address. First check
 		   whether there is some client here at all! */
 		if (i2c_smbus_xfer(adapter,addr,0,0,0,I2C_SMBUS_QUICK,NULL) >= 0)
-			if ((err = found_proc(adapter,addr,0,-1)))
+			if ((err = found_proc(adapter,addr,-1)))
 				return err;
 	}
 	return 0;
diff -Nru a/drivers/i2c/i2c-sensor.c b/drivers/i2c/i2c-sensor.c
--- a/drivers/i2c/i2c-sensor.c	Wed Apr  2 12:01:10 2003
+++ b/drivers/i2c/i2c-sensor.c	Thu Apr 24 06:36:20 2003
@@ -35,14 +35,14 @@
 
 /* Very inefficient for ISA detects, and won't work for 10-bit addresses! */
 int i2c_detect(struct i2c_adapter *adapter,
-		   struct i2c_address_data *address_data,
-		   i2c_found_addr_proc * found_proc)
+	       struct i2c_address_data *address_data,
+	       int (*found_proc) (struct i2c_adapter *, int, int))
 {
 	int addr, i, found, j, err;
 	struct i2c_force_data *this_force;
 	int is_isa = i2c_is_isa_adapter(adapter);
 	int adapter_id =
-	    is_isa ? SENSORS_ISA_BUS : i2c_adapter_id(adapter);
+	    is_isa ? ANY_I2C_ISA_BUS : i2c_adapter_id(adapter);
 
 	/* Forget it if we can't probe using SMBUS_QUICK */
 	if ((!is_isa) &&
@@ -59,9 +59,9 @@
 		   detection at all */
 		found = 0;
 		for (i = 0; !found && (this_force = address_data->forces + i, this_force->force); i++) {
-			for (j = 0; !found && (this_force->force[j] != SENSORS_I2C_END); j += 2) {
+			for (j = 0; !found && (this_force->force[j] != I2C_CLIENT_END); j += 2) {
 				if ( ((adapter_id == this_force->force[j]) ||
-				      ((this_force->force[j] == SENSORS_ANY_I2C_BUS) && !is_isa)) &&
+				      ((this_force->force[j] == ANY_I2C_BUS) && !is_isa)) &&
 				      (addr == this_force->force[j + 1]) ) {
 					dev_dbg(&adapter->dev, "found force parameter for adapter %d, addr %04x\n", adapter_id, addr);
 					if ((err = found_proc(adapter, addr, this_force->kind)))
@@ -75,18 +75,18 @@
 
 		/* If this address is in one of the ignores, we can forget about it
 		   right now */
-		for (i = 0; !found && (address_data->ignore[i] != SENSORS_I2C_END); i += 2) {
+		for (i = 0; !found && (address_data->ignore[i] != I2C_CLIENT_END); i += 2) {
 			if ( ((adapter_id == address_data->ignore[i]) ||
-			      ((address_data->ignore[i] == SENSORS_ANY_I2C_BUS) &&
+			      ((address_data->ignore[i] == ANY_I2C_BUS) &&
 			       !is_isa)) &&
 			      (addr == address_data->ignore[i + 1])) {
 				dev_dbg(&adapter->dev, "found ignore parameter for adapter %d, addr %04x\n", adapter_id, addr);
 				found = 1;
 			}
 		}
-		for (i = 0; !found && (address_data->ignore_range[i] != SENSORS_I2C_END); i += 3) {
+		for (i = 0; !found && (address_data->ignore_range[i] != I2C_CLIENT_END); i += 3) {
 			if ( ((adapter_id == address_data->ignore_range[i]) ||
-			      ((address_data-> ignore_range[i] == SENSORS_ANY_I2C_BUS) & 
+			      ((address_data-> ignore_range[i] == ANY_I2C_BUS) & 
 			       !is_isa)) &&
 			     (addr >= address_data->ignore_range[i + 1]) &&
 			     (addr <= address_data->ignore_range[i + 2])) {
@@ -100,13 +100,13 @@
 		/* Now, we will do a detection, but only if it is in the normal or 
 		   probe entries */
 		if (is_isa) {
-			for (i = 0; !found && (address_data->normal_isa[i] != SENSORS_ISA_END); i += 1) {
+			for (i = 0; !found && (address_data->normal_isa[i] != I2C_CLIENT_ISA_END); i += 1) {
 				if (addr == address_data->normal_isa[i]) {
 					dev_dbg(&adapter->dev, "found normal isa entry for adapter %d, addr %04x\n", adapter_id, addr);
 					found = 1;
 				}
 			}
-			for (i = 0; !found && (address_data->normal_isa_range[i] != SENSORS_ISA_END); i += 3) {
+			for (i = 0; !found && (address_data->normal_isa_range[i] != I2C_CLIENT_ISA_END); i += 3) {
 				if ((addr >= address_data->normal_isa_range[i]) &&
 				    (addr <= address_data->normal_isa_range[i + 1]) &&
 				    ((addr - address_data->normal_isa_range[i]) % address_data->normal_isa_range[i + 2] == 0)) {
@@ -115,13 +115,13 @@
 				}
 			}
 		} else {
-			for (i = 0; !found && (address_data->normal_i2c[i] != SENSORS_I2C_END); i += 1) {
+			for (i = 0; !found && (address_data->normal_i2c[i] != I2C_CLIENT_END); i += 1) {
 				if (addr == address_data->normal_i2c[i]) {
 					found = 1;
 					dev_dbg(&adapter->dev, "found normal i2c entry for adapter %d, addr %02x", adapter_id, addr);
 				}
 			}
-			for (i = 0; !found && (address_data->normal_i2c_range[i] != SENSORS_I2C_END); i += 2) {
+			for (i = 0; !found && (address_data->normal_i2c_range[i] != I2C_CLIENT_END); i += 2) {
 				if ((addr >= address_data->normal_i2c_range[i]) &&
 				    (addr <= address_data->normal_i2c_range[i + 1])) {
 					dev_dbg(&adapter->dev, "found normal i2c_range entry for adapter %d, addr %04x\n", adapter_id, addr);
@@ -131,19 +131,19 @@
 		}
 
 		for (i = 0;
-		     !found && (address_data->probe[i] != SENSORS_I2C_END);
+		     !found && (address_data->probe[i] != I2C_CLIENT_END);
 		     i += 2) {
 			if (((adapter_id == address_data->probe[i]) ||
 			     ((address_data->
-			       probe[i] == SENSORS_ANY_I2C_BUS) & !is_isa))
+			       probe[i] == ANY_I2C_BUS) & !is_isa))
 			    && (addr == address_data->probe[i + 1])) {
 				dev_dbg(&adapter->dev, "found probe parameter for adapter %d, addr %04x\n", adapter_id, addr);
 				found = 1;
 			}
 		}
-		for (i = 0; !found && (address_data->probe_range[i] != SENSORS_I2C_END); i += 3) {
+		for (i = 0; !found && (address_data->probe_range[i] != I2C_CLIENT_END); i += 3) {
 			if ( ((adapter_id == address_data->probe_range[i]) ||
-			      ((address_data->probe_range[i] == SENSORS_ANY_I2C_BUS) & !is_isa)) &&
+			      ((address_data->probe_range[i] == ANY_I2C_BUS) & !is_isa)) &&
 			     (addr >= address_data->probe_range[i + 1]) &&
 			     (addr <= address_data->probe_range[i + 2])) {
 				found = 1;
@@ -163,20 +163,8 @@
 	return 0;
 }
 
-static int __init i2c_sensor_init(void)
-{
-	return 0;
-}
-
-static void __exit i2c_sensor_exit(void)
-{
-}
-
 EXPORT_SYMBOL(i2c_detect);
 
 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
 MODULE_DESCRIPTION("i2c-sensor driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_sensor_init);
-module_exit(i2c_sensor_exit);
diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig
--- a/drivers/ide/Kconfig	Sun Mar 23 08:45:07 2003
+++ b/drivers/ide/Kconfig	Sun Apr 20 12:56:52 2003
@@ -22,7 +22,7 @@
 	  topics, is contained in <file:Documentation/ide.txt>. For detailed
 	  information about hard drives, consult the Disk-HOWTO and the
 	  Multi-Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  To fine-tune ATA/IDE drive/interface parameters for improved
 	  performance, look for the hdparm package at
@@ -1017,7 +1017,7 @@
 	  If you are unsure, then just choose the Enhanced IDE/MFM/RLL driver
 	  instead of this one. For more detailed information, read the
 	  Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config IDEDMA_AUTO
 	bool
diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
--- a/drivers/ide/ide-cd.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/ide/ide-cd.c	Sat Apr 19 14:18:27 2003
@@ -3366,7 +3366,8 @@
 	DRIVER(drive)->busy++;
 	g->minors = 1;
 	g->minor_shift = 0;
-	strcpy(g->devfs_name, drive->devfs_name);
+	snprintf(g->devfs_name, sizeof(g->devfs_name),
+			"%s/cd", drive->devfs_name);
 	g->driverfs_dev = &drive->gendev;
 	g->flags = GENHD_FL_CD;
 	if (ide_cdrom_setup(drive)) {
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/ide/ide-disk.c	Mon Apr 21 03:32:44 2003
@@ -58,7 +58,6 @@
 #include <linux/genhd.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/buffer_head.h>
 
 #define _IDE_DISK
 
@@ -1743,7 +1742,6 @@
 		memset(&args, 0, sizeof(ide_task_t));
 		args.tfRegister[IDE_COMMAND_OFFSET] = WIN_DOORUNLOCK;
 		args.command_type = ide_cmd_type_parser(&args);
-		invalidate_bdev(inode->i_bdev, 0);
 		if (drive->doorlocking && ide_raw_taskfile(drive, &args, NULL))
 			drive->doorlocking = 0;
 	}
diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
--- a/drivers/ide/ide-io.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/ide/ide-io.c	Sun Apr 20 14:14:28 2003
@@ -1112,7 +1112,7 @@
  *	on the hwgroup and the process begins again.
  */
  
-void ide_intr (int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id;
@@ -1126,7 +1126,7 @@
 
 	if (!ide_ack_intr(hwif)) {
 		spin_unlock_irqrestore(&ide_lock, flags);
-		return;
+		return IRQ_NONE;
 	}
 
 	if ((handler = hwgroup->handler) == NULL ||
@@ -1165,7 +1165,7 @@
 #endif /* CONFIG_BLK_DEV_IDEPCI */
 		}
 		spin_unlock_irqrestore(&ide_lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 	drive = hwgroup->drive;
 	if (!drive) {
@@ -1176,7 +1176,7 @@
 		 * [Note - this can occur if the drive is hot unplugged]
 		 */
 		spin_unlock_irqrestore(&ide_lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 	if (!drive_is_ready(drive)) {
 		/*
@@ -1187,7 +1187,7 @@
 		 * enough advance overhead that the latter isn't a problem.
 		 */
 		spin_unlock_irqrestore(&ide_lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 	if (!hwgroup->busy) {
 		hwgroup->busy = 1;	/* paranoia */
@@ -1222,6 +1222,7 @@
 		}
 	}
 	spin_unlock_irqrestore(&ide_lock, flags);
+	return IRQ_HANDLED;
 }
 
 EXPORT_SYMBOL(ide_intr);
diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
--- a/drivers/ide/ide-probe.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/ide/ide-probe.c	Wed Apr 23 23:25:24 2003
@@ -1214,7 +1214,7 @@
 	spin_unlock_irq(&ide_lock);
 out_up:
 	up(&ide_cfg_sem);
-	return 0;
+	return 1;
 }
 
 static int ata_lock(dev_t dev, void *data)
diff -Nru a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c	Fri Apr 18 08:58:31 2003
+++ b/drivers/ide/ide-tape.c	Mon Apr 21 11:29:32 2003
@@ -1404,7 +1404,7 @@
  */
 static void idetape_onstream_mode_sense_tape_parameter_page(ide_drive_t *drive, int debug);
 static int idetape_chrdev_release (struct inode *inode, struct file *filp);
-static void idetape_write_release (struct inode *inode);
+static void idetape_write_release (ide_drive_t *drive, unsigned int minor);
 
 /*
  * Too bad. The drive wants to send us data which we are not ready to accept.
@@ -4292,18 +4292,6 @@
 		set_bit(IDETAPE_IGNORE_DSC, &tape->flags);
 }
 
-/*
- *	Character device interface functions
- */
-static ide_drive_t *get_drive_ptr (kdev_t i_rdev)
-{
-	unsigned int i = minor(i_rdev) & ~0xc0;
-
-	if (i >= MAX_HWIFS * MAX_DRIVES)
-		return NULL;
-	return (idetape_chrdevs[i].drive);
-}
-
 static int idetape_onstream_space_over_filemarks_backward (ide_drive_t *drive,short mt_op,int mt_count)
 {
 	idetape_tape_t *tape = drive->driver_data;
@@ -4591,7 +4579,7 @@
 				    size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
-	ide_drive_t *drive = get_drive_ptr(inode->i_rdev);
+	ide_drive_t *drive = file->private_data;
 	idetape_tape_t *tape = drive->driver_data;
 	ssize_t bytes_read,temp, actually_read = 0, rc;
 
@@ -4819,8 +4807,9 @@
 				     size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
-	ide_drive_t *drive = get_drive_ptr(inode->i_rdev);
+	ide_drive_t *drive = file->private_data;
 	idetape_tape_t *tape = drive->driver_data;
+	unsigned int minor = minor(inode->i_rdev);
 	ssize_t retval, actually_written = 0;
 	int position;
 
@@ -4852,7 +4841,7 @@
 				"EOM early warning");
 #endif
 			if (tape->chrdev_direction == idetape_direction_write)
-				idetape_write_release(inode);
+				idetape_write_release(drive, minor);
 			return -ENOSPC;
 		}
 	}
@@ -5293,7 +5282,7 @@
  */
 static int idetape_chrdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	ide_drive_t *drive = get_drive_ptr(inode->i_rdev);
+	ide_drive_t *drive = file->private_data;
 	idetape_tape_t *tape = drive->driver_data;
 	struct mtop mtop;
 	struct mtget mtget;
@@ -5465,17 +5454,18 @@
  */
 static int idetape_chrdev_open (struct inode *inode, struct file *filp)
 {
+	unsigned int minor = minor(inode->i_rdev), i = minor & ~0xc0;
 	ide_drive_t *drive;
 	idetape_tape_t *tape;
 	idetape_pc_t pc;
-	unsigned int minor = minor(inode->i_rdev);
 			
 #if IDETAPE_DEBUG_LOG
 	printk(KERN_INFO "ide-tape: Reached idetape_chrdev_open\n");
 #endif /* IDETAPE_DEBUG_LOG */
 	
-	if ((drive = get_drive_ptr(inode->i_rdev)) == NULL)
+	if (i >= MAX_HWIFS * MAX_DRIVES)
 		return -ENXIO;
+	drive = idetape_chrdevs[i].drive;
 	tape = drive->driver_data;
 
 	if (test_and_set_bit(IDETAPE_BUSY, &tape->flags))
@@ -5519,11 +5509,9 @@
 	return 0;
 }
 
-static void idetape_write_release (struct inode *inode)
+static void idetape_write_release (ide_drive_t *drive, unsigned int minor)
 {
-	ide_drive_t *drive = get_drive_ptr(inode->i_rdev);
 	idetape_tape_t *tape = drive->driver_data;
-	unsigned int minor = minor(inode->i_rdev);
 
 	idetape_empty_write_pipeline(drive);
 	tape->merge_stage = __idetape_kmalloc_stage(tape, 1, 0);
@@ -5537,8 +5525,6 @@
 	idetape_flush_tape_buffers(drive);
 	idetape_write_header(drive, minor >= 128);
 	idetape_flush_tape_buffers(drive);
-
-	return;
 }
 
 /*
@@ -5546,7 +5532,7 @@
  */
 static int idetape_chrdev_release (struct inode *inode, struct file *filp)
 {
-	ide_drive_t *drive = get_drive_ptr(inode->i_rdev);
+	ide_drive_t *drive = file->private_data;
 	idetape_tape_t *tape;
 	idetape_pc_t pc;
 	unsigned int minor = minor(inode->i_rdev);
@@ -5558,9 +5544,8 @@
 		printk(KERN_INFO "ide-tape: Reached idetape_chrdev_release\n");
 #endif /* IDETAPE_DEBUG_LOG */
 
-	if (tape->chrdev_direction == idetape_direction_write) {
-		idetape_write_release(inode);
-	}
+	if (tape->chrdev_direction == idetape_direction_write)
+		idetape_write_release(drive, minor);
 	if (tape->chrdev_direction == idetape_direction_read) {
 		if (minor < 128)
 			idetape_discard_read_pipeline(drive, 1);
@@ -6270,7 +6255,6 @@
 static int idetape_attach (ide_drive_t *drive)
 {
 	idetape_tape_t *tape;
-	char devfs_name[64];
 	int minor;
 
 	if (!strstr("ide-tape", drive->driver_req))
@@ -6306,17 +6290,14 @@
 	idetape_setup(drive, tape, minor);
 	idetape_chrdevs[minor].drive = drive;
 
-	sprintf(devfs_name, "%s/mt", drive->devfs_name);
-	tape->de_r = devfs_register (NULL, devfs_name, 0,
-			HWIF(drive)->major, minor,
+	devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor)
 			S_IFCHR | S_IRUGO | S_IWUGO,
-			&idetape_fops, NULL);
-
-	sprintf(devfs_name, "%s/mtn", drive->devfs_name);
-	tape->de_n = devfs_register (NULL, devfs_name, 0,
-			HWIF(drive)->major, minor + 128,
+			&idetape_fops, NULL,
+			"%s/mt", drive->devfs_name);
+	devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor + 128),
 			S_IFCHR | S_IRUGO | S_IWUGO,
-			&idetape_fops, NULL);
+			&idetape_fops, NULL,
+			"%s/mtn", drive->devfs_name);
 
 	drive->disk->number = devfs_register_tape(drive->devfs_name);
 	drive->disk->fops = &idetape_block_ops;
diff -Nru a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
--- a/drivers/ide/legacy/hd.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/ide/legacy/hd.c	Thu Apr 24 05:17:30 2003
@@ -679,7 +679,7 @@
  * be forgotten about...
  */
 
-static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	void (*handler)(void) = do_hd;
 
@@ -689,6 +689,7 @@
 		handler = unexpected_hd_interrupt;
 	handler();
 	local_irq_enable();
+	return IRQ_HANDLED;
 }
 
 static struct block_device_operations hd_fops = {
diff -Nru a/drivers/ide/legacy/hd98.c b/drivers/ide/legacy/hd98.c
--- a/drivers/ide/legacy/hd98.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/ide/legacy/hd98.c	Sun Apr 20 11:08:34 2003
@@ -655,11 +655,8 @@
 	unsigned int cmd, unsigned long arg)
 {
 	struct hd_geometry *loc = (struct hd_geometry *) arg;
-	int dev;
+	int dev = DEVICE_NR(inode->i_rdev);
 
-	if ((!inode) || kdev_none(inode->i_rdev))
-		return -EINVAL;
-	dev = DEVICE_NR(inode->i_rdev);
 	if (dev >= NR_HD)
 		return -EINVAL;
 	switch (cmd) {
diff -Nru a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c
--- a/drivers/ide/legacy/pdc4030.c	Thu Mar 20 10:23:19 2003
+++ b/drivers/ide/legacy/pdc4030.c	Thu Apr 24 05:17:29 2003
@@ -113,7 +113,7 @@
  */
 int pdc4030_cmd(ide_drive_t *drive, u8 cmd)
 {
-	u32 timeout;
+	unsigned long timeout;
 	u8 status_val;
 
 	promise_selectproc(drive);	/* redundant? */
diff -Nru a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
--- a/drivers/ide/ppc/pmac.c	Sat Mar 22 12:32:12 2003
+++ b/drivers/ide/ppc/pmac.c	Thu Apr 24 03:30:41 2003
@@ -702,7 +702,7 @@
 
 static int ide_majors[]  __pmacdata = { 3, 22, 33, 34, 56, 57 };
 
-kdev_t __init
+dev_t __init
 pmac_find_ide_boot(char *bootdevice, int n)
 {
 	int i;
@@ -717,7 +717,7 @@
 		name = pmac_ide[i].node->full_name;
 		if (memcmp(name, bootdevice, n) == 0 && name[n] == 0) {
 			/* XXX should cope with the 2nd drive as well... */
-			return mk_kdev(ide_majors[i], 0);
+			return MKDEV(ide_majors[i], 0);
 		}
 	}
 
diff -Nru a/drivers/ieee1394/Makefile b/drivers/ieee1394/Makefile
--- a/drivers/ieee1394/Makefile	Tue Mar  4 15:56:33 2003
+++ b/drivers/ieee1394/Makefile	Wed Apr 23 14:06:10 2003
@@ -20,4 +20,4 @@
 
 $(obj)/oui.o: $(obj)/oui.c
 $(obj)/oui.c: $(obj)/oui.db $(obj)/oui2c.sh
-	$(CONFIG_SHELL) $(obj)/oui2c.sh < $(obj)/oui.db > $(obj)/oui.c
+	$(CONFIG_SHELL) $(obj)/oui2c.sh < $(obj)/oui.db > $@
diff -Nru a/drivers/ieee1394/csr.c b/drivers/ieee1394/csr.c
--- a/drivers/ieee1394/csr.c	Sat Apr 19 07:55:06 2003
+++ b/drivers/ieee1394/csr.c	Mon Apr 21 08:37:12 2003
@@ -448,7 +448,7 @@
                 /* bandwidth available algorithm adapted from IEEE 1394a-2000 spec */
                 if (arg > 0x1fff) {
                         *store = cpu_to_be32(old);	/* change nothing */
-                        break;
+			break;
                 }
                 data &= 0x1fff;
                 if (arg >= data) {
diff -Nru a/drivers/ieee1394/dv1394-private.h b/drivers/ieee1394/dv1394-private.h
--- a/drivers/ieee1394/dv1394-private.h	Sat Apr 19 07:53:53 2003
+++ b/drivers/ieee1394/dv1394-private.h	Mon Apr 21 08:37:12 2003
@@ -455,6 +455,10 @@
 	 */
 	spinlock_t spinlock;
 
+	/* flag to prevent spurious interrupts (which OHCI seems to
+	   generate a lot :) from accessing the struct */
+	int dma_running;
+	
 	/*
 	  3) the sleeping semaphore 'sem' - this is used from process context only,
 	  to serialize various operations on the video_card. Even though only one
@@ -568,7 +572,7 @@
 
 static int do_dv1394_init(struct video_card *video, struct dv1394_init *init);
 static int do_dv1394_init_default(struct video_card *video);
-static int do_dv1394_shutdown(struct video_card *video, int free_user_buf);
+static void do_dv1394_shutdown(struct video_card *video, int free_user_buf);
 
 
 /* NTSC empty packet rate accurate to within 0.01%, 
diff -Nru a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
--- a/drivers/ieee1394/dv1394.c	Sat Apr 19 07:53:55 2003
+++ b/drivers/ieee1394/dv1394.c	Thu Apr 24 03:35:00 2003
@@ -108,7 +108,6 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 #include <linux/vmalloc.h>
 #include <linux/string.h>
 #include <linux/ioctl32.h>
@@ -689,7 +688,7 @@
 		wmb();
 #endif
 
-		
+		video->dma_running = 1;
 
 		/* set the 'run' bit */
 		reg_write(video->ohci, video->ohci_IsoXmitContextControlSet, 0x8000);
@@ -811,7 +810,9 @@
 		reg_write(video->ohci, video->ohci_IsoRcvCommandPtr,             
 			  video->frames[0]->descriptor_pool_dma | 1); /* Z=1 */
 		wmb();
-		
+
+		video->dma_running = 1;
+
 		/* run */
 		reg_write(video->ohci, video->ohci_IsoRcvContextControlSet, 0x8000);
 		flush_pci_write(video->ohci);
@@ -912,16 +913,16 @@
 	u64 chan_mask;
 	int retval = -EINVAL;
 
-	debug_printk( "dv1394: initialising %d\n", video->id );
+	debug_printk("dv1394: initialising %d\n", video->id);
 	if(init->api_version != DV1394_API_VERSION)
-		goto err;
+		return -EINVAL;
 	
 	/* first sanitize all the parameters */
 	if( (init->n_frames < 2) || (init->n_frames > DV1394_MAX_FRAMES) )
-		goto err;
+		return -EINVAL;
 
 	if( (init->format != DV1394_NTSC) && (init->format != DV1394_PAL) )
-		goto err;
+		return -EINVAL;
 
 	if( (init->syt_offset == 0) || (init->syt_offset > 50) )
 		/* default SYT offset is 3 cycles */
@@ -942,15 +943,15 @@
 	if(new_buf_size % PAGE_SIZE) new_buf_size += PAGE_SIZE - (new_buf_size % PAGE_SIZE);
 
 	/* don't allow the user to allocate the DMA buffer more than once */
-	if(video->dv_buf.kvirt && video->dv_buf_size != new_buf_size)
-		goto err;
-	
+	if(video->dv_buf.kvirt && video->dv_buf_size != new_buf_size) {
+		printk("dv1394: re-sizing the DMA buffer is not allowed\n");
+		return -EINVAL;
+	}
+
 	/* shutdown the card if it's currently active */
 	/* (the card should not be reset if the parameters are screwy) */
-	if( video_card_initialized(video) )
-		do_dv1394_shutdown(video, 0);
-
 
+	do_dv1394_shutdown(video, 0);
 	
 	/* try to claim the ISO channel */
 	spin_lock_irqsave(&video->ohci->IR_channel_lock, flags);
@@ -967,7 +968,6 @@
 	/* initialize misc. fields of video */
 	video->n_frames = init->n_frames;
 	video->pal_or_ntsc = init->format;
-	
 
 	video->cip_accum = 0;
 	video->continuity_counter = 0;
@@ -983,7 +983,6 @@
 	video->current_packet = -1;
 	video->first_frame = 0;
 
-
 	if(video->pal_or_ntsc == DV1394_NTSC) {
 		video->cip_n = init->cip_n != 0 ? init->cip_n : CIP_N_NTSC;
 		video->cip_d = init->cip_d != 0 ? init->cip_d : CIP_D_NTSC;
@@ -996,14 +995,8 @@
 
 	video->syt_offset = init->syt_offset;
 	
-	
 	/* find and claim DMA contexts on the OHCI card */
 
-	/* XXX this should be the last step of initialization, since the interrupt
-	   handler uses ohci_i*_ctx to indicate whether or not it is safe to touch
-	   frames. I'm not making this change quite yet, since it would be better
-	   to clean up the init/shutdown process first.*/
-
 	if(video->ohci_it_ctx == -1) {
 		ohci1394_init_iso_tasklet(&video->it_tasklet, OHCI_ISO_TRANSMIT,
 					  it_tasklet_func, (unsigned long) video);
@@ -1011,14 +1004,12 @@
 		if (ohci1394_register_iso_tasklet(video->ohci, &video->it_tasklet) < 0) {	
 			printk(KERN_ERR "dv1394: could not find an available IT DMA context\n");
 			retval = -EBUSY;
-			goto err_ctx;
-		}
-		else {
-			video->ohci_it_ctx = video->it_tasklet.context;
-			debug_printk("dv1394: claimed IT DMA context %d\n", video->ohci_it_ctx);
+			goto err;
 		}
+		
+		video->ohci_it_ctx = video->it_tasklet.context;
+		debug_printk("dv1394: claimed IT DMA context %d\n", video->ohci_it_ctx);
 	}
-	
 
 	if(video->ohci_ir_ctx == -1) {
 		ohci1394_init_iso_tasklet(&video->ir_tasklet, OHCI_ISO_RECEIVE,
@@ -1027,14 +1018,11 @@
 		if (ohci1394_register_iso_tasklet(video->ohci, &video->ir_tasklet) < 0) {
 			printk(KERN_ERR "dv1394: could not find an available IR DMA context\n");
 			retval = -EBUSY;
-			goto err_ctx;
-		}
-		else {
-			video->ohci_ir_ctx = video->ir_tasklet.context;
-			debug_printk("dv1394: claimed IR DMA context %d\n", video->ohci_ir_ctx);
+			goto err;
 		}
+		video->ohci_ir_ctx = video->ir_tasklet.context;
+		debug_printk("dv1394: claimed IR DMA context %d\n", video->ohci_ir_ctx);
 	}
-
 	
 	/* allocate struct frames */
 	for(i = 0; i < init->n_frames; i++) {
@@ -1043,7 +1031,7 @@
 		if(!video->frames[i]) {
 			printk(KERN_ERR "dv1394: Cannot allocate frame structs\n");
 			retval = -ENOMEM;
-			goto err_frames;
+			goto err;
 		}
 	}
 
@@ -1051,7 +1039,7 @@
 		/* allocate the ringbuffer */
 		retval = dma_region_alloc(&video->dv_buf, new_buf_size, video->ohci->dev, PCI_DMA_TODEVICE);
 		if(retval)
-			goto err_frames;
+			goto err;
 					  
 		video->dv_buf_size = new_buf_size;
 
@@ -1073,7 +1061,7 @@
 		retval = dma_region_alloc(&video->packet_buf, video->packet_buf_size,
 					  video->ohci->dev, PCI_DMA_FROMDEVICE);
 		if(retval)
-			goto err_dv_buf;
+			goto err;
 		
 		debug_printk("dv1394: Allocated %d packets in buffer, total %u pages (%u DMA pages), %lu bytes\n", 
 				 video->n_frames*MAX_PACKETS, video->packet_buf.n_pages,
@@ -1103,30 +1091,8 @@
 	
 	return 0;
 
- err_dv_buf:
-	dma_region_free(&video->dv_buf);
-	
- err_frames:
-	for(i = 0; i < DV1394_MAX_FRAMES; i++) {
-		if(video->frames[i])
-			frame_delete(video->frames[i]);
-	}	
-	video->n_frames = 0;
-
- err_ctx:
-	if(video->ohci_it_ctx != -1) {
-		ohci1394_unregister_iso_tasklet(video->ohci, &video->it_tasklet);
-		video->ohci_it_ctx = -1;
-	}
-	if(video->ohci_ir_ctx != -1) {
-		ohci1394_unregister_iso_tasklet(video->ohci, &video->ir_tasklet);
-		video->ohci_ir_ctx = -1;
-	}
-	
-	spin_lock_irqsave(&video->ohci->IR_channel_lock, flags);
-	video->ohci->ISO_channel_usage &= ~chan_mask;
-	spin_unlock_irqrestore(&video->ohci->IR_channel_lock, flags);
- err:
+err:
+	do_dv1394_shutdown(video, 1);
 	return retval;
 }
 
@@ -1154,10 +1120,15 @@
 {
 	unsigned long flags;
 	int i;
-	
+
 	/* no interrupts */
 	spin_lock_irqsave(&video->spinlock, flags);
 
+	video->dma_running = 0;
+
+	if( (video->ohci_it_ctx == -1) && (video->ohci_ir_ctx == -1) )
+		goto out;
+
 	/* stop DMA if in progress */
 	if( (video->active_frame != -1) ||
 	    (reg_read(video->ohci, video->ohci_IsoXmitContextControlClear) & (1 << 10)) ||
@@ -1197,24 +1168,22 @@
 	}
 	else
 		debug_printk("dv1394: stop_dma: already stopped.\n");
-		
+
+out:
 	spin_unlock_irqrestore(&video->spinlock, flags);
 }
 
 
 
-static int do_dv1394_shutdown(struct video_card *video, int free_dv_buf)
+static void do_dv1394_shutdown(struct video_card *video, int free_dv_buf)
 {
 	int i;
-	unsigned long flags;
 	
 	debug_printk("dv1394: shutdown...\n");
 
 	/* stop DMA if in progress */
 	stop_dma(video);
 	
-	spin_lock_irqsave(&video->spinlock, flags);
-
 	/* release the DMA contexts */
 	if(video->ohci_it_ctx != -1) {
 		video->ohci_IsoXmitContextControlSet = 0;
@@ -1245,8 +1214,6 @@
 		video->ohci_ir_ctx = -1;
 	}
 
-	spin_unlock_irqrestore(&video->spinlock, flags);
-
 	/* release the ISO channel */
 	if(video->channel != -1) {
 		u64 chan_mask;
@@ -1282,9 +1249,7 @@
 	dma_region_free(&video->packet_buf);
 	video->packet_buf_size = 0;
 
-	debug_printk("dv1394: shutdown complete\n");
-
-	return 0;
+	debug_printk("dv1394: shutdown OK\n");
 }
 
 /*
@@ -1770,7 +1735,8 @@
 	}
 
 	case DV1394_IOC_SHUTDOWN:
-		ret = do_dv1394_shutdown(video, 0);
+		do_dv1394_shutdown(video, 0);
+		ret = 0;
 		break;
 
 
@@ -2140,6 +2106,9 @@
 
 	spin_lock(&video->spinlock);
 
+	if(!video->dma_running)
+		goto out;
+
 	irq_printk("ContextControl = %08x, CommandPtr = %08x\n", 
 	       reg_read(video->ohci, video->ohci_IsoXmitContextControlSet),
 	       reg_read(video->ohci, video->ohci_IsoXmitCommandPtr)
@@ -2266,14 +2235,15 @@
 		} /* for(each frame) */
 	}
 
-	spin_unlock(&video->spinlock);
-
 	if(wake) {
 		kill_fasync(&video->fasync, SIGIO, POLL_OUT);
 		
 		/* wake readers/writers/ioctl'ers */
 		wake_up_interruptible(&video->waitq);
 	}
+
+out:
+	spin_unlock(&video->spinlock);
 }
 
 static void ir_tasklet_func(unsigned long data)
@@ -2283,8 +2253,11 @@
 
 	spin_lock(&video->spinlock);
 
-	if( (video->ohci_ir_ctx != -1) 
-	    && (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) ) 
+	if(!video->dma_running)
+		goto out;
+	
+	if( (video->ohci_ir_ctx != -1) &&
+	    (reg_read(video->ohci, video->ohci_IsoRcvContextControlSet) & (1 << 10)) )
 	{ 
 
 		int sof=0; /* start-of-frame flag */
@@ -2424,14 +2397,15 @@
 		
 	} /* receive interrupt */
 	
-	spin_unlock(&video->spinlock);
-	
 	if(wake) {
 		kill_fasync(&video->fasync, SIGIO, POLL_IN);
 
 		/* wake readers/writers/ioctl'ers */
 		wake_up_interruptible(&video->waitq);
 	}
+	
+out:
+	spin_unlock(&video->spinlock);
 }
 
 static struct file_operations dv1394_fops=
@@ -2554,6 +2528,7 @@
 
 	clear_bit(0, &video->open);
 	spin_lock_init(&video->spinlock);
+	video->dma_running = 0;
 	init_MUTEX(&video->sem);
 	init_waitqueue_head(&video->waitq);
 	video->fasync = NULL;
@@ -2565,7 +2540,7 @@
 	
 #ifdef CONFIG_DEVFS_FS
 	if (dv1394_devfs_add_entry(video) < 0)
-		goto err_free;
+			goto err_free;
 #endif
 
 	debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id);
@@ -2718,6 +2693,9 @@
 	
 	spin_lock_irqsave(&video->spinlock, flags);
 
+	if(!video->dma_running)
+		goto out;
+
 	/* check IT context */
 	if(video->ohci_it_ctx != -1) {
 		u32 ctx;
@@ -2790,7 +2768,8 @@
 				   reg_read(video->ohci, video->ohci_IsoRcvCommandPtr));
 		}
 	}
-	
+
+out:
 	spin_unlock_irqrestore(&video->spinlock, flags);
 	
 	/* wake readers/writers/ioctl'ers */
diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
--- a/drivers/ieee1394/eth1394.c	Sat Apr 19 07:53:54 2003
+++ b/drivers/ieee1394/eth1394.c	Mon Apr 21 08:37:01 2003
@@ -78,7 +78,7 @@
 	printk(KERN_ERR fmt, ## args)
 
 static char version[] __devinitdata =
-	"$Rev: 886 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 895 $ Ben Collins <bcollins@debian.org>";
 
 /* Our ieee1394 highlevel driver */
 #define ETHER1394_DRIVER_NAME "ether1394"
@@ -340,6 +340,7 @@
 	priv = (struct eth1394_priv *)dev->priv;
 
 	priv->host = host;
+	spin_lock_init(&priv->lock);
 
 	hi = hpsb_create_hostinfo(hl, host, sizeof(*hi));
 
diff -Nru a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
--- a/drivers/ieee1394/highlevel.c	Sat Apr 19 08:22:57 2003
+++ b/drivers/ieee1394/highlevel.c	Mon Apr 21 08:37:12 2003
@@ -38,7 +38,7 @@
 
 
 static LIST_HEAD(hl_drivers);
-static DECLARE_MUTEX(hl_drivers_lock);
+static rwlock_t hl_drivers_lock = RW_LOCK_UNLOCKED;
 
 static LIST_HEAD(addr_space);
 static rwlock_t addr_space_lock = RW_LOCK_UNLOCKED;
@@ -48,20 +48,22 @@
 static struct hpsb_address_serve dummy_zero_addr, dummy_max_addr;
 
 
-/* Internal usage. Must be called with hl_drivers_lock held */
 static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl,
 					      struct hpsb_host *host)
 {
-	struct hl_host_info *hi;
+	struct hl_host_info *hi = NULL;
 	struct list_head *lh;
 
+	read_lock(&hl->host_info_lock);
 	list_for_each (lh, &hl->host_info_list) {
 		hi = list_entry(lh, struct hl_host_info, list);
 		if (hi->host == host)
-			return hi;
+			break;
+		hi = NULL;
 	}
+	read_unlock(&hl->host_info_lock);
 
-	return NULL;
+	return hi;
 }
 
 
@@ -69,16 +71,12 @@
  * hpsb_create_hostinfo. */
 void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host)
 {
-	struct hl_host_info *hi;
-	void *data = NULL;
+	struct hl_host_info *hi = hl_get_hostinfo(hl, host);
 
-	read_lock(&hl_drivers_lock);
-	hi = hl_get_hostinfo(hl, host);
 	if (hi)
-		data = hi->data;
-	read_unlock(&hl_drivers_lock);
+		return hi->data;
 
-	return data;
+	return NULL;
 }
 
 
@@ -88,10 +86,9 @@
 {
 	struct hl_host_info *hi;
 	void *data;
+	unsigned long flags;
 
-	read_lock(&hl_drivers_lock);
 	hi = hl_get_hostinfo(hl, host);
-	read_unlock(&hl_drivers_lock);
 	if (hi) {
 		HPSB_ERR("%s called hpsb_create_hostinfo when hostinfo already exists",
 			 hl->name);
@@ -112,9 +109,9 @@
 
 	hi->host = host;
 
-	write_lock_irq(&hl_drivers_lock);
+	write_lock_irqsave(&hl->host_info_lock, flags);
 	list_add_tail(&hi->list, &hl->host_info_list);
-	write_unlock_irq(&hl_drivers_lock);
+	write_unlock_irqrestore(&hl->host_info_lock, flags);
 
 	return data;
 }
@@ -124,23 +121,20 @@
 		      void *data)
 {
 	struct hl_host_info *hi;
-	int ret = -EINVAL;
 
-	write_lock_irq(&hl_drivers_lock);
 	hi = hl_get_hostinfo(hl, host);
 	if (hi) {
 		if (!hi->size && !hi->data) {
 			hi->data = data;
-			ret = 0;
+			return 0;
 		} else
 			HPSB_ERR("%s called hpsb_set_hostinfo when hostinfo already has data",
 				 hl->name);
 	} else
 		HPSB_ERR("%s called hpsb_set_hostinfo when no hostinfo exists",
 			 hl->name);
-	write_unlock_irq(&hl_drivers_lock);
 
-	return ret;
+	return -EINVAL;
 }
 
 
@@ -148,13 +142,14 @@
 {
 	struct hl_host_info *hi;
 
-	write_lock_irq(&hl_drivers_lock);
 	hi = hl_get_hostinfo(hl, host);
 	if (hi) {
+		unsigned long flags;
+		write_lock_irqsave(&hl->host_info_lock, flags);
 		list_del(&hi->list);
+		write_unlock_irqrestore(&hl->host_info_lock, flags);
 		kfree(hi);
 	}
-	write_unlock_irq(&hl_drivers_lock);
 
 	return;
 }
@@ -164,11 +159,9 @@
 {
 	struct hl_host_info *hi;
 
-	write_lock(&hl_drivers_lock);
 	hi = hl_get_hostinfo(hl, host);
 	if (hi)
 		hi->key = key;
-	write_unlock(&hl_drivers_lock);
 
 	return;
 }
@@ -177,15 +170,12 @@
 unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host)
 {
 	struct hl_host_info *hi;
-	unsigned long key = 0;
 
-	read_lock(&hl_drivers_lock);
 	hi = hl_get_hostinfo(hl, host);
 	if (hi)
-		key = hi->key;
-	read_unlock(&hl_drivers_lock);
+		return hi->key;
 
-	return key;
+	return 0;
 }
 
 
@@ -195,7 +185,7 @@
 	struct hl_host_info *hi;
 	void *data = NULL;
 
-	read_lock(&hl_drivers_lock);
+	read_lock(&hl->host_info_lock);
 	list_for_each (lh, &hl->host_info_list) {
 		hi = list_entry(lh, struct hl_host_info, list);
 		if (hi->key == key) {
@@ -203,7 +193,7 @@
 			break;
 		}
 	}
-	read_unlock(&hl_drivers_lock);
+	read_unlock(&hl->host_info_lock);
 
 	return data;
 }
@@ -214,6 +204,7 @@
 {
         struct hpsb_highlevel *hl;
 	struct list_head *lh;
+	unsigned long flags;
 
         hl = (struct hpsb_highlevel *)kmalloc(sizeof(struct hpsb_highlevel),
                                               GFP_KERNEL);
@@ -225,12 +216,14 @@
         INIT_LIST_HEAD(&hl->addr_list);
 	INIT_LIST_HEAD(&hl->host_info_list);
 
+	rwlock_init(&hl->host_info_lock);
+
         hl->name = name;
         hl->op = ops;
 
-	down(&hl_drivers_lock);
+	write_lock_irqsave(&hl_drivers_lock, flags);
         list_add_tail(&hl->hl_list, &hl_drivers);
-	up(&hl_drivers_lock);
+	write_unlock_irqrestore(&hl_drivers_lock, flags);
 
 	if (hl->op->add_host) {
 		down(&hpsb_hosts_lock);
@@ -248,22 +241,23 @@
 {
         struct list_head *lh, *next;
         struct hpsb_address_serve *as;
+	unsigned long flags;
 
         if (hl == NULL) {
                 return;
         }
 
-        write_lock_irq(&addr_space_lock);
+	write_lock_irqsave(&addr_space_lock, flags);
 	list_for_each_safe (lh, next, &hl->addr_list) {
                 as = list_entry(lh, struct hpsb_address_serve, addr_list);
                 list_del(&as->as_list);
                 kfree(as);
         }
-        write_unlock_irq(&addr_space_lock);
+	write_unlock_irqrestore(&addr_space_lock, flags);
 
-	down(&hl_drivers_lock);
+	write_lock_irqsave(&hl_drivers_lock, flags);
         list_del(&hl->hl_list);
-	up(&hl_drivers_lock);
+	write_unlock_irqrestore(&hl_drivers_lock, flags);
 
         if (hl->op->remove_host) {
 		down(&hpsb_hosts_lock);
@@ -307,8 +301,10 @@
         write_lock_irqsave(&addr_space_lock, flags);
         entry = addr_space.next;
 
-        while (list_entry(entry, struct hpsb_address_serve, as_list)->end <= start) {
-                if (list_entry(entry->next, struct hpsb_address_serve, as_list)->start >= end) {
+        while (list_entry(entry, struct hpsb_address_serve, as_list)->end
+               <= start) {
+                if (list_entry(entry->next, struct hpsb_address_serve, as_list)
+                    ->start >= end) {
                         list_add(&as->as_list, entry);
                         list_add_tail(&as->addr_list, &hl->addr_list);
                         retval = 1;
@@ -387,14 +383,13 @@
         struct list_head *entry;
         struct hpsb_highlevel *hl;
 
-	down(&hl_drivers_lock);
+        read_lock(&hl_drivers_lock);
         list_for_each(entry, &hl_drivers) {
                 hl = list_entry(entry, struct hpsb_highlevel, hl_list);
-
 		if (hl->op->add_host)
 			hl->op->add_host(host, hl);
         }
-        up(&hl_drivers_lock);
+        read_unlock(&hl_drivers_lock);
 }
 
 void highlevel_remove_host(struct hpsb_host *host)
@@ -402,7 +397,7 @@
         struct list_head *entry;
         struct hpsb_highlevel *hl;
 
-        down(&hl_drivers_lock);
+	read_lock(&hl_drivers_lock);
 	list_for_each(entry, &hl_drivers) {
                 hl = list_entry(entry, struct hpsb_highlevel, hl_list);
 
@@ -411,7 +406,7 @@
 			hpsb_destroy_hostinfo(hl, host);
 		}
         }
-        up(&hl_drivers_lock);
+	read_unlock(&hl_drivers_lock);
 }
 
 void highlevel_host_reset(struct hpsb_host *host)
@@ -419,14 +414,14 @@
         struct list_head *entry;
         struct hpsb_highlevel *hl;
 
-	down(&hl_drivers_lock);
+	read_lock(&hl_drivers_lock);
 	list_for_each(entry, &hl_drivers) {
                 hl = list_entry(entry, struct hpsb_highlevel, hl_list);
 
                 if (hl->op->host_reset)
                         hl->op->host_reset(host);
         }
-	up(&hl_drivers_lock);
+	read_unlock(&hl_drivers_lock);
 }
 
 void highlevel_iso_receive(struct hpsb_host *host, void *data,
@@ -436,14 +431,17 @@
         struct hpsb_highlevel *hl;
         int channel = (((quadlet_t *)data)[0] >> 8) & 0x3f;
 
-        down(&hl_drivers_lock);
-	list_for_each(entry, &hl_drivers) {
-                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
+        read_lock(&hl_drivers_lock);
+        entry = hl_drivers.next;
 
-                if (hl->op->iso_receive)
+        while (entry != &hl_drivers) {
+                hl = list_entry(entry, struct hpsb_highlevel, hl_list);
+                if (hl->op->iso_receive) {
                         hl->op->iso_receive(host, channel, data, length);
+                }
+                entry = entry->next;
         }
-        up(&hl_drivers_lock);
+        read_unlock(&hl_drivers_lock);
 }
 
 void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction,
@@ -453,13 +451,18 @@
         struct hpsb_highlevel *hl;
         int cts = ((quadlet_t *)data)[0] >> 4;
 
-        down(&hl_drivers_lock);
-	list_for_each(entry, &hl_drivers) {
+        read_lock(&hl_drivers_lock);
+        entry = hl_drivers.next;
+
+        while (entry != &hl_drivers) {
                 hl = list_entry(entry, struct hpsb_highlevel, hl_list);
-                if (hl->op->fcp_request)
-                        hl->op->fcp_request(host, nodeid, direction, cts, data, length);
+                if (hl->op->fcp_request) {
+                        hl->op->fcp_request(host, nodeid, direction, cts, data,
+                                            length);
+                }
+                entry = entry->next;
         }
-        up(&hl_drivers_lock);
+        read_unlock(&hl_drivers_lock);
 }
 
 int highlevel_read(struct hpsb_host *host, int nodeid, void *data,
diff -Nru a/drivers/ieee1394/highlevel.h b/drivers/ieee1394/highlevel.h
--- a/drivers/ieee1394/highlevel.h	Sat Apr 19 08:21:40 2003
+++ b/drivers/ieee1394/highlevel.h	Mon Apr 21 08:37:12 2003
@@ -14,6 +14,7 @@
 
 	/* Used by the highlevel drivers to store data per host */
 	struct list_head host_info_list;
+	rwlock_t host_info_lock;
 };
 
 
@@ -154,7 +155,7 @@
  * iso_receive op.
  */
 int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 
-			unsigned int channel);
+                         unsigned int channel);
 void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
                            unsigned int channel);
 
@@ -175,6 +176,5 @@
 /* Set the hostinfo pointer to something useful. Usually follows a call to
  * hpsb_create_hostinfo, where the size is 0. */
 int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, void *data);
-
 
 #endif /* IEEE1394_HIGHLEVEL_H */
diff -Nru a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
--- a/drivers/ieee1394/ieee1394_core.c	Sat Apr 19 10:11:13 2003
+++ b/drivers/ieee1394/ieee1394_core.c	Mon Apr 21 08:37:12 2003
@@ -1295,7 +1295,6 @@
 /** nodemgr.c **/
 EXPORT_SYMBOL(hpsb_guid_get_entry);
 EXPORT_SYMBOL(hpsb_nodeid_get_entry);
-EXPORT_SYMBOL(hpsb_check_nodeid);
 EXPORT_SYMBOL(hpsb_node_fill_packet);
 EXPORT_SYMBOL(hpsb_node_read);
 EXPORT_SYMBOL(hpsb_node_write);
diff -Nru a/drivers/ieee1394/ieee1394_types.h b/drivers/ieee1394/ieee1394_types.h
--- a/drivers/ieee1394/ieee1394_types.h	Wed Mar  5 08:03:24 2003
+++ b/drivers/ieee1394/ieee1394_types.h	Mon Apr 21 08:37:12 2003
@@ -79,13 +79,13 @@
 	struct semaphore count;
 };
 
-#define HPSB_TPOOL_INIT(_tp)            	\
-do {                                    	\
+#define HPSB_TPOOL_INIT(_tp)			\
+do {						\
 	CLEAR_BITMAP((_tp)->pool, 64);		\
-	spin_lock_init(&(_tp)->lock);   	\
-	(_tp)->next = 0;                	\
+	spin_lock_init(&(_tp)->lock);		\
+	(_tp)->next = 0;			\
 	(_tp)->allocations = 0;			\
-	sema_init(&(_tp)->count, 63);   	\
+	sema_init(&(_tp)->count, 63);		\
 } while(0)
 
 
diff -Nru a/drivers/ieee1394/iso.c b/drivers/ieee1394/iso.c
--- a/drivers/ieee1394/iso.c	Mon Mar 10 12:07:49 2003
+++ b/drivers/ieee1394/iso.c	Mon Apr 21 08:37:12 2003
@@ -47,8 +47,11 @@
 	int dma_direction;
 
 	/* make sure driver supports the ISO API */
-	if(!host->driver->isoctl)
+	if(!host->driver->isoctl) {
+		printk(KERN_INFO "ieee1394: host driver '%s' does not support the rawiso API\n",
+		       host->driver->name);
 		return NULL;
+	}
 
 	/* sanitize parameters */
 
diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
--- a/drivers/ieee1394/nodemgr.c	Sat Apr 19 10:11:14 2003
+++ b/drivers/ieee1394/nodemgr.c	Wed Apr 23 14:06:10 2003
@@ -19,7 +19,6 @@
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <asm/atomic.h>
-#include <asm/byteorder.h>
 
 #include "ieee1394_types.h"
 #include "ieee1394.h"
@@ -48,6 +47,7 @@
 	return NULL;
 }
 
+
 /* 
  * Basically what we do here is start off retrieving the bus_info block.
  * From there will fill in some info about the node, verify it is of IEEE
@@ -594,7 +594,6 @@
 	ret = -ENXIO;
 	for (; size > 0; size--, address += 4, quadp++) {
 		for (i = 0; i < 3; i++) {
-			
 			ret = hpsb_node_read(ne, address, quadp, 4);
 			if (ret != -EAGAIN)
 				break;
@@ -638,7 +637,6 @@
 		code = CONFIG_ROM_KEY(quad);
 
 		if (code == CONFIG_ROM_VENDOR_ID && length > 0) {
-
 			/* Check if there is a text descriptor leaf
 			   immediately after this.  */
 			size = nodemgr_size_text_leaf(host, nodeid, generation,
@@ -847,7 +845,7 @@
 			   store?  Only count immediate values and
 			   CSR offsets for now.  */
 			code &= CONFIG_ROM_KEY_TYPE_MASK;
-			if ((code & 0x80) == 0)
+			if ((code & CONFIG_ROM_KEY_TYPE_LEAF) == 0)
 				count++;
 			break;
 		}
@@ -894,20 +892,21 @@
 /* This implementation currently only scans the config rom and its
  * immediate unit directories looking for software_id and
  * software_version entries, in order to get driver autoloading working. */
-static void nodemgr_process_unit_directory(struct host_info *hi, struct node_entry *ne, 
-					   octlet_t address, unsigned int id)
+static struct unit_directory *nodemgr_process_unit_directory
+	(struct host_info *hi, struct node_entry *ne, octlet_t address, unsigned int *id)
 {
 	struct unit_directory *ud;
 	quadlet_t quad;
 	quadlet_t *infop;
 	int length;
+	struct unit_directory *ud_temp = NULL;
 
 	if (!(ud = nodemgr_scan_unit_directory(ne, address)))
 		goto unit_directory_error;
 
 	ud->ne = ne;
 	ud->address = address;
-	ud->id = id;
+	ud->id = (*id)++;
 
 	if (nodemgr_read_quadlet(ne->host, ne->nodeid, ne->generation,
 				 address, &quad))
@@ -983,12 +982,48 @@
 			/* TODO: read strings... icons? */
 			break;
 
+		case CONFIG_ROM_LOGICAL_UNIT_DIRECTORY:
+			/* TODO: Parent this with it's UD */
+			ud_temp = nodemgr_process_unit_directory(hi, ne, address + value * 4, id);
+
+			/* inherit unspecified values */
+			if (ud_temp != NULL)
+			{
+				if ((ud->flags & UNIT_DIRECTORY_VENDOR_ID) &&
+					!(ud_temp->flags & UNIT_DIRECTORY_VENDOR_ID))
+				{
+					ud_temp->flags |=  UNIT_DIRECTORY_VENDOR_ID;
+					ud_temp->vendor_id = ud->vendor_id;
+					ud_temp->vendor_oui = ud->vendor_oui;
+				}
+				if ((ud->flags & UNIT_DIRECTORY_MODEL_ID) &&
+					!(ud_temp->flags & UNIT_DIRECTORY_MODEL_ID))
+				{
+					ud_temp->flags |=  UNIT_DIRECTORY_MODEL_ID;
+					ud_temp->model_id = ud->model_id;
+				}
+				if ((ud->flags & UNIT_DIRECTORY_SPECIFIER_ID) &&
+					!(ud_temp->flags & UNIT_DIRECTORY_SPECIFIER_ID))
+				{
+					ud_temp->flags |=  UNIT_DIRECTORY_SPECIFIER_ID;
+					ud_temp->specifier_id = ud->specifier_id;
+				}
+				if ((ud->flags & UNIT_DIRECTORY_VERSION) &&
+					!(ud_temp->flags & UNIT_DIRECTORY_VERSION))
+				{
+					ud_temp->flags |=  UNIT_DIRECTORY_VERSION;
+					ud_temp->version = ud->version;
+				}
+			}
+
+			break;
+
 		default:
 			/* Which types of quadlets do we want to
 			   store?  Only count immediate values and
 			   CSR offsets for now.  */
 			code &= CONFIG_ROM_KEY_TYPE_MASK;
-			if ((code & 0x80) == 0)
+			if ((code & CONFIG_ROM_KEY_TYPE_LEAF) == 0)
 				*infop++ = quad;
 			break;
 		}
@@ -1006,11 +1041,12 @@
 		device_create_file(&ud->device, &dev_attr_ud_vendor_oui);
 	nodemgr_create_ud_dev_files(ud);
 
-	return;
+	return ud;
 
 unit_directory_error:	
 	if (ud != NULL)
 		kfree(ud);
+	return NULL;
 }
 
 
@@ -1071,7 +1107,7 @@
 			break;
 
 		case CONFIG_ROM_UNIT_DIRECTORY:
-			nodemgr_process_unit_directory(hi, ne, address + value * 4, ud_id++);
+			nodemgr_process_unit_directory(hi, ne, address + value * 4, &ud_id);
 			break;			
 
 		case CONFIG_ROM_DESCRIPTOR_LEAF:
@@ -1137,6 +1173,9 @@
 #endif /* CONFIG_HOTPLUG */
 
 
+static DECLARE_MUTEX(host_num_sema);
+/* Must hold above mutex until the result of the below call is assigned to
+ * a hostinfo entry. */
 static int nodemgr_alloc_host_num(void)
 {
 	int hostnum;
@@ -1156,6 +1195,18 @@
 	/*
 	 * Right now registration always succeeds, but maybe we should
 	 * detect clashes in protocols handled by other drivers.
+     * DRD> No because multiple drivers are needed to handle certain devices.
+     * For example, a DV camera is an IEC 61883 device (dv1394) and AV/C (raw1394).
+     * This will become less an issue with libiec61883 using raw1394.
+     *
+     * BenC: But can we handle this with an ALLOW_SHARED flag for a
+     * protocol? When we get an SBP-3 driver, it will be nice if they were
+     * mutually exclusive, since SBP-3 can handle SBP-2 protocol.
+     *
+     * Not to mention that we currently do not seem to support multiple
+     * drivers claiming the same unitdirectory. If we implement both of
+     * those, then we'll need to keep probing when a driver claims a
+     * unitdirectory, but is sharable.
 	 */
 
 	return 0;
@@ -1434,9 +1485,9 @@
 	/* If we had a bus reset while we were scanning the bus, it is
 	 * possible that we did not probe all nodes.  In that case, we
 	 * skip the clean up for now, since we could remove nodes that
-	 * were still on the bus.  The bus reset increased
-	 * hi->reset_sem, so there's a bus scan pending which will do
-	 * the clean up eventually. */
+	 * were still on the bus.  The bus reset increased hi->reset_sem,
+	 * so there's a bus scan pending which will do the clean up
+	 * eventually. */
 	if (generation == get_hpsb_generation(host)) {
 		struct cleanup_baton cleanup;
 
@@ -1470,7 +1521,7 @@
 
 /* Because we are a 1394a-2000 compliant IRM, we need to inform all the other
  * nodes of the broadcast channel.  (Really we're only setting the validity
- * bit).  Other IRM responsibilities go in here as well. */
+ * bit). Other IRM responsibilities go in here as well. */
 static void nodemgr_do_irm_duties(struct hpsb_host *host)
 {
 	quadlet_t bc;
@@ -1489,12 +1540,12 @@
 	/* If there is no bus manager then we should set the root node's
 	 * force_root bit to promote bus stability per the 1394
 	 * spec. (8.4.2.6) */
-	if(host->busmgr_id == 0x3f && host->node_count > 1)
-        {
+	if (host->busmgr_id == 0x3f && host->node_count > 1)
+	{
 		u16 root_node = host->node_count - 1;
 		struct node_entry *ne = hpsb_nodeid_get_entry(host, root_node);
-		
-		if(ne->busopt.cmc)
+
+		if (ne->busopt.cmc)
 			hpsb_send_phy_config(host, root_node, -1);
 		else {
 			HPSB_DEBUG("The root node is not cycle master capable; "
@@ -1508,7 +1559,7 @@
 /* We need to ensure that if we are not the IRM, that the IRM node is capable of
  * everything we can do, otherwise issue a bus reset and try to become the IRM
  * ourselves. */
-static int nodemgr_check_irm_capability(struct hpsb_host *host)
+static int nodemgr_check_irm_capability(struct hpsb_host *host, int cycles)
 {
 	quadlet_t bc;
 	int status;
@@ -1525,10 +1576,19 @@
 		/* The current irm node does not have a valid BROADCAST_CHANNEL
 		 * register and we do, so reset the bus with force_root set */
 		HPSB_DEBUG("Current remote IRM is not 1394a-2000 compliant, resetting...");
+
+		if (cycles >= 5) {
+			/* Oh screw it! Just leave the bus as it is */
+			HPSB_DEBUG("Stopping reset loop for IRM sanity");
+			return 1;
+		}
+
 		hpsb_send_phy_config(host, host->node_id, -1);
 		hpsb_reset_bus(host, LONG_RESET_FORCE_ROOT);
+
 		return 0;
 	}
+
 	return 1;
 }
 
@@ -1536,6 +1596,7 @@
 {
 	struct host_info *hi = (struct host_info *)__hi;
 	struct hpsb_host *host = hi->host;
+	int reset_cycles = 0;
 
 	/* No userlevel access needed */
 	daemonize(hi->daemon_name);
@@ -1571,12 +1632,14 @@
 				i = HZ/4;
 		}
 
-		if (!nodemgr_check_irm_capability(host)) {
+		if (!nodemgr_check_irm_capability(host, reset_cycles++)) {
 			/* Do nothing, we are resetting */
 			up(&nodemgr_serialize);
 			continue;
 		}
 
+		reset_cycles = 0;
+
 		nodemgr_node_probe(hi, generation);
 		nodemgr_do_irm_duties(host);
 
@@ -1588,7 +1651,7 @@
 
 caught_signal:
 #ifdef CONFIG_IEEE1394_VERBOSEDEBUG
-	HPSB_DEBUG ("NodeMgr: Exiting thread for %s", hi->host->driver->name);
+	HPSB_DEBUG ("NodeMgr: Exiting thread");
 #endif
 
 	complete_and_exit(&hi->exited, 0);
@@ -1616,18 +1679,6 @@
 	return ne;
 }
 
-struct node_entry *hpsb_check_nodeid(struct hpsb_host *host, nodeid_t nodeid)
-{
-	struct node_entry *ne;
-
-	if (down_trylock(&nodemgr_serialize))
-		return NULL;
-	ne = find_entry_by_nodeid(host, nodeid);
-	up(&nodemgr_serialize);
-
-	return ne;
-}
-
 /* The following four convenience functions use a struct node_entry
  * for addressing a node on the bus.  They are intended for use by any
  * process context, not just the nodemgr thread, so we need to be a
@@ -1684,25 +1735,28 @@
 static void nodemgr_add_host(struct hpsb_host *host, struct hpsb_highlevel *hl)
 {
 	struct host_info *hi;
+	int id;
 
+	down(&host_num_sema);
+	/* Must be called before we create the hostinfo entry, else it
+	 * will match entry '0' since all keys default to zero */
+	id = nodemgr_alloc_host_num();
 	hi = hpsb_create_hostinfo(hl, host, sizeof(*hi));
 
 	if (!hi) {
+		up(&host_num_sema);
 		HPSB_ERR ("NodeMgr: out of memory in add host");
 		return;
 	}
 
-	/* Initialize the hostinfo here and start the thread.  The
-	 * thread blocks on the reset semaphore until a bus reset
-	 * happens. */
+	hi->id = id;
+	hpsb_set_hostinfo_key(hl, host, hi->id);
+	up(&host_num_sema);
+
 	hi->host = host;
 	init_completion(&hi->exited);
         sema_init(&hi->reset_sem, 0);
 
-	hi->id = nodemgr_alloc_host_num();
-
-	hpsb_set_hostinfo_key(hl, host, hi->id);
-
 	memcpy(&host->device, &nodemgr_dev_template_host,
 	       sizeof(host->device));
 	host->device.parent = &host->pdev->dev;
@@ -1768,7 +1822,7 @@
 {
 	bus_register(&ieee1394_bus_type);
 
-        nodemgr_hl = hpsb_register_highlevel("Node manager", &nodemgr_ops);
+	nodemgr_hl = hpsb_register_highlevel("Node manager", &nodemgr_ops);
         if (!nodemgr_hl) {
 		HPSB_ERR("NodeMgr: out of memory during ieee1394 initialization");
         }
diff -Nru a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
--- a/drivers/ieee1394/nodemgr.h	Fri Mar 14 13:49:28 2003
+++ b/drivers/ieee1394/nodemgr.h	Wed Apr 23 14:06:10 2003
@@ -55,6 +55,7 @@
 #define CONFIG_ROM_MODEL_ID			0x17
 #define CONFIG_ROM_NODE_CAPABILITES		0x0C
 #define CONFIG_ROM_UNIT_DIRECTORY		0xd1
+#define CONFIG_ROM_LOGICAL_UNIT_DIRECTORY	0xd4
 #define CONFIG_ROM_SPECIFIER_ID			0x12 
 #define CONFIG_ROM_UNIT_SW_VERSION		0x13
 #define CONFIG_ROM_DESCRIPTOR_LEAF		0x81
@@ -137,8 +138,7 @@
 	const char *vendor_name;
 	const char *vendor_oui;
 
-	u32 capabilities;	
-
+	u32 capabilities;
 	struct hpsb_tlabel_pool *tpool;
 
 	struct device device;
@@ -162,10 +162,6 @@
 /* Same as above, but use the nodeid to get an node entry. This is not
  * fool-proof by itself, since the nodeid can change.  */
 struct node_entry *hpsb_nodeid_get_entry(struct hpsb_host *host, nodeid_t nodeid);
-
-/* Same as above except that it will not block waiting for the nodemgr
- * serialize semaphore.  */
-struct node_entry *hpsb_check_nodeid(struct hpsb_host *host, nodeid_t nodeid);
 
 /*
  * If the entry refers to a local host, this function will return the pointer
diff -Nru a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
--- a/drivers/ieee1394/ohci1394.c	Thu Apr 17 13:10:55 2003
+++ b/drivers/ieee1394/ohci1394.c	Thu Apr 24 03:35:03 2003
@@ -108,7 +108,6 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 #include <linux/vmalloc.h>
 #include <linux/init.h>
 
@@ -165,7 +164,7 @@
 printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
 
 static char version[] __devinitdata =
-	"$Rev: 866 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 902 $ Ben Collins <bcollins@debian.org>";
 
 /* Module Parameters */
 static int phys_dma = 1;
@@ -2214,7 +2213,7 @@
 
 }
 
-static void ohci_irq_handler(int irq, void *dev_id,
+static irqreturn_t ohci_irq_handler(int irq, void *dev_id,
                              struct pt_regs *regs_are_unused)
 {
 	quadlet_t event, node_id;
@@ -2231,7 +2230,8 @@
 	reg_write(ohci, OHCI1394_IntEventClear, event & ~OHCI1394_busReset);
 	spin_unlock_irqrestore(&ohci->event_lock, flags);
 
-	if (!event) return;
+	if (!event)
+		return IRQ_NONE;
 
 	DBGMSG(ohci->id, "IntEvent: %08x", event);
 
@@ -2462,7 +2462,7 @@
 		PRINT(KERN_ERR, ohci->id, "Unhandled interrupt(s) 0x%08x",
 		      event);
 
-	return;
+	return IRQ_HANDLED;
 }
 
 /* Put the buffer back into the dma context */
diff -Nru a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
--- a/drivers/ieee1394/pcilynx.c	Fri Apr 11 17:00:00 2003
+++ b/drivers/ieee1394/pcilynx.c	Wed Apr 23 14:06:11 2003
@@ -1163,7 +1163,7 @@
  ********************************************************/
 
 
-static void lynx_irq_handler(int irq, void *dev_id,
+static irqreturn_t lynx_irq_handler(int irq, void *dev_id,
                              struct pt_regs *regs_are_unused)
 {
         struct ti_lynx *lynx = (struct ti_lynx *)dev_id;
@@ -1174,7 +1174,8 @@
         linkint = reg_read(lynx, LINK_INT_STATUS);
         intmask = reg_read(lynx, PCI_INT_STATUS);
 
-        if (!(intmask & PCI_INT_INT_PEND)) return;
+        if (!(intmask & PCI_INT_INT_PEND))
+		return IRQ_NONE;
 
         PRINTD(KERN_DEBUG, lynx->id, "interrupt: 0x%08x / 0x%08x", intmask,
                linkint);
@@ -1390,6 +1391,8 @@
 
                 run_pcl(lynx, lynx->rcv_pcl_start, CHANNEL_ASYNC_RCV);
         }
+
+	return IRQ_HANDLED;
 }
 
 
@@ -1893,7 +1896,7 @@
         .name =     PCILYNX_DRIVER_NAME,
         .id_table = pci_table,
         .probe =    add_card,
-        .remove =   __devexit_p(remove_card),
+        .remove =   remove_card,
 };
 
 static struct hpsb_host_driver lynx_driver = {
diff -Nru a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
--- a/drivers/ieee1394/sbp2.c	Fri Apr 18 15:36:55 2003
+++ b/drivers/ieee1394/sbp2.c	Mon Apr 21 09:30:57 2003
@@ -298,7 +298,7 @@
 #include "sbp2.h"
 
 static char version[] __devinitdata =
-	"$Rev: 884 $ James Goodwin <jamesg@filanet.com>";
+	"$Rev: 896 $ James Goodwin <jamesg@filanet.com>";
 
 /*
  * Module load parameter definitions
@@ -3040,10 +3040,10 @@
 	SPRINTF("Driver version         : %s\n", version);
 
 	SPRINTF("\nModule options         :\n");
-	SPRINTF("  max_speed       : %s\n", hpsb_speedto_str[max_speed]);
-	SPRINTF("  max_sectors     : %d\n", max_sectors);
-	SPRINTF("  serialize_io    : %s\n", serialize_io ? "yes" : "no");
-	SPRINTF("  exclusive_login : %s\n", exclusive_login ? "yes" : "no");
+	SPRINTF("  max_speed            : %s\n", hpsb_speedto_str[max_speed]);
+	SPRINTF("  max_sectors          : %d\n", max_sectors);
+	SPRINTF("  serialize_io         : %s\n", serialize_io ? "yes" : "no");
+	SPRINTF("  exclusive_login      : %s\n", exclusive_login ? "yes" : "no");
 
 	SPRINTF("\nAttached devices       : %s\n", !list_empty(&host->my_devices) ?
 		"" : "none");
diff -Nru a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
--- a/drivers/ieee1394/video1394.c	Sat Apr 19 08:21:40 2003
+++ b/drivers/ieee1394/video1394.c	Thu Apr 24 03:35:05 2003
@@ -39,7 +39,6 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 #include <linux/vmalloc.h>
 #include <linux/timex.h>
 #include <linux/mm.h>
@@ -67,14 +66,6 @@
 #define vmalloc_32(x) vmalloc(x)
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3))
-#define remap_page_range_1394(vma, start, addr, size, prot) \
-	remap_page_range(start, addr, size, prot)
-#else
-#define remap_page_range_1394(vma, start, addr, size, prot) \
-	remap_page_range(vma, start, addr, size, prot)
-#endif
-
 struct it_dma_prg {
 	struct dma_cmd begin;
 	quadlet_t data[4];
@@ -496,11 +487,7 @@
 		if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) {
 			reset_ir_status(d, i);
 			d->buffer_status[i] = VIDEO1394_BUFFER_READY;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
-			get_fast_time(&d->buffer_time[i]);
-#else
 			do_gettimeofday(&d->buffer_time[i]);
-#endif
 		}
 	}
 
diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c	Sat Mar 22 09:03:17 2003
+++ b/drivers/input/evdev.c	Sun Apr 20 16:21:18 2003
@@ -19,15 +19,15 @@
 #include <linux/input.h>
 #include <linux/smp_lock.h>
 #include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
 
-struct evdev{
+struct evdev {
 	int exist;
 	int open;
 	int minor;
 	char name[16];
 	struct input_handle handle;
 	wait_queue_head_t wait;
-	devfs_handle_t devfs;
 	struct list_head list;
 };
 
@@ -76,6 +76,13 @@
 	return input_flush_device(&list->evdev->handle, file);
 }
 
+static void evdev_free(struct evdev *evdev)
+{
+	devfs_remove("input/event%d", evdev->minor);
+	evdev_table[evdev->minor] = NULL;
+	kfree(evdev);
+}
+
 static int evdev_release(struct inode * inode, struct file * file)
 {
 	struct evdev_list *list = file->private_data;
@@ -84,17 +91,13 @@
 	list_del(&list->node);
 
 	if (!--list->evdev->open) {
-		if (list->evdev->exist) {
+		if (list->evdev->exist)
 			input_close_device(&list->evdev->handle);
-		} else {
-			input_unregister_minor(list->evdev->devfs);
-			evdev_table[list->evdev->minor] = NULL;
-			kfree(list->evdev);
-		}
+		else
+			evdev_free(list->evdev);
 	}
 
 	kfree(list);
-
 	return 0;
 }
 
@@ -397,7 +400,7 @@
 	sprintf(evdev->name, "event%d", minor);
 
 	evdev_table[minor] = evdev;
-	evdev->devfs = input_register_minor("input/event%d", minor, EVDEV_MINOR_BASE);
+	input_register_minor("input/event%d", minor, EVDEV_MINOR_BASE);
 
 	return &evdev->handle;
 }
@@ -411,11 +414,8 @@
 	if (evdev->open) {
 		input_close_device(handle);
 		wake_up_interruptible(&evdev->wait);
-	} else {
-		input_unregister_minor(evdev->devfs);
-		evdev_table[evdev->minor] = NULL;
-		kfree(evdev);
-	}
+	} else
+		evdev_free(evdev);
 }
 
 static struct input_device_id evdev_ids[] = {
diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c	Mon Apr 14 04:16:02 2003
+++ b/drivers/input/input.c	Sun Apr 20 16:21:18 2003
@@ -22,6 +22,7 @@
 #include <linux/interrupt.h>
 #include <linux/poll.h>
 #include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("Input core");
@@ -32,7 +33,6 @@
 EXPORT_SYMBOL(input_register_handler);
 EXPORT_SYMBOL(input_unregister_handler);
 EXPORT_SYMBOL(input_register_minor);
-EXPORT_SYMBOL(input_unregister_minor);
 EXPORT_SYMBOL(input_open_device);
 EXPORT_SYMBOL(input_close_device);
 EXPORT_SYMBOL(input_accept_process);
@@ -47,7 +47,6 @@
 static LIST_HEAD(input_handler_list);
 
 static struct input_handler *input_table[8];
-static devfs_handle_t input_devfs_handle;
 
 #ifdef CONFIG_PROC_FS
 static struct proc_dir_entry *proc_bus_input_dir;
@@ -542,20 +541,13 @@
 	.open = input_open_file,
 };
 
-devfs_handle_t input_register_minor(char *name, int minor, int minor_base)
+void input_register_minor(char *name, int minor, int minor_base)
 {
 	char devfs_name[16];
-	sprintf(devfs_name, name, minor);
-
-	return devfs_register(NULL, devfs_name, 0,
-			INPUT_MAJOR, minor + minor_base,
-			S_IFCHR|S_IRUGO|S_IWUSR,
-			&input_fops, NULL);
-}
 
-void input_unregister_minor(devfs_handle_t handle)
-{
-	devfs_unregister(handle);
+	sprintf(devfs_name, name, minor);
+	devfs_register(NULL, devfs_name, 0, INPUT_MAJOR, minor_base + minor,
+			S_IFCHR|S_IRUGO|S_IWUSR, &input_fops, NULL);
 }
 
 #ifdef CONFIG_PROC_FS
@@ -699,8 +691,7 @@
 		return -EBUSY;
 	}
 
-	input_devfs_handle = devfs_mk_dir("input");
-
+	devfs_mk_dir("input");
 	return 0;
 }
 
@@ -711,7 +702,7 @@
 	remove_proc_entry("handlers", proc_bus_input_dir);
 	remove_proc_entry("input", proc_bus);
 #endif
-	devfs_unregister(input_devfs_handle);
+	devfs_remove("input");
         if (unregister_chrdev(INPUT_MAJOR, "input"))
                 printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
 	devclass_unregister(&input_devclass);
diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c	Wed Feb 12 02:02:06 2003
+++ b/drivers/input/joydev.c	Sun Apr 20 16:21:18 2003
@@ -26,6 +26,7 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Joystick device interfaces");
@@ -45,7 +46,6 @@
 	char name[16];
 	struct input_handle handle;
 	wait_queue_head_t wait;
-	devfs_handle_t devfs;
 	struct list_head list;
 	struct js_corr corr[ABS_MAX];
 	struct JS_DATA_SAVE_TYPE glue;
@@ -141,6 +141,13 @@
 	return retval < 0 ? retval : 0;
 }
 
+static void joydev_free(struct joydev *joydev)
+{
+	devfs_remove("js%d", joydev->minor);
+	joydev_table[joydev->minor] = NULL;
+	kfree(joydev);
+}
+
 static int joydev_release(struct inode * inode, struct file * file)
 {
 	struct joydev_list *list = file->private_data;
@@ -150,17 +157,13 @@
 	list_del(&list->node);
 
 	if (!--list->joydev->open) {
-		if (list->joydev->exist) {
+		if (list->joydev->exist)
 			input_close_device(&list->joydev->handle);
-		} else {
-			input_unregister_minor(list->joydev->devfs);
-			joydev_table[list->joydev->minor] = NULL;
-			kfree(list->joydev);
-		}
+		else
+			joydev_free(list->joydev);
 	}
 
 	kfree(list);
-
 	return 0;
 }
 
@@ -442,7 +445,7 @@
 	}
 
 	joydev_table[minor] = joydev;
-	joydev->devfs = input_register_minor("js%d", minor, JOYDEV_MINOR_BASE);
+	input_register_minor("js%d", minor, JOYDEV_MINOR_BASE);
 
 	return &joydev->handle;
 }
@@ -453,13 +456,10 @@
 
 	joydev->exist = 0;
 
-	if (joydev->open) {
+	if (joydev->open)
 		input_close_device(handle);	
-	} else {
-		input_unregister_minor(joydev->devfs);
-		joydev_table[joydev->minor] = NULL;
-		kfree(joydev);
-	}
+	else
+		joydev_free(joydev);
 }
 
 static struct input_device_id joydev_ids[] = {
diff -Nru a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c
--- a/drivers/input/joystick/iforce/iforce-serio.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/joystick/iforce/iforce-serio.c	Mon Apr 21 04:18:18 2003
@@ -78,40 +78,38 @@
 	iforce_serial_xmit((struct iforce *)serio->private);
 }
 
-static void iforce_serio_irq(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t iforce_serio_irq(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct iforce* iforce = serio->private;
 
 	if (!iforce->pkt) {
-		if (data != 0x2b) {
-			return;
-		}
-		iforce->pkt = 1;
-		return;
+		if (data == 0x2b)
+			iforce->pkt = 1;
+		goto out;
 	}
 
 	if (!iforce->id) {
-		if (data > 3 && data != 0xff) {
+		if (data > 3 && data != 0xff)
 			iforce->pkt = 0;
-			return;
-		}
-		iforce->id = data;
-		return;
+		else
+			iforce->id = data;
+		goto out;
 	}
 
 	if (!iforce->len) {
 		if (data > IFORCE_MAX_LENGTH) {
 			iforce->pkt = 0;
 			iforce->id = 0;
-			return;
+		} else {
+			iforce->len = data;
 		}
-		iforce->len = data;
-		return;
+		goto out;
 	}
 
 	if (iforce->idx < iforce->len) {
 		iforce->csum += iforce->data[iforce->idx++] = data;
-		return;
+		goto out;
 	}
 
 	if (iforce->idx == iforce->len) {
@@ -122,6 +120,8 @@
 		iforce->idx = 0;
 		iforce->csum = 0;
 	}
+out:
+	return IRQ_HANDLED;
 }
 
 static void iforce_serio_connect(struct serio *serio, struct serio_dev *dev)
diff -Nru a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c
--- a/drivers/input/joystick/magellan.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/joystick/magellan.c	Mon Apr 21 04:15:10 2003
@@ -113,7 +113,8 @@
 	input_sync(dev);
 }
 
-static void magellan_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t magellan_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct magellan* magellan = serio->private;
 
@@ -123,7 +124,8 @@
 	} else {
 		if (magellan->idx < MAGELLAN_MAX_LENGTH)
 			magellan->data[magellan->idx++] = data;
-	} 
+	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
--- a/drivers/input/joystick/spaceball.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/joystick/spaceball.c	Mon Apr 21 04:15:52 2003
@@ -149,7 +149,8 @@
  * can occur in the axis values.
  */
 
-static void spaceball_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t spaceball_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct spaceball *spaceball = serio->private;
 
@@ -158,11 +159,11 @@
 			spaceball_process_packet(spaceball, regs);
 			spaceball->idx = 0;
 			spaceball->escape = 0;
-			return;
+			break;
 		case '^':
 			if (!spaceball->escape) {
 				spaceball->escape = 1;
-				return;
+				break;
 			}
 			spaceball->escape = 0;
 		case 'M':
@@ -177,8 +178,9 @@
 				spaceball->escape = 0;
 			if (spaceball->idx < SPACEBALL_MAX_LENGTH)
 				spaceball->data[spaceball->idx++] = data;
-			return;
+			break;
 	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c
--- a/drivers/input/joystick/spaceorb.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/joystick/spaceorb.c	Mon Apr 21 04:16:10 2003
@@ -130,7 +130,8 @@
 	input_sync(dev);
 }
 
-static void spaceorb_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t spaceorb_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct spaceorb* spaceorb = serio->private;
 
@@ -140,6 +141,7 @@
 	}
 	if (spaceorb->idx < SPACEORB_MAX_LENGTH)
 		spaceorb->data[spaceorb->idx++] = data & 0x7f;
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c
--- a/drivers/input/joystick/stinger.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/joystick/stinger.c	Mon Apr 21 04:14:00 2003
@@ -98,7 +98,8 @@
  * packet processing routine.
  */
 
-static void stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t stinger_interrupt(struct serio *serio,
+	unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct stinger* stinger = serio->private;
 
@@ -112,7 +113,7 @@
 		stinger->idx = 0;
 	}
 
-	return;
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
--- a/drivers/input/joystick/warrior.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/joystick/warrior.c	Mon Apr 21 04:13:41 2003
@@ -99,7 +99,8 @@
  * packet processing routine.
  */
 
-static void warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t warrior_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct warrior* warrior = serio->private;
 
@@ -117,6 +118,7 @@
 		warrior->idx = 0;
 		warrior->len = 0;
 	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/keyboard/atkbd.c	Mon Apr 21 04:17:32 2003
@@ -132,7 +132,8 @@
  * the keyboard into events.
  */
 
-static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
+			unsigned int flags, struct pt_regs *regs)
 {
 	struct atkbd *atkbd = serio->private;
 	int code = data;
@@ -145,7 +146,7 @@
 		printk("atkbd.c: frame/parity error: %02x\n", flags);
 		serio_write(serio, ATKBD_CMD_RESEND);
 		atkbd->resend = 1;
-		return;
+		goto out;
 	}
 	
 	if (!flags)
@@ -154,34 +155,35 @@
 	switch (code) {
 		case ATKBD_RET_ACK:
 			atkbd->ack = 1;
-			return;
+			goto out;
 		case ATKBD_RET_NAK:
 			atkbd->ack = -1;
-			return;
+			goto out;
 	}
 
 	if (atkbd->cmdcnt) {
 		atkbd->cmdbuf[--atkbd->cmdcnt] = code;
-		return;
+		goto out;
 	}
 
 	switch (atkbd->keycode[code]) {
 		case ATKBD_KEY_BAT:
 			serio_rescan(atkbd->serio);
-			return;
+			goto out;
 		case ATKBD_KEY_EMUL0:
 			atkbd->emul = 1;
-			return;
+			goto out;
 		case ATKBD_KEY_EMUL1:
 			atkbd->emul = 2;
-			return;
+			goto out;
 		case ATKBD_KEY_RELEASE:
 			atkbd->release = 1;
-			return;
+			goto out;
 	}
 
 	if (atkbd->emul) {
-		if (--atkbd->emul) return;
+		if (--atkbd->emul)
+			goto out;
 		code |= 0x100;
 	}
 
@@ -197,8 +199,10 @@
 			input_report_key(&atkbd->dev, atkbd->keycode[code], !atkbd->release);
 			input_sync(&atkbd->dev);
 	}
-		
+
 	atkbd->release = 0;
+out:
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c
--- a/drivers/input/keyboard/newtonkbd.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/keyboard/newtonkbd.c	Mon Apr 21 04:13:24 2003
@@ -62,7 +62,8 @@
 	char phys[32];
 };
 
-void nkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+irqreturn_t nkbd_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct nkbd *nkbd = serio->private;
 
@@ -75,6 +76,7 @@
 
 	else if (data == 0xe7) /* end of init sequence */
 		printk(KERN_INFO "input: %s on %s\n", nkbd_name, serio->phys);
+	return IRQ_HANDLED;
 
 }
 
diff -Nru a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
--- a/drivers/input/keyboard/sunkbd.c	Wed Feb 12 02:08:58 2003
+++ b/drivers/input/keyboard/sunkbd.c	Mon Apr 21 04:14:52 2003
@@ -89,18 +89,19 @@
  * is received.
  */
 
-static void sunkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t sunkbd_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct sunkbd* sunkbd = serio->private;
 
 	if (sunkbd->reset <= -1) {		/* If cp[i] is 0xff, sunkbd->reset will stay -1. */
 		sunkbd->reset = data;		/* The keyboard sends 0xff 0xff 0xID on powerup */
-		return;
+		goto out;
 	}
 
 	if (sunkbd->layout == -1) {
 		sunkbd->layout = data;
-		return;
+		goto out;
 	}
 
 	switch (data) {
@@ -108,14 +109,14 @@
 		case SUNKBD_RET_RESET:
 			schedule_work(&sunkbd->tq);
 			sunkbd->reset = -1;
-			return;
+			break;
 
 		case SUNKBD_RET_LAYOUT:
 			sunkbd->layout = -1;
-			return;
+			break;
 
 		case SUNKBD_RET_ALLUP: /* All keys released */
-			return;
+			break;
 
 		default:
 			if (sunkbd->keycode[data & SUNKBD_KEY]) {
@@ -127,6 +128,8 @@
                                         data & SUNKBD_KEY, data & SUNKBD_RELEASE ? "released" : "pressed");
                         }
 	}
+out:
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c
--- a/drivers/input/keyboard/xtkbd.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/keyboard/xtkbd.c	Mon Apr 21 04:13:02 2003
@@ -63,14 +63,15 @@
 	char phys[32];
 };
 
-void xtkbd_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+irqreturn_t xtkbd_interrupt(struct serio *serio,
+	unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct xtkbd *xtkbd = serio->private;
 
 	switch (data) {
 		case XTKBD_EMUL0:
 		case XTKBD_EMUL1:
-			return;
+			break;
 		default:
 
 			if (xtkbd->keycode[data & XTKBD_KEY]) {
@@ -81,7 +82,8 @@
 				printk(KERN_WARNING "xtkbd.c: Unknown key (scancode %#x) %s.\n",
 					data & XTKBD_KEY, data & XTKBD_RELEASE ? "released" : "pressed");
 			}
-		}
+	}
+	return IRQ_HANDLED;
 }
 
 void xtkbd_connect(struct serio *serio, struct serio_dev *dev)
diff -Nru a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
--- a/drivers/input/mouse/inport.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/mouse/inport.c	Mon Apr 21 04:04:38 2003
@@ -85,7 +85,7 @@
 static int inport_irq = INPORT_IRQ;
 static int inport_used = 0;
 
-static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static int inport_open(struct input_dev *dev)
 {
@@ -124,7 +124,7 @@
 	},
 };
 
-static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned char buttons;
 
@@ -150,6 +150,7 @@
 	outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT);
 
 	input_sync(&inport_dev);
+	return IRQ_HANDLED;
 }
 
 #ifndef MODULE
diff -Nru a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c
--- a/drivers/input/mouse/logibm.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/mouse/logibm.c	Mon Apr 21 04:05:02 2003
@@ -75,7 +75,7 @@
 static int logibm_irq = LOGIBM_IRQ;
 static int logibm_used = 0;
 
-static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static int logibm_open(struct input_dev *dev)
 {
@@ -114,7 +114,7 @@
 	},
 };
 
-static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	char dx, dy;
 	unsigned char buttons;
@@ -139,6 +139,7 @@
 	input_sync(&logibm_dev);
 
 	outb(LOGIBM_ENABLE_IRQ, LOGIBM_CONTROL_PORT);
+	return IRQ_HANDLED;
 }
 
 #ifndef MODULE
diff -Nru a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
--- a/drivers/input/mouse/pc110pad.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/mouse/pc110pad.c	Thu Apr 24 05:18:50 2003
@@ -60,7 +60,7 @@
 static char *pc110pad_name = "IBM PC110 TouchPad";
 static char *pc110pad_phys = "isa15e0/input0";
 
-static void pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs)
 {
 	int value     = inb_p(pc110pad_io);
 	int handshake = inb_p(pc110pad_io + 2);
@@ -71,7 +71,8 @@
 
 	pc110pad_data[pc110pad_count++] = value;
 
-	if (pc110pad_count < 3) return;
+	if (pc110pad_count < 3)
+		return IRQ_HANDLED;
 	
 	input_regs(&pc110pad_dev, regs);
 	input_report_key(&pc110pad_dev, BTN_TOUCH,
@@ -83,6 +84,7 @@
 	input_sync(&pc110pad_dev);
 
 	pc110pad_count = 0;
+	return IRQ_HANDLED;
 }
 
 static void pc110pad_close(struct input_dev *dev)
diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Thu Apr 17 12:52:40 2003
+++ b/drivers/input/mouse/psmouse.c	Mon Apr 21 04:12:09 2003
@@ -167,7 +167,8 @@
  * packets or passing them to the command routine as command output.
  */
 
-static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t psmouse_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct psmouse *psmouse = serio->private;
 
@@ -186,12 +187,12 @@
 				break;
 		}
 		psmouse->acking = 0;
-		return;
+		goto out;
 	}
 
 	if (psmouse->cmdcnt) {
 		psmouse->cmdbuf[--psmouse->cmdcnt] = data;
-		return;
+		goto out;
 	}
 
 	if (psmouse->pktcnt && time_after(jiffies, psmouse->last + HZ/2)) {
@@ -205,13 +206,15 @@
 	if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
 		psmouse_process_packet(psmouse, regs);
 		psmouse->pktcnt = 0;
-		return;
+		goto out;
 	}
 
 	if (psmouse->pktcnt == 1 && psmouse->packet[0] == PSMOUSE_RET_BAT) {
 		serio_rescan(serio);
-		return;
-	}	
+		goto out;
+	}
+out:
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
--- a/drivers/input/mouse/sermouse.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/mouse/sermouse.c	Mon Apr 21 04:12:31 2003
@@ -204,7 +204,8 @@
  * packets or passing them to the command routine as command output.
  */
 
-static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t sermouse_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct sermouse *sermouse = serio->private;
 
@@ -215,6 +216,7 @@
 		sermouse_process_ms(sermouse, data, regs);
 	else
 		sermouse_process_msc(sermouse, data, regs);
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
--- a/drivers/input/mousedev.c	Sat Mar 22 09:03:17 2003
+++ b/drivers/input/mousedev.c	Sun Apr 20 16:21:18 2003
@@ -22,6 +22,7 @@
 #include <linux/random.h>
 #include <linux/major.h>
 #include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
 #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
 #include <linux/miscdevice.h>
 #endif
@@ -46,7 +47,6 @@
 	wait_queue_head_t wait;
 	struct list_head list;
 	struct input_handle handle;
-	devfs_handle_t devfs;
 };
 
 struct mousedev_list {
@@ -171,45 +171,52 @@
 	return retval < 0 ? retval : 0;
 }
 
+static void mousedev_free(struct mousedev *mousedev)
+{
+	devfs_remove("input/mouse%d", mousedev->minor);
+	mousedev_table[mousedev->minor] = NULL;
+	kfree(mousedev);
+}
+
+static int mixdev_release(void)
+{
+	struct input_handle *handle;
+
+	list_for_each_entry(handle, &mousedev_handler.h_list, h_node) {
+		struct mousedev *mousedev = handle->private;
+
+		if (!mousedev->open) {
+			if (mousedev->exist)
+				input_close_device(&mousedev->handle);
+			else
+				mousedev_free(mousedev);
+		}
+	}
+
+	return 0;
+}
+
 static int mousedev_release(struct inode * inode, struct file * file)
 {
 	struct mousedev_list *list = file->private_data;
-	struct input_handle *handle;
-	struct mousedev *mousedev;
 
 	mousedev_fasync(-1, file, 0);
 
 	list_del(&list->node);
 
 	if (!--list->mousedev->open) {
-		if (list->mousedev->minor == MOUSEDEV_MIX) {
-			list_for_each_entry(handle, &mousedev_handler.h_list, h_node) {
-				mousedev = handle->private;
-				if (!mousedev->open) {
-					if (mousedev->exist) {
-						input_close_device(&mousedev->handle);
-					} else {
-						input_unregister_minor(mousedev->devfs);
-						mousedev_table[mousedev->minor] = NULL;
-						kfree(mousedev);
-					}
-				}
-			}
-		} else {
-			if (!mousedev_mix.open) {
-				if (list->mousedev->exist) {
-					input_close_device(&list->mousedev->handle);
-				} else {
-					input_unregister_minor(list->mousedev->devfs);
-					mousedev_table[list->mousedev->minor] = NULL;
-					kfree(list->mousedev);
-				}
-			}
+		if (list->mousedev->minor == MOUSEDEV_MIX)
+			return mixdev_release();
+
+		if (!mousedev_mix.open) {
+			if (list->mousedev->exist)
+				input_close_device(&list->mousedev->handle);
+			else
+				mousedev_free(list->mousedev);
 		}
 	}
 	
 	kfree(list);
-
 	return 0;
 }
 
@@ -425,7 +432,7 @@
 		input_open_device(&mousedev->handle);
 
 	mousedev_table[minor] = mousedev;
-	mousedev->devfs = input_register_minor("input/mouse%d", minor, MOUSEDEV_MINOR_BASE);
+	input_register_minor("input/mouse%d", minor, MOUSEDEV_MINOR_BASE);
 
 	return &mousedev->handle;
 }
@@ -441,9 +448,7 @@
 	} else {
 		if (mousedev_mix.open)
 			input_close_device(handle);
-		input_unregister_minor(mousedev->devfs);
-		mousedev_table[mousedev->minor] = NULL;
-		kfree(mousedev);
+		mousedev_free(mousedev);
 	}
 }
 
@@ -507,7 +512,7 @@
 	mousedev_table[MOUSEDEV_MIX] = &mousedev_mix;
 	mousedev_mix.exist = 1;
 	mousedev_mix.minor = MOUSEDEV_MIX;
-	mousedev_mix.devfs = input_register_minor("input/mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE);
+	input_register_minor("input/mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE);
 
 #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
 	if (!(mousedev_mix.misc = !misc_register(&psaux_mouse)))
@@ -525,7 +530,7 @@
 	if (mousedev_mix.misc)
 		misc_deregister(&psaux_mouse);
 #endif
-	input_unregister_minor(mousedev_mix.devfs);
+	devfs_remove("input/mice");
 	input_unregister_handler(&mousedev_handler);
 	interface_unregister(&mousedev_intf);
 }
diff -Nru a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
--- a/drivers/input/serio/ct82c710.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/serio/ct82c710.c	Mon Apr 21 04:04:07 2003
@@ -64,7 +64,7 @@
 static int ct82c710_data;
 static int ct82c710_status;
 
-static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs);
+static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs);
 
 /*
  * Wait for device to send output char and flush any input char.
@@ -154,9 +154,9 @@
  * is waiting in the 82C710.
  */
 
-static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
+static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
 {
-	serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs);
+	return serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs);
 }
 
 /*
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	Thu Apr 17 12:33:06 2003
+++ b/drivers/input/serio/i8042.c	Sun Apr 20 14:14:28 2003
@@ -74,7 +74,7 @@
 	 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110
 };
 
-static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /*
  * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to
@@ -332,7 +332,7 @@
  * to the upper layers.
  */
 
-static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	unsigned char str, data;
@@ -415,6 +415,8 @@
 		serio_interrupt(&i8042_kbd_port, data, dfl, regs);
 	}
 
+	/* FIXME - was it really ours? */
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
--- a/drivers/input/serio/parkbd.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/serio/parkbd.c	Thu Apr 24 05:17:40 2003
@@ -43,14 +43,14 @@
 #define PARKBD_CLOCK	0x01	/* Strobe & Ack */
 #define PARKBD_DATA	0x02	/* AutoFd & Busy */
 
-static int parkbd = 0;
+static int parkbd;
 static int parkbd_mode = SERIO_8042;
 
-static int parkbd_buffer = 0;
-static int parkbd_counter = 0;
-static int parkbd_last = 0;
-static int parkbd_writing = 0;
-static unsigned long parkbd_start = 0;
+static int parkbd_buffer;
+static int parkbd_counter;
+static unsigned long parkbd_last;
+static int parkbd_writing;
+static unsigned long parkbd_start;
 
 static struct pardevice *parkbd_dev;
 
diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/serio/serio.c	Mon Apr 21 04:04:03 2003
@@ -135,13 +135,20 @@
 	wake_up(&serio_wait);
 }
 
-void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
-{       
-        if (serio->dev && serio->dev->interrupt) 
-                serio->dev->interrupt(serio, data, flags, regs);
-	else 
-		if (!flags)
+irqreturn_t serio_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
+{
+	irqreturn_t ret = IRQ_NONE;
+
+        if (serio->dev && serio->dev->interrupt) {
+                ret = serio->dev->interrupt(serio, data, flags, regs);
+	} else {
+		if (!flags) {
 			serio_rescan(serio);
+			ret = IRQ_HANDLED;
+		}
+	}
+	return ret;
 }
 
 void serio_register_port(struct serio *serio)
diff -Nru a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
--- a/drivers/input/serio/serport.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/serio/serport.c	Mon Apr 21 20:58:40 2003
@@ -44,7 +44,7 @@
 static int serport_serio_write(struct serio *serio, unsigned char data)
 {
 	struct serport *serport = serio->driver;
-	return -(serport->tty->driver.write(serport->tty, 0, &data, 1) != 1);
+	return -(serport->tty->driver->write(serport->tty, 0, &data, 1) != 1);
 }
 
 static int serport_serio_open(struct serio *serio)
diff -Nru a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c
--- a/drivers/input/touchscreen/gunze.c	Wed Feb 12 01:41:01 2003
+++ b/drivers/input/touchscreen/gunze.c	Mon Apr 21 04:11:22 2003
@@ -78,7 +78,8 @@
 	input_sync(dev);
 }
 
-static void gunze_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
+static irqreturn_t gunze_interrupt(struct serio *serio,
+		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct gunze* gunze = serio->private;
 
@@ -88,7 +89,8 @@
 	} else {
 		if (gunze->idx < GUNZE_MAX_LENGTH)
 			gunze->data[gunze->idx++] = data;
-	} 
+	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/input/tsdev.c b/drivers/input/tsdev.c
--- a/drivers/input/tsdev.c	Sat Mar 22 09:03:17 2003
+++ b/drivers/input/tsdev.c	Sun Apr 20 16:21:18 2003
@@ -41,6 +41,7 @@
 #include <linux/random.h>
 #include <linux/time.h>
 #include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
 
 #ifndef CONFIG_INPUT_TSDEV_SCREEN_X
 #define CONFIG_INPUT_TSDEV_SCREEN_X	240
@@ -57,7 +58,6 @@
 	wait_queue_head_t wait;
 	struct list_head list;
 	struct input_handle handle;
-	devfs_handle_t devfs;
 };
 
 /* From Compaq's Touch Screen Specification version 0.2 (draft) */
@@ -115,6 +115,13 @@
 	return 0;
 }
 
+static void tsdev_free(struct tsdev *tsdev)
+{
+	devfs_remove("input/ts%d", tsdev->minor);
+	tsdev_table[tsdev->minor] = NULL;
+	kfree(tsdev);
+}
+
 static int tsdev_release(struct inode *inode, struct file *file)
 {
 	struct tsdev_list *list = file->private_data;
@@ -123,13 +130,10 @@
 	list_del(&list->node);
 
 	if (!--list->tsdev->open) {
-		if (list->tsdev->exist) {
+		if (list->tsdev->exist)
 			input_close_device(&list->tsdev->handle);
-		} else {
-			input_unregister_minor(list->tsdev->devfs);
-			tsdev_table[list->tsdev->minor] = NULL;
-			kfree(list->tsdev);
-		}
+		else
+			tsdev_free(list->tsdev);
 	}
 	kfree(list);
 	return 0;
@@ -325,8 +329,7 @@
 	tsdev->handle.private = tsdev;
 
 	tsdev_table[minor] = tsdev;
-	tsdev->devfs =
-	    input_register_minor("input/ts%d", minor, TSDEV_MINOR_BASE);
+	input_register_minor("input/ts%d", minor, TSDEV_MINOR_BASE);
 
 
 	return &tsdev->handle;
@@ -341,11 +344,8 @@
 	if (tsdev->open) {
 		input_close_device(handle);
 		wake_up_interruptible(&tsdev->wait);
-	} else {
-		input_unregister_minor(tsdev->devfs);
-		tsdev_table[tsdev->minor] = NULL;
-		kfree(tsdev);
-	}
+	} else
+		tsdev_free(tsdev);
 }
 
 static struct input_device_id tsdev_ids[] = {
diff -Nru a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c
--- a/drivers/isdn/act2000/act2000_isa.c	Mon Sep  2 12:15:36 2002
+++ b/drivers/isdn/act2000/act2000_isa.c	Mon Apr 21 03:58:37 2003
@@ -69,7 +69,7 @@
         return ret;
 }
 
-static void
+static irqreturn_t
 act2000_isa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         act2000_card *card = irq2card_map[irq];
@@ -78,7 +78,7 @@
         if (!card) {
                 printk(KERN_WARNING
                        "act2000: Spurious interrupt!\n");
-                return;
+                return IRQ_NONE;
         }
         istatus = (inb(ISA_PORT_ISR) & 0x07);
         if (istatus & ISA_ISR_OUT) {
@@ -95,6 +95,7 @@
         }
 	if (istatus)
 		printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
--- a/drivers/isdn/capi/capi.c	Mon Dec 30 08:54:00 2002
+++ b/drivers/isdn/capi/capi.c	Thu Apr 24 03:30:41 2003
@@ -278,7 +278,6 @@
 	struct capincci *np, **pp;
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
 	struct capiminor *mp = 0;
-	kdev_t kdev;
 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
 
 	np = kmalloc(sizeof(*np), GFP_ATOMIC);
@@ -297,8 +296,7 @@
 		printk(KERN_DEBUG "set mp->nccip\n");
 #endif
 #if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
-		kdev = mk_kdev(capi_ttymajor, mp->minor);
-		capifs_new_ncci(0, mp->minor, kdev);
+		capifs_new_ncci(0, mp->minor, MKDEV(capi_ttymajor, mp->minor));
 #endif
 	}
 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
@@ -1283,7 +1281,7 @@
 	memset(drv, 0, sizeof(struct tty_driver));
 	drv->magic = TTY_DRIVER_MAGIC;
 	drv->driver_name = "capi_nc";
-	drv->name = "capi/%d";
+	drv->name = "capi/";
 	drv->major = capi_ttymajor;
 	drv->minor_start = 0;
 	drv->num = CAPINC_NR_PORTS;
diff -Nru a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
--- a/drivers/isdn/capi/capidrv.c	Sun Nov 17 15:08:01 2002
+++ b/drivers/isdn/capi/capidrv.c	Thu Apr 24 05:17:37 2003
@@ -1985,7 +1985,7 @@
 static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 {
 	capidrv_contr *card;
-	long flags;
+	unsigned long flags;
 	isdn_ctrl cmd;
 	char id[20];
 	int i;
diff -Nru a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c
--- a/drivers/isdn/capi/capifs.c	Mon Oct  7 10:27:57 2002
+++ b/drivers/isdn/capi/capifs.c	Thu Apr 24 03:30:41 2003
@@ -9,24 +9,12 @@
  *
  */
 
-#include <linux/version.h>
 #include <linux/fs.h>
-#include <linux/tty.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/stat.h>
-#include <linux/param.h>
+#include <linux/mount.h>
+#include <linux/namei.h>
 #include <linux/module.h>
-#include <linux/string.h>
 #include <linux/init.h>
-#include <linux/kdev_t.h>
-#include <linux/kernel.h>
-#include <linux/major.h>
-#include <linux/slab.h>
 #include <linux/ctype.h>
-#include <linux/smp_lock.h>
-#include <asm/bitops.h>
-#include <asm/uaccess.h>
 
 MODULE_DESCRIPTION("CAPI4Linux: /dev/capi/ filesystem");
 MODULE_AUTHOR("Carsten Paeth");
@@ -34,209 +22,33 @@
 
 static char *revision = "$Revision: 1.14.6.8 $";
 
-struct capifs_ncci {
-	struct inode *inode;
-	char used;
-	char type;
-	unsigned int num;
-	kdev_t kdev;
-};
-
-struct capifs_sb_info {
-	u32 magic;
-	struct super_block *next;
-	struct super_block **back;
+struct options {
 	int setuid;
 	int setgid;
 	uid_t   uid;
 	gid_t   gid;
 	umode_t mode;
-
-	unsigned int max_ncci;
-	struct capifs_ncci *nccis;
 };
+static struct options options = {.mode = 0600};
 
 #define CAPIFS_SUPER_MAGIC (('C'<<8)|'N')
-#define CAPIFS_SBI_MAGIC   (('C'<<24)|('A'<<16)|('P'<<8)|'I')
-
-static inline struct capifs_sb_info *SBI(struct super_block *sb)
-{
-	return (struct capifs_sb_info *)(sb->s_fs_info);
-}
 
 /* ------------------------------------------------------------------ */
 
-static int capifs_root_readdir(struct file *,void *,filldir_t);
-static struct dentry *capifs_root_lookup(struct inode *,struct dentry *);
-static int capifs_revalidate(struct dentry *, int);
-static struct inode *capifs_new_inode(struct super_block *sb);
-
-static struct file_operations capifs_root_operations = {
-	.read		= generic_read_dir,
-	.readdir	= capifs_root_readdir,
-};
-
-struct inode_operations capifs_root_inode_operations = {
-	.lookup = capifs_root_lookup,
-};
-
-static struct dentry_operations capifs_dentry_operations = {
-	.d_revalidate = capifs_revalidate,
-};
-
-/*
- * /dev/capi/%d
- * /dev/capi/r%d
- */
-
-static int capifs_root_readdir(struct file *filp, void *dirent, filldir_t filldir)
-{
-	struct inode * inode = filp->f_dentry->d_inode;
-	struct capifs_sb_info * sbi = SBI(filp->f_dentry->d_inode->i_sb);
-	off_t nr;
-	char numbuf[32];
-
-	lock_kernel();
-
-	nr = filp->f_pos;
-
-	switch(nr)
-	{
-	case 0:
-		if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0)
-			goto out;
-		filp->f_pos = ++nr;
-		/* fall through */
-	case 1:
-		if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0)
-			goto out;
-		filp->f_pos = ++nr;
-		/* fall through */
-	default:
-		while (nr < sbi->max_ncci) {
-			int n = nr - 2;
-			struct capifs_ncci *np = &sbi->nccis[n];
-			if (np->inode && np->used) {
-				char *p = numbuf;
-				if (np->type) *p++ = np->type;
-				sprintf(p, "%u", np->num);
-				if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr, DT_UNKNOWN) < 0 )
-					goto out;
-			}
-			filp->f_pos = ++nr;
-		}
-		break;
-	}
-
-out:
-	unlock_kernel();
-	return 0;
-}
-
-/*
- * Revalidate is called on every cache lookup.  We use it to check that
- * the ncci really does still exist.  Never revalidate negative dentries;
- * for simplicity (fix later?)
- */
-static int capifs_revalidate(struct dentry * dentry, int flags)
-{
-	struct capifs_sb_info *sbi;
-
-	if ( !dentry->d_inode )
-		return 0;
-
-	sbi = SBI(dentry->d_inode->i_sb);
-
-	return ( sbi->nccis[dentry->d_inode->i_ino - 2].inode == dentry->d_inode );
-}
-
-static struct dentry *capifs_root_lookup(struct inode * dir, struct dentry * dentry)
-{
-	struct capifs_sb_info *sbi = SBI(dir->i_sb);
-	struct capifs_ncci *np;
-	unsigned int i;
-	char numbuf[32];
-	char *p, *tmp;
-	unsigned int num;
-	char type = 0;
-
-	dentry->d_inode = NULL;	/* Assume failure */
-	dentry->d_op    = &capifs_dentry_operations;
-
-	if (dentry->d_name.len >= sizeof(numbuf) )
-		return NULL;
-	strncpy(numbuf, dentry->d_name.name, dentry->d_name.len);
-	numbuf[dentry->d_name.len] = 0;
-        p = numbuf;
-	if (!isdigit(*p)) type = *p++;
-	tmp = p;
-	num = (unsigned int)simple_strtoul(p, &tmp, 10);
-	if (tmp == p || *tmp)
-		return NULL;
-
-	lock_kernel();
-	for (i = 0, np = sbi->nccis ; i < sbi->max_ncci; i++, np++) {
-		if (np->used && np->num == num && np->type == type)
-			break;
-	}
-	unlock_kernel();
-
-	if ( i >= sbi->max_ncci )
-		return NULL;
-
-	dentry->d_inode = np->inode;
-	if ( dentry->d_inode )
-		atomic_inc(&dentry->d_inode->i_count);
-	
-	d_add(dentry, dentry->d_inode);
-
-	return NULL;
-}
-
-/* ------------------------------------------------------------------ */
-
-static struct super_block *mounts = NULL;
-
-static void capifs_put_super(struct super_block *sb)
-{
-	struct capifs_sb_info *sbi = SBI(sb);
-	struct inode *inode;
-	int i;
-
-	for ( i = 0 ; i < sbi->max_ncci ; i++ ) {
-		if ( (inode = sbi->nccis[i].inode) ) {
-			if (atomic_read(&inode->i_count) != 1 )
-				printk("capifs_put_super: badness: entry %d count %d\n",
-				       i, (unsigned)atomic_read(&inode->i_count));
-			inode->i_nlink--;
-			iput(inode);
-		}
-	}
-
-	*sbi->back = sbi->next;
-	if ( sbi->next )
-		SBI(sbi->next)->back = sbi->back;
-
-	kfree(sbi->nccis);
-	kfree(sbi);
-}
-
-static struct super_operations capifs_sops = {
-	.put_super	= capifs_put_super,
-	.statfs		= simple_statfs,
-};
 
-static int capifs_parse_options(char *options, struct capifs_sb_info *sbi)
+static int capifs_parse_options(char *s, struct options *p)
 {
 	int setuid = 0;
 	int setgid = 0;
 	uid_t uid = 0;
 	gid_t gid = 0;
 	umode_t mode = 0600;
-	unsigned int maxncci = 512;
 	char *this_char, *value;
 
-	while ((this_char = strsep(&options,",")) != NULL) {
+	if (!s)
+		return 0;
+
+	while ((this_char = strsep(&s, ",")) != NULL) {
 		if (!*this_char)
 			continue;
 		if ((value = strchr(this_char,'=')) != NULL)
@@ -264,110 +76,74 @@
 			if (*value)
 				return 1;
 		}
-		else if (!strcmp(this_char,"maxncci")) {
-			if (!value || !*value)
-				return 1;
-			maxncci = simple_strtoul(value,&value,8);
-			if (*value)
-				return 1;
-		}
-		else
-			return 1;
 	}
-	sbi->setuid   = setuid;
-	sbi->setgid   = setgid;
-	sbi->uid      = uid;
-	sbi->gid      = gid;
-	sbi->mode     = mode & ~S_IFMT;
-	sbi->max_ncci = maxncci;
+	p->setuid   = setuid;
+	p->setgid   = setgid;
+	p->uid      = uid;
+	p->gid      = gid;
+	p->mode     = mode & ~S_IFMT;
 
 	return 0;
 }
 
-static int capifs_fill_super(struct super_block *s, void *data, int silent)
+static int capifs_remount(struct super_block *s, int *flags, char *data)
 {
-	struct inode * root_inode;
-	struct dentry * root;
-	struct capifs_sb_info *sbi;
-
-	sbi = (struct capifs_sb_info *) kmalloc(sizeof(struct capifs_sb_info), GFP_KERNEL);
-	if ( !sbi )
-		goto fail;
-
-	memset(sbi, 0, sizeof(struct capifs_sb_info));
-	sbi->magic  = CAPIFS_SBI_MAGIC;
-
-	if ( capifs_parse_options(data,sbi) ) {
-		kfree(sbi);
+	struct options new;
+	if (capifs_parse_options(data, &new)) {
 		printk("capifs: called with bogus options\n");
-		goto fail;
+		return -EINVAL;
 	}
+	options = new;
+	return 0;
+}
+
 
-	sbi->nccis = kmalloc(sizeof(struct capifs_ncci) * sbi->max_ncci, GFP_KERNEL);
-	if ( !sbi->nccis ) {
-		kfree(sbi);
-		goto fail;
+static struct super_operations capifs_sops =
+{
+	.statfs		= simple_statfs,
+	.remount_fs	= capifs_remount,
+};
+
+static int capifs_fill_super(struct super_block *s, void *data, int silent)
+{
+	struct inode * inode;
+
+	if (capifs_parse_options(data, &options)) {
+		printk("capifs: called with bogus options\n");
+		return -EINVAL;
 	}
-	memset(sbi->nccis, 0, sizeof(struct capifs_ncci) * sbi->max_ncci);
 
-	s->s_fs_info = (void *) sbi;
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
 	s->s_magic = CAPIFS_SUPER_MAGIC;
 	s->s_op = &capifs_sops;
 
-	/*
-	 * Get the root inode and dentry, but defer checking for errors.
-	 */
-	root_inode = capifs_new_inode(s);
-	if (root_inode) {
-		root_inode->i_ino = 1;
-		root_inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
-		root_inode->i_op = &capifs_root_inode_operations;
-		root_inode->i_fop = &capifs_root_operations;
-		root_inode->i_nlink = 2;
-	} 
-	root = d_alloc_root(root_inode);
+	inode = new_inode(s);
+	if (!inode)
+		return -ENOMEM;
+	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
+	inode->i_blocks = 0;
+	inode->i_blksize = 1024;
+	inode->i_uid = inode->i_gid = 0;
+	inode->i_ino = 1;
+	inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
+	inode->i_op = &simple_dir_inode_operations;
+	inode->i_fop = &simple_dir_operations;
+	inode->i_nlink = 2;
+	s->s_root = d_alloc_root(inode);
 
-	if (!root) {
+	if (!s->s_root) {
 		printk("capifs: get root dentry failed\n");
-		/*
-	 	* iput() can block, so we clear the super block first.
-	 	*/
-		iput(root_inode);
-		kfree(sbi->nccis);
-		kfree(sbi);
-		goto fail;
+		iput(inode);
+		return -ENOMEM;
 	}
-
-	s->s_root = root;
-
-	sbi->next = mounts;
-	if ( sbi->next )
-		SBI(sbi->next)->back = &(sbi->next);
-	sbi->back = &mounts;
-	mounts = s;
 	return 0;
-fail:
-	return -EINVAL;
-}
-
-static struct inode *capifs_new_inode(struct super_block *sb)
-{
-	struct inode *inode = new_inode(sb);
-	if (inode) {
-		inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
-		inode->i_blocks = 0;
-		inode->i_blksize = 1024;
-		inode->i_uid = inode->i_gid = 0;
-	}
-	return inode;
 }
 
 static struct super_block *capifs_get_sb(struct file_system_type *fs_type,
 	int flags, char *dev_name, void *data)
 {
-	return get_sb_nodev(fs_type, flags, data, capifs_fill_super);
+	return get_sb_single(fs_type, flags, data, capifs_fill_super);
 }
 
 static struct file_system_type capifs_fs_type = {
@@ -377,62 +153,99 @@
 	.kill_sb	= kill_anon_super,
 };
 
-void capifs_new_ncci(char type, unsigned int num, kdev_t device)
+static spinlock_t entries_lock = SPIN_LOCK_UNLOCKED;
+static struct vfsmount *capifs_mnt;
+static int entry_count = 0;
+
+static struct vfsmount *grab_instance(void)
+{
+	struct vfsmount *mnt = NULL;
+	spin_lock(&entries_lock);
+	if (!capifs_mnt) {
+		spin_unlock(&entries_lock);
+		mnt = kern_mount(&capifs_fs_type);
+		if (IS_ERR(mnt))
+			return NULL;
+		spin_lock(&entries_lock);
+		if (!capifs_mnt)
+			capifs_mnt = mnt;
+	}
+	mntget(capifs_mnt);
+	entry_count++;
+	spin_unlock(&entries_lock);
+	mntput(mnt);
+	return capifs_mnt;
+}
+
+static void drop_instance(void)
+{
+	struct vfsmount *mnt;
+	spin_lock(&entries_lock);
+	mnt = capifs_mnt;
+	if (!--entry_count)
+		capifs_mnt = NULL;
+	spin_unlock(&entries_lock);
+	mntput(mnt);
+}
+
+static struct dentry *get_node(int type, int num)
+{
+	char s[10];
+	int len;
+	struct dentry *root = capifs_mnt->mnt_root;
+	if (type)
+		len = sprintf(s, "%d", num);
+	else
+		len = sprintf(s, "%c%d", type, num);
+	down(&root->d_inode->i_sem);
+	return lookup_one_len(s, root, len);
+}
+
+void capifs_new_ncci(char type, unsigned int num, dev_t device)
 {
 	struct super_block *sb;
-	struct capifs_sb_info *sbi;
-	struct capifs_ncci *np;
-	ino_t ino;
-
-	for ( sb = mounts ; sb ; sb = sbi->next ) {
-		sbi = SBI(sb);
-
-		for (ino = 0, np = sbi->nccis ; ino < sbi->max_ncci; ino++, np++) {
-			if (np->used == 0) {
-				np->used = 1;
-				np->type = type;
-				np->num = num;
-				np->kdev = device;
-				break;
-			}
-		}
-		if ( ino >= sbi->max_ncci )
-			continue;
+	struct dentry *dentry;
+	struct inode *inode;
 
-		if ((np->inode = capifs_new_inode(sb)) != NULL) {
-			struct inode *inode = np->inode;
-			inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid;
-			inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
-			inode->i_nlink = 1;
-			inode->i_ino = ino + 2;
-			init_special_inode(inode, sbi->mode|S_IFCHR, kdev_t_to_nr(np->kdev));
-		}
+	if (!grab_instance())
+		return;
+	sb = capifs_mnt->mnt_sb;
+	inode = new_inode(sb);
+	if (inode) {
+		inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
+		inode->i_blocks = 0;
+		inode->i_blksize = 1024;
+		inode->i_uid = options.setuid ? options.uid : current->fsuid;
+		inode->i_gid = options.setgid ? options.gid : current->fsgid;
+		inode->i_nlink = 1;
+		init_special_inode(inode, S_IFCHR | options.mode, device);
+		dentry = get_node(type, num);
+		if (!IS_ERR(dentry) && !dentry->d_inode) {
+			grab_instance();
+			d_instantiate(dentry, inode);
+		} else
+			iput(inode);
+		up(&sb->s_root->d_inode->i_sem);
 	}
+	drop_instance();
 }
 
 void capifs_free_ncci(char type, unsigned int num)
 {
-	struct super_block *sb;
-	struct capifs_sb_info *sbi;
-	struct inode *inode;
-	struct capifs_ncci *np;
-	ino_t ino;
-
-	for ( sb = mounts ; sb ; sb = sbi->next ) {
-		sbi = SBI(sb);
-
-		for (ino = 0, np = sbi->nccis ; ino < sbi->max_ncci; ino++, np++) {
-			if (!np->used || np->type != type || np->num != num)
-				continue;
-			if (np->inode) {
-				inode = np->inode;
-				np->inode = 0;
-				np->used = 0;
+	if (grab_instance()) {
+		struct dentry *dentry = get_node(type, num);
+		if (!IS_ERR(dentry)) {
+			struct inode *inode = dentry->d_inode;
+			if (inode) {
 				inode->i_nlink--;
-				iput(inode);
-				break;
+				d_delete(dentry);
+				dput(dentry);
+				drop_instance();
 			}
+			dput(dentry);
 		}
+		up(&capifs_mnt->mnt_root->d_inode->i_sem);
+		drop_instance();
 	}
 }
 
@@ -442,8 +255,6 @@
 	char *p;
 	int err;
 
-	MOD_INC_USE_COUNT;
-
 	if ((p = strchr(revision, ':')) != 0 && p[1]) {
 		strncpy(rev, p + 2, sizeof(rev));
 		rev[sizeof(rev)-1] = 0;
@@ -453,12 +264,8 @@
 		strcpy(rev, "1.0");
 
 	err = register_filesystem(&capifs_fs_type);
-	if (err) {
-		MOD_DEC_USE_COUNT;
-		return err;
-	}
-        printk(KERN_NOTICE "capifs: Rev %s\n", rev);
-	MOD_DEC_USE_COUNT;
+	if (!err)
+		printk(KERN_NOTICE "capifs: Rev %s\n", rev);
 	return 0;
 }
 
diff -Nru a/drivers/isdn/capi/capifs.h b/drivers/isdn/capi/capifs.h
--- a/drivers/isdn/capi/capifs.h	Sun Apr 21 20:22:43 2002
+++ b/drivers/isdn/capi/capifs.h	Thu Apr 24 03:30:41 2003
@@ -7,5 +7,5 @@
  *
  */
 
-void capifs_new_ncci(char type, unsigned int num, kdev_t device);
+void capifs_new_ncci(char type, unsigned int num, dev_t device);
 void capifs_free_ncci(char type, unsigned int num);
diff -Nru a/drivers/isdn/eicon/eicon.h b/drivers/isdn/eicon/eicon.h
--- a/drivers/isdn/eicon/eicon.h	Fri Feb  7 00:20:34 2003
+++ b/drivers/isdn/eicon/eicon.h	Mon Apr 21 03:58:37 2003
@@ -14,6 +14,8 @@
 #ifndef eicon_h
 #define eicon_h
 
+#include <linux/interrupt.h>
+
 #define EICON_IOCTL_SETMMIO   0
 #define EICON_IOCTL_GETMMIO   1
 #define EICON_IOCTL_SETIRQ    2
@@ -364,7 +366,7 @@
 
 extern int eicon_addcard(int, int, int, char *, int);
 extern void eicon_io_transmit(eicon_card *card);
-extern void eicon_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t eicon_irq(int irq, void *dev_id, struct pt_regs *regs);
 extern void eicon_io_rcv_dispatch(eicon_card *ccard);
 extern void eicon_io_ack_dispatch(eicon_card *ccard);
 #ifdef CONFIG_MCA
diff -Nru a/drivers/isdn/eicon/eicon_idi.c b/drivers/isdn/eicon/eicon_idi.c
--- a/drivers/isdn/eicon/eicon_idi.c	Tue Feb 25 02:43:59 2003
+++ b/drivers/isdn/eicon/eicon_idi.c	Mon Apr 21 03:58:37 2003
@@ -3097,7 +3097,7 @@
 {
 	int l = 0;
 	int ret = 0;
-	int timeout;
+	unsigned long timeout;
 	int i;
         struct sk_buff *skb;
         struct sk_buff *skb2;
diff -Nru a/drivers/isdn/eicon/eicon_io.c b/drivers/isdn/eicon/eicon_io.c
--- a/drivers/isdn/eicon/eicon_io.c	Sun Oct  6 18:00:18 2002
+++ b/drivers/isdn/eicon/eicon_io.c	Mon Apr 21 03:58:37 2003
@@ -501,7 +501,7 @@
 /*
  * IRQ handler 
  */
-void
+irqreturn_t
 eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
 	eicon_card *ccard = (eicon_card *)dev_id;
         eicon_isa_card *isa_card;
@@ -521,7 +521,7 @@
 
         if (!ccard) {
                 eicon_log(ccard, 1, "eicon_irq: spurious interrupt %d\n", irq);
-                return;
+                return IRQ_NONE;
         }
 
 	if (ccard->type == EICON_CTYPE_QUADRO) {
@@ -554,7 +554,7 @@
 			break;
 		default:
                 	eicon_log(ccard, 1, "eicon_irq: unsupported card-type!\n");
-			return;
+			return IRQ_NONE;
 	}
 
 	if (*irqprobe) {
@@ -577,7 +577,7 @@
 				(*irqprobe)++;
 				break;
 		}
-		return;
+		return IRQ_HANDLED;
 	}
 
 	switch(ccard->type) {
@@ -588,7 +588,7 @@
 		case EICON_CTYPE_S2M:
 			if (!(readb(isa_card->intack))) { /* card did not interrupt */
 				eicon_log(ccard, 1, "eicon: IRQ: card reports no interrupt!\n");
-				return;
+				return IRQ_NONE;
 			} 
 			break;
 	}
@@ -744,6 +744,6 @@
 			break;
 	}
 
-  return;
+  return IRQ_HANDLED;
 }
 #endif
diff -Nru a/drivers/isdn/eicon/linio.c b/drivers/isdn/eicon/linio.c
--- a/drivers/isdn/eicon/linio.c	Sat Nov 23 11:44:40 2002
+++ b/drivers/isdn/eicon/linio.c	Mon Apr 21 03:58:37 2003
@@ -36,7 +36,7 @@
 
 void UxPause(long int ms)
 {
-	int timeout = jiffies + ((ms * HZ) / 1000);
+	unsigned long timeout = jiffies + ((ms * HZ) / 1000);
 
 	while (time_before(jiffies, timeout));
 }
@@ -577,7 +577,7 @@
     return;
 }
 
-void 	Divasintr(int arg, void *unused, struct pt_regs *unused_regs)
+irqreturn_t Divasintr(int arg, void *unused, struct pt_regs *unused_regs)
 {
 	int i;
 	card_t *card = NULL;
@@ -602,7 +602,7 @@
 		}
 	}
 
-	return;
+	return IRQ_HANDLED;
 }
 
 
@@ -680,7 +680,7 @@
 	return flags;
 }
 
-void UxCardUnlock(ux_diva_card_t *card, long ipl)
+void UxCardUnlock(ux_diva_card_t *card, unsigned long ipl)
 {
 	spin_unlock_irqrestore(&diva_lock, ipl);
 }
diff -Nru a/drivers/isdn/eicon/uxio.h b/drivers/isdn/eicon/uxio.h
--- a/drivers/isdn/eicon/uxio.h	Sat Nov 23 11:44:40 2002
+++ b/drivers/isdn/eicon/uxio.h	Mon Apr 21 03:58:37 2003
@@ -59,7 +59,7 @@
  */
 
 long		UxCardLock(ux_diva_card_t *card);
-void	UxCardUnlock(ux_diva_card_t *card, long ipl);
+void	UxCardUnlock(ux_diva_card_t *card, unsigned long ipl);
 
 /*
  * Set the mapping address for PCI cards
diff -Nru a/drivers/isdn/hardware/avm/avmcard.h b/drivers/isdn/hardware/avm/avmcard.h
--- a/drivers/isdn/hardware/avm/avmcard.h	Sat May 25 22:34:17 2002
+++ b/drivers/isdn/hardware/avm/avmcard.h	Mon Apr 21 03:58:37 2003
@@ -12,6 +12,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/list.h>
+#include <linux/interrupt.h>
 
 #define	AVMB1_PORTLEN		0x1f
 #define AVM_MAXVERSION		8
@@ -555,7 +556,7 @@
 void b1_release_appl(struct capi_ctr *ctrl, u16 appl);
 u16  b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
 void b1_parse_version(avmctrl_info *card);
-void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
+irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
 
 int b1ctl_read_proc(char *page, char **start, off_t off,
         		int count, int *eof, struct capi_ctr *ctrl);
@@ -568,7 +569,7 @@
 int b1pciv4_detect(avmcard *card);
 int t1pci_detect(avmcard *card);
 void b1dma_reset(avmcard *card);
-void b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
+irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
 
 int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
 void b1dma_reset_ctr(struct capi_ctr *ctrl);
diff -Nru a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
--- a/drivers/isdn/hardware/avm/b1.c	Sun May 26 09:49:48 2002
+++ b/drivers/isdn/hardware/avm/b1.c	Mon Apr 21 03:58:37 2003
@@ -491,7 +491,7 @@
 
 /* ------------------------------------------------------------- */
 
-void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
+irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
 {
 	avmcard *card = devptr;
 	avmctrl_info *cinfo = &card->ctrlinfo[0];
@@ -506,7 +506,7 @@
 	unsigned WindowSize;
 
 	if (!b1_rx_full(card->port))
-	   return;
+	   return IRQ_NONE;
 
 	b1cmd = b1_get_byte(card->port);
 
@@ -619,12 +619,13 @@
 
 	case 0xff:
 		printk(KERN_ERR "%s: card removed ?\n", card->name);
-		return;
+		return IRQ_NONE;
 	default:
 		printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
 				card->name, b1cmd);
-		return;
+		return IRQ_HANDLED;
 	}
+	return IRQ_HANDLED;
 }
 
 /* ------------------------------------------------------------- */
diff -Nru a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c
--- a/drivers/isdn/hardware/avm/b1dma.c	Sun May 26 09:49:48 2002
+++ b/drivers/isdn/hardware/avm/b1dma.c	Mon Apr 21 03:58:37 2003
@@ -618,11 +618,12 @@
 	spin_unlock(&card->lock);
 }
 
-void b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
+irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
 {
 	avmcard *card = devptr;
 
 	b1dma_handle_interrupt(card);
+	return IRQ_HANDLED;
 }
 
 /* ------------------------------------------------------------- */
diff -Nru a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
--- a/drivers/isdn/hardware/avm/c4.c	Thu Aug 15 15:01:13 2002
+++ b/drivers/isdn/hardware/avm/c4.c	Mon Apr 21 03:58:37 2003
@@ -659,7 +659,7 @@
 
 /* ------------------------------------------------------------- */
 
-static void c4_handle_interrupt(avmcard *card)
+static irqreturn_t c4_handle_interrupt(avmcard *card)
 {
 	u32 status = c4inmeml(card->mbase+DOORBELL);
 
@@ -667,7 +667,7 @@
 		int i;
 		c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c);
 		if (card->nlogcontr == 0)
-			return;
+			return IRQ_HANDLED;
 		printk(KERN_ERR "%s: unexpected reset\n", card->name);
                 for (i=0; i < card->nr_controllers; i++) {
 			avmctrl_info *cinfo = &card->ctrlinfo[i];
@@ -676,12 +676,12 @@
 			capi_ctr_reseted(&cinfo->capi_ctrl);
 		}
 		card->nlogcontr = 0;
-		return;
+		return IRQ_HANDLED;
 	}
 
 	status &= (DBELL_UP_HOST | DBELL_DOWN_HOST);
 	if (!status)
-		return;
+		return IRQ_HANDLED;
 	c4outmeml(card->mbase+DOORBELL, status);
 
 	if ((status & DBELL_UP_HOST) != 0) {
@@ -702,13 +702,14 @@
 			c4_dispatch_tx(card);
 		}
 	}
+	return IRQ_HANDLED;
 }
 
-static void c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
+static irqreturn_t c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
 {
 	avmcard *card = devptr;
 
-	c4_handle_interrupt(card);
+	return c4_handle_interrupt(card);
 }
 
 /* ------------------------------------------------------------- */
diff -Nru a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c
--- a/drivers/isdn/hardware/avm/t1isa.c	Sun May 26 09:49:48 2002
+++ b/drivers/isdn/hardware/avm/t1isa.c	Mon Apr 21 03:58:37 2003
@@ -124,7 +124,7 @@
         return 0;
 }
 
-static void t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
+static irqreturn_t t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
 {
 	avmcard *card = devptr;
 	avmctrl_info *cinfo = &card->ctrlinfo[0];
@@ -252,13 +252,14 @@
 
 		case 0xff:
 			printk(KERN_ERR "%s: card reseted ?\n", card->name);
-			return;
+			return IRQ_HANDLED;
 		default:
 			printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
 					card->name, b1cmd);
-			return;
+			return IRQ_NONE;
 		}
 	}
+	return IRQ_HANDLED;
 }
 
 /* ------------------------------------------------------------- */
diff -Nru a/drivers/isdn/hardware/eicon/diva.c b/drivers/isdn/hardware/eicon/diva.c
--- a/drivers/isdn/hardware/eicon/diva.c	Mon Jan 27 12:05:53 2003
+++ b/drivers/isdn/hardware/eicon/diva.c	Thu Apr 24 05:17:30 2003
@@ -509,22 +509,23 @@
 }
 
 
-void diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs)
+irqreturn_t diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs)
 {
 	diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) context;
 	diva_xdi_clear_interrupts_proc_t clear_int_proc;
 
 	if (!a || !a->xdi_adapter.diva_isr_handler) {
-		return;
+		return IRQ_NONE;
 	}
 
 	if ((clear_int_proc = a->clear_interrupts_proc)) {
 		(*clear_int_proc) (a);
 		a->clear_interrupts_proc = 0;
-		return;
+		return IRQ_HANDLED;
 	}
 
 	(*(a->xdi_adapter.diva_isr_handler)) (&a->xdi_adapter);
+	return IRQ_HANDLED;
 }
 
 static void diva_init_request_array(void)
diff -Nru a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
--- a/drivers/isdn/hardware/eicon/divasmain.c	Wed Feb 19 12:18:20 2003
+++ b/drivers/isdn/hardware/eicon/divasmain.c	Thu Apr 24 05:17:30 2003
@@ -61,7 +61,7 @@
 static char *DRIVERLNAME = "divas";
 char *DRIVERRELEASE = "2.0";
 
-extern void diva_os_irq_wrapper(int irq, void *context,
+extern irqreturn_t diva_os_irq_wrapper(int irq, void *context,
 				struct pt_regs *regs);
 extern int create_divas_proc(void);
 extern void remove_divas_proc(void);
diff -Nru a/drivers/isdn/hisax/avm_a1.c b/drivers/isdn/hisax/avm_a1.c
--- a/drivers/isdn/hisax/avm_a1.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/avm_a1.c	Mon Apr 21 03:58:37 2003
@@ -113,14 +113,16 @@
 	.write_fifo = hscx_write_fifo,
 };
 
-static void
+static irqreturn_t
 avm_a1_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
 	u8 val, sval;
+	int handled = 0;
 
 	spin_lock(&cs->lock);
 	while (((sval = bytein(cs->hw.avm.cfg_reg)) & 0xf) != 0x7) {
+		handled = 1;
 		if (!(sval & AVM_A1_STAT_TIMER)) {
 			byteout(cs->hw.avm.cfg_reg, 0x1E);
 			sval = bytein(cs->hw.avm.cfg_reg);
@@ -144,6 +146,7 @@
 	hscx_write(cs, 0, HSCX_MASK, 0x0);
 	hscx_write(cs, 1, HSCX_MASK, 0x0);
 	spin_unlock(&cs->lock);
+	return IRQ_RETVAL(handled);
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/avm_a1p.c b/drivers/isdn/hisax/avm_a1p.c
--- a/drivers/isdn/hisax/avm_a1p.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/avm_a1p.c	Mon Apr 21 03:58:37 2003
@@ -159,7 +159,7 @@
 	.write_fifo = hscx_write_fifo,
 };
 
-static void
+static irqreturn_t
 avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -187,6 +187,7 @@
 	hscx_write(cs, 0, HSCX_MASK, 0x0);
 	hscx_write(cs, 1, HSCX_MASK, 0x0);
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c
--- a/drivers/isdn/hisax/bkm_a4t.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/bkm_a4t.c	Mon Apr 21 03:58:37 2003
@@ -137,18 +137,20 @@
 	.write_fifo = jade_write_fifo,
 };
 
-static void
+static irqreturn_t
 bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
 	u8 val = 0;
 	I20_REGISTER_FILE *pI20_Regs;
+	int handled = 0;
 
 	spin_lock(&cs->lock);
 	pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
 
 	/* ISDN interrupt pending? */
 	if (pI20_Regs->i20IntStatus & intISDN) {
+		handled = 1;
 		/* Reset the ISDN interrupt     */
 		pI20_Regs->i20IntStatus = intISDN;
 		/* Disable ISDN interrupt */
@@ -172,6 +174,7 @@
 		pI20_Regs->i20IntCtrl |= intISDN;
 	}
 	spin_unlock(&cs->lock);
+	return IRQ_RETVAL(handled);
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
--- a/drivers/isdn/hisax/diva.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/diva.c	Mon Apr 21 03:58:37 2003
@@ -319,7 +319,7 @@
 	.read_fifo  = ipacx_bc_read_fifo,
 };
 
-static void
+static irqreturn_t
 diva_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -331,9 +331,10 @@
 	}
 	if (!cnt)
 		printk(KERN_WARNING "Diva: IRQ LOOP\n");
+	return IRQ_HANDLED;
 }
 
-static void
+static irqreturn_t
 diva_ipac_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -341,22 +342,24 @@
 
 	val = readb(cs->hw.diva.pci_cfg);
 	if (!(val & PITA_INT0_STATUS))
-		return; /* other shared IRQ */
+		return IRQ_NONE; /* other shared IRQ */
 	writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg); /* Reset pending INT0 */
 
-	ipac_irq(intno, dev_id, regs);
+	return ipac_irq(intno, dev_id, regs);
 }
 
-static void
+static irqreturn_t
 diva_ipacx_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
 	u8 val;
 
 	val = readb(cs->hw.diva.pci_cfg);
-	if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ
+	if (!(val &PITA_INT0_STATUS))
+		return IRQ_NONE; // other shared IRQ
 	interrupt_ipacx(cs);      // handler for chip
 	writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg);  // Reset PLX interrupt
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
--- a/drivers/isdn/hisax/elsa.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/elsa.c	Mon Apr 21 03:58:37 2003
@@ -307,7 +307,7 @@
 	return (v & ELSA_TIMER_RUN);
 }
 
-static void
+static irqreturn_t
 elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -317,7 +317,7 @@
 	/* The card tends to generate interrupts while being removed
 	   causing us to just crash the kernel. bad. */
 		printk(KERN_WARNING "Elsa: card not available!\n");
-		return;
+		return IRQ_NONE;
 	}
 #if ARCOFI_USE
 	if (cs->hw.elsa.MFlag) {
@@ -351,9 +351,10 @@
 #endif
 	if (cs->hw.elsa.trig)
 		byteout(cs->hw.elsa.trig, 0x00);
+	return IRQ_HANDLED;
 }
 
-static void
+static irqreturn_t
 elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -361,13 +362,13 @@
 
 	if (!cs) {
 		printk(KERN_WARNING "Elsa: Spurious interrupt!\n");
-		return;
+		return IRQ_NONE;
 	}
 	if (cs->subtyp == ELSA_QS1000PCI || cs->subtyp == ELSA_QS3000PCI) {
 		val = bytein(cs->hw.elsa.cfg + 0x4c); /* PCI IRQ */
 		if (!test_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags) && 
 		    !(val & ELSA_PCI_IRQ_MASK))
-			return;
+			return IRQ_NONE;
 	}
 #if ARCOFI_USE
 	if (cs->hw.elsa.MFlag) {
@@ -380,7 +381,7 @@
 		}
 	}
 #endif
-	ipac_irq(intno, dev_id, regs);
+	return ipac_irq(intno, dev_id, regs);
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c
--- a/drivers/isdn/hisax/enternow_pci.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/enternow_pci.c	Mon Apr 21 03:58:37 2003
@@ -208,7 +208,7 @@
 	return 0;
 }
 
-static void
+static irqreturn_t
 enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -253,6 +253,7 @@
 			write_tiger(cs);
 	}
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static struct card_ops enpci_ops = {
diff -Nru a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
--- a/drivers/isdn/hisax/hfc_pci.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/hfc_pci.c	Mon Apr 21 03:58:37 2003
@@ -869,7 +869,7 @@
 /*********************/
 /* Interrupt handler */
 /*********************/
-static void
+static irqreturn_t
 hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -880,17 +880,17 @@
 
 	if (!cs) {
 		printk(KERN_WARNING "HFC-PCI: Spurious interrupt!\n");
-		return;
+		return IRQ_NONE;
 	}
 	if (!(cs->hw.hfcpci.int_m2 & 0x08))
-		return;		/* not initialised */
+		return IRQ_NONE;		/* not initialised */
 
 	if (HFCPCI_ANYINT & (stat = Read_hfc(cs, HFCPCI_STATUS))) {
 		val = Read_hfc(cs, HFCPCI_INT_S1);
 		if (cs->debug & L1_DEB_ISAC)
 			debugl1(cs, "HFC-PCI: stat(%02x) s1(%02x)", stat, val);
 	} else
-		return;
+		return IRQ_NONE;
 
 	if (cs->debug & L1_DEB_ISAC)
 		debugl1(cs, "HFC-PCI irq %x", val);
@@ -964,6 +964,7 @@
 		} else
 			val = 0;
 	}
+	return IRQ_HANDLED;
 }
 
 /********************************************************************/
diff -Nru a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
--- a/drivers/isdn/hisax/hfc_sx.c	Sat Apr 19 13:06:54 2003
+++ b/drivers/isdn/hisax/hfc_sx.c	Mon Apr 21 03:58:37 2003
@@ -661,7 +661,7 @@
 /*********************/
 /* Interrupt handler */
 /*********************/
-static void
+static irqreturn_t
 hfcsx_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -672,17 +672,17 @@
 
 	if (!cs) {
 		printk(KERN_WARNING "HFC-SX: Spurious interrupt!\n");
-		return;
+		return IRQ_NONE;
 	}
 	if (!(cs->hw.hfcsx.int_m2 & 0x08))
-		return;		/* not initialised */
+		return IRQ_NONE;		/* not initialised */
 
 	if (HFCSX_ANYINT & (stat = Read_hfc(cs, HFCSX_STATUS))) {
 		val = Read_hfc(cs, HFCSX_INT_S1);
 		if (cs->debug & L1_DEB_ISAC)
 			debugl1(cs, "HFC-SX: stat(%02x) s1(%02x)", stat, val);
 	} else
-		return;
+		return IRQ_NONE;
 
 	if (cs->debug & L1_DEB_ISAC)
 		debugl1(cs, "HFC-SX irq %x", val);
@@ -756,6 +756,7 @@
 		} else
 			val = 0;
 	}
+	return IRQ_HANDLED;
 }
 
 /********************************************************************/
diff -Nru a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c
--- a/drivers/isdn/hisax/hfcscard.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/hfcscard.c	Mon Apr 21 03:58:37 2003
@@ -32,7 +32,7 @@
 	cs->bc_hw_ops->write_reg(cs, data, reg, val);
 }
 
-static void
+static irqreturn_t
 hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -40,7 +40,7 @@
 
 	if (!cs) {
 		printk(KERN_WARNING "HFCS: Spurious interrupt!\n");
-		return;
+		return IRQ_NONE;
 	}
 	if ((HFCD_ANYINT | HFCD_BUSY_NBUSY) & 
 		(stat = hfcs_read_reg(cs, HFCD_DATA, HFCD_STAT))) {
@@ -52,6 +52,7 @@
 		if (cs->debug & L1_DEB_ISAC)
 			debugl1(cs, "HFCS: irq_no_irq stat(%02x)", stat);
 	}
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
--- a/drivers/isdn/hisax/hisax.h	Thu Mar  6 23:20:18 2003
+++ b/drivers/isdn/hisax/hisax.h	Mon Apr 21 03:58:37 2003
@@ -28,6 +28,7 @@
 #include <linux/tty.h>
 #include <linux/serial_reg.h>
 #include <linux/netdevice.h>
+#include <linux/interrupt.h>
 
 #define ERROR_STATISTIC
 
@@ -886,7 +887,7 @@
 	void   (*release)    (struct IsdnCardState *);
 	void   (*aux_ind)    (struct IsdnCardState *, void *);
 	void   (*led_handler)(struct IsdnCardState *);
-	void   (*irq_func)   (int, void *, struct pt_regs *);
+	irqreturn_t (*irq_func)   (int, void *, struct pt_regs *);
 };
 
 /* Card specific drivers provide methods to access the
diff -Nru a/drivers/isdn/hisax/hisax_fcclassic.c b/drivers/isdn/hisax/hisax_fcclassic.c
--- a/drivers/isdn/hisax/hisax_fcclassic.c	Sat Feb 22 08:50:25 2003
+++ b/drivers/isdn/hisax/hisax_fcclassic.c	Mon Apr 21 03:58:37 2003
@@ -120,7 +120,7 @@
 
 // ----------------------------------------------------------------------
 
-static void
+static irqreturn_t
 fcclassic_irq(int intno, void *dev, struct pt_regs *regs)
 {
 	struct fritz_adapter *adapter = dev;
@@ -139,6 +139,7 @@
 			isac_irq(&adapter->isac);
 		}
 	}
+	return IRQ_HANDLED;
 }
 
 // ----------------------------------------------------------------------
diff -Nru a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c	Tue Mar 25 09:31:31 2003
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c	Mon Apr 21 03:58:37 2003
@@ -629,7 +629,7 @@
 
 // ----------------------------------------------------------------------
 
-static void fcpci2_irq(int intno, void *dev, struct pt_regs *regs)
+static irqreturn_t fcpci2_irq(int intno, void *dev, struct pt_regs *regs)
 {
 	struct fritz_adapter *adapter = dev;
 	unsigned char val;
@@ -637,16 +637,17 @@
 	val = inb(adapter->io + AVM_STATUS0);
 	if (!(val & AVM_STATUS0_IRQ_MASK))
 		/* hopefully a shared  IRQ reqest */
-		return;
+		return IRQ_NONE;
 	DBG(2, "STATUS0 %#x", val);
 	if (val & AVM_STATUS0_IRQ_ISAC)
 		isacsx_irq(&adapter->isac);
 
 	if (val & AVM_STATUS0_IRQ_HDLC)
 		hdlc_irq(adapter);
+	return IRQ_HANDLED;
 }
 
-static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
+static irqreturn_t fcpci_irq(int intno, void *dev, struct pt_regs *regs)
 {
 	struct fritz_adapter *adapter = dev;
 	unsigned char sval;
@@ -654,13 +655,14 @@
 	sval = inb(adapter->io + 2);
 	if ((sval & AVM_STATUS0_IRQ_MASK) == AVM_STATUS0_IRQ_MASK)
 		/* possibly a shared  IRQ reqest */
-		return;
+		return IRQ_NONE;
 	DBG(2, "sval %#x", sval);
 	if (!(sval & AVM_STATUS0_IRQ_ISAC))
 		isac_irq(&adapter->isac);
 
 	if (!(sval & AVM_STATUS0_IRQ_HDLC))
 		hdlc_irq(adapter);
+	return IRQ_HANDLED;
 }
 
 // ----------------------------------------------------------------------
diff -Nru a/drivers/isdn/hisax/hisax_hfcpci.c b/drivers/isdn/hisax/hisax_hfcpci.c
--- a/drivers/isdn/hisax/hisax_hfcpci.c	Sun Jan 12 12:14:10 2003
+++ b/drivers/isdn/hisax/hisax_hfcpci.c	Mon Apr 21 03:58:37 2003
@@ -1321,7 +1321,7 @@
 // ----------------------------------------------------------------------
 // IRQ handler
 
-static void
+static irqreturn_t
 hfcpci_irq(int intno, void *dev, struct pt_regs *regs)
 {
 	struct hfcpci_adapter *adapter = dev;
@@ -1329,11 +1329,11 @@
 	u8 val, stat;
 
 	if (!(adapter->int_m2 & 0x08))
-		return;		/* not initialised */ // XX
+		return IRQ_NONE;		/* not initialised */ // XX
 
 	stat = hfcpci_readb(adapter, HFCPCI_STATUS);
 	if (!(stat & HFCPCI_ANYINT))
-		return;
+		return IRQ_NONE;
 
 	spin_lock(&adapter->hw_lock);
 	while (loop-- > 0) {
@@ -1369,6 +1369,7 @@
 			hfcpci_timer_irq(adapter);
 	}
 	spin_unlock(&adapter->hw_lock);
+	return IRQ_HANDLED;
 }
 
 // ----------------------------------------------------------------------
diff -Nru a/drivers/isdn/hisax/hscx.h b/drivers/isdn/hisax/hscx.h
--- a/drivers/isdn/hisax/hscx.h	Sun Jan 12 16:12:37 2003
+++ b/drivers/isdn/hisax/hscx.h	Mon Apr 21 03:58:37 2003
@@ -10,6 +10,8 @@
  *
  */
 
+#include <linux/interrupt.h>
+
 /* All Registers original Siemens Spec  */
 
 #define HSCX_ISTA 0x20
@@ -37,7 +39,7 @@
 extern void modehscx(struct BCState *bcs, int mode, int bc);
 extern void inithscxisac(struct IsdnCardState *cs);
 extern void hscx_int_main(struct IsdnCardState *cs, u8 val);
-extern void hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs);
 extern int  hscxisac_setup(struct IsdnCardState *cs,
 			   struct dc_hw_ops *isac_ops,
 			   struct bc_hw_ops *hscx_ops);
diff -Nru a/drivers/isdn/hisax/hscx_irq.c b/drivers/isdn/hisax/hscx_irq.c
--- a/drivers/isdn/hisax/hscx_irq.c	Sat Jan 11 11:37:52 2003
+++ b/drivers/isdn/hisax/hscx_irq.c	Mon Apr 21 03:58:37 2003
@@ -185,7 +185,7 @@
 	cs->dc_hw_ops->write_reg(cs, addr, val);
 }
 
-void
+irqreturn_t
 hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -221,5 +221,6 @@
 	hscx_write(&cs->bcs[0], HSCX_MASK, 0x0);
 	hscx_write(&cs->bcs[1], HSCX_MASK, 0x0);
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
diff -Nru a/drivers/isdn/hisax/ipac.c b/drivers/isdn/hisax/ipac.c
--- a/drivers/isdn/hisax/ipac.c	Sun Jan 12 16:12:37 2003
+++ b/drivers/isdn/hisax/ipac.c	Mon Apr 21 03:58:37 2003
@@ -47,7 +47,7 @@
 	inithscxisac(cs);
 }
 
-void
+irqreturn_t
 ipac_irq(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -90,6 +90,7 @@
 	ipac_write(cs, IPAC_MASK, 0xFF);
 	ipac_write(cs, IPAC_MASK, 0xC0);
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 int
@@ -102,4 +103,5 @@
 	cs->bc_hw_ops = ipac_bc_ops;
 	val = ipac_read(cs, IPAC_ID);
 	printk(KERN_INFO "HiSax: IPAC version %#x\n", val);
+	return 0;
 }
diff -Nru a/drivers/isdn/hisax/ipac.h b/drivers/isdn/hisax/ipac.h
--- a/drivers/isdn/hisax/ipac.h	Sun Jan 12 16:12:37 2003
+++ b/drivers/isdn/hisax/ipac.h	Mon Apr 21 03:58:37 2003
@@ -10,6 +10,8 @@
  *
  */
 
+#include <linux/interrupt.h>
+
 /* All Registers original Siemens Spec  */
 
 #define IPAC_CONF	0xC0
@@ -29,7 +31,7 @@
 #define IPAC_TIMR2	0xCC
 
 void ipac_init(struct IsdnCardState *cs);
-void ipac_irq(int intno, void *dev_id, struct pt_regs *regs);
+irqreturn_t ipac_irq(int intno, void *dev_id, struct pt_regs *regs);
 int  ipac_setup(struct IsdnCardState *cs, struct dc_hw_ops *ipac_dc_ops,
 		struct bc_hw_ops *ipac_bc_ops);
 
diff -Nru a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
--- a/drivers/isdn/hisax/isurf.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/isurf.c	Thu Apr 24 05:18:50 2003
@@ -94,7 +94,7 @@
 	.write_reg = WriteISAR,
 };
 
-static void
+static irqreturn_t
 isurf_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -130,6 +130,7 @@
 	writeb(0, cs->hw.isurf.isac + ISAC_MASK);mb();
 	writeb(ISAR_IRQMSK, cs->hw.isurf.isar + ISAR_IRQBIT); mb();
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c
--- a/drivers/isdn/hisax/niccy.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/niccy.c	Mon Apr 21 03:58:37 2003
@@ -151,7 +151,7 @@
 	.write_fifo = hscx_write_fifo,
 };
 
-static void
+static irqreturn_t
 niccy_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -160,10 +160,10 @@
 		int ival;
 		ival = inl(cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG);
 		if (!(ival & PCI_IRQ_ASSERT)) /* IRQ not for us (shared) */
-			return;
+			return IRQ_NONE;
 		outl(ival, cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG);
 	}
-	hscxisac_irq(intno, dev_id, regs);
+	return hscxisac_irq(intno, dev_id, regs);
 }
 
 void
diff -Nru a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c
--- a/drivers/isdn/hisax/nj_s.c	Thu Mar  6 22:52:04 2003
+++ b/drivers/isdn/hisax/nj_s.c	Mon Apr 21 03:58:37 2003
@@ -17,7 +17,7 @@
 
 const char *NETjet_S_revision = "$Revision: 2.7.6.6 $";
 
-static void
+static irqreturn_t
 nj_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -70,6 +70,7 @@
 	}
 */
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static int
diff -Nru a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c
--- a/drivers/isdn/hisax/nj_u.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/nj_u.c	Mon Apr 21 03:58:37 2003
@@ -17,7 +17,7 @@
 
 const char *NETjet_U_revision = "$Revision: 2.8.6.6 $";
 
-static void
+static irqreturn_t
 nj_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -70,6 +70,7 @@
 	}
 */
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static int
diff -Nru a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c
--- a/drivers/isdn/hisax/saphir.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/saphir.c	Mon Apr 21 03:58:37 2003
@@ -132,13 +132,15 @@
 	.write_fifo = hscx_write_fifo,
 };
 
-static void
+static irqreturn_t
 saphir_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
+	irqreturn_t ret;
 
-	hscxisac_irq(intno, dev_id, regs);
+	ret = hscxisac_irq(intno, dev_id, regs);
 	mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ);
+	return ret;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c
--- a/drivers/isdn/hisax/sedlbauer.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/sedlbauer.c	Mon Apr 21 03:58:37 2003
@@ -283,7 +283,7 @@
 	.write_reg  = isar_write,
 };
 
-static void
+static irqreturn_t
 sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -292,12 +292,12 @@
 		/* The card tends to generate interrupts while being removed
 		   causing us to just crash the kernel. bad. */
 		printk(KERN_WARNING "Sedlbauer: card not available!\n");
-		return;
+		return IRQ_NONE;
 	}
-	hscxisac_irq(intno, dev_id, regs);
+	return hscxisac_irq(intno, dev_id, regs);
 }
 
-static void
+static irqreturn_t
 sedlbauer_isar_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -334,6 +334,7 @@
 	isac_write(cs, ISAC_MASK, 0x0);
 	isar_write(cs, 0, ISAR_IRQBIT, ISAR_IRQMSK);
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static int
diff -Nru a/drivers/isdn/hisax/sportster.c b/drivers/isdn/hisax/sportster.c
--- a/drivers/isdn/hisax/sportster.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/sportster.c	Mon Apr 21 03:58:37 2003
@@ -111,13 +111,14 @@
 	.write_fifo = hscx_write_fifo,
 };
 
-static void
+static irqreturn_t
 sportster_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
 
 	hscxisac_irq(intno, dev_id, regs);
 	bytein(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ +1);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c
--- a/drivers/isdn/hisax/teleint.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/teleint.c	Mon Apr 21 03:58:37 2003
@@ -178,7 +178,7 @@
 	.write_reg = WriteHFC,
 };
 
-static void
+static irqreturn_t
 teleint_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -198,6 +198,7 @@
 	writereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0xFF);
 	writereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0x0);
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c
--- a/drivers/isdn/hisax/telespci.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/telespci.c	Mon Apr 21 03:58:37 2003
@@ -199,7 +199,7 @@
 	.write_fifo = hscx_write_fifo,
 };
 
-static void
+static irqreturn_t
 telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 #define MAXCOUNT 20
@@ -223,6 +223,7 @@
 	hscx_write(cs, 0, HSCX_MASK, 0x0);
 	hscx_write(cs, 1, HSCX_MASK, 0x0);
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static struct card_ops telespci_ops = {
diff -Nru a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
--- a/drivers/isdn/hisax/w6692.c	Thu Mar  6 22:52:05 2003
+++ b/drivers/isdn/hisax/w6692.c	Mon Apr 21 03:58:37 2003
@@ -287,7 +287,7 @@
 	}
 }
 
-static void
+static irqreturn_t
 w6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	struct IsdnCardState *cs = dev_id;
@@ -395,6 +395,7 @@
 		w6692_write_reg(cs, W_IMASK, 0xff);
 	}
 	spin_unlock(&cs->lock);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c
--- a/drivers/isdn/hysdn/boardergo.c	Tue Oct  1 09:01:14 2002
+++ b/drivers/isdn/hysdn/boardergo.c	Mon Apr 21 03:58:37 2003
@@ -32,7 +32,7 @@
 /***************************************************/
 /* The cards interrupt handler. Called from system */
 /***************************************************/
-static void
+static irqreturn_t
 ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs)
 {
 	hysdn_card *card = dev_id;	/* parameter from irq */
@@ -41,16 +41,16 @@
 	uchar volatile b;
 
 	if (!card)
-		return;		/* error -> spurious interrupt */
+		return IRQ_NONE;		/* error -> spurious interrupt */
 	if (!card->irq_enabled)
-		return;		/* other device interrupting or irq switched off */
+		return IRQ_NONE;		/* other device interrupting or irq switched off */
 
 	save_flags(flags);
 	cli();			/* no further irqs allowed */
 
 	if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
 		restore_flags(flags);	/* restore old state */
-		return;		/* no interrupt requested by E1 */
+		return IRQ_NONE;		/* no interrupt requested by E1 */
 	}
 	/* clear any pending ints on the board */
 	dpr = card->dpram;
@@ -62,6 +62,7 @@
 	if (!card->hw_lock)
 		schedule_work(&card->irq_queue);
 	restore_flags(flags);
+	return IRQ_HANDLED;
 }				/* ergo_interrupt */
 
 /******************************************************************************/
diff -Nru a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
--- a/drivers/isdn/i4l/isdn_tty.c	Thu Apr  3 10:20:35 2003
+++ b/drivers/isdn/i4l/isdn_tty.c	Mon Apr 21 20:58:42 2003
@@ -1045,17 +1045,17 @@
 }
 
 static inline int
-isdn_tty_paranoia_check(modem_info * info, kdev_t device, const char *routine)
+isdn_tty_paranoia_check(modem_info * info, char *name, const char *routine)
 {
 #ifdef MODEM_PARANOIA_CHECK
 	if (!info) {
-		printk(KERN_WARNING "isdn_tty: null info_struct for (%d, %d) in %s\n",
-		       major(device), minor(device), routine);
+		printk(KERN_WARNING "isdn_tty: null info_struct for %s in %s\n",
+		       name, routine);
 		return 1;
 	}
 	if (info->magic != ISDN_ASYNC_MAGIC) {
-		printk(KERN_WARNING "isdn_tty: bad magic for modem struct (%d, %d) in %s\n",
-		       major(device), minor(device), routine);
+		printk(KERN_WARNING "isdn_tty: bad magic for modem struct %s in %s\n",
+		       name, routine);
 		return 1;
 	}
 #endif
@@ -1205,7 +1205,7 @@
 	modem_info *info = (modem_info *) tty->driver_data;
 	atemu *m = &info->emu;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_write"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_write"))
 		return 0;
 	if (from_user)
 		down(&info->write_sem);
@@ -1318,7 +1318,7 @@
 	modem_info *info = (modem_info *) tty->driver_data;
 	int ret;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_write_room"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_write_room"))
 		return 0;
 	if (!info->online)
 		return info->xmit_size;
@@ -1331,7 +1331,7 @@
 {
 	modem_info *info = (modem_info *) tty->driver_data;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_chars_in_buffer"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_chars_in_buffer"))
 		return 0;
 	if (!info->online)
 		return 0;
@@ -1351,7 +1351,7 @@
 		return;
 	}
 	info = (modem_info *) tty->driver_data;
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_flush_buffer")) {
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_buffer")) {
 		restore_flags(flags);
 		return;
 	}
@@ -1369,7 +1369,7 @@
 {
 	modem_info *info = (modem_info *) tty->driver_data;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_flush_chars"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_chars"))
 		return;
 	if ((info->xmit_count) || (skb_queue_len(&info->xmit_queue)))
 		isdn_tty_modem_xmit(info);
@@ -1388,7 +1388,7 @@
 {
 	modem_info *info = (modem_info *) tty->driver_data;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_throttle"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_throttle"))
 		return;
 	if (I_IXOFF(tty))
 		info->x_char = STOP_CHAR(tty);
@@ -1400,7 +1400,7 @@
 {
 	modem_info *info = (modem_info *) tty->driver_data;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_unthrottle"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_unthrottle"))
 		return;
 	if (I_IXOFF(tty)) {
 		if (info->x_char)
@@ -1542,7 +1542,7 @@
 	modem_info *info = (modem_info *) tty->driver_data;
 	int retval;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_ioctl"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_ioctl"))
 		return -ENODEV;
 	if (tty->flags & (1 << TTY_IO_ERROR))
 		return -EIO;
@@ -1655,7 +1655,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == ISDN_SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == ISDN_SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ISDN_ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
@@ -1766,15 +1766,15 @@
 
 	MOD_INC_USE_COUNT;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if (line < 0 || line > ISDN_MAX_CHANNELS)
 		return -ENODEV;
 	info = &isdn_mdm.info[line];
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_open"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open"))
 		return -ENODEV;
 #ifdef ISDN_DEBUG_MODEM_OPEN
-	printk(KERN_DEBUG "isdn_tty_open %s%d, count = %d\n", tty->driver.name,
-	       info->line, info->count);
+	printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name,
+	       info->count);
 #endif
 	info->count++;
 	tty->driver_data = info;
@@ -1797,7 +1797,7 @@
 		return retval;
 	}
 	if ((info->count == 1) && (info->flags & ISDN_ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == ISDN_SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == ISDN_SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else
 			*tty->termios = info->callout_termios;
@@ -1822,7 +1822,7 @@
 	ulong flags;
 	ulong timeout;
 
-	if (!info || isdn_tty_paranoia_check(info, tty->device, "isdn_tty_close"))
+	if (!info || isdn_tty_paranoia_check(info, tty->name, "isdn_tty_close"))
 		goto out;
 
 	save_flags(flags);
@@ -1892,8 +1892,8 @@
 	}
 	dev->modempoll--;
 	isdn_tty_shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	info->tty = 0;
@@ -1923,7 +1923,7 @@
 {
 	modem_info *info = (modem_info *) tty->driver_data;
 
-	if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_hangup"))
+	if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_hangup"))
 		return;
 	isdn_tty_shutdown(info);
 	info->count = 0;
diff -Nru a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c
--- a/drivers/isdn/pcbit/layer2.c	Tue Oct  1 09:08:02 2002
+++ b/drivers/isdn/pcbit/layer2.c	Mon Apr 21 03:58:37 2003
@@ -524,7 +524,7 @@
 	}
 }
 
-void
+irqreturn_t
 pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs)
 {
 	struct pcbit_dev *dev;
@@ -536,11 +536,11 @@
 
 	if (!dev) {
 		printk(KERN_WARNING "pcbit_irq_handler: wrong device\n");
-		return;
+		return IRQ_NONE;
 	}
 	if (dev->interrupt) {
 		printk(KERN_DEBUG "pcbit: reentering interrupt hander\n");
-		return;
+		return IRQ_HANDLED;
 	}
 	dev->interrupt = 1;
 
@@ -549,7 +549,7 @@
 	if (dev->l2_state == L2_STARTING || dev->l2_state == L2_ERROR) {
 		pcbit_l2_active_conf(dev, info);
 		dev->interrupt = 0;
-		return;
+		return IRQ_HANDLED;
 	}
 	if (info & 0x40U) {     /* E bit set */
 #ifdef DEBUG
@@ -557,11 +557,11 @@
 #endif
 		pcbit_l2_error(dev);
 		dev->interrupt = 0;
-		return;
+		return IRQ_HANDLED;
 	}
 	if (dev->l2_state != L2_RUNNING && dev->l2_state != L2_LOADING) {
 		dev->interrupt = 0;
-		return;
+		return IRQ_HANDLED;
 	}
 	ack_seq = (info >> 3) & 0x07U;
 	read_seq = (info & 0x07U);
@@ -582,6 +582,7 @@
 	info |= dev->send_seq;
 
 	writeb(info, dev->sh_mem + BANK4);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/isdn/pcbit/layer2.h b/drivers/isdn/pcbit/layer2.h
--- a/drivers/isdn/pcbit/layer2.h	Mon Feb  4 23:49:25 2002
+++ b/drivers/isdn/pcbit/layer2.h	Mon Apr 21 03:58:37 2003
@@ -17,6 +17,8 @@
 #ifndef LAYER2_H
 #define LAYER2_H
 
+#include <linux/interrupt.h>
+
 #include <asm/byteorder.h>
 
 #define BANK1 0x0000U /* PC -> Board */
@@ -122,7 +124,7 @@
 extern int pcbit_l2_write(struct pcbit_dev * dev, ulong msg, ushort refnum, 
                           struct sk_buff *skb, unsigned short hdr_len);
 
-extern void pcbit_irq_handler(int interrupt, void *, struct pt_regs *regs);
+extern irqreturn_t pcbit_irq_handler(int interrupt, void *, struct pt_regs *regs);
 
 extern struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS];
 
diff -Nru a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
--- a/drivers/isdn/sc/init.c	Sun Nov 17 12:37:02 2002
+++ b/drivers/isdn/sc/init.c	Mon Apr 21 03:58:37 2003
@@ -36,7 +36,7 @@
 static int sup_irq[] = { 11, 10, 9, 5, 12, 14, 7, 3, 4, 6 };
 #define MAX_IRQS	10
 
-extern void interrupt_handler(int, void *, struct pt_regs *);
+extern irqreturn_t interrupt_handler(int, void *, struct pt_regs *);
 extern int sndpkt(int, int, int, struct sk_buff *);
 extern int command(isdn_ctrl *);
 extern int indicate_status(int, int, ulong, char*);
diff -Nru a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c
--- a/drivers/isdn/sc/interrupt.c	Mon Sep  2 12:15:36 2002
+++ b/drivers/isdn/sc/interrupt.c	Mon Apr 21 03:58:37 2003
@@ -19,6 +19,7 @@
 #include "hardware.h"
 #include "message.h"
 #include "card.h"
+#include <linux/interrupt.h>
 
 extern int indicate_status(int, int, ulong, char *);
 extern void check_phystat(unsigned long);
@@ -44,7 +45,8 @@
 /*
  * 
  */
-void interrupt_handler(int interrupt, void * cardptr, struct pt_regs *regs ) {
+irqreturn_t interrupt_handler(int interrupt, void *cardptr, struct pt_regs *regs)
+{
 
 	RspMessage rcvmsg;
 	int channel;
@@ -54,7 +56,7 @@
 
 	if(!IS_VALID_CARD(card)) {
 		pr_debug("Invalid param: %d is not a valid card id\n", card);
-		return;
+		return IRQ_NONE;
 	}
 
 	pr_debug("%s: Entered Interrupt handler\n", adapter[card]->devicename);
@@ -242,4 +244,5 @@
 	}	/* while */
 
 	pr_debug("%s: Exiting Interrupt Handler\n", adapter[card]->devicename);
+	return IRQ_HANDLED;
 }
diff -Nru a/drivers/isdn/tpam/tpam.h b/drivers/isdn/tpam/tpam.h
--- a/drivers/isdn/tpam/tpam.h	Tue Oct  1 07:57:26 2002
+++ b/drivers/isdn/tpam/tpam.h	Mon Apr 21 03:58:37 2003
@@ -17,6 +17,7 @@
 #include <linux/isdnif.h>
 #include <linux/init.h>
 #include <linux/workqueue.h>
+#include <linux/interrupt.h>
 
 /* Maximum number of channels for this board */
 #define TPAM_NBCHANNEL		30
@@ -197,7 +198,7 @@
 /* Function prototypes from tpam_queues.c */
 extern void tpam_enqueue(tpam_card *, struct sk_buff *);
 extern void tpam_enqueue_data(tpam_channel *, struct sk_buff *);
-extern void tpam_irq(int, void *, struct pt_regs *);
+extern irqreturn_t tpam_irq(int, void *, struct pt_regs *);
 extern void tpam_recv_tq(tpam_card *);
 extern void tpam_send_tq(tpam_card *);
 
diff -Nru a/drivers/isdn/tpam/tpam_commands.c b/drivers/isdn/tpam/tpam_commands.c
--- a/drivers/isdn/tpam/tpam_commands.c	Tue Feb 25 10:27:26 2003
+++ b/drivers/isdn/tpam/tpam_commands.c	Mon Apr 21 03:58:37 2003
@@ -173,7 +173,8 @@
  * Return: 0 if OK, <0 on errors.
  */
 static int tpam_command_ioctl_dsprun(tpam_card *card) {
-	u32 signature = 0, timeout, i;
+	u32 signature = 0, i;
+	unsigned long timeout;
 	isdn_ctrl ctrl;
 	struct sk_buff *skb;
 
diff -Nru a/drivers/isdn/tpam/tpam_queues.c b/drivers/isdn/tpam/tpam_queues.c
--- a/drivers/isdn/tpam/tpam_queues.c	Tue Oct  1 08:15:11 2002
+++ b/drivers/isdn/tpam/tpam_queues.c	Mon Apr 21 03:58:37 2003
@@ -74,7 +74,8 @@
  * 	dev_id: the registered board to the irq
  * 	regs: not used.
  */
-void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) {
+irqreturn_t tpam_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
 	tpam_card *card = (tpam_card *)dev_id;
 	u32 ackupload, uploadptr;
 	u32 waiting_too_long;
@@ -115,7 +116,7 @@
 			printk(KERN_ERR "TurboPAM(tpam_irq): "
 			       "alloc_skb failed\n");
 			spin_unlock(&card->lock);
-			return;
+			return IRQ_HANDLED;
 		}
 
 		/* build the skb_header */
@@ -147,7 +148,7 @@
 				spin_unlock(&card->lock);
 				printk(KERN_ERR "TurboPAM(tpam_irq): "
 						"waiting too long...\n");
-				return;
+				return IRQ_HANDLED;
 			}
 		} while (hpic & 0x00000002);
 
@@ -169,7 +170,7 @@
 			skb_queue_tail(&card->recvq, skb);
 			schedule_work(&card->recv_tq);
 		}
-		return;
+		return IRQ_HANDLED;
 	}
 	else {
 		/* it is a ack from the board */
@@ -185,10 +186,8 @@
 
 		/* schedule the send queue for execution */
 		schedule_work(&card->send_tq);
-		return;
 	}
-
-	/* not reached */
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c
--- a/drivers/macintosh/macserial.c	Sun Mar 16 15:21:50 2003
+++ b/drivers/macintosh/macserial.c	Thu Apr 24 03:30:40 2003
@@ -183,20 +183,20 @@
 
 static inline int __pmac
 serial_paranoia_check(struct mac_serial *info,
-		      kdev_t device, const char *routine)
+		      char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char badmagic[] = KERN_WARNING
-		"Warning: bad magic number for serial struct (%d, %d) in %s\n";
+		"Warning: bad magic number for serial struct %s in %s\n";
 	static const char badinfo[] = KERN_WARNING
-		"Warning: null mac_serial for (%d, %d) in %s\n";
+		"Warning: null mac_serial for %s in %s\n";
 
 	if (!info) {
-		printk(badinfo, major(device), minor(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, major(device), minor(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -667,7 +667,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 
 #if 0
@@ -691,7 +691,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 
 	spin_lock_irqsave(&info->lock, flags);
@@ -1459,7 +1459,7 @@
 	struct mac_serial *info = (struct mac_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	spin_lock_irqsave(&info->lock, flags);
@@ -1477,7 +1477,7 @@
 	struct mac_serial *info = (struct mac_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf || !tmp_buf)
@@ -1544,7 +1544,7 @@
 	struct mac_serial *info = (struct mac_serial *)tty->driver_data;
 	int	ret;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -1556,7 +1556,7 @@
 {
 	struct mac_serial *info = (struct mac_serial *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -1566,7 +1566,7 @@
 	struct mac_serial *info = (struct mac_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	spin_lock_irqsave(&info->lock, flags);
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1593,7 +1593,7 @@
 	printk(KERN_DEBUG "throttle %ld....\n",tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 
 	if (I_IXOFF(tty)) {
@@ -1647,7 +1647,7 @@
 			tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 
 	if (I_IXOFF(tty)) {
@@ -1833,7 +1833,7 @@
 	struct mac_serial *info = (struct mac_serial *) tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_break"))
+	if (serial_paranoia_check(info, tty->name, "rs_break"))
 		return;
 
 	spin_lock_irqsave(&info->lock, flags);
@@ -1854,7 +1854,7 @@
 	if (info->kgdb_channel)
 		return -ENODEV;
 #endif
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1921,7 +1921,7 @@
 	struct mac_serial * info = (struct mac_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	spin_lock_irqsave(&info->lock, flags);
@@ -2003,8 +2003,8 @@
 	   specific irqs */
 	spin_unlock_irqrestore(&info->lock, flags);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -2032,7 +2032,7 @@
 	struct mac_serial *info = (struct mac_serial *) tty->driver_data;
 	unsigned long orig_jiffies, char_time;
 
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 /*	printk("rs_wait_until_sent, timeout:%d, tty_stopped:%d, tx_stopped:%d\n",
@@ -2078,7 +2078,7 @@
 {
 	struct mac_serial * info = (struct mac_serial *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	rs_flush_buffer(tty);
@@ -2120,7 +2120,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ZILOG_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ZILOG_CALLOUT_ACTIVE) &&
@@ -2229,7 +2229,7 @@
 	unsigned long		page;
 
 	MOD_INC_USE_COUNT;
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= zs_channels_found)) {
 		MOD_DEC_USE_COUNT;
 		return -ENODEV;
@@ -2242,10 +2242,10 @@
 		return -ENODEV;
 	}
 #endif
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
-	OPNDBG("rs_open %s%d, count = %d, tty=%p\n", tty->driver.name,
-	       info->line, info->count, tty);
+	OPNDBG("rs_open %s, count = %d, tty=%p\n", tty->name,
+	       info->count, tty);
 
 	info->count++;
 	tty->driver_data = info;
@@ -2292,7 +2292,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -2309,7 +2309,7 @@
 	info->session = current->session;
 	info->pgrp = current->pgrp;
 
-	OPNDBG("rs_open ttyS%d successful...\n", info->line);
+	OPNDBG("rs_open %s successful...\n", tty->name);
 	return 0;
 }
 
@@ -2607,7 +2607,7 @@
 	serial_driver.magic = TTY_DRIVER_MAGIC;
 	serial_driver.driver_name = "macserial";
 #ifdef CONFIG_DEVFS_FS
-	serial_driver.name = "tts/%d";
+	serial_driver.name = "tts/";
 #else
 	serial_driver.name = "ttyS";
 #endif /* CONFIG_DEVFS_FS */
@@ -2650,7 +2650,7 @@
 	 */
 	callout_driver = serial_driver;
 #ifdef CONFIG_DEVFS_FS
-	callout_driver.name = "cua/%d";
+	callout_driver.name = "cua/";
 #else
 	callout_driver.name = "cua";
 #endif /* CONFIG_DEVFS_FS */
@@ -2835,9 +2835,11 @@
 	/* Don't disable the transmitter. */
 }
 
-static kdev_t serial_console_device(struct console *c)
+extern struct tty_driver serial_driver;
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 /*
diff -Nru a/drivers/md/Kconfig b/drivers/md/Kconfig
--- a/drivers/md/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/drivers/md/Kconfig	Sun Apr 20 12:56:52 2003
@@ -25,7 +25,7 @@
 
 	  More information about Software RAID on Linux is contained in the
 	  Software RAID mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. There you will also learn
+	  <http://www.tldp.org/docs.html#howto>. There you will also learn
 	  where to get the supporting user space utilities raidtools.
 
 	  If unsure, say N.
@@ -57,7 +57,7 @@
 
 	  Information about Software RAID on Linux is contained in the
 	  Software-RAID mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. There you will also
+	  <http://www.tldp.org/docs.html#howto>. There you will also
 	  learn where to get the supporting user space utilities raidtools.
 
 	  If you want to compile this as a module ( = code which can be
@@ -81,7 +81,7 @@
 
 	  Information about Software RAID on Linux is contained in the
 	  Software-RAID mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  There you will also
+	  <http://www.tldp.org/docs.html#howto>.  There you will also
 	  learn where to get the supporting user space utilities raidtools.
 
 	  If you want to use such a RAID-1 set, say Y. This code is also
@@ -106,7 +106,7 @@
 
 	  Information about Software RAID on Linux is contained in the
 	  Software-RAID mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. There you will also
+	  <http://www.tldp.org/docs.html#howto>. There you will also
 	  learn where to get the supporting user space utilities raidtools.
 
 	  If you want to use such a RAID-4/RAID-5 set, say Y. This code is
diff -Nru a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
--- a/drivers/md/dm-ioctl.c	Sat Apr  5 23:55:25 2003
+++ b/drivers/md/dm-ioctl.c	Sat Apr 19 14:26:30 2003
@@ -14,6 +14,7 @@
 #include <linux/wait.h>
 #include <linux/blk.h>
 #include <linux/slab.h>
+#include <linux/devfs_fs_kernel.h>
 
 #include <asm/uaccess.h>
 
@@ -174,16 +175,10 @@
 static int register_with_devfs(struct hash_cell *hc)
 {
 	struct gendisk *disk = dm_disk(hc->md);
-	char *name = kmalloc(DM_NAME_LEN + strlen(DM_DIR) + 1, GFP_KERNEL);
-	if (!name) {
-		return -ENOMEM;
-	}
 
-	sprintf(name, DM_DIR "/%s", hc->name);
-	devfs_register(NULL, name, 0, disk->major, disk->first_minor,
+	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
 		       S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP,
-		       &dm_blk_dops, NULL);
-	kfree(name);
+		       DM_DIR "/%s", hc->name);
 	return 0;
 }
 
diff -Nru a/drivers/md/dm.c b/drivers/md/dm.c
--- a/drivers/md/dm.c	Sat Mar  8 14:50:22 2003
+++ b/drivers/md/dm.c	Sat Apr 19 23:22:55 2003
@@ -15,7 +15,7 @@
 #include <linux/slab.h>
 
 static const char *_name = DM_NAME;
-#define MAX_DEVICES (1 << KDEV_MINOR_BITS)
+#define MAX_DEVICES 1024
 
 static int major = 0;
 static int _major = 0;
diff -Nru a/drivers/md/md.c b/drivers/md/md.c
--- a/drivers/md/md.c	Thu Apr  3 17:21:40 2003
+++ b/drivers/md/md.c	Sat Apr 19 14:26:30 2003
@@ -3486,11 +3486,11 @@
 	devfs_mk_dir("md");
 	blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE,
 				md_probe, NULL, NULL);
+
 	for (minor=0; minor < MAX_MD_DEVS; ++minor) {
-		char name[16];
-		sprintf(name, "md/%d", minor);
-		devfs_register(NULL, name, DEVFS_FL_DEFAULT, MAJOR_NR, minor,
-			       S_IFBLK | S_IRUSR | S_IWUSR, &md_fops, NULL);
+		devfs_mk_bdev(MKDEV(MAJOR_NR, minor),
+				S_IFBLK|S_IRUSR|S_IWUSR,
+				"md/%d", minor);
 	}
 
 	register_reboot_notifier(&md_notifier);
diff -Nru a/drivers/md/raid1.c b/drivers/md/raid1.c
--- a/drivers/md/raid1.c	Sat Apr 12 23:14:24 2003
+++ b/drivers/md/raid1.c	Sun Apr 20 09:24:36 2003
@@ -258,7 +258,7 @@
 		r1_bio->sector + (r1_bio->master_bio->bi_size >> 9);
 }
 
-static int end_request(struct bio *bio, unsigned int bytes_done, int error)
+static int raid1_end_request(struct bio *bio, unsigned int bytes_done, int error)
 {
 	int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
 	r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private);
@@ -496,7 +496,7 @@
 
 		read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset;
 		read_bio->bi_bdev = mirror->rdev->bdev;
-		read_bio->bi_end_io = end_request;
+		read_bio->bi_end_io = raid1_end_request;
 		read_bio->bi_rw = r1_bio->cmd;
 		read_bio->bi_private = r1_bio;
 
@@ -531,7 +531,7 @@
 
 		mbio->bi_sector	= r1_bio->sector + conf->mirrors[i].rdev->data_offset;
 		mbio->bi_bdev = conf->mirrors[i].rdev->bdev;
-		mbio->bi_end_io	= end_request;
+		mbio->bi_end_io	= raid1_end_request;
 		mbio->bi_rw = r1_bio->cmd;
 		mbio->bi_private = r1_bio;
 
@@ -551,11 +551,11 @@
 	/*
 	 * We have to be a bit careful about the semaphore above, thats
 	 * why we start the requests separately. Since generic_make_request()
-	 * can sleep, this is the safer solution. Imagine, end_request
+	 * can sleep, this is the safer solution. Imagine, raid1_end_request
 	 * decreasing the semaphore before we could have set it up ...
 	 * We could play tricks with the semaphore (presetting it and
 	 * correcting at the end if sum_bios is not 'n' but we have to
-	 * do end_request by hand if all requests finish until we had a
+	 * do raid1_end_request by hand if all requests finish until we had a
 	 * chance to set up the semaphore correctly ... lots of races).
 	 */
 
diff -Nru a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
--- a/drivers/media/common/saa7146_core.c	Mon Apr  7 13:16:30 2003
+++ b/drivers/media/common/saa7146_core.c	Mon Apr 21 01:03:35 2003
@@ -192,7 +192,7 @@
 /********************************************************************************/
 /* interrupt handler */
 
-static void interrupt_hw(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct saa7146_dev *dev = (struct saa7146_dev*)dev_id;
 	u32 isr = 0;
@@ -203,7 +203,7 @@
 	/* is this our interrupt? */
 	if ( 0 == isr ) {
 		/* nope, some other device */
-		return;
+		return IRQ_NONE;
 	}
 
 	saa7146_write(dev, ISR, isr);
@@ -254,6 +254,7 @@
 		ERR(("disabling interrupt source(s)!\n"));
 		IER_DISABLE(dev,isr);
 	}
+	return IRQ_HANDLED;
 }
 
 /*********************************************************************************/
diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
--- a/drivers/media/dvb/dvb-core/dvbdev.c	Thu Apr 17 09:17:57 2003
+++ b/drivers/media/dvb/dvb-core/dvbdev.c	Sat Apr 19 01:48:24 2003
@@ -45,7 +45,6 @@
 static int dvbdev_debug = 0;
 #define dprintk if (dvbdev_debug) printk
 
-static devfs_handle_t dvb_devfs_handle;
 static LIST_HEAD(dvb_adapter_list);
 static DECLARE_MUTEX(dvbdev_register_lock);
 
@@ -221,10 +220,8 @@
 	list_add_tail (&dvbdev->list_head, &adap->device_list);
 
 	sprintf(name, "dvb/adapter%d%s%d", adap->num, dnames[type], id);
-	dvbdev->devfs_handle = devfs_register(NULL, name, 0, DVB_MAJOR,
-					      nums2minor(adap->num, type, id),
-					      S_IFCHR | S_IRUSR | S_IWUSR,
-					      dvbdev->fops, dvbdev);
+	devfs_register(NULL, name, 0, DVB_MAJOR, nums2minor(adap->num, type, id),
+			S_IFCHR | S_IRUSR | S_IWUSR, dvbdev->fops, dvbdev);
 
 	dprintk("DVB: register adapter%d/%s @ minor: %i (0x%02x)\n",
 		adap->num, name, nums2minor(adap->num, type, id),
@@ -236,12 +233,12 @@
 
 void dvb_unregister_device(struct dvb_device *dvbdev)
 {
-	if (!dvbdev)
-		return;
-
-	devfs_unregister(dvbdev->devfs_handle);
-	list_del (&dvbdev->list_head);
-	kfree (dvbdev);
+	if (dvbdev) {
+		devfs_remove("dvb/adapter%d%s%d", dvbdev->adapter->num,
+				dnames[dvbdev->type], dvbdev->id);
+		list_del(&dvbdev->list_head);
+		kfree(dvbdev);
+	}
 }
 
 
@@ -289,11 +286,12 @@
 	INIT_LIST_HEAD (&adap->device_list);
 
  	/* fixme: is this correct? */
+	/* No */
 	try_module_get(THIS_MODULE);
 
 	printk ("DVB: registering new adapter (%s).\n", name);
 	
-	adap->devfs_handle = devfs_mk_dir("dvb/adapter%d", num);
+	devfs_mk_dir("dvb/adapter%d", num);
 	adap->num = num;
 	adap->name = name;
 
@@ -307,13 +305,14 @@
 
 int dvb_unregister_adapter(struct dvb_adapter *adap)
 {
-        devfs_unregister (adap->devfs_handle);
 	if (down_interruptible (&dvbdev_register_lock))
 		return -ERESTARTSYS;
+        devfs_remove("dvb/adapter%d", adap->num);
 	list_del (&adap->list_head);
 	up (&dvbdev_register_lock);
 	kfree (adap);
 	/* fixme: is this correct? */
+	/* No. */
 	module_put(THIS_MODULE);
 	return 0;
 }
@@ -322,7 +321,7 @@
 static
 int __init init_dvbdev(void)
 {
-	dvb_devfs_handle = devfs_mk_dir ("dvb");
+	devfs_mk_dir("dvb");
 #ifndef CONFIG_DVB_DEVFS_ONLY
 	if(register_chrdev(DVB_MAJOR,"DVB", &dvb_device_fops)) {
 		printk("video_dev: unable to get major %d\n", DVB_MAJOR);
@@ -339,7 +338,7 @@
 #ifndef CONFIG_DVB_DEVFS_ONLY
 	unregister_chrdev(DVB_MAJOR, "DVB");
 #endif
-        devfs_unregister(dvb_devfs_handle);
+        devfs_remove("dvb");
 }
 
 module_init(init_dvbdev);
diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
--- a/drivers/media/dvb/dvb-core/dvbdev.h	Mon Apr  7 13:17:58 2003
+++ b/drivers/media/dvb/dvb-core/dvbdev.h	Fri Apr 18 11:10:40 2003
@@ -45,7 +45,6 @@
 
 struct dvb_adapter {
 	int num;
-	devfs_handle_t devfs_handle;
 	struct list_head list_head;
 	struct list_head device_list;
 	const char *name;
@@ -55,7 +54,6 @@
 struct dvb_device {
 	struct list_head list_head;
 	struct file_operations *fops;
-	devfs_handle_t devfs_handle;
 	struct dvb_adapter *adapter;
 	int type;
 	u32 id;
diff -Nru a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
--- a/drivers/media/video/adv7175.c	Mon Mar 31 07:18:58 2003
+++ b/drivers/media/video/adv7175.c	Thu Apr 24 05:25:35 2003
@@ -39,7 +39,6 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 
 #include <linux/videodev.h>
 #include <linux/version.h>
@@ -164,7 +163,8 @@
 {
 	struct adv7175 *encoder;
 	struct	i2c_client	*client;
-	int rv, i, x_common=39; /* x is number entries init_common - 1 */
+	int rv = 0;
+	int i, x_common=39; /* x is number entries init_common - 1 */
 
 	printk(KERN_INFO "adv717x: video chip found.\n");
 	client=kmalloc(sizeof(*client), GFP_KERNEL);
diff -Nru a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c
--- a/drivers/media/video/bt856.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/bt856.c	Thu Apr 24 03:35:13 2003
@@ -41,7 +41,6 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 
 #include <linux/videodev.h>
 #include <linux/version.h>
diff -Nru a/drivers/media/video/bttv-vbi.c b/drivers/media/video/bttv-vbi.c
--- a/drivers/media/video/bttv-vbi.c	Wed Jan  8 01:59:58 2003
+++ b/drivers/media/video/bttv-vbi.c	Thu Apr 24 05:25:28 2003
@@ -62,7 +62,8 @@
 	return 0;
 }
 
-static int vbi_buffer_setup(struct file *file, int *count, int *size)
+static int vbi_buffer_setup(struct file *file,
+			unsigned int *count, unsigned int *size)
 {
 	struct bttv_fh *fh = file->private_data;
 	struct bttv *btv = fh->btv;
diff -Nru a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
--- a/drivers/media/video/cpia.c	Thu Mar  6 15:46:22 2003
+++ b/drivers/media/video/cpia.c	Thu Apr 24 03:35:15 2003
@@ -39,7 +39,6 @@
 #include <linux/pagemap.h>
 #include <asm/io.h>
 #include <asm/semaphore.h>
-#include <linux/wrapper.h>
 
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
@@ -234,7 +233,7 @@
 	memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 	adr = (unsigned long) mem;
 	while (size > 0) {
-		mem_map_reserve(vmalloc_to_page((void *)adr));
+		SetPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
@@ -251,7 +250,7 @@
 
 	adr = (unsigned long) mem;
 	while ((long) size > 0) {
-		mem_map_unreserve(vmalloc_to_page((void *)adr));
+		ClearPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
diff -Nru a/drivers/media/video/meye.c b/drivers/media/video/meye.c
--- a/drivers/media/video/meye.c	Tue Feb 18 03:30:43 2003
+++ b/drivers/media/video/meye.c	Thu Apr 24 03:35:17 2003
@@ -35,7 +35,6 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <linux/delay.h>
-#include <linux/wrapper.h>
 #include <linux/interrupt.h>
 #include <linux/vmalloc.h>
 
@@ -139,7 +138,7 @@
 		memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 	        adr = (unsigned long)mem;
 		while (size > 0) {
-			mem_map_reserve(vmalloc_to_page((void *)adr));
+			SetPageReserved(vmalloc_to_page((void *)adr));
 			adr += PAGE_SIZE;
 			size -= PAGE_SIZE;
 		}
@@ -153,7 +152,7 @@
 	if (mem) {
 	        adr = (unsigned long) mem;
 		while ((long) size > 0) {
-			mem_map_unreserve(vmalloc_to_page((void *)adr));
+			ClearPageReserved(vmalloc_to_page((void *)adr));
 			adr += PAGE_SIZE;
 			size -= PAGE_SIZE;
 		}
diff -Nru a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
--- a/drivers/media/video/msp3400.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/msp3400.c	Thu Apr 24 04:11:51 2003
@@ -1208,8 +1208,7 @@
 
 /* ----------------------------------------------------------------------- */
 
-static int msp_attach(struct i2c_adapter *adap, int addr,
-		      unsigned short flags, int kind);
+static int msp_attach(struct i2c_adapter *adap, int addr, int kind);
 static int msp_detach(struct i2c_client *client);
 static int msp_probe(struct i2c_adapter *adap);
 static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
@@ -1233,8 +1232,7 @@
 	},
 };
 
-static int msp_attach(struct i2c_adapter *adap, int addr,
-		      unsigned short flags, int kind)
+static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	DECLARE_MUTEX_LOCKED(sem);
 	struct msp3400c *msp;
diff -Nru a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
--- a/drivers/media/video/mxb.c	Mon Apr  7 13:17:33 2003
+++ b/drivers/media/video/mxb.c	Thu Apr 24 10:34:20 2003
@@ -177,6 +177,9 @@
 	int	cur_mute;	/* current mute status */
 };
 
+static
+struct saa7146_extension extension;
+
 static int mxb_vbi_bypass(struct saa7146_dev* dev)
 {
 	struct mxb* mxb = (struct mxb*)dev->ext_priv;
@@ -269,6 +272,95 @@
 	return 0;
 }
 
+/* some init data for the saa7740, the so-called 'sound arena module'. 
+   there are no specs available, so we simply use some init values */
+static struct {
+	int	length;
+	char	data[9];
+} mxb_saa7740_init[] = {
+	{ 3, { 0x80, 0x00, 0x00 } },{ 3, { 0x80, 0x89, 0x00 } },
+	{ 3, { 0x80, 0xb0, 0x0a } },{ 3, { 0x00, 0x00, 0x00 } },
+	{ 3, { 0x49, 0x00, 0x00 } },{ 3, { 0x4a, 0x00, 0x00 } },
+	{ 3, { 0x4b, 0x00, 0x00 } },{ 3, { 0x4c, 0x00, 0x00 } },
+	{ 3, { 0x4d, 0x00, 0x00 } },{ 3, { 0x4e, 0x00, 0x00 } },
+	{ 3, { 0x4f, 0x00, 0x00 } },{ 3, { 0x50, 0x00, 0x00 } },
+	{ 3, { 0x51, 0x00, 0x00 } },{ 3, { 0x52, 0x00, 0x00 } },
+	{ 3, { 0x53, 0x00, 0x00 } },{ 3, { 0x54, 0x00, 0x00 } },
+	{ 3, { 0x55, 0x00, 0x00 } },{ 3, { 0x56, 0x00, 0x00 } },
+	{ 3, { 0x57, 0x00, 0x00 } },{ 3, { 0x58, 0x00, 0x00 } },
+	{ 3, { 0x59, 0x00, 0x00 } },{ 3, { 0x5a, 0x00, 0x00 } },
+	{ 3, { 0x5b, 0x00, 0x00 } },{ 3, { 0x5c, 0x00, 0x00 } },
+	{ 3, { 0x5d, 0x00, 0x00 } },{ 3, { 0x5e, 0x00, 0x00 } },
+	{ 3, { 0x5f, 0x00, 0x00 } },{ 3, { 0x60, 0x00, 0x00 } },
+	{ 3, { 0x61, 0x00, 0x00 } },{ 3, { 0x62, 0x00, 0x00 } },
+	{ 3, { 0x63, 0x00, 0x00 } },{ 3, { 0x64, 0x00, 0x00 } },
+	{ 3, { 0x65, 0x00, 0x00 } },{ 3, { 0x66, 0x00, 0x00 } },
+	{ 3, { 0x67, 0x00, 0x00 } },{ 3, { 0x68, 0x00, 0x00 } },
+	{ 3, { 0x69, 0x00, 0x00 } },{ 3, { 0x6a, 0x00, 0x00 } },
+	{ 3, { 0x6b, 0x00, 0x00 } },{ 3, { 0x6c, 0x00, 0x00 } },
+	{ 3, { 0x6d, 0x00, 0x00 } },{ 3, { 0x6e, 0x00, 0x00 } },
+	{ 3, { 0x6f, 0x00, 0x00 } },{ 3, { 0x70, 0x00, 0x00 } },
+	{ 3, { 0x71, 0x00, 0x00 } },{ 3, { 0x72, 0x00, 0x00 } },
+	{ 3, { 0x73, 0x00, 0x00 } },{ 3, { 0x74, 0x00, 0x00 } },
+	{ 3, { 0x75, 0x00, 0x00 } },{ 3, { 0x76, 0x00, 0x00 } },
+	{ 3, { 0x77, 0x00, 0x00 } },{ 3, { 0x41, 0x00, 0x42 } },
+	{ 3, { 0x42, 0x10, 0x42 } },{ 3, { 0x43, 0x20, 0x42 } },
+	{ 3, { 0x44, 0x30, 0x42 } },{ 3, { 0x45, 0x00, 0x01 } },
+	{ 3, { 0x46, 0x00, 0x01 } },{ 3, { 0x47, 0x00, 0x01 } },
+	{ 3, { 0x48, 0x00, 0x01 } },
+	{ 9, { 0x01, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } },
+	{ 9, { 0x21, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } },
+	{ 9, { 0x09, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } },
+	{ 9, { 0x29, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } },
+	{ 9, { 0x11, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } },
+	{ 9, { 0x31, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } },
+	{ 9, { 0x19, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } },
+	{ 9, { 0x39, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } },
+	{ 9, { 0x05, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } },
+	{ 9, { 0x25, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } },
+	{ 9, { 0x0d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } },
+	{ 9, { 0x2d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } },
+	{ 9, { 0x15, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } },
+	{ 9, { 0x35, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } },
+	{ 9, { 0x1d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } },
+	{ 9, { 0x3d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } },
+	{ 3, { 0x80, 0xb3, 0x0a } },
+	{-1, { 0} }
+};
+
+static unsigned char mxb_saa7111_init[25] = {
+	0x00,
+	
+	0x00,	  /* 00 - ID byte */
+	0x00,	  /* 01 - reserved */
+
+	/*front end */
+	0xd8,	  /* 02 - FUSE=x, GUDL=x, MODE=x */
+	0x23,	  /* 03 - HLNRS=0, VBSL=1, WPOFF=0, HOLDG=0, GAFIX=0, GAI1=256, GAI2=256 */
+	0x00,	  /* 04 - GAI1=256 */
+	0x00,	  /* 05 - GAI2=256 */
+
+	/* decoder */
+	0xf0,	  /* 06 - HSB at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
+	0x30,	  /* 07 - HSS at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
+	0xa8,	  /* 08 - AUFD=x, FSEL=x, EXFIL=x, VTRC=x, HPLL=x, VNOI=x */
+	0x02,	  /* 09 - BYPS=x, PREF=x, BPSS=x, VBLB=x, UPTCV=x, APER=x */
+	0x80,	  /* 0a - BRIG=128 */
+	0x47,	  /* 0b - CONT=1.109 */
+	0x40,	  /* 0c - SATN=1.0 */
+	0x00,	  /* 0d - HUE=0 */
+	0x01,	  /* 0e - CDTO=0, CSTD=0, DCCF=0, FCTC=0, CHBW=1 */
+	0x00,	  /* 0f - reserved */
+	0xd0,	  /* 10 - OFTS=x, HDEL=x, VRLN=x, YDEL=x */
+	0x8c,	  /* 11 - GPSW=x, CM99=x, FECO=x, COMPO=x, OEYC=1, OEHV=1, VIPB=0, COLO=0 */
+	0x80,	  /* 12 - xx output control 2 */
+	0x30,	  /* 13 - xx output control 3 */
+	0x00,	  /* 14 - reserved */
+	0x15,	  /* 15 - VBI */
+	0x04,	  /* 16 - VBI */
+	0x00,	  /* 17 - VBI */
+};
+
 /* bring hardware to a sane state. this has to be done, just in case someone
    wants to capture from this device before it has been properly initialized.
    the capture engine would badly fail, because no valid signal arrives on the
@@ -277,100 +369,13 @@
 {
 	struct mxb* mxb = (struct mxb*)dev->ext_priv;
 	
-	struct {
-		int	length;
-		char	data[9];
-	} saa7740_init[] = {
-		{ 3, { 0x80, 0x00, 0x00 } },{ 3, { 0x80, 0x89, 0x00 } },
-		{ 3, { 0x80, 0xb0, 0x0a } },{ 3, { 0x00, 0x00, 0x00 } },
-		{ 3, { 0x49, 0x00, 0x00 } },{ 3, { 0x4a, 0x00, 0x00 } },
-		{ 3, { 0x4b, 0x00, 0x00 } },{ 3, { 0x4c, 0x00, 0x00 } },
-		{ 3, { 0x4d, 0x00, 0x00 } },{ 3, { 0x4e, 0x00, 0x00 } },
-		{ 3, { 0x4f, 0x00, 0x00 } },{ 3, { 0x50, 0x00, 0x00 } },
-		{ 3, { 0x51, 0x00, 0x00 } },{ 3, { 0x52, 0x00, 0x00 } },
-		{ 3, { 0x53, 0x00, 0x00 } },{ 3, { 0x54, 0x00, 0x00 } },
-		{ 3, { 0x55, 0x00, 0x00 } },{ 3, { 0x56, 0x00, 0x00 } },
-		{ 3, { 0x57, 0x00, 0x00 } },{ 3, { 0x58, 0x00, 0x00 } },
-		{ 3, { 0x59, 0x00, 0x00 } },{ 3, { 0x5a, 0x00, 0x00 } },
-		{ 3, { 0x5b, 0x00, 0x00 } },{ 3, { 0x5c, 0x00, 0x00 } },
-		{ 3, { 0x5d, 0x00, 0x00 } },{ 3, { 0x5e, 0x00, 0x00 } },
-		{ 3, { 0x5f, 0x00, 0x00 } },{ 3, { 0x60, 0x00, 0x00 } },
-		{ 3, { 0x61, 0x00, 0x00 } },{ 3, { 0x62, 0x00, 0x00 } },
-		{ 3, { 0x63, 0x00, 0x00 } },{ 3, { 0x64, 0x00, 0x00 } },
-		{ 3, { 0x65, 0x00, 0x00 } },{ 3, { 0x66, 0x00, 0x00 } },
-		{ 3, { 0x67, 0x00, 0x00 } },{ 3, { 0x68, 0x00, 0x00 } },
-		{ 3, { 0x69, 0x00, 0x00 } },{ 3, { 0x6a, 0x00, 0x00 } },
-		{ 3, { 0x6b, 0x00, 0x00 } },{ 3, { 0x6c, 0x00, 0x00 } },
-		{ 3, { 0x6d, 0x00, 0x00 } },{ 3, { 0x6e, 0x00, 0x00 } },
-		{ 3, { 0x6f, 0x00, 0x00 } },{ 3, { 0x70, 0x00, 0x00 } },
-		{ 3, { 0x71, 0x00, 0x00 } },{ 3, { 0x72, 0x00, 0x00 } },
-		{ 3, { 0x73, 0x00, 0x00 } },{ 3, { 0x74, 0x00, 0x00 } },
-		{ 3, { 0x75, 0x00, 0x00 } },{ 3, { 0x76, 0x00, 0x00 } },
-		{ 3, { 0x77, 0x00, 0x00 } },{ 3, { 0x41, 0x00, 0x42 } },
-		{ 3, { 0x42, 0x10, 0x42 } },{ 3, { 0x43, 0x20, 0x42 } },
-		{ 3, { 0x44, 0x30, 0x42 } },{ 3, { 0x45, 0x00, 0x01 } },
-		{ 3, { 0x46, 0x00, 0x01 } },{ 3, { 0x47, 0x00, 0x01 } },
-		{ 3, { 0x48, 0x00, 0x01 } },
-		{ 9, { 0x01, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } },
-		{ 9, { 0x21, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } },
-		{ 9, { 0x09, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } },
-		{ 9, { 0x29, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } },
-		{ 9, { 0x11, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } },
-		{ 9, { 0x31, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } },
-		{ 9, { 0x19, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } },
-		{ 9, { 0x39, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } },
-		{ 9, { 0x05, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } },
-		{ 9, { 0x25, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } },
-		{ 9, { 0x0d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } },
-		{ 9, { 0x2d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } },
-		{ 9, { 0x15, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } },
-		{ 9, { 0x35, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } },
-		{ 9, { 0x1d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } },
-		{ 9, { 0x3d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } },
-		{ 3, { 0x80, 0xb3, 0x0a } },
-		{-1, { 0} }
-	};
-	
-	unsigned char init[25] = {
-		0x00,
-		
-		0x00,	  /* 00 - ID byte */
-		0x00,	  /* 01 - reserved */
-
-		/*front end */
-		0xd8,	  /* 02 - FUSE=x, GUDL=x, MODE=x */
-		0x23,	  /* 03 - HLNRS=0, VBSL=1, WPOFF=0, HOLDG=0, GAFIX=0, GAI1=256, GAI2=256 */
-		0x00,	  /* 04 - GAI1=256 */
-		0x00,	  /* 05 - GAI2=256 */
-
-		/* decoder */
-		0xf0,	  /* 06 - HSB at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
-		0x30,	  /* 07 - HSS at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
-		0xa8,	  /* 08 - AUFD=x, FSEL=x, EXFIL=x, VTRC=x, HPLL=x, VNOI=x */
-		0x02,	  /* 09 - BYPS=x, PREF=x, BPSS=x, VBLB=x, UPTCV=x, APER=x */
-		0x80,	  /* 0a - BRIG=128 */
-		0x47,	  /* 0b - CONT=1.109 */
-		0x40,	  /* 0c - SATN=1.0 */
-		0x00,	  /* 0d - HUE=0 */
-		0x01,	  /* 0e - CDTO=0, CSTD=0, DCCF=0, FCTC=0, CHBW=1 */
-		0x00,	  /* 0f - reserved */
-		0xd0,	  /* 10 - OFTS=x, HDEL=x, VRLN=x, YDEL=x */
-		0x8c,	  /* 11 - GPSW=x, CM99=x, FECO=x, COMPO=x, OEYC=1, OEHV=1, VIPB=0, COLO=0 */
-		0x80,	  /* 12 - xx output control 2 */
-		0x30,	  /* 13 - xx output control 3 */
-		0x00,	  /* 14 - reserved */
-		0x15,	  /* 15 - VBI */
-		0x04,	  /* 16 - VBI */
-		0x00,	  /* 17 - VBI */
-	};
-
 	struct i2c_msg msg;
 
 	int i = 0, err = 0;
 	struct	tea6415c_multiplex vm;	
 
 	/* write configuration to saa7111a */
-	i = i2c_master_send(mxb->saa7111a, init, sizeof(init));
+	i = i2c_master_send(mxb->saa7111a, mxb_saa7111_init, sizeof(mxb_saa7111_init));
 	if (i < 0) {
 		printk("failed to initialize saa7111a. this should never happen.\n");
 	}
@@ -420,16 +425,22 @@
 	   engineered. */
 	msg.addr = 0x1b;
 	msg.flags = 0;
-	msg.len = saa7740_init[0].length;
-	msg.buf = &saa7740_init[0].data[0];
+	msg.len = mxb_saa7740_init[0].length;
+	msg.buf = &mxb_saa7740_init[0].data[0];
 
 	if( 1 == (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) {
+		/* the sound arena module is a pos, that's probably the reason
+		   philips refuses to hand out a datasheet for the saa7740...
+		   it seems to screw up the i2c bus, so we disable fast irq
+		   based i2c transactions here and rely on the slow and safe
+		   polling method ... */
+		extension.flags &= ~SAA7146_USE_I2C_IRQ;
 		for(i = 1;;i++) {
-			msg.len = saa7740_init[i].length;		
-			if( -1 == msg.len ) {
+			msg.len = mxb_saa7740_init[i].length;		
+			if (msg.len == -1U) {
 				break;
 			}
-			msg.buf = &saa7740_init[i].data[0];
+			msg.buf = &mxb_saa7740_init[i].data[0];
 			if( 1 != (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) {
 				DEB_D(("failed to initialize 'sound arena module'.\n"));
 				goto err;
@@ -1003,9 +1014,6 @@
 };
 
 static
-struct saa7146_extension extension;
-
-static
 struct saa7146_pci_extension_data mxb = {
         .ext_priv = "Multimedia eXtension Board",
         .ext = &extension,
@@ -1023,6 +1031,8 @@
 		.vendor	= 0,
 	}
 };
+
+MODULE_DEVICE_TABLE(pci, pci_tbl);
 
 static
 struct saa7146_ext_vv vv_data = {
diff -Nru a/drivers/media/video/planb.c b/drivers/media/video/planb.c
--- a/drivers/media/video/planb.c	Sun Feb 16 16:16:53 2003
+++ b/drivers/media/video/planb.c	Thu Apr 24 03:35:19 2003
@@ -40,7 +40,6 @@
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
-#include <linux/wrapper.h>
 #include <linux/videodev.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -146,12 +145,12 @@
 								|GFP_DMA, 0);
 		if (!pb->rawbuf[i])
 			break;
-		mem_map_reserve(virt_to_page(pb->rawbuf[i]));
+		SetPageReserved(virt_to_page(pb->rawbuf[i]));
 	}
 	if (i-- < npage) {
 		printk(KERN_DEBUG "PlanB: init_grab: grab buffer not allocated\n");
 		for (; i > 0; i--) {
-			mem_map_unreserve(virt_to_page(pb->rawbuf[i]));
+			ClearPageReserved(virt_to_page(pb->rawbuf[i]));
 			free_pages((unsigned long)pb->rawbuf[i], 0);
 		}
 		kfree(pb->rawbuf);
@@ -412,7 +411,7 @@
 	}
 	if(pb->rawbuf) {
 		for (i = 0; i < pb->rawbuf_size; i++) {
-			mem_map_unreserve(virt_to_page(pb->rawbuf[i]));
+			ClearPageReserved(virt_to_page(pb->rawbuf[i]));
 			free_pages((unsigned long)pb->rawbuf[i], 0);
 		}
 		kfree(pb->rawbuf);
diff -Nru a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
--- a/drivers/media/video/saa5249.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/saa5249.c	Thu Apr 24 04:11:51 2003
@@ -149,7 +149,7 @@
 
 static struct i2c_client client_template;
 
-static int saa5249_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind)		
+static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	int pgbuf;
 	int err;
diff -Nru a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c
--- a/drivers/media/video/saa7111.c	Mon Apr  7 13:30:09 2003
+++ b/drivers/media/video/saa7111.c	Thu Apr 24 04:11:51 2003
@@ -66,7 +66,7 @@
 
 /* ----------------------------------------------------------------------- */
 
-static int saa7111_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind)
+static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	int i;
 	struct saa7111 *decoder;
diff -Nru a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
--- a/drivers/media/video/saa7134/saa7134-core.c	Wed Mar 12 06:07:06 2003
+++ b/drivers/media/video/saa7134/saa7134-core.c	Thu Apr 24 05:18:50 2003
@@ -532,7 +532,7 @@
 	printk("\n");
 }
 
-static void saa7134_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct saa7134_dev *dev = (struct saa7134_dev*) dev_id;
 	unsigned long report,status;
@@ -546,7 +546,7 @@
 			if (irq_debug > 1)
 				printk(KERN_DEBUG "%s/irq: no (more) work\n",
 				       dev->name);
-			return;
+			goto out;
 		}
 		if (irq_debug)
 			print_irqstatus(dev,loop,report,status);
@@ -582,6 +582,8 @@
 		saa_writel(SAA7134_IRQ1,0);
 		saa_writel(SAA7134_IRQ2,0);
 	}
+out:
+	return IRQ_HANDLED;
 }
 
 /* ------------------------------------------------------------------ */
diff -Nru a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
--- a/drivers/media/video/saa7134/saa7134-ts.c	Thu Mar 13 16:52:15 2003
+++ b/drivers/media/video/saa7134/saa7134-ts.c	Thu Apr 24 05:25:35 2003
@@ -127,7 +127,7 @@
 }
 
 static int
-buffer_setup(struct file *file, int *count, int *size)
+buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
 {
 	*size = TS_PACKET_SIZE * TS_NR_PACKETS;
 	if (0 == *count)
diff -Nru a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
--- a/drivers/media/video/saa7134/saa7134-video.c	Tue Mar 18 09:00:14 2003
+++ b/drivers/media/video/saa7134/saa7134-video.c	Thu Apr 24 05:25:35 2003
@@ -882,7 +882,7 @@
 }
 
 static int
-buffer_setup(struct file *file, int *count, int *size)
+buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
 {
 	struct saa7134_fh *fh = file->private_data;
 
diff -Nru a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c
--- a/drivers/media/video/saa7185.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/saa7185.c	Thu Apr 24 03:35:21 2003
@@ -37,7 +37,6 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 
 #include <linux/videodev.h>
 #include <linux/version.h>
diff -Nru a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
--- a/drivers/media/video/stradis.c	Thu Jan 16 16:55:35 2003
+++ b/drivers/media/video/stradis.c	Thu Apr 24 03:35:23 2003
@@ -39,7 +39,6 @@
 #include <linux/sched.h>
 #include <asm/types.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 #include <linux/interrupt.h>
 #include <asm/uaccess.h>
 #include <linux/vmalloc.h>
@@ -442,11 +441,12 @@
 	}
 }
 
-static void saa7146_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t saa7146_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct saa7146 *saa = (struct saa7146 *) dev_id;
 	u32 stat, astat;
 	int count;
+	int handled = 0;
 
 	count = 0;
 	while (1) {
@@ -454,7 +454,8 @@
 		stat = saaread(SAA7146_ISR);
 		astat = stat & saaread(SAA7146_IER);
 		if (!astat)
-			return;
+			break;
+		handled = 1;
 		saawrite(astat, SAA7146_ISR);
 		if (astat & SAA7146_PSR_DEBI_S) {
 			do_irq_send_data(saa);
@@ -611,6 +612,7 @@
 			       "stradis%d: IRQ loop cleared\n", saa->nr);
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 static int ibm_send_command(struct saa7146 *saa,
diff -Nru a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c
--- a/drivers/media/video/tda7432.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/tda7432.c	Thu Apr 24 04:11:51 2003
@@ -312,8 +312,7 @@
  * i2c interface functions *
  * *********************** */
 
-static int tda7432_attach(struct i2c_adapter *adap, int addr,
-			  unsigned short flags, int kind)
+static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	struct tda7432 *t;
 	struct i2c_client *client;
diff -Nru a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
--- a/drivers/media/video/tda9840.c	Mon Apr  7 13:31:46 2003
+++ b/drivers/media/video/tda9840.c	Thu Apr 24 04:11:51 2003
@@ -178,7 +178,7 @@
 	return 0;
 }
 
-static int tda9840_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind)
+static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind)
 {
 	struct	i2c_client *client;
 	int result = 0;
diff -Nru a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c
--- a/drivers/media/video/tda9875.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/tda9875.c	Thu Apr 24 04:11:51 2003
@@ -240,8 +240,7 @@
 	return(0);
 }
 
-static int tda9875_attach(struct i2c_adapter *adap, int addr,
-			  unsigned short flags, int kind)
+static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	struct tda9875 *t;
 	struct i2c_client *client;
diff -Nru a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
--- a/drivers/media/video/tda9887.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/tda9887.c	Thu Apr 24 04:11:51 2003
@@ -345,8 +345,7 @@
 
 /* ---------------------------------------------------------------------- */
 
-static int tda9887_attach(struct i2c_adapter *adap, int addr,
-			  unsigned short flags, int kind)
+static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	struct tda9887 *t;
 
diff -Nru a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
--- a/drivers/media/video/tea6415c.c	Mon Apr  7 13:32:33 2003
+++ b/drivers/media/video/tea6415c.c	Thu Apr 24 04:11:51 2003
@@ -55,7 +55,7 @@
 static int tea6415c_id = 0;
 
 /* this function is called by i2c_probe */
-static int tea6415c_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind)
+static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind)
 {
 	struct	i2c_client *client = 0;
 	int err = 0;
diff -Nru a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
--- a/drivers/media/video/tea6420.c	Mon Apr  7 13:39:26 2003
+++ b/drivers/media/video/tea6420.c	Thu Apr 24 04:11:51 2003
@@ -95,7 +95,7 @@
 }
 
 /* this function is called by i2c_probe */
-static int tea6420_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind)
+static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
 {
 	struct	i2c_client *client;
 	int err = 0, i = 0;
diff -Nru a/drivers/media/video/tuner-3036.c b/drivers/media/video/tuner-3036.c
--- a/drivers/media/video/tuner-3036.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/tuner-3036.c	Thu Apr 24 04:11:51 2003
@@ -114,8 +114,7 @@
 /* ---------------------------------------------------------------------- */
 
 static int 
-tuner_attach(struct i2c_adapter *adap, int addr,
-	     unsigned short flags, int kind)
+tuner_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	static unsigned char buffer[] = { 0x29, 0x32, 0x2a, 0, 0x2b, 0 };
 
diff -Nru a/drivers/media/video/tuner.c b/drivers/media/video/tuner.c
--- a/drivers/media/video/tuner.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/tuner.c	Thu Apr 24 04:11:51 2003
@@ -776,8 +776,7 @@
 
 /* ---------------------------------------------------------------------- */
 
-static int tuner_attach(struct i2c_adapter *adap, int addr,
-			unsigned short flags, int kind)
+static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	struct tuner *t;
 	struct i2c_client *client;
diff -Nru a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
--- a/drivers/media/video/tvaudio.c	Sat Mar 22 23:17:51 2003
+++ b/drivers/media/video/tvaudio.c	Thu Apr 24 04:11:51 2003
@@ -1326,8 +1326,7 @@
 /* ---------------------------------------------------------------------- */
 /* i2c registration                                                       */
 
-static int chip_attach(struct i2c_adapter *adap, int addr,
-		       unsigned short flags, int kind)
+static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
 {
 	struct CHIPSTATE *chip;
 	struct CHIPDESC  *desc;
diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
--- a/drivers/media/video/videodev.c	Thu Dec  5 18:56:38 2002
+++ b/drivers/media/video/videodev.c	Sun Apr 20 16:21:18 2003
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/kmod.h>
 #include <linux/slab.h>
+#include <linux/devfs_fs_kernel.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/semaphore.h>
@@ -375,7 +376,6 @@
 	int base;
 	int end;
 	char *name_base;
-	char name[16];
 	
 	switch(type)
 	{
@@ -426,19 +426,19 @@
 	vfd->minor=i;
 	up(&videodev_lock);
 
-	sprintf (name, "v4l/%s%d", name_base, i - base);
-	vfd->devfs_handle =
-		devfs_register (NULL, name, DEVFS_FL_DEFAULT,
-				VIDEO_MAJOR, vfd->minor,
-				S_IFCHR | S_IRUSR | S_IWUSR,
-				&video_fops,
-				NULL);
+	sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base);
+	devfs_register(NULL, vfd->devfs_name, 0, VIDEO_MAJOR, vfd->minor,
+			S_IFCHR | S_IRUSR | S_IWUSR, &video_fops, NULL);
 	init_MUTEX(&vfd->lock);
 	
 #ifdef CONFIG_VIDEO_PROC_FS
-	sprintf (name, "%s%d", name_base, i - base);
-	videodev_proc_create_dev (vfd, name);
+{
+	char name[16];
+	sprintf(name, "%s%d", name_base, i - base);
+	videodev_proc_create_dev(vfd, name);
+}
 #endif
+
 	return 0;
 }
 
@@ -460,7 +460,7 @@
 	videodev_proc_destroy_dev (vfd);
 #endif
 
-	devfs_unregister (vfd->devfs_handle);
+	devfs_remove(vfd->devfs_name);
 	video_device[vfd->minor]=NULL;
 	up(&videodev_lock);
 }
diff -Nru a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
--- a/drivers/media/video/w9966.c	Thu Mar  6 13:58:28 2003
+++ b/drivers/media/video/w9966.c	Thu Apr 24 05:25:35 2003
@@ -157,7 +157,9 @@
 
 static int w9966_rReg(struct w9966_dev* cam, int reg);
 static int w9966_wReg(struct w9966_dev* cam, int reg, int data);
+#if 0
 static int w9966_rReg_i2c(struct w9966_dev* cam, int reg);
+#endif
 static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data);
 static int w9966_findlen(int near, int size, int maxlen);
 static int w9966_calcscale(int size, int min, int max, int* beg, int* end, unsigned char* factor);
@@ -171,7 +173,9 @@
 static inline int  w9966_i2c_getsda(struct w9966_dev* cam);
 static inline int  w9966_i2c_getscl(struct w9966_dev* cam);
 static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
+#if 0
 static int w9966_i2c_rbyte(struct w9966_dev* cam);
+#endif
 
 static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
 			   unsigned int cmd, unsigned long arg);
@@ -555,7 +559,8 @@
 // Expects a claimed pdev. -1 on error
 static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state)
 {
-	int timeout;
+	unsigned long timeout;
+
 	if (state)
 		cam->i2c_state |= W9966_I2C_W_CLOCK;
 	else
@@ -616,6 +621,7 @@
 
 // Read a data byte with ack from the i2c-bus
 // Expects a claimed pdev. -1 on error
+#if 0
 static int w9966_i2c_rbyte(struct w9966_dev* cam)
 {
 	unsigned char data = 0x00;
@@ -635,9 +641,11 @@
 	}
 	return data;
 }
+#endif
 
 // Read a register from the i2c device.
 // Expects claimed pdev. -1 on error
+#if 0
 static int w9966_rReg_i2c(struct w9966_dev* cam, int reg)
 {
 	int data;
@@ -671,6 +679,7 @@
 	
 	return data;
 }
+#endif
 
 // Write a register to the i2c device.
 // Expects claimed pdev. -1 on error
diff -Nru a/drivers/media/video/zr36067.c b/drivers/media/video/zr36067.c
--- a/drivers/media/video/zr36067.c	Tue Feb 25 10:27:30 2003
+++ b/drivers/media/video/zr36067.c	Thu Apr 24 05:18:50 2003
@@ -59,12 +59,10 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 
 #include <linux/spinlock.h>
 #include <linux/vmalloc.h>
 #include <linux/i2c-old.h>
-#define     MAP_NR(x)       virt_to_page(x)
 #define     ZORAN_HARDWARE  VID_HARDWARE_ZR36067
 
 #include <linux/videodev.h>
@@ -303,7 +301,7 @@
 			zr->v4l_gbuf[i].fbuffer_phys = virt_to_phys(mem);
 			zr->v4l_gbuf[i].fbuffer_bus = virt_to_bus(mem);
 			for (off = 0; off < v4l_bufsize; off += PAGE_SIZE)
-				mem_map_reserve(MAP_NR(mem + off));
+				SetPageReserved(virt_to_page(mem + off));
 			DEBUG1(printk
 			       (KERN_INFO
 				"%s: V4L frame %d mem 0x%lx (bus: 0x%lx)\n",
@@ -366,7 +364,7 @@
 		if (v4l_bufsize <= MAX_KMALLOC_MEM) {
 			mem = zr->v4l_gbuf[i].fbuffer;
 			for (off = 0; off < v4l_bufsize; off += PAGE_SIZE)
-				mem_map_unreserve(MAP_NR(mem + off));
+				ClearPageReserved(virt_to_page(mem + off));
 			kfree((void *) zr->v4l_gbuf[i].fbuffer);
 		}
 #if defined(CONFIG_BIGPHYS_AREA)
@@ -445,7 +443,7 @@
 			zr->jpg_gbuf[i].frag_tab[1] =
 			    ((zr->jpg_bufsize / 4) << 1) | 1;
 			for (off = 0; off < zr->jpg_bufsize; off += PAGE_SIZE)
-				mem_map_reserve(MAP_NR(mem + off));
+				SetPageReserved(virt_to_page(mem + off));
 		} else {
 			/* jpg_bufsize is allreay page aligned */
 			for (j = 0; j < zr->jpg_bufsize / PAGE_SIZE; j++) 
@@ -463,7 +461,7 @@
 				    virt_to_bus((void *) mem);
 				zr->jpg_gbuf[i].frag_tab[2 * j + 1] =
 				    (PAGE_SIZE / 4) << 1;
-				mem_map_reserve(MAP_NR(mem));
+				SetPageReserved(virt_to_page(mem));
 			}
 
 			zr->jpg_gbuf[i].frag_tab[2 * j - 1] |= 1;
@@ -503,7 +501,7 @@
 								  [0]);
 				for (off = 0; off < zr->jpg_bufsize;
 				     off += PAGE_SIZE)
-					mem_map_unreserve(MAP_NR
+					ClearPageReserved(virt_to_page
 							  (mem + off));
 				kfree((void *) mem);
 				zr->jpg_gbuf[i].frag_tab[0] = 0;
@@ -513,7 +511,7 @@
 			for (j = 0; j < zr->jpg_bufsize / PAGE_SIZE; j++) {
 				if (!zr->jpg_gbuf[i].frag_tab[2 * j])
 					break;
-				mem_map_unreserve(MAP_NR
+				ClearPageReserved(virt_to_page
 						  (bus_to_virt
 						   (zr->jpg_gbuf[i].
 						    frag_tab[2 * j])));
@@ -2782,12 +2780,13 @@
 	}
 }
 
-static void zoran_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t zoran_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	u32 stat, astat;
 	int count;
 	struct zoran *zr;
 	unsigned long flags;
+	int handled = 0;
 
 	zr = (struct zoran *) dev_id;
 	count = 0;
@@ -2806,7 +2805,7 @@
 		}
 		zr->last_isr = stat;
 		spin_unlock_irqrestore(&zr->lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	spin_lock_irqsave(&zr->lock, flags);
@@ -2817,6 +2816,7 @@
 		if (!astat) {
 			break;
 		}
+		handled = 1;
 		if (astat & cardvsync[zr->card]) {	// SW
 
 			if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS
@@ -3010,6 +3010,7 @@
 		zr->last_isr = stat;
 	}
 	spin_unlock_irqrestore(&zr->lock, flags);
+	return IRQ_RETVAL(handled);
 }
 
 /* Check a zoran_params struct for correctness, insert default params */
diff -Nru a/drivers/media/video/zr36120_mem.c b/drivers/media/video/zr36120_mem.c
--- a/drivers/media/video/zr36120_mem.c	Mon Feb  4 23:49:26 2002
+++ b/drivers/media/video/zr36120_mem.c	Thu Apr 24 03:35:27 2003
@@ -21,7 +21,6 @@
 #include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
-#include <linux/wrapper.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <asm/io.h>
@@ -51,7 +50,7 @@
 	if (mem) {
 		unsigned long adr = (unsigned long)mem;
 		while (size > 0) {
-			mem_map_reserve(virt_to_page(phys_to_virt(adr)));
+			SetPageReserved(virt_to_page(phys_to_virt(adr)));
 			adr += PAGE_SIZE;
 			size -= PAGE_SIZE;
 		}
@@ -65,7 +64,7 @@
 		unsigned long adr = (unsigned long)mem;
 		unsigned long siz = size;
 		while (siz > 0) {
-			mem_map_unreserve(virt_to_page(phys_to_virt(adr)));
+			ClearPageReserved(virt_to_page(phys_to_virt(adr)));
 			adr += PAGE_SIZE;
 			siz -= PAGE_SIZE;
 		}
diff -Nru a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
--- a/drivers/message/fusion/mptbase.c	Fri Feb 21 06:26:38 2003
+++ b/drivers/message/fusion/mptbase.c	Sun Apr 20 23:54:11 2003
@@ -179,7 +179,7 @@
 /*
  *  Forward protos...
  */
-static void	mpt_interrupt(int irq, void *bus_id, struct pt_regs *r);
+static irqreturn_t mpt_interrupt(int irq, void *bus_id, struct pt_regs *r);
 static int	mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply);
 
 static int	mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag);
@@ -312,7 +312,7 @@
  *	dispatches (calls) a protocol-specific callback routine to handle
  *	the protocol-specific details of the MPT request completion.
  */
-static void
+static irqreturn_t
 mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
 {
 	MPT_ADAPTER	*ioc;
@@ -338,7 +338,7 @@
 
 		if (!iocCmp) {
 			printk(KERN_WARNING "mpt_interrupt: Invalid ioc!\n");
-			return;
+			return IRQ_NONE;
 		}
 	}
 
@@ -353,7 +353,7 @@
 	while (1) {
 
 		if ((pa = CHIPREG_READ32(&ioc->chip->ReplyFifo)) == 0xFFFFFFFF)
-			return;
+			return IRQ_HANDLED;
 
 		cb_idx = 0;
 		freeme = 0;
@@ -501,10 +501,12 @@
 			dirqprintk((MYIOC_s_INFO_FMT "ISR processed %d replies.",
 					ioc->name, count));
 			dirqprintk((" Giving this ISR a break!\n"));
-			return;
+			return IRQ_HANDLED;
 		}
 
 	}	/* drain reply FIFO */
+
+	return IRQ_HANDLED;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
diff -Nru a/drivers/message/i2o/i2o_core.c b/drivers/message/i2o/i2o_core.c
--- a/drivers/message/i2o/i2o_core.c	Thu Mar 13 12:42:11 2003
+++ b/drivers/message/i2o/i2o_core.c	Thu Apr 24 05:17:30 2003
@@ -3463,10 +3463,11 @@
  *	to be rather simple. We keep the controller pointer in the cookie.
  */
  
-static void i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r)
+static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r)
 {
 	struct i2o_controller *c = dev_id;
 	i2o_run_queue(c);
+	return IRQ_HANDLED;
 }	
 
 /**
diff -Nru a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c
--- a/drivers/mtd/chips/sharp.c	Wed Feb 26 05:28:28 2003
+++ b/drivers/mtd/chips/sharp.c	Thu Apr 24 05:25:35 2003
@@ -431,7 +431,7 @@
 	unsigned long adr)
 {
 	int ret;
-	int timeo;
+	unsigned long timeo;
 	int status;
 	DECLARE_WAITQUEUE(wait, current);
 
diff -Nru a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
--- a/drivers/mtd/mtdblock.c	Tue Apr  8 12:33:09 2003
+++ b/drivers/mtd/mtdblock.c	Sun Apr 20 16:21:18 2003
@@ -19,7 +19,6 @@
 #define MAJOR_NR MTD_BLOCK_MAJOR
 #define DEVICE_NAME "mtdblock"
 #define DEVICE_NR(device) (device)
-#define LOCAL_END_REQUEST
 #include <linux/blk.h>
 #include <linux/devfs_fs_kernel.h>
 
@@ -528,25 +527,20 @@
         if (!mtd || mtd->type == MTD_ABSENT)
                 return;
 
-#ifdef CONFIG_DEVFS_FS
-        sprintf(name, DEVICE_NAME"/%d", mtd->index);
-        devfs_register(NULL, name, DEVFS_FL_DEFAULT,
-			MTD_BLOCK_MAJOR, mtd->index,
-                        S_IFBLK | S_IRUGO | S_IWUGO,
-                        &mtd_fops, NULL);
-#endif
-
 	disk = alloc_disk(1);
 	if (disk) {
 		disk->major = MAJOR_NR;
 		disk->first_minor = mtd->index;
 		disk->fops = &mtd_fops;
+
 		sprintf(disk->disk_name, "mtdblock%d", mtd->index);
+		sprintf(disk->devfs_name, "mtdblock/%d", mtd->index);
 
 		mtddisk[mtd->index] = disk;
 		set_capacity(disk, mtd->size / 512);
 		disk->private_data = &mtdblks[mtd->index];
 		disk->queue = &mtd_queue;
+
 		add_disk(disk);
 	}
 }
@@ -555,8 +549,6 @@
 {
         if (!mtd || mtd->type == MTD_ABSENT)
                 return;
-
-        devfs_remove(DEVICE_NAME"/%d", mtd->index);
 
         if (mtddisk[mtd->index]) {
 		del_gendisk(mtddisk[mtd->index]);
diff -Nru a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c
--- a/drivers/mtd/mtdblock_ro.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/mtd/mtdblock_ro.c	Sun Apr 20 16:21:18 2003
@@ -18,7 +18,6 @@
 #include <linux/buffer_head.h>
 #include <linux/genhd.h>
 
-#define LOCAL_END_REQUEST
 #define MAJOR_NR MTD_BLOCK_MAJOR
 #define DEVICE_NAME "mtdblock"
 #include <linux/blk.h>
diff -Nru a/drivers/net/3c501.c b/drivers/net/3c501.c
--- a/drivers/net/3c501.c	Thu Mar  6 15:14:17 2003
+++ b/drivers/net/3c501.c	Sun Apr 20 22:41:08 2003
@@ -510,7 +510,7 @@
  * TCP window.
  */
 
-static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct net_local *lp;
@@ -558,7 +558,7 @@
 			}
 			lp->loading=2;		/* Force a reload */
 			spin_unlock(&lp->lock);
-			return;
+			goto out;
 		}
 
 		if (el_debug > 6)
@@ -606,7 +606,7 @@
 			outb(AX_XMIT, AX_CMD);
 			lp->stats.collisions++;
 			spin_unlock(&lp->lock);
-			return;
+			goto out;
 		}
 		else
 		{
@@ -675,7 +675,8 @@
 	inb(RX_STATUS);		/* Be certain that interrupts are cleared. */
 	inb(TX_STATUS);
 	spin_unlock(&lp->lock);
-	return;
+out:
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/net/3c501.h b/drivers/net/3c501.h
--- a/drivers/net/3c501.h	Wed Oct  9 10:48:40 2002
+++ b/drivers/net/3c501.h	Sun Apr 20 22:41:08 2003
@@ -8,7 +8,7 @@
 static int  el_open(struct net_device *dev);
 static void el_timeout(struct net_device *dev);
 static int  el_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void el_receive(struct net_device *dev);
 static void el_reset(struct net_device *dev);
 static int  el1_close(struct net_device *dev);
diff -Nru a/drivers/net/3c505.c b/drivers/net/3c505.c
--- a/drivers/net/3c505.c	Tue Apr  8 07:47:08 2003
+++ b/drivers/net/3c505.c	Sun Apr 20 23:00:41 2003
@@ -259,7 +259,7 @@
 
 static inline int get_status(unsigned int base_addr)
 {
-	int timeout = jiffies + 10*HZ/100;
+	unsigned long timeout = jiffies + 10*HZ/100;
 	register int stat1;
 	do {
 		stat1 = inb_status(base_addr);
@@ -283,7 +283,7 @@
 
 inline static void adapter_reset(struct net_device *dev)
 {
-	int timeout;
+	unsigned long timeout;
 	elp_device *adapter = dev->priv;
 	unsigned char orig_hcr = adapter->hcr_val;
 
@@ -343,7 +343,7 @@
 /* Primitive functions used by send_pcb() */
 static inline unsigned int send_pcb_slow(unsigned int base_addr, unsigned char byte)
 {
-	unsigned int timeout;
+	unsigned long timeout;
 	outb_command(byte, base_addr);
 	for (timeout = jiffies + 5*HZ/100; time_before(jiffies, timeout);) {
 		if (inb_status(base_addr) & HCRE)
@@ -402,7 +402,7 @@
 static int send_pcb(struct net_device *dev, pcb_struct * pcb)
 {
 	int i;
-	int timeout;
+	unsigned long timeout;
 	elp_device *adapter = dev->priv;
 	unsigned long flags;
 
@@ -488,7 +488,7 @@
 	int i, j;
 	int total_length;
 	int stat;
-	int timeout;
+	unsigned long timeout;
 	unsigned long flags;
 
 	elp_device *adapter = dev->priv;
@@ -662,14 +662,14 @@
  *
  ******************************************************/
 
-static void elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
+static irqreturn_t elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
 {
 	int len;
 	int dlen;
 	int icount = 0;
 	struct net_device *dev;
 	elp_device *adapter;
-	int timeout;
+	unsigned long timeout;
 
 	dev = dev_id;
 	adapter = (elp_device *) dev->priv;
@@ -855,6 +855,7 @@
 	 * indicate no longer in interrupt routine
 	 */
 	spin_unlock(&adapter->lock);
+	return IRQ_HANDLED;
 }
 
 
@@ -947,7 +948,7 @@
 	if (!send_pcb(dev, &adapter->tx_pcb))
 		printk("%s: couldn't send memory configuration command\n", dev->name);
 	else {
-		int timeout = jiffies + TIMEOUT;
+		unsigned long timeout = jiffies + TIMEOUT;
 		while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && time_before(jiffies, timeout));
 		if (time_after_eq(jiffies, timeout))
 			TIMEOUT_MSG(__LINE__);
@@ -966,7 +967,7 @@
 	if (!send_pcb(dev, &adapter->tx_pcb))
 		printk("%s: couldn't send 82586 configure command\n", dev->name);
 	else {
-		int timeout = jiffies + TIMEOUT;
+		unsigned long timeout = jiffies + TIMEOUT;
 		while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout));
 		if (time_after_eq(jiffies, timeout))
 			TIMEOUT_MSG(__LINE__);
@@ -1150,7 +1151,7 @@
 	if (!send_pcb(dev, &adapter->tx_pcb))
 		printk("%s: couldn't send get statistics command\n", dev->name);
 	else {
-		int timeout = jiffies + TIMEOUT;
+		unsigned long timeout = jiffies + TIMEOUT;
 		while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && time_before(jiffies, timeout));
 		if (time_after_eq(jiffies, timeout)) {
 			TIMEOUT_MSG(__LINE__);
@@ -1317,7 +1318,7 @@
 		if (!send_pcb(dev, &adapter->tx_pcb))
 			printk("%s: couldn't send set_multicast command\n", dev->name);
 		else {
-			int timeout = jiffies + TIMEOUT;
+			unsigned long timeout = jiffies + TIMEOUT;
 			while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && time_before(jiffies, timeout));
 			if (time_after_eq(jiffies, timeout)) {
 				TIMEOUT_MSG(__LINE__);
@@ -1344,7 +1345,7 @@
 		printk("%s: couldn't send 82586 configure command\n", dev->name);
 	}
 	else {
-		int timeout = jiffies + TIMEOUT;
+		unsigned long timeout = jiffies + TIMEOUT;
 		spin_unlock_irqrestore(&adapter->lock, flags);
 		while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout));
 		if (time_after_eq(jiffies, timeout))
@@ -1396,10 +1397,8 @@
 
 static int __init elp_sense(struct net_device *dev)
 {
-	int timeout;
 	int addr = dev->base_addr;
 	const char *name = dev->name;
-	unsigned long flags;
 	byte orig_HSR;
 
 	if (!request_region(addr, ELP_IO_EXTENT, "3c505"))
@@ -1506,7 +1505,8 @@
 int __init elplus_probe(struct net_device *dev)
 {
 	elp_device *adapter;
-	int i, tries, tries1, timeout, okay;
+	int i, tries, tries1, okay;
+	unsigned long timeout;
 	unsigned long cookie = 0;
 
 	SET_MODULE_OWNER(dev);
diff -Nru a/drivers/net/3c505.h b/drivers/net/3c505.h
--- a/drivers/net/3c505.h	Tue Feb  5 09:40:01 2002
+++ b/drivers/net/3c505.h	Sun Apr 20 23:00:41 2003
@@ -279,7 +279,7 @@
 		unsigned int length;
 		struct sk_buff *skb;
 	        void *target;
-		long int start_time;
+		unsigned long start_time;
 	} current_dma;
 
 	/* flags */
diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c
--- a/drivers/net/3c507.c	Fri Jan 10 11:59:15 2003
+++ b/drivers/net/3c507.c	Sun Apr 20 22:41:08 2003
@@ -291,7 +291,7 @@
 static int	el16_probe1(struct net_device *dev, int ioaddr);
 static int	el16_open(struct net_device *dev);
 static int	el16_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void	el16_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void el16_rx(struct net_device *dev);
 static int	el16_close(struct net_device *dev);
 static struct net_device_stats *el16_get_stats(struct net_device *dev);
@@ -516,7 +516,7 @@
 
 /*	The typical workload of the driver:
 	Handle the network interface interrupts. */
-static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct net_local *lp;
@@ -526,7 +526,7 @@
 
 	if (dev == NULL) {
 		printk ("net_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	ioaddr = dev->base_addr;
@@ -616,6 +616,7 @@
 	/* Enable the 82586's interrupt input. */
 	outb(0x84, ioaddr + MISC_CTRL);
 	spin_unlock(&lp->lock);
+	return IRQ_HANDLED;
 }
 
 static int el16_close(struct net_device *dev)
diff -Nru a/drivers/net/3c509.c b/drivers/net/3c509.c
--- a/drivers/net/3c509.c	Wed Mar 19 15:35:44 2003
+++ b/drivers/net/3c509.c	Sun Apr 20 22:41:08 2003
@@ -192,7 +192,7 @@
 static ushort read_eeprom(int ioaddr, int index);
 static int el3_open(struct net_device *dev);
 static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void el3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void update_stats(struct net_device *dev);
 static struct net_device_stats *el3_get_stats(struct net_device *dev);
 static int el3_rx(struct net_device *dev);
@@ -882,7 +882,7 @@
 }
 
 /* The EL3 interrupt handler. */
-static void
+static irqreturn_t
 el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *)dev_id;
@@ -892,7 +892,7 @@
 
 	if (dev == NULL) {
 		printk ("el3_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	lp = (struct el3_private *)dev->priv;
@@ -967,7 +967,7 @@
 			   inw(ioaddr + EL3_STATUS));
 	}
 	spin_unlock(&lp->lock);
-	return;
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c
--- a/drivers/net/3c515.c	Tue Feb 25 11:50:51 2003
+++ b/drivers/net/3c515.c	Sun Apr 20 22:41:08 2003
@@ -1,4 +1,3 @@
-
 /*
 	Written 1997-1998 by Donald Becker.
 
@@ -387,7 +386,7 @@
 static int corkscrew_rx(struct net_device *dev);
 static void corkscrew_timeout(struct net_device *dev);
 static int boomerang_rx(struct net_device *dev);
-static void corkscrew_interrupt(int irq, void *dev_id,
+static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
 				    struct pt_regs *regs);
 static int corkscrew_close(struct net_device *dev);
 static void update_stats(int addr, struct net_device *dev);
@@ -1150,7 +1149,7 @@
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
 
-static void corkscrew_interrupt(int irq, void *dev_id,
+static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
 				    struct pt_regs *regs)
 {
 	/* Use the now-standard shared IRQ implementation. */
@@ -1289,6 +1288,7 @@
 
 	if (corkscrew_debug > 4)
 		printk("%s: exiting interrupt, status %4.4x.\n", dev->name, status);
+	return IRQ_HANDLED;
 }
 
 static int corkscrew_rx(struct net_device *dev)
diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c
--- a/drivers/net/3c59x.c	Tue Apr  8 04:25:37 2003
+++ b/drivers/net/3c59x.c	Sun Apr 20 22:41:08 2003
@@ -885,8 +885,8 @@
 static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int vortex_rx(struct net_device *dev);
 static int boomerang_rx(struct net_device *dev);
-static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int vortex_close(struct net_device *dev);
 static void dump_tx_ring(struct net_device *dev);
 static void update_stats(long ioaddr, struct net_device *dev);
@@ -2208,14 +2208,16 @@
  * full_bus_master_tx == 0 && full_bus_master_rx == 0
  */
 
-static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct vortex_private *vp = (struct vortex_private *)dev->priv;
 	long ioaddr;
 	int status;
 	int work_done = max_interrupt_work;
-	
+	int handled = 0;
+
 	ioaddr = dev->base_addr;
 	spin_lock(&vp->lock);
 
@@ -2226,6 +2228,7 @@
 
 	if ((status & IntLatch) == 0)
 		goto handler_exit;		/* No interrupt: shared IRQs cause this */
+	handled = 1;
 
 	if (status & IntReq) {
 		status |= vp->deferred;
@@ -2302,6 +2305,7 @@
 			   dev->name, status);
 handler_exit:
 	spin_unlock(&vp->lock);
+	return IRQ_RETVAL(handled);
 }
 
 /*
@@ -2309,13 +2313,15 @@
  * full_bus_master_tx == 1 && full_bus_master_rx == 1
  */
 
-static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct vortex_private *vp = (struct vortex_private *)dev->priv;
 	long ioaddr;
 	int status;
 	int work_done = max_interrupt_work;
+	int handled;
 
 	ioaddr = dev->base_addr;
 
@@ -2330,14 +2336,18 @@
 	if (vortex_debug > 6)
 		printk(KERN_DEBUG "boomerang_interrupt. status=0x%4x\n", status);
 
-	if ((status & IntLatch) == 0)
+	if ((status & IntLatch) == 0) {
+		handled = 0;
 		goto handler_exit;		/* No interrupt: shared IRQs can cause this */
+	}
 
 	if (status == 0xffff) {		/* h/w no longer present (hotplug)? */
 		if (vortex_debug > 1)
 			printk(KERN_DEBUG "boomerang_interrupt(1): status = 0xffff\n");
+		handled = 0;
 		goto handler_exit;
 	}
+	handled = 1;
 
 	if (status & IntReq) {
 		status |= vp->deferred;
@@ -2432,6 +2442,7 @@
 			   dev->name, status);
 handler_exit:
 	spin_unlock(&vp->lock);
+	return IRQ_RETVAL(handled);
 }
 
 static int vortex_rx(struct net_device *dev)
diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c
--- a/drivers/net/8139cp.c	Mon Apr  7 00:03:41 2003
+++ b/drivers/net/8139cp.c	Sun Apr 20 22:09:47 2003
@@ -658,7 +658,8 @@
 	cp->rx_tail = rx_tail;
 }
 
-static void cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t
+cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_instance;
 	struct cp_private *cp = dev->priv;
@@ -666,7 +667,7 @@
 
 	status = cpr16(IntrStatus);
 	if (!status || (status == 0xFFFF))
-		return;
+		return IRQ_NONE;
 
 	if (netif_msg_intr(cp))
 		printk(KERN_DEBUG "%s: intr, status %04x cmd %02x cpcmd %04x\n",
@@ -693,6 +694,7 @@
 	}
 
 	spin_unlock(&cp->lock);
+	return IRQ_HANDLED;
 }
 
 static void cp_tx (struct cp_private *cp)
diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c
--- a/drivers/net/8139too.c	Sun Feb 16 12:44:16 2003
+++ b/drivers/net/8139too.c	Sun Apr 20 22:09:47 2003
@@ -615,7 +615,7 @@
 static void rtl8139_init_ring (struct net_device *dev);
 static int rtl8139_start_xmit (struct sk_buff *skb,
 			       struct net_device *dev);
-static void rtl8139_interrupt (int irq, void *dev_instance,
+static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
 			       struct pt_regs *regs);
 static int rtl8139_close (struct net_device *dev);
 static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
@@ -2029,7 +2029,7 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void rtl8139_interrupt (int irq, void *dev_instance,
+static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
 			       struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
@@ -2038,6 +2038,7 @@
 	void *ioaddr = tp->mmio_addr;
 	int ackstat, status;
 	int link_changed = 0; /* avoid bogus "uninit" warning */
+	int handled = 0;
 
 	spin_lock (&tp->lock);
 
@@ -2053,6 +2054,8 @@
 		      RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0)
 			break;
 
+		handled = 1;
+
 		/* Acknowledge all of the current interrupt sources ASAP, but
 		   an first get an additional status bit from CSCR. */
 		if (status & RxUnderrun)
@@ -2097,6 +2100,7 @@
 
 	DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n",
 		 dev->name, RTL_R16 (IntrStatus));
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/drivers/net/82596.c b/drivers/net/82596.c
--- a/drivers/net/82596.c	Wed Feb  5 08:51:16 2003
+++ b/drivers/net/82596.c	Sun Apr 20 22:09:47 2003
@@ -357,7 +357,7 @@
 
 static int i596_open(struct net_device *dev);
 static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int i596_close(struct net_device *dev);
 static struct net_device_stats *i596_get_stats(struct net_device *dev);
 static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd);
@@ -1018,8 +1018,6 @@
 
 	netif_start_queue(dev);
 
-	MOD_INC_USE_COUNT;
-
 	/* Initialize the 82596 memory */
 	if (init_i596_mem(dev)) {
 		res = -EAGAIN;
@@ -1218,6 +1216,7 @@
 	DEB(DEB_PROBE,printk(KERN_INFO "%s", version));
 
 	/* The 82596-specific entries in the device structure. */
+	SET_MODULE_OWNER(dev);
 	dev->open = i596_open;
 	dev->stop = i596_close;
 	dev->hard_start_xmit = i596_start_xmit;
@@ -1247,24 +1246,25 @@
 	return 0;
 }
 
-static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct i596_private *lp;
 	short ioaddr;
 	unsigned short status, ack_cmd = 0;
+	int handled = 0;
 
 #ifdef ENABLE_BVME6000_NET
 	if (MACH_IS_BVME6000) {
 		if (*(char *) BVME_LOCAL_IRQ_STAT & BVME_ETHERR) {
 			i596_error(irq, dev_id, regs);
-			return;
+			return IRQ_HANDLED;
 		}
 	}
 #endif
 	if (dev == NULL) {
 		printk(KERN_ERR "i596_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	ioaddr = dev->base_addr;
@@ -1283,6 +1283,7 @@
 	if ((status & 0x8000) || (status & 0x2000)) {
 		struct i596_cmd *ptr;
 
+		handled = 1;
 		if ((status & 0x8000))
 			DEB(DEB_INTS,printk(KERN_DEBUG "%s: i596 interrupt completed command.\n", dev->name));
 		if ((status & 0x2000))
@@ -1405,7 +1406,7 @@
 	DEB(DEB_INTS,printk(KERN_DEBUG "%s: exiting interrupt.\n", dev->name));
 
 	spin_unlock (&lp->lock);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 static int i596_close(struct net_device *dev)
@@ -1450,7 +1451,6 @@
 
 	free_irq(dev->irq, dev);
 	remove_rx_bufs(dev);
-	MOD_DEC_USE_COUNT;
 
 	return 0;
 }
diff -Nru a/drivers/net/8390.c b/drivers/net/8390.c
--- a/drivers/net/8390.c	Tue Feb 25 02:44:22 2003
+++ b/drivers/net/8390.c	Sun Apr 20 21:26:41 2003
@@ -421,7 +421,7 @@
  * needed.
  */
 
-void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device *dev = dev_id;
 	long e8390_base;
@@ -431,7 +431,7 @@
 	if (dev == NULL) 
 	{
 		printk ("net_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
     
 	e8390_base = dev->base_addr;
@@ -454,7 +454,7 @@
 			   inb_p(e8390_base + EN0_IMR));
 #endif
 		spin_unlock(&ei_local->page_lock);
-		return;
+		return IRQ_NONE;
 	}
     
 	/* Change to page 0 and read the intr status reg. */
@@ -520,7 +520,7 @@
 		}
 	}
 	spin_unlock(&ei_local->page_lock);
-	return;
+	return IRQ_HANDLED;
 }
 
 /**
diff -Nru a/drivers/net/8390.h b/drivers/net/8390.h
--- a/drivers/net/8390.h	Tue Oct 15 07:03:22 2002
+++ b/drivers/net/8390.h	Sun Apr 20 21:26:41 2003
@@ -43,7 +43,7 @@
 extern void NS8390_init(struct net_device *dev, int startp);
 extern int ei_open(struct net_device *dev);
 extern int ei_close(struct net_device *dev);
-extern void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /* You have one of these per-board */
 struct ei_device {
diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig	Sun Mar 30 01:45:41 2003
+++ b/drivers/net/Kconfig	Sun Apr 20 12:56:51 2003
@@ -12,7 +12,7 @@
 	  telephone line with a modem either via UUCP (UUCP is a protocol to
 	  forward mail and news between unix hosts over telephone lines; read
 	  the UUCP-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
+	  <http://www.tldp.org/docs.html#howto>) or dialing up a shell
 	  account or a BBS, even using term (term is a program which gives you
 	  almost full Internet connectivity if you have a regular dial up
 	  shell account on some Internet connected Unix computer. Read
@@ -32,7 +32,7 @@
 
 	  Make sure to read the NET-3-HOWTO. Eventually, you will have to read
 	  Olaf Kirch's excellent and free book "Network Administrator's
-	  Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
+	  Guide", to be found in <http://www.tldp.org/docs.html#guide>. If
 	  unsure, say Y.
 
 if NETDEVICES
@@ -51,7 +51,7 @@
 	  thing often comes in handy, the default is Y. It won't enlarge your
 	  kernel either. What a deal. Read about it in the Network
 	  Administrator's Guide, available from
-	  <http://www.linuxdoc.org/docs.html#guide>.
+	  <http://www.tldp.org/docs.html#guide>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -98,7 +98,7 @@
 	  Say Y if you want this and read
 	  <file:Documentation/networking/eql.txt>.  You may also want to read
 	  section 6.2 of the NET-3-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -206,7 +206,7 @@
 	  If your Linux machine will be connected to an Ethernet and you have
 	  an Ethernet network interface card (NIC) installed in your computer,
 	  say Y here and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. You will then also have
+	  <http://www.tldp.org/docs.html#howto>. You will then also have
 	  to say Y to the driver for your particular NIC.
 
 	  Note that the answer to this question won't directly affect the
@@ -357,7 +357,7 @@
 	  If you want to include a driver to support Nubus or LC-PDS
 	  Ethernet cards using an NS8390 chipset or its equivalent, say Y
 	  and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config MAC89x0
 	tristate "Macintosh CS89x0 based ethernet cards"
@@ -366,7 +366,7 @@
 	  Support for CS89x0 chipset based Ethernet cards.  If you have a
 	  Nubus or LC-PDS network (Ethernet) card of this type, say Y and
 	  read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -382,7 +382,7 @@
 	  the onboard Ethernet in many Quadras as well as some LC-PDS,
 	  a few Nubus and all known Comm Slot Ethernet cards.  If you have
 	  one of these say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -397,7 +397,7 @@
 	  Support for the onboard AMD 79C940 MACE Ethernet controller used in
 	  the 660AV and 840AV Macintosh.  If you have one of these Macintoshes
 	  say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config MVME147_NET
 	tristate "MVME147 (Lance) Ethernet support"
@@ -516,7 +516,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config STNIC
 	tristate "National DP83902AV  support"
@@ -595,7 +595,7 @@
 	help
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -608,7 +608,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Also, consider buying a
+	  <http://www.tldp.org/docs.html#howto>.  Also, consider buying a
 	  new card, since the 3c501 is slow, broken, and obsolete: you will
 	  have problems.  Some people suggest to ping ("man ping") a nearby
 	  machine every minute ("man cron") when using this card.
@@ -625,7 +625,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -640,7 +640,7 @@
 	  Information about this network (Ethernet) card can be found in
 	  <file:Documentation/networking/3c505.txt>.  If you have a card of
 	  this type, say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -654,7 +654,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -668,7 +668,7 @@
 	---help---
 	  If you have a network (Ethernet) card belonging to the 3Com
 	  EtherLinkIII series, say Y and read the Ethernet-HOWTO, available
-	  from <http://www.linuxdoc.org/docs.html#howto>.
+	  from <http://www.tldp.org/docs.html#howto>.
 
 	  If your card is not working you may need to use the DOS
 	  setup disk to disable Plug & Play mode, and to select the default
@@ -686,7 +686,7 @@
 	help
 	  If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet
 	  network card, say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -700,7 +700,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -714,7 +714,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -736,7 +736,7 @@
 	  "Hurricane" (3c555/3cSOHO)                           PCI
 
 	  If you have such a card, say Y and read the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>. More
+	  available from <http://www.tldp.org/docs.html#howto>. More
 	  specific information is in
 	  <file:Documentation/networking/vortex.txt> and in the comments at
 	  the beginning of <file:drivers/net/3c59x.c>.
@@ -758,7 +758,7 @@
 
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -772,7 +772,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. Some LinkSys cards are
+	  <http://www.tldp.org/docs.html#howto>. Some LinkSys cards are
 	  of this type.
 
 	  If you want to compile this driver as a module ( = code which can be
@@ -786,7 +786,7 @@
 	help
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -799,7 +799,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -813,7 +813,7 @@
 	help
 	  If you have a network (Ethernet) card of this type and are running
 	  an MCA based system (PS/2), say Y and read the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -827,7 +827,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Important: There have been many reports that, with some motherboards
 	  mixing an SMC Ultra and an Adaptec AHA154x SCSI card (or compatible,
@@ -848,7 +848,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -865,7 +865,7 @@
 	  another SMC9192/9194 based chipset.  Say Y if you want it compiled
 	  into the kernel, and read the file
 	  <file:Documentation/networking/smc9.txt> and the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -879,7 +879,7 @@
 	help
 	  If you have a network (Ethernet) card belonging to this class, such
 	  as the NI5010, NI5210 or NI6210, say Y and read the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -892,7 +892,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. Note that this is still
+	  <http://www.tldp.org/docs.html#howto>. Note that this is still
 	  experimental code.
 
 	  This driver is also available as a module ( = code which can be
@@ -907,7 +907,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -921,7 +921,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -937,7 +937,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -952,7 +952,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto> as well as
+	  <http://www.tldp.org/docs.html#howto> as well as
 	  <file:drivers/net/depca.c>.
 
 	  If you want to compile this as a module ( = code which can be
@@ -968,7 +968,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -984,7 +984,7 @@
 	  bus system (that's the way the cards talks to the other components
 	  of your computer) is ISA (as opposed to EISA, VLB or PCI), say Y.
 	  Make sure you know the name of your card. Read the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  If unsure, say Y.
 
@@ -999,7 +999,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1015,7 +1015,7 @@
 	  cards. If this is for you, say Y and read
 	  <file:Documentation/networking/ewrk3.txt> in the kernel source as
 	  well as the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -1029,7 +1029,7 @@
 	---help---
 	  If you have an EtherExpress16 network (Ethernet) card, say Y and
 	  read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Note that the Intel
+	  <http://www.tldp.org/docs.html#howto>.  Note that the Intel
 	  EtherExpress16 card used to be regarded as a very poor choice
 	  because the driver was very unreliable. We now have a new driver
 	  that should do better.
@@ -1048,7 +1048,7 @@
 	  driver supports intel i82595{FX,TX} based boards. Note however
 	  that the EtherExpress PRO/100 Ethernet card has its own separate
 	  driver.  Please read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1062,7 +1062,7 @@
 	---help---
 	  If you have a Fujitsu FMV-181/182/183/184 network (Ethernet) card,
 	  say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you use an FMV-183 or FMV-184 and it is not working, you may need
 	  to disable Plug & Play mode of the card.
@@ -1079,7 +1079,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1093,7 +1093,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1115,7 +1115,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1129,7 +1129,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Many Ethernet cards
+	  <http://www.tldp.org/docs.html#howto>.  Many Ethernet cards
 	  without a specific driver are compatible with NE2000.
 
 	  If you have a PCI NE2000 card however, say N here and Y to "PCI
@@ -1152,7 +1152,7 @@
 	  (Ethernet) card, and this is the Linux driver for it. Note that the
 	  IBM Thinkpad 300 is compatible with the Z-Note and is also supported
 	  by this driver. Read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config SEEQ8005
 	tristate "SEEQ8005 support (EXPERIMENTAL)"
@@ -1160,7 +1160,7 @@
 	help
 	  This is a driver for the SEEQ 8005 network (Ethernet) card.  If this
 	  is for you, read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -1174,7 +1174,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 config NET_CBUS
 	bool "NEC PC-9800 C-bus cards"
@@ -1248,7 +1248,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1278,7 +1278,7 @@
 	help
 	  This is another class of network cards which attach directly to the
 	  bus. If you have one of those, say Y and read the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question doesn't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -1292,7 +1292,7 @@
 	help
 	  If you have a PCnet32 or PCnetPCI based network (Ethernet) card,
 	  answer Y here and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1306,7 +1306,7 @@
 	help
 	  If you have an AMD 8111-based PCI lance ethernet card,
 	  answer Y here and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1346,7 +1346,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1360,7 +1360,7 @@
 	help
 	  If you have a network (Ethernet) controller of this type, say Y and
 	  read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -1374,7 +1374,7 @@
 	help
 	  If you have a network (Ethernet) controller of this type, say Y and
 	  read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -1389,7 +1389,7 @@
 	  Support for CS89x0 chipset based Ethernet cards. If you have a
 	  network (Ethernet) card of this type, say Y and read the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto> as well as
+	  <http://www.tldp.org/docs.html#howto> as well as
 	  <file:Documentation/networking/cs89x0.txt>.
 
 	  If you want to compile this as a module ( = code which can be
@@ -1406,7 +1406,7 @@
 	  PCI/EISA Ethernet switch cards. These include the SE-4 and the SE-6
 	  models.  If you have a network card of this type, say Y and read the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  More specific
+	  <http://www.tldp.org/docs.html#howto>.  More specific
 	  information is contained in <file:Documentation/networking/dgrs.txt>.
 
 	  This driver is also available as a module ( = code which can be
@@ -1421,7 +1421,7 @@
 	help
 	  If you have an Intel EtherExpress PRO/100 PCI network (Ethernet)
 	  card, say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1523,7 +1523,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1557,7 +1557,7 @@
 	  with ISA NE2000 cards (they have their own driver, "NE2000/NE1000
 	  support" below). If you have a PCI NE2000 network (Ethernet) card,
 	  say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver also works for the following NE2000 clone cards:
 	  RealTek RTL-8029  Winbond 89C940  Compex RL2000  KTI ET32P2
@@ -1576,7 +1576,7 @@
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Note that this driver
+	  <http://www.tldp.org/docs.html#howto>.  Note that this driver
 	  will NOT WORK for NE3200 cards as they are completely different.
 
 	  This driver is also available as a module ( = code which can be
@@ -1591,7 +1591,7 @@
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1606,7 +1606,7 @@
 	  This is a driver for the Fast Ethernet PCI network cards based on
 	  the RTL8139C+ chips. If you have one of those, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this driver as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -1621,7 +1621,7 @@
 	  the RTL8139 chips. If you have one of those, say Y and read
 	  <file:Documentation/networking/8139too.txt> as well as the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this driver as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -1675,7 +1675,7 @@
 	  the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in
 	  SiS 630 and SiS 540 chipsets.  If you have one of those, say Y and
 	  read the Ethernet-HOWTO, available at
-	  <http://www.linuxdoc.org/docs.html#howto>.  Please read
+	  <http://www.tldp.org/docs.html#howto>.  Please read
 	  <file:Documentation/networking/sis900.txt> and comments at the
 	  beginning of <file:drivers/net/sis900.c> for more information.
 
@@ -1721,7 +1721,7 @@
 	  If you have a PCI Ethernet network card based on the ThunderLAN chip
 	  which is supported by this driver, say Y and read the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Devices currently supported by this driver are Compaq Netelligent,
 	  Compaq NetFlex and Olicom cards.  Please read the file
@@ -1777,7 +1777,7 @@
 	  Cute little network (Ethernet) devices which attach to the parallel
 	  port ("pocket adapters"), commonly used with laptops. If you have
 	  one of those, say Y and read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to plug a network (or some other) card into the PCMCIA
 	  (or PC-card) slot of your laptop instead (PCMCIA is the standard for
@@ -1799,7 +1799,7 @@
 	---help---
 	  This is a network (Ethernet) device which attaches to your parallel
 	  port. Read <file:drivers/net/atp.c> as well as the Ethernet-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>, if you
+	  available from <http://www.tldp.org/docs.html#howto>, if you
 	  want to use this.  If you intend to use this driver, you should have
 	  said N to the "Parallel printer support", because the two drivers
 	  don't like each other.
@@ -1816,7 +1816,7 @@
 	  This is a network (Ethernet) device which attaches to your parallel
 	  port. Read <file:Documentation/networking/DLINK.txt> as well as the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, if you want to use
+	  <http://www.tldp.org/docs.html#howto>, if you want to use
 	  this. It is possible to have several devices share a single parallel
 	  port and it is safe to compile the corresponding drivers into the
 	  kernel.
@@ -1834,7 +1834,7 @@
 	  This is a network (Ethernet) device which attaches to your parallel
 	  port. Read <file:Documentation/networking/DLINK.txt> as well as the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, if you want to use
+	  <http://www.tldp.org/docs.html#howto>, if you want to use
 	  this. It is possible to have several devices share a single parallel
 	  port and it is safe to compile the corresponding drivers into the
 	  kernel.
@@ -2010,7 +2010,7 @@
 	help
 	  If you have a Gigabit Ethernet card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -2201,7 +2201,7 @@
 
 	  If you want to use PLIP, say Y and read the PLIP mini-HOWTO as well
 	  as the NET-3-HOWTO, both available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Note that the PLIP
+	  <http://www.tldp.org/docs.html#howto>.  Note that the PLIP
 	  protocol has been changed and this PLIP driver won't work together
 	  with the PLIP support in Linux versions 1.0.x.  This option enlarges
 	  your kernel by about 8 KB.
@@ -2225,7 +2225,7 @@
 
 	  To use PPP, you need an additional program called pppd as described
 	  in the PPP-HOWTO, available at
-	  <http://www.linuxdoc.org/docs.html#howto>.  Make sure that you have
+	  <http://www.tldp.org/docs.html#howto>.  Make sure that you have
 	  the version of pppd recommended in <file:Documentation/Changes>.
 	  The PPP option enlarges your kernel by about 16 KB.
 
@@ -2377,7 +2377,7 @@
 	  allows you to use SLIP over a regular dial up shell connection. If
 	  you plan to use SLiRP, make sure to say Y to CSLIP, below. The
 	  NET-3-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, explains how to
+	  <http://www.tldp.org/docs.html#howto>, explains how to
 	  configure SLIP. Note that you don't need this option if you just
 	  want to run term (term is a program which gives you almost full
 	  Internet connectivity if you have a regular dial up shell account on
@@ -2403,7 +2403,7 @@
 	  <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
 	  allows you to use SLIP over a regular dial up shell connection, you
 	  definitely want to say Y here. The NET-3-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, explains how to configure
+	  <http://www.tldp.org/docs.html#howto>, explains how to configure
 	  CSLIP. This won't enlarge your kernel.
 
 config SLIP_SMART
diff -Nru a/drivers/net/ac3200.c b/drivers/net/ac3200.c
--- a/drivers/net/ac3200.c	Tue Feb 18 10:51:34 2003
+++ b/drivers/net/ac3200.c	Wed Apr 23 00:49:34 2003
@@ -167,7 +167,7 @@
 		dev->irq = config2irq(inb(ioaddr + AC_CONFIG));
 		printk(", using");
 	} else {
-		dev->irq = irq_cannonicalize(dev->irq);
+		dev->irq = irq_canonicalize(dev->irq);
 		printk(", assigning");
 	}
 
diff -Nru a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
--- a/drivers/net/amd8111e.c	Wed Feb 12 22:25:17 2003
+++ b/drivers/net/amd8111e.c	Sun Apr 20 22:41:09 2003
@@ -780,16 +780,18 @@
 /*
 This is device interrupt function. It handles transmit, receive and link change interrupts.
 */
-static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 
 	struct net_device * dev = (struct net_device *) dev_id;
 	struct amd8111e_priv *lp = dev->priv;
 	void * mmio = lp->mmio;
 	unsigned int intr0;
+	int handled = 0;
 
 	if(dev == NULL)
-		return;
+		return IRQ_NONE;
 
 	spin_lock (&lp->lock);
 	/* disabling interrupt */
@@ -802,7 +804,8 @@
 
 	if (!(intr0 & INTR))
 		goto err_no_interrupt;
-		 
+
+	handled = 1;
 	/* Current driver processes 3 interrupts : RINT,TINT,LCINT */
 	writel(intr0, mmio + INT0);
 
@@ -823,7 +826,7 @@
 err_no_interrupt:
 	writel( VAL0 | INTREN,mmio + CMD0);
 	spin_unlock(&lp->lock);
-	return;
+	return IRQ_RETVAL(handled);
 
 }
 /*
diff -Nru a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
--- a/drivers/net/appletalk/ltpc.c	Fri Apr  4 09:31:37 2003
+++ b/drivers/net/appletalk/ltpc.c	Thu Apr 24 05:25:35 2003
@@ -1295,7 +1295,7 @@
 
 static void __exit ltpc_cleanup(void)
 {
-	long timeout;
+	unsigned long timeout;
 
 	ltpc_timer.data = 0;  /* signal the poll routine that we're done */
 
diff -Nru a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig
--- a/drivers/net/arcnet/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/drivers/net/arcnet/Kconfig	Sun Apr 20 12:56:51 2003
@@ -18,7 +18,7 @@
 	  support" below.
 
 	  You might also want to have a look at the Ethernet-HOWTO, available
-	  from <http://www.linuxdoc.org/docs.html#howto>(even though ARCnet
+	  from <http://www.tldp.org/docs.html#howto>(even though ARCnet
 	  is not really Ethernet).
 
 	  This driver is also available as a module ( = code which can be
diff -Nru a/drivers/net/at1700.c b/drivers/net/at1700.c
--- a/drivers/net/at1700.c	Fri Mar 14 19:54:58 2003
+++ b/drivers/net/at1700.c	Sun Apr 20 22:41:09 2003
@@ -202,7 +202,7 @@
 static int read_eeprom(long ioaddr, int location);
 static int net_open(struct net_device *dev);
 static int	net_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void net_rx(struct net_device *dev);
 static int net_close(struct net_device *dev);
 static struct net_device_stats *net_get_stats(struct net_device *dev);
@@ -696,16 +696,17 @@
 
 /* The typical workload of the driver:
    Handle the network interface interrupts. */
-static void
+static irqreturn_t
 net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct net_local *lp;
 	int ioaddr, status;
+	int handled = 0;
 
 	if (dev == NULL) {
 		printk ("at1700_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	ioaddr = dev->base_addr;
@@ -726,6 +727,7 @@
 		   Tx interrupt. Thus we flag on rx_started, so that we prevent
 		   the interrupt routine (net_interrupt) to dive into net_rx
 		   again. */
+		handled = 1;
 		lp->rx_started = 1;
 		outb(0x00, ioaddr + RX_INTR);	/* Disable RX intr. */
 		net_rx(dev);
@@ -733,6 +735,7 @@
 		lp->rx_started = 0;
 	}
 	if (status & 0x00ff) {
+		handled = 1;
 		if (status & 0x02) {
 			/* More than 16 collisions occurred */
 			if (net_debug > 4)
@@ -760,7 +763,7 @@
 	}
 
 	spin_unlock (&lp->lock);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /* We have a good packet(s), get it/them out of the buffers. */
@@ -914,9 +917,11 @@
 
 		memset(mc_filter, 0, sizeof(mc_filter));
 		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-			 i++, mclist = mclist->next)
-			set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26,
-					mc_filter);
+			 i++, mclist = mclist->next) {
+			unsigned int bit =
+				ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26;
+			mc_filter[bit >> 3] |= (1 << bit);
+		}
 		outb(0x02, ioaddr + RX_MODE);	/* Use normal mode. */
 	}
 
diff -Nru a/drivers/net/atp.c b/drivers/net/atp.c
--- a/drivers/net/atp.c	Mon Feb 24 10:34:22 2003
+++ b/drivers/net/atp.c	Sun Apr 20 23:39:11 2003
@@ -203,7 +203,7 @@
 static void write_packet(long ioaddr, int length, unsigned char *packet, int pad, int mode);
 static void trigger_send(long ioaddr, int length);
 static int	atp_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void atp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t atp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void net_rx(struct net_device *dev);
 static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode);
 static int net_close(struct net_device *dev);
@@ -560,7 +560,7 @@
 	struct net_local *lp = (struct net_local *)dev->priv;
 	long ioaddr = dev->base_addr;
 	int length;
-	long flags;
+	unsigned long flags;
 
 	length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
 
@@ -596,17 +596,19 @@
 
 /* The typical workload of the driver:
    Handle the network interface interrupts. */
-static void atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs)
+static irqreturn_t
+atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs)
 {
 	struct net_device *dev = (struct net_device *)dev_instance;
 	struct net_local *lp;
 	long ioaddr;
 	static int num_tx_since_rx;
 	int boguscount = max_interrupt_work;
+	int handled = 0;
 
 	if (dev == NULL) {
 		printk(KERN_ERR "ATP_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 	ioaddr = dev->base_addr;
 	lp = (struct net_local *)dev->priv;
@@ -626,6 +628,7 @@
 		if (net_debug > 5) printk("loop status %02x..", status);
 
 		if (status & (ISR_RxOK<<3)) {
+			handled = 1;
 			write_reg(ioaddr, ISR, ISR_RxOK); /* Clear the Rx interrupt. */
 			do {
 				int read_status = read_nibble(ioaddr, CMR1);
@@ -648,6 +651,7 @@
 					break;
 			} while (--boguscount > 0);
 		} else if (status & ((ISR_TxErr + ISR_TxOK)<<3)) {
+			handled = 1;
 			if (net_debug > 6)  printk("handling Tx done..");
 			/* Clear the Tx interrupt.  We should check for too many failures
 			   and reinitialize the adapter. */
@@ -712,7 +716,7 @@
 	spin_unlock(&lp->lock);
 
 	if (net_debug > 5) printk("exiting interrupt.\n");
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 #ifdef TIMED_CHECKER
diff -Nru a/drivers/net/b44.c b/drivers/net/b44.c
--- a/drivers/net/b44.c	Wed Nov 27 11:00:48 2002
+++ b/drivers/net/b44.c	Sun Apr 20 22:09:47 2003
@@ -799,12 +799,13 @@
 	return (done ? 0 : 1);
 }
 
-static void b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct b44 *bp = dev->priv;
 	unsigned long flags;
 	u32 istat, imask;
+	int handled = 0;
 
 	spin_lock_irqsave(&bp->lock, flags);
 
@@ -816,6 +817,7 @@
 	 */
 	istat &= imask;
 	if (istat) {
+		handled = 1;
 		if (netif_rx_schedule_prep(dev)) {
 			/* NOTE: These writes are posted by the readback of
 			 *       the ISTAT register below.
@@ -832,6 +834,7 @@
 		br32(B44_ISTAT);
 	}
 	spin_unlock_irqrestore(&bp->lock, flags);
+	return IRQ_RETVAL(handled);
 }
 
 static void b44_tx_timeout(struct net_device *dev)
diff -Nru a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
--- a/drivers/net/cs89x0.c	Tue Feb 25 02:08:40 2003
+++ b/drivers/net/cs89x0.c	Sun Apr 20 22:09:47 2003
@@ -218,7 +218,7 @@
 static int cs89x0_probe1(struct net_device *dev, int ioaddr);
 static int net_open(struct net_device *dev);
 static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void set_multicast_list(struct net_device *dev);
 static void net_timeout(struct net_device *dev);
 static void net_rx(struct net_device *dev);
@@ -1401,12 +1401,13 @@
 /* The typical workload of the driver:
    Handle the network interface interrupts. */
    
-static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device *dev = dev_id;
 	struct net_local *lp;
 	int ioaddr, status;
- 
+ 	int handled = 0;
+
 	ioaddr = dev->base_addr;
 	lp = (struct net_local *)dev->priv;
 
@@ -1419,6 +1420,7 @@
            vista, baby!  */
 	while ((status = readword(dev, ISQ_PORT))) {
 		if (net_debug > 4)printk("%s: event=%04x\n", dev->name, status);
+		handled = 1;
 		switch(status & ISQ_EVENT_MASK) {
 		case ISQ_RECEIVER_EVENT:
 			/* Got a packet(s). */
@@ -1485,6 +1487,7 @@
 			break;
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 static void
diff -Nru a/drivers/net/de600.c b/drivers/net/de600.c
--- a/drivers/net/de600.c	Fri Jan 10 12:04:48 2003
+++ b/drivers/net/de600.c	Sun Apr 20 23:39:11 2003
@@ -258,7 +258,7 @@
  * Handle the network interface interrupts.
  */
 
-static void de600_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t de600_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device	*dev = dev_id;
 	u8		irq_status;
@@ -268,7 +268,7 @@
 	/* This might just as well be deleted now, no crummy drivers present :-) */
 	if ((dev == NULL) || (DE600_IRQ != irq)) {
 		printk(KERN_ERR "%s: bogus interrupt %d\n", dev?dev->name:"DE-600", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	spin_lock(&de600_lock);
@@ -303,7 +303,7 @@
 	if (retrig)
 		trigger_interrupt(dev);
 	spin_unlock(&de600_lock);
-	return;
+	return IRQ_HANDLED;
 }
 
 static int de600_tx_intr(struct net_device *dev, int irq_status)
diff -Nru a/drivers/net/de600.h b/drivers/net/de600.h
--- a/drivers/net/de600.h	Sun Oct  6 16:39:24 2002
+++ b/drivers/net/de600.h	Sun Apr 20 23:39:11 2003
@@ -125,7 +125,7 @@
 static int	de600_start_xmit(struct sk_buff *skb, struct net_device *dev);
 
 /* Dispatch from interrupts. */
-static void	de600_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t de600_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int	de600_tx_intr(struct net_device *dev, int irq_status);
 static void	de600_rx_intr(struct net_device *dev);
 
diff -Nru a/drivers/net/de620.c b/drivers/net/de620.c
--- a/drivers/net/de620.c	Fri Jan 10 12:04:27 2003
+++ b/drivers/net/de620.c	Sun Apr 20 23:39:11 2003
@@ -221,7 +221,7 @@
 static int	de620_start_xmit(struct sk_buff *, struct net_device *);
 
 /* Dispatch from interrupts. */
-static void	de620_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t de620_interrupt(int, void *, struct pt_regs *);
 static int	de620_rx_intr(struct net_device *);
 
 /* Initialization */
@@ -591,7 +591,8 @@
  * Handle the network interface interrupts.
  *
  */
-static void de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	byte irq_status;
@@ -617,6 +618,7 @@
 		netif_wake_queue(dev);
 		
 	spin_unlock(&de620_lock);
+	return IRQ_HANDLED;
 }
 
 /**************************************
diff -Nru a/drivers/net/depca.c b/drivers/net/depca.c
--- a/drivers/net/depca.c	Fri Feb 14 11:37:27 2003
+++ b/drivers/net/depca.c	Sun Apr 20 23:00:41 2003
@@ -430,7 +430,7 @@
 */
 static int depca_open(struct net_device *dev);
 static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void depca_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t depca_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int depca_close(struct net_device *dev);
 static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void depca_tx_timeout(struct net_device *dev);
@@ -894,7 +894,7 @@
 /*
 ** The DEPCA interrupt handler. 
 */
-static void depca_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t depca_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct depca_private *lp;
@@ -903,7 +903,7 @@
 
 	if (dev == NULL) {
 		printk("depca_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	lp = (struct depca_private *) dev->priv;
@@ -938,6 +938,7 @@
 	outb(nicsr, DEPCA_NICSR);
 
 	spin_unlock(&lp->lock);
+	return IRQ_HANDLED;
 }
 
 /* Called with lp->lock held */
diff -Nru a/drivers/net/dgrs.c b/drivers/net/dgrs.c
--- a/drivers/net/dgrs.c	Tue Mar  4 22:44:07 2003
+++ b/drivers/net/dgrs.c	Sun Apr 20 21:26:41 2003
@@ -888,7 +888,7 @@
  *	dev, priv will always refer to the 0th device in Multi-NIC mode.
  */
 
-static void dgrs_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t dgrs_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device	*dev0 = (struct net_device *) dev_id;
 	DGRS_PRIV	*priv0 = (DGRS_PRIV *) dev0->priv;
@@ -971,6 +971,8 @@
 ack_intr:
 	if (priv0->plxreg)
 		OUTL(dev0->base_addr + PLX_LCL2PCI_DOORBELL, 1);
+
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/net/dl2k.c b/drivers/net/dl2k.c
--- a/drivers/net/dl2k.c	Wed Dec 11 05:42:59 2002
+++ b/drivers/net/dl2k.c	Sun Apr 20 22:09:47 2003
@@ -98,7 +98,7 @@
 static void rio_tx_timeout (struct net_device *dev);
 static void alloc_list (struct net_device *dev);
 static int start_xmit (struct sk_buff *skb, struct net_device *dev);
-static void rio_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t rio_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
 static void rio_free_tx (struct net_device *dev, int irq);
 static void tx_error (struct net_device *dev, int tx_status);
 static int receive_packet (struct net_device *dev);
@@ -699,7 +699,7 @@
 	return 0;
 }
 
-static void
+static irqreturn_t
 rio_interrupt (int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
@@ -707,6 +707,7 @@
 	unsigned int_status;
 	long ioaddr;
 	int cnt = max_intrloop;
+	int handled = 0;
 
 	ioaddr = dev->base_addr;
 	np = dev->priv;
@@ -716,6 +717,7 @@
 		int_status &= DEFAULT_INTR;
 		if (int_status == 0 || --cnt < 0)
 			break;
+		handled = 1;
 		/* Processing received packets */
 		if (int_status & RxDMAComplete)
 			receive_packet (dev);
@@ -736,6 +738,7 @@
 	}
 	if (np->cur_tx != np->old_tx)
 		writel (100, ioaddr + CountDown);
+	return IRQ_RETVAL(handled);
 }
 
 static void 
@@ -744,7 +747,7 @@
 	struct netdev_private *np = (struct netdev_private *) dev->priv;
 	int entry = np->old_tx % TX_RING_SIZE;
 	int tx_use = 0;
-	long flag = 0;
+	unsigned long flag = 0;
 	
 	if (irq)
 		spin_lock(&np->tx_lock);
diff -Nru a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c
--- a/drivers/net/e100/e100_main.c	Mon Apr  7 00:03:41 2003
+++ b/drivers/net/e100/e100_main.c	Sun Apr 20 14:14:29 2003
@@ -190,7 +190,7 @@
 static int e100_set_mac(struct net_device *, void *);
 struct net_device_stats *e100_get_stats(struct net_device *);
 
-static void e100intr(int, void *, struct pt_regs *);
+static irqreturn_t e100intr(int, void *, struct pt_regs *);
 static void e100_print_brd_conf(struct e100_private *);
 static void e100_set_multi(struct net_device *);
 void e100_set_speed_duplex(struct e100_private *);
@@ -1837,7 +1837,7 @@
  * the RX & TX queues & starts the RU if it has stopped due
  * to no resources.
  */
-void
+irqreturn_t
 e100intr(int irq, void *dev_inst, struct pt_regs *regs)
 {
 	struct net_device *dev;
@@ -1850,7 +1850,7 @@
 	intr_status = readw(&bdp->scb->scb_status);
 	/* If not my interrupt, just return */
 	if (!(intr_status & SCB_STATUS_ACK_MASK) || (intr_status == 0xffff)) {
-		return;
+		return IRQ_NONE;
 	}
 
 	/* disable and ack intr */
@@ -1859,7 +1859,7 @@
 	/* the device is closed, don't continue or else bad things may happen. */
 	if (!netif_running(dev)) {
 		e100_set_intr_mask(bdp);
-		return;
+		return IRQ_NONE;
 	}
 
 	/* SWI intr (triggered by watchdog) is signal to allocate new skb buffers */
@@ -1877,6 +1877,7 @@
 		e100_tx_srv(bdp);
 
 	e100_set_intr_mask(bdp);
+	return IRQ_HANDLED;
 }
 
 /**
diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c	Tue Apr  1 10:26:01 2003
+++ b/drivers/net/e1000/e1000_main.c	Sun Apr 20 22:41:09 2003
@@ -154,7 +154,7 @@
 static void e1000_update_stats(struct e1000_adapter *adapter);
 static inline void e1000_irq_disable(struct e1000_adapter *adapter);
 static inline void e1000_irq_enable(struct e1000_adapter *adapter);
-static void e1000_intr(int irq, void *data, struct pt_regs *regs);
+static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs);
 #ifdef CONFIG_E1000_NAPI
 static int e1000_clean(struct net_device *netdev, int *budget);
 static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter,
@@ -1981,7 +1981,7 @@
  * @pt_regs: CPU registers structure
  **/
 
-static void
+static irqreturn_t
 e1000_intr(int irq, void *data, struct pt_regs *regs)
 {
 	struct net_device *netdev = data;
@@ -1992,7 +1992,7 @@
 #endif
 
 	if(!icr)
-		return;  /* Not our interrupt */
+		return IRQ_NONE;  /* Not our interrupt */
 
 	if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
 		adapter->hw.get_link_status = 1;
@@ -2016,6 +2016,7 @@
 		   !e1000_clean_tx_irq(adapter))
 			break;
 #endif
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_E1000_NAPI
diff -Nru a/drivers/net/eepro.c b/drivers/net/eepro.c
--- a/drivers/net/eepro.c	Fri Jan 10 12:05:04 2003
+++ b/drivers/net/eepro.c	Sun Apr 20 23:39:11 2003
@@ -307,7 +307,7 @@
 static int	eepro_probe1(struct net_device *dev, short ioaddr);
 static int	eepro_open(struct net_device *dev);
 static int	eepro_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void	eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t eepro_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void 	eepro_rx(struct net_device *dev);
 static void 	eepro_transmit_interrupt(struct net_device *dev);
 static int	eepro_close(struct net_device *dev);
@@ -1104,8 +1104,6 @@
 	/* enabling rx */
 	eepro_en_rx(ioaddr);
 
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -1178,17 +1176,18 @@
 /*	The typical workload of the driver:
 	Handle the network interface interrupts. */
 
-static void
+static irqreturn_t
 eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device *dev =  (struct net_device *)dev_id;
 	                      /* (struct net_device *)(irq2dev_map[irq]);*/
 	struct eepro_local *lp;
 	int ioaddr, status, boguscount = 20;
+	int handled = 0;
 
 	if (dev == NULL) {
                 printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq);
-                return;
+                return IRQ_NONE;
         }
 
 	lp = (struct eepro_local *)dev->priv;
@@ -1202,6 +1201,7 @@
 
 	while (((status = inb(ioaddr + STATUS_REG)) & (RX_INT|TX_INT)) && (boguscount--))
 	{
+		handled = 1;
 		if (status & RX_INT) {
 			if (net_debug > 4)
 				printk(KERN_DEBUG "%s: packet received interrupt.\n", dev->name);
@@ -1233,7 +1233,7 @@
 		printk(KERN_DEBUG "%s: exiting eepro_interrupt routine.\n", dev->name);
 
 	spin_unlock(&lp->lock);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 static int eepro_close(struct net_device *dev)
@@ -1274,8 +1274,6 @@
 #endif
 
 	/* Update the statistics here. What statistics? */
-
-	MOD_DEC_USE_COUNT;
 
 	return 0;
 }
diff -Nru a/drivers/net/eepro100.c b/drivers/net/eepro100.c
--- a/drivers/net/eepro100.c	Sat Mar  8 18:51:49 2003
+++ b/drivers/net/eepro100.c	Sun Apr 20 21:26:41 2003
@@ -541,7 +541,7 @@
 static void speedo_refill_rx_buffers(struct net_device *dev, int force);
 static int speedo_rx(struct net_device *dev);
 static void speedo_tx_buffer_gc(struct net_device *dev);
-static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int speedo_close(struct net_device *dev);
 static struct net_device_stats *speedo_get_stats(struct net_device *dev);
 static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -1560,12 +1560,13 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *)dev_instance;
 	struct speedo_private *sp;
 	long ioaddr, boguscnt = max_interrupt_work;
 	unsigned short status;
+	unsigned int handled = 0;
 
 	ioaddr = dev->base_addr;
 	sp = (struct speedo_private *)dev->priv;
@@ -1576,7 +1577,7 @@
 		printk(KERN_ERR"%s: SMP simultaneous entry of an interrupt handler.\n",
 			   dev->name);
 		sp->in_interrupt = 0;	/* Avoid halting machine. */
-		return;
+		return IRQ_NONE;
 	}
 #endif
 
@@ -1593,6 +1594,7 @@
 
 		if ((status & 0xfc00) == 0)
 			break;
+		handled = 1;
 
 
 		if ((status & 0x5000) ||	/* Packet received, or Rx error. */
@@ -1654,7 +1656,7 @@
 			   dev->name, inw(ioaddr + SCBStatus));
 
 	clear_bit(0, (void*)&sp->in_interrupt);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry)
diff -Nru a/drivers/net/eexpress.c b/drivers/net/eexpress.c
--- a/drivers/net/eexpress.c	Fri Feb 14 11:36:46 2003
+++ b/drivers/net/eexpress.c	Sun Apr 20 23:39:11 2003
@@ -252,7 +252,7 @@
 static struct net_device_stats *eexp_stats(struct net_device *dev);
 static int eexp_xmit(struct sk_buff *buf, struct net_device *dev);
 
-static void eexp_irq(int irq, void *dev_addr, struct pt_regs *regs);
+static irqreturn_t eexp_irq(int irq, void *dev_addr, struct pt_regs *regs);
 static void eexp_set_multicast(struct net_device *dev);
 
 /*
@@ -761,7 +761,7 @@
 	}
 }
 	
-static void eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
+static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_info;
 	struct net_local *lp;
@@ -772,7 +772,7 @@
 	{
 		printk(KERN_WARNING "eexpress: irq %d for unknown device\n",
 		       irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	lp = (struct net_local *)dev->priv;
@@ -860,7 +860,7 @@
 	outw(old_write_ptr, ioaddr+WRITE_PTR);
 	
 	spin_unlock(&lp->lock);
-	return;
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/net/epic100.c b/drivers/net/epic100.c
--- a/drivers/net/epic100.c	Fri Jan 10 12:05:04 2003
+++ b/drivers/net/epic100.c	Sun Apr 20 21:58:27 2003
@@ -360,7 +360,7 @@
 static void epic_init_ring(struct net_device *dev);
 static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int epic_rx(struct net_device *dev);
-static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static int epic_close(struct net_device *dev);
 static struct net_device_stats *epic_get_stats(struct net_device *dev);
@@ -973,7 +973,7 @@
 	struct epic_private *ep = dev->priv;
 	int entry, free_count;
 	u32 ctrl_word;
-	long flags;
+	unsigned long flags;
 	
 	if (skb->len < ETH_ZLEN) {
 		skb = skb_padto(skb, ETH_ZLEN);
@@ -1028,12 +1028,13 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_instance;
 	struct epic_private *ep = dev->priv;
 	long ioaddr = dev->base_addr;
 	int status, boguscnt = max_interrupt_work;
+	unsigned int handled = 0;
 
 	do {
 		status = inl(ioaddr + INTSTAT);
@@ -1047,6 +1048,7 @@
 
 		if ((status & IntrSummary) == 0)
 			break;
+		handled = 1;
 
 		if (status & (RxDone | RxStarted | RxEarlyWarn | RxOverflow))
 			epic_rx(dev);
@@ -1156,7 +1158,7 @@
 		printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n",
 			   dev->name, status);
 
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 static int epic_rx(struct net_device *dev)
@@ -1343,9 +1345,11 @@
 
 		memset(mc_filter, 0, sizeof(mc_filter));
 		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-			 i++, mclist = mclist->next)
-			set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f,
-					mc_filter);
+			 i++, mclist = mclist->next) {
+			unsigned int bit_nr =
+				ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
+			mc_filter[bit_nr >> 3] |= (1 << bit_nr);
+		}
 	}
 	/* ToDo: perhaps we need to stop the Tx and Rx process here? */
 	if (memcmp(mc_filter, ep->mc_filter, sizeof(mc_filter))) {
diff -Nru a/drivers/net/fealnx.c b/drivers/net/fealnx.c
--- a/drivers/net/fealnx.c	Thu Feb  6 07:33:47 2003
+++ b/drivers/net/fealnx.c	Sun Apr 20 21:58:27 2003
@@ -438,7 +438,7 @@
 static void tx_timeout(struct net_device *dev);
 static void init_ring(struct net_device *dev);
 static int start_tx(struct sk_buff *skb, struct net_device *dev);
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
 static int netdev_rx(struct net_device *dev);
 static void set_rx_mode(struct net_device *dev);
 static struct net_device_stats *get_stats(struct net_device *dev);
@@ -1412,12 +1412,13 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
 	struct netdev_private *np = dev->priv;
 	long ioaddr, boguscnt = max_interrupt_work;
 	unsigned int num_tx = 0;
+	int handled = 0;
 
 	writel(0, dev->base_addr + IMR);
 
@@ -1437,6 +1438,8 @@
 		if (!(intr_status & np->imrvalue))
 			break;
 
+		handled = 1;
+
 // 90/1/16 delete,
 //
 //      if (intr_status & FBE)
@@ -1559,7 +1562,7 @@
 
 	writel(np->imrvalue, ioaddr + IMR);
 
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 
@@ -1739,8 +1742,9 @@
 		memset(mc_filter, 0, sizeof(mc_filter));
 		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
 		     i++, mclist = mclist->next) {
-			set_bit((ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F,
-				mc_filter);
+			unsigned int bit;
+			bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F;
+			mc_filter[bit >> 5] |= (1 << bit);
 		}
 		rx_mode = AB | AM;
 	}
diff -Nru a/drivers/net/hamachi.c b/drivers/net/hamachi.c
--- a/drivers/net/hamachi.c	Mon Feb 24 09:56:05 2003
+++ b/drivers/net/hamachi.c	Sun Apr 20 22:09:47 2003
@@ -558,7 +558,7 @@
 static void hamachi_tx_timeout(struct net_device *dev);
 static void hamachi_init_ring(struct net_device *dev);
 static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static inline int hamachi_rx(struct net_device *dev);
 static inline int hamachi_tx(struct net_device *dev);
 static void hamachi_error(struct net_device *dev, int intr_status);
@@ -1367,16 +1367,17 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
 	struct hamachi_private *hmp;
 	long ioaddr, boguscnt = max_interrupt_work;
+	int handled = 0;
 
 #ifndef final_version			/* Can never occur. */
 	if (dev == NULL) {
 		printk (KERN_ERR "hamachi_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 #endif
 
@@ -1394,6 +1395,8 @@
 		if (intr_status == 0)
 			break;
 
+		handled = 1;
+
 		if (intr_status & IntrRxDone)
 			hamachi_rx(dev);
 
@@ -1466,6 +1469,7 @@
 #endif
 
 	spin_unlock(&hmp->lock);
+	return IRQ_RETVAL(handled);
 }
 
 /* This routine is logically part of the interrupt handler, but separated
diff -Nru a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
--- a/drivers/net/hamradio/6pack.c	Fri Feb  7 00:20:36 2003
+++ b/drivers/net/hamradio/6pack.c	Mon Apr 21 20:58:40 2003
@@ -315,13 +315,13 @@
 		   immediately after data has arrived. */
 		if (sp->duplex == 1) {
 			sp->led_state = 0x70;
-			sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+			sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 			sp->tx_enable = 1;
-			actual = sp->tty->driver.write(sp->tty, 0, sp->xbuff, count);
+			actual = sp->tty->driver->write(sp->tty, 0, sp->xbuff, count);
 			sp->xleft = count - actual;
 			sp->xhead = sp->xbuff + actual;
 			sp->led_state = 0x60;
-			sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+			sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 		} else {
 			sp->xleft = count;
 			sp->xhead = sp->xbuff;
@@ -357,7 +357,7 @@
 	}
 
 	if (sp->tx_enable == 1) {
-		actual = tty->driver.write(tty, 0, sp->xhead, sp->xleft);
+		actual = tty->driver->write(tty, 0, sp->xhead, sp->xleft);
 		sp->xleft -= actual;
 		sp->xhead += actual;
 	}
@@ -394,13 +394,13 @@
 
 	if (((sp->status1 & SIXP_DCD_MASK) == 0) && (random < sp->persistence)) {
 		sp->led_state = 0x70;
-		sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+		sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 		sp->tx_enable = 1;
-		actual = sp->tty->driver.write(sp->tty, 0, sp->xbuff, sp->status2);
+		actual = sp->tty->driver->write(sp->tty, 0, sp->xbuff, sp->status2);
 		sp->xleft -= actual;
 		sp->xhead += actual;
 		sp->led_state = 0x60;
-		sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+		sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 		sp->status2 = 0;
 	} else
 		sp_start_tx_timer(sp);
@@ -566,8 +566,8 @@
 		return -ENFILE;
 	sp->tty = tty;
 	tty->disc_data = sp;
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
@@ -882,7 +882,7 @@
 {
 	unsigned char inbyte = 0xe8;
 
-	sp->tty->driver.write(sp->tty, 0, &inbyte, 1);
+	sp->tty->driver->write(sp->tty, 0, &inbyte, 1);
 
 	del_timer(&sp->resync_t);
 	sp->resync_t.data = (unsigned long) sp;
@@ -924,9 +924,9 @@
 	else { /* output watchdog char if idle */
 		if ((sp->status2 != 0) && (sp->duplex == 1)) {
 			sp->led_state = 0x70;
-			sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+			sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 			sp->tx_enable = 1;
-			actual = sp->tty->driver.write(sp->tty, 0, sp->xbuff, sp->status2);
+			actual = sp->tty->driver->write(sp->tty, 0, sp->xbuff, sp->status2);
 			sp->xleft -= actual;
 			sp->xhead += actual;
 			sp->led_state = 0x60;
@@ -936,7 +936,7 @@
 	}
 
 	/* needed to trigger the TNC watchdog */
-	sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+	sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 
         /* if the state byte has been received, the TNC is present,
            so the resync timer can be reset. */
@@ -977,8 +977,8 @@
 	/* resync the TNC */
 
 	sp->led_state = 0x60;
-	sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
-	sp->tty->driver.write(sp->tty, 0, &resync_cmd, 1);
+	sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
+	sp->tty->driver->write(sp->tty, 0, &resync_cmd, 1);
 
 
 	/* Start resync timer again -- the TNC might be still absent */
@@ -1006,12 +1006,12 @@
 				if ((sp->status & SIXP_RX_DCD_MASK) ==
 					SIXP_RX_DCD_MASK) {
 					sp->led_state = 0x68;
-					sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+					sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 				}
 			} else {
 				sp->led_state = 0x60;
 				/* fill trailing bytes with zeroes */
-				sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1);
+				sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1);
 				rest = sp->rx_count;
 				if (rest != 0)
 					 for (i = rest; i <= 3; i++)
diff -Nru a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
--- a/drivers/net/hamradio/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/drivers/net/hamradio/Kconfig	Sun Apr 20 12:56:51 2003
@@ -60,7 +60,7 @@
 	  Currently, this driver supports Ottawa PI/PI2, Paccomm/Gracilis
 	  PackeTwin, and S5SCC/DMA boards. They are detected automatically.
 	  If you have one of these cards, say Y here and read the AX25-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  This driver can operate multiple boards simultaneously. If you
 	  compile it as a module (by saying M instead of Y), it will be called
@@ -88,7 +88,7 @@
 	  in order to communicate with other computers. If you want to use
 	  this, read <file:Documentation/networking/z8530drv.txt> and the
 	  AX25-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. Also make sure to say Y
+	  <http://www.tldp.org/docs.html#howto>. Also make sure to say Y
 	  to "Amateur Radio AX.25 Level 2" support.
 
 	  If you want to compile this as a module ( = code which can be
diff -Nru a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
--- a/drivers/net/hamradio/dmascc.c	Mon Mar 31 15:55:38 2003
+++ b/drivers/net/hamradio/dmascc.c	Mon Apr 21 02:16:43 2003
@@ -674,7 +674,7 @@
     if (reg) outb_p(reg, priv->scc_cmd);
     return inb_p(priv->scc_cmd);
   default:
-    spin_lock_irqsave(&priv->register_lock, flags);
+    spin_lock_irqsave(priv->register_lock, flags);
     outb_p(0, priv->card_base + PI_DREQ_MASK);
     if (reg) outb_p(reg, priv->scc_cmd);
     rc = inb_p(priv->scc_cmd);
diff -Nru a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
--- a/drivers/net/hamradio/mkiss.c	Thu Apr  4 01:39:23 2002
+++ b/drivers/net/hamradio/mkiss.c	Mon Apr 21 20:58:40 2003
@@ -384,7 +384,7 @@
 			 break;
 		}
 		ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
-		actual = ax->tty->driver.write(ax->tty, 0, ax->xbuff, count);
+		actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count);
 		ax->tx_packets++;
 		ax->dev->trans_start = jiffies;
 		ax->xleft = count - actual;
@@ -392,7 +392,7 @@
 	} else {
 		count = kiss_esc(p, (unsigned char *) ax->mkiss->xbuff, len);
 		ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
-		actual = ax->mkiss->tty->driver.write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count);
+		actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count);
 		ax->tx_packets++;
 		ax->mkiss->dev->trans_start = jiffies;
 		ax->mkiss->xleft = count - actual;
@@ -429,7 +429,7 @@
 		return;
 	}
 
-	actual = tty->driver.write(tty, 0, ax->xhead, ax->xleft);
+	actual = tty->driver->write(tty, 0, ax->xhead, ax->xleft);
 	ax->xleft -= actual;
 	ax->xhead += actual;
 }
@@ -475,7 +475,7 @@
 		}
 
 		printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name,
-		       (ax->tty->driver.chars_in_buffer(ax->tty) || ax->xleft) ?
+		       (ax->tty->driver->chars_in_buffer(ax->tty) || ax->xleft) ?
 		       "bad line quality" : "driver error");
 
 		ax->xleft = 0;
@@ -643,8 +643,8 @@
 	ax->mkiss = NULL;
 	tmp_ax    = NULL;
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c
--- a/drivers/net/hp100.c	Tue Feb 25 02:08:45 2003
+++ b/drivers/net/hp100.c	Sun Apr 20 22:41:09 2003
@@ -320,7 +320,7 @@
 static void hp100_update_stats(struct net_device *dev);
 static void hp100_clear_stats(struct hp100_private *lp, int ioaddr);
 static void hp100_set_multicast_list(struct net_device *dev);
-static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void hp100_start_interface(struct net_device *dev);
 static void hp100_stop_interface(struct net_device *dev);
 static void hp100_load_eeprom(struct net_device *dev, u_short ioaddr);
@@ -2271,7 +2271,7 @@
  *  hardware interrupt handling
  */
 
-static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
 	struct hp100_private *lp = (struct hp100_private *) dev->priv;
@@ -2280,7 +2280,7 @@
 	u_int val;
 
 	if (dev == NULL)
-		return;
+		return IRQ_NONE;
 	ioaddr = dev->base_addr;
 
 	spin_lock(&lp->lock);
@@ -2302,7 +2302,7 @@
 	if (val == 0) {		/* might be a shared interrupt */
 		spin_unlock(&lp->lock);
 		hp100_ints_on();
-		return;
+		return IRQ_NONE;
 	}
 	/* We're only interested in those interrupts we really enabled. */
 	/* val &= hp100_inw( IRQ_MASK ); */
@@ -2394,6 +2394,7 @@
 
 	spin_unlock(&lp->lock);
 	hp100_ints_on();
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
--- a/drivers/net/irda/donauboe.c	Fri Jan  3 12:53:07 2003
+++ b/drivers/net/irda/donauboe.c	Mon Apr 21 02:55:03 2003
@@ -1193,7 +1193,7 @@
 }
 
 /*interrupt handler */
-STATIC void
+STATIC irqreturn_t
 toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
 {
   struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id;
@@ -1201,13 +1201,13 @@
   struct sk_buff *skb = NULL;
 
   if (self == NULL && toshoboe_invalid_dev(irq)) 
-    return;
+    return IRQ_NONE;
 
   irqstat = INB (OBOE_ISR);
 
 /* was it us */
   if (!(irqstat & OBOE_INT_MASK))
-      return;
+      return IRQ_NONE;
 
 /* Ack all the interrupts */
   OUTB (irqstat, OBOE_ISR);
@@ -1381,6 +1381,7 @@
       IRDA_DEBUG (1, "%s.sip:%x(%x)%x\n", __FUNCTION__
 	      ,self->int_sip,irqstat,self->txpending);
     }
+  return IRQ_HANDLED;
 }
 
 STATIC int
diff -Nru a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c
--- a/drivers/net/irda/irport.c	Sat Apr 19 13:09:27 2003
+++ b/drivers/net/irda/irport.c	Mon Apr 21 02:53:21 2003
@@ -720,17 +720,18 @@
  *
  *    Interrupt handler
  */
-void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs) 
+irqreturn_t irport_interrupt(int irq, void *dev_id, struct pt_regs *regs) 
 {
 	struct net_device *dev = (struct net_device *) dev_id;
 	struct irport_cb *self;
 	int boguscount = 0;
 	int iobase;
 	int iir, lsr;
+	int handled = 0;
 
 	if (!dev) {
 		WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq);
-		return;
+		return IRQ_NONE;
 	}
 	self = (struct irport_cb *) dev->priv;
 
@@ -740,6 +741,8 @@
 
 	iir = inb(iobase+UART_IIR) & UART_IIR_ID;
 	while (iir) {
+		handled = 1;
+
 		/* Clear interrupt */
 		lsr = inb(iobase+UART_LSR);
 
@@ -771,6 +774,7 @@
  	        iir = inb(iobase + UART_IIR) & UART_IIR_ID;
 	}
 	spin_unlock(&self->lock);
+	return IRQ_RETVAL(handled);
 }
 
 static int irport_net_init(struct net_device *dev)
diff -Nru a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
--- a/drivers/net/irda/irtty-sir.c	Wed Apr 16 15:35:04 2003
+++ b/drivers/net/irda/irtty-sir.c	Mon Apr 21 20:58:42 2003
@@ -62,7 +62,7 @@
 	ASSERT(priv != NULL, return -1;);
 	ASSERT(priv->magic == IRTTY_MAGIC, return -1;);
 
-	return priv->tty->driver.chars_in_buffer(priv->tty);
+	return priv->tty->driver->chars_in_buffer(priv->tty);
 }
 
 /* Wait (sleep) until underlaying hardware finished transmission
@@ -91,9 +91,9 @@
 	ASSERT(priv->magic == IRTTY_MAGIC, return;);
 
 	tty = priv->tty;
-	if (tty->driver.wait_until_sent) {
+	if (tty->driver->wait_until_sent) {
 		lock_kernel();
-		tty->driver.wait_until_sent(tty, MSECS_TO_JIFFIES(100));
+		tty->driver->wait_until_sent(tty, MSECS_TO_JIFFIES(100));
 		unlock_kernel();
 	}
 	else {
@@ -161,8 +161,8 @@
 	}	
 
 	tty->termios->c_cflag = cflag;
-	if (tty->driver.set_termios)
-		tty->driver.set_termios(tty, &old_termios);
+	if (tty->driver->set_termios)
+		tty->driver->set_termios(tty, &old_termios);
 	unlock_kernel();
 
 	priv->io.speed = speed;
@@ -201,8 +201,8 @@
 	 * This function is not yet defined for all tty driver, so
 	 * let's be careful... Jean II
 	 */
-	ASSERT(priv->tty->driver.tiocmset != NULL, return -1;);
-	priv->tty->driver.tiocmset(priv->tty, NULL, set, clear);
+	ASSERT(priv->tty->driver->tiocmset != NULL, return -1;);
+	priv->tty->driver->tiocmset(priv->tty, NULL, set, clear);
 
 	return 0;
 }
@@ -231,17 +231,17 @@
 	ASSERT(priv->magic == IRTTY_MAGIC, return -1;);
 
 	tty = priv->tty;
-	if (!tty->driver.write)
+	if (!tty->driver->write)
 		return 0;
 	tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
-	if (tty->driver.write_room) {
-		writelen = tty->driver.write_room(tty);
+	if (tty->driver->write_room) {
+		writelen = tty->driver->write_room(tty);
 		if (writelen > len)
 			writelen = len;
 	}
 	else
 		writelen = len;
-	return tty->driver.write(tty, 0, ptr, writelen);
+	return tty->driver->write(tty, 0, ptr, writelen);
 }
 
 /* ------------------------------------------------------- */
@@ -354,8 +354,8 @@
 		cflag |= CREAD;
 
 	tty->termios->c_cflag = cflag;
-	if (tty->driver.set_termios)
-		tty->driver.set_termios(tty, &old_termios);
+	if (tty->driver->set_termios)
+		tty->driver->set_termios(tty, &old_termios);
 	unlock_kernel();
 }
 
@@ -381,8 +381,8 @@
 
 	tty = priv->tty;
 
-	if (tty->driver.start)
-		tty->driver.start(tty);
+	if (tty->driver->start)
+		tty->driver->start(tty);
 	/* Make sure we can receive more data */
 	irtty_stop_receiver(tty, FALSE);
 
@@ -410,8 +410,8 @@
 
 	/* Make sure we don't receive more data */
 	irtty_stop_receiver(tty, TRUE);
-	if (tty->driver.stop)
-		tty->driver.stop(tty);
+	if (tty->driver->stop)
+		tty->driver->stop(tty);
 
 	up(&irtty_sem);
 
@@ -502,7 +502,6 @@
 {
 	struct sir_dev *dev;
 	struct sirtty_cb *priv;
-	char hwname[16];
 	int ret = 0;
 
 	/* unfortunately, there's no tty_ldisc->owner field
@@ -522,11 +521,11 @@
 
 	/* stop the underlying  driver */
 	irtty_stop_receiver(tty, TRUE);
-	if (tty->driver.stop)
-		tty->driver.stop(tty);
+	if (tty->driver->stop)
+		tty->driver->stop(tty);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	
 /* from old irtty - but what is it good for?
  * we _are_ the ldisc and we _don't_ implement flush_buffer!
@@ -535,25 +534,11 @@
  *		tty->ldisc.flush_buffer(tty);
  */
 
-
-	/* create device name - could we use tty_name() here? */
-
-	if (strchr(tty->driver.name, '%')) {
-		sprintf(hwname, tty->driver.name,
-			minor(tty->device) - tty->driver.minor_start +
-			tty->driver.name_base);
-	}
-	else {
-		sprintf(hwname, "%s%d", tty->driver.name,
-			minor(tty->device) - tty->driver.minor_start +
-			tty->driver.name_base);
-	}
-
 	/* apply mtt override */
 	sir_tty_drv.qos_mtt_bits = qos_mtt_bits;
 
 	/* get a sir device instance for this driver */
-	dev = sirdev_get_instance(&sir_tty_drv, hwname);
+	dev = sirdev_get_instance(&sir_tty_drv, tty->name);
 	if (!dev) {
 		ret = -ENODEV;
 		goto out;
@@ -625,8 +610,8 @@
 	/* Stop tty */
 	irtty_stop_receiver(tty, TRUE);
 	tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
-	if (tty->driver.stop)
-		tty->driver.stop(tty);
+	if (tty->driver->stop)
+		tty->driver->stop(tty);
 
 	kfree(priv);
 
diff -Nru a/drivers/net/irda/irtty.c b/drivers/net/irda/irtty.c
--- a/drivers/net/irda/irtty.c	Fri Sep 20 17:31:49 2002
+++ b/drivers/net/irda/irtty.c	Mon Apr 21 20:58:41 2003
@@ -170,14 +170,12 @@
 	tty->disc_data = self;
 
 	/* Give self a name */
-	sprintf(name, "%s%d", tty->driver.name,
-		minor(tty->device) - tty->driver.minor_start +
-		tty->driver.name_base);
+	strcpy(name, tty->name);
 
 	hashbin_insert(irtty, (irda_queue_t *) self, (int) self, NULL);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
@@ -335,7 +333,7 @@
 
 	/* This is unsafe, but currently under discussion - Jean II */
 	self->tty->termios->c_cflag = cflag;
-	self->tty->driver.set_termios(self->tty, &old_termios);
+	self->tty->driver->set_termios(self->tty, &old_termios);
 }
 
 /* 
@@ -388,7 +386,7 @@
 
 	/* This is unsafe, but currently under discussion - Jean II */
 	self->tty->termios->c_cflag = cflag;
-	self->tty->driver.set_termios(self->tty, &old_termios);
+	self->tty->driver->set_termios(self->tty, &old_termios);
 
 	self->io.speed = speed;
 }
@@ -429,7 +427,7 @@
 		 * Make sure all data is sent before changing the speed of the
 		 * serial port.
 		 */
-		if (self->tty->driver.chars_in_buffer(self->tty)) {
+		if (self->tty->driver->chars_in_buffer(self->tty)) {
 			/* Keep state, and try again later */
 			ret = MSECS_TO_JIFFIES(10);
 			break;
@@ -684,8 +682,8 @@
 	dev->trans_start = jiffies;
 	self->stats.tx_bytes += self->tx_buff.len;
 
-	if (self->tty->driver.write)
-		actual = self->tty->driver.write(self->tty, 0, 
+	if (self->tty->driver->write)
+		actual = self->tty->driver->write(self->tty, 0, 
 						 self->tx_buff.data, 
 						 self->tx_buff.len);
 	/* Hide the part we just transmitted */
@@ -738,7 +736,7 @@
 	/* Finished with frame?  */
 	if (self->tx_buff.len > 0)  {
 		/* Write data left in transmit buffer */
-		actual = tty->driver.write(tty, 0, self->tx_buff.data, 
+		actual = tty->driver->write(tty, 0, self->tx_buff.data, 
 					   self->tx_buff.len);
 
 		self->tx_buff.data += actual;
@@ -823,7 +821,7 @@
 	set_fs(get_ds());
 	
 	/* This is probably unsafe, but currently under discussion - Jean II */
-	if (tty->driver.ioctl(tty, NULL, TIOCMSET, (unsigned long) &arg)) { 
+	if (tty->driver->ioctl(tty, NULL, TIOCMSET, (unsigned long) &arg)) { 
 		IRDA_DEBUG(2, "%s(), error doing ioctl!\n", __FUNCTION__);
 	}
 	set_fs(fs);
@@ -923,8 +921,8 @@
 	ASSERT(self != NULL, return 0;);
 	ASSERT(self->magic == IRTTY_MAGIC, return 0;);
 
-	if (self->tty->driver.write)
-		actual = self->tty->driver.write(self->tty, 0, buf, len);
+	if (self->tty->driver->write)
+		actual = self->tty->driver->write(self->tty, 0, buf, len);
 
 	return actual;
 }
@@ -957,9 +955,7 @@
 	irtty_stop_receiver(self, FALSE);
 
 	/* Give self a hardware name */
-	sprintf(hwname, "%s%d", tty->driver.name,
-		minor(tty->device) - tty->driver.minor_start +
-		tty->driver.name_base);
+	sprintf(hwname, "%s", tty->name);
 
 	/* 
 	 * Open new IrLAP layer instance, now that everything should be
diff -Nru a/drivers/net/irda/smc-ircc.c b/drivers/net/irda/smc-ircc.c
--- a/drivers/net/irda/smc-ircc.c	Mon Jan 27 12:55:06 2003
+++ b/drivers/net/irda/smc-ircc.c	Mon Apr 21 02:54:19 2003
@@ -86,7 +86,7 @@
 static int  ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev);
 static void ircc_dma_xmit(struct ircc_cb *self, int iobase, int bofs);
 static void ircc_change_speed(void *priv, u32 speed);
-static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int  ircc_net_open(struct net_device *dev);
 static int  ircc_net_close(struct net_device *dev);
 static int  ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data);
@@ -979,7 +979,7 @@
  *    An interrupt from the chip has arrived. Time to do some work
  *
  */
-static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
 	struct irport_cb *irport;
@@ -989,7 +989,7 @@
 	if (dev == NULL) {
 		printk(KERN_WARNING "%s: irq %d for unknown device.\n", 
 		       driver_name, irq);
-		return;
+		return IRQ_NONE;
 	}
 	irport = (struct irport_cb *) dev->priv;
 	ASSERT(irport != NULL, return;);
@@ -1000,7 +1000,7 @@
 	if (self->io->speed < 576000) {
 		/* Will spinlock itself - Jean II */
 		irport_interrupt(irq, dev_id, regs);
-		return;
+		return IRQ_HANDLED;
 	}
 	iobase = self->io->fir_base;
 
@@ -1028,6 +1028,7 @@
 	outb(IRCC_IER_ACTIVE_FRAME|IRCC_IER_EOM, iobase+IRCC_IER);
 
 	spin_unlock(&self->irport->lock);
+	return IRQ_HANDLED;
 }
 
 #if 0 /* unused */
diff -Nru a/drivers/net/lance.c b/drivers/net/lance.c
--- a/drivers/net/lance.c	Fri Jan 10 12:05:04 2003
+++ b/drivers/net/lance.c	Sun Apr 20 22:41:09 2003
@@ -278,7 +278,7 @@
 static void lance_init_ring(struct net_device *dev, int mode);
 static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int lance_rx(struct net_device *dev);
-static void lance_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int lance_close(struct net_device *dev);
 static struct net_device_stats *lance_get_stats(struct net_device *dev);
 static void set_multicast_list(struct net_device *dev);
@@ -945,7 +945,7 @@
 }
 
 /* The LANCE interrupt handler. */
-static void
+static irqreturn_t
 lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device *dev = dev_id;
@@ -955,7 +955,7 @@
 
 	if (dev == NULL) {
 		printk ("lance_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	ioaddr = dev->base_addr;
@@ -1066,6 +1066,7 @@
 			   inw(dev->base_addr + LANCE_DATA));
 
 	spin_unlock (&lp->devlock);
+	return IRQ_HANDLED;
 }
 
 static int
diff -Nru a/drivers/net/lp486e.c b/drivers/net/lp486e.c
--- a/drivers/net/lp486e.c	Mon Apr  7 11:14:53 2003
+++ b/drivers/net/lp486e.c	Sun Apr 20 23:39:11 2003
@@ -377,7 +377,7 @@
 
 static int i596_open(struct net_device *dev);
 static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int i596_close(struct net_device *dev);
 static struct net_device_stats *i596_get_stats(struct net_device *dev);
 static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd);
@@ -1160,7 +1160,7 @@
 	spin_unlock_irqrestore(&lp->cmd_lock, flags);
 }
 
-static void
+static irqreturn_t
 i596_interrupt (int irq, void *dev_instance, struct pt_regs *regs) {
 	struct net_device *dev = (struct net_device *) dev_instance;
 	struct i596_private *lp;
@@ -1229,7 +1229,7 @@
 	CA();
 
  out:
-	return;
+	return IRQ_HANDLED;
 }
 
 static int i596_close(struct net_device *dev) {
diff -Nru a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
--- a/drivers/net/myri_sbus.c	Thu Jan 16 11:15:45 2003
+++ b/drivers/net/myri_sbus.c	Mon Apr 21 00:01:24 2003
@@ -533,7 +533,7 @@
 	}
 }
 
-static void myri_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t myri_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev		= (struct net_device *) dev_id;
 	struct myri_eth *mp		= (struct myri_eth *) dev->priv;
@@ -567,6 +567,8 @@
 	DIRQ(("\n"));
 
 	spin_unlock_irqrestore(&mp->irq_lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 static int myri_open(struct net_device *dev)
diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c
--- a/drivers/net/natsemi.c	Tue Feb 18 10:31:36 2003
+++ b/drivers/net/natsemi.c	Sun Apr 20 21:58:27 2003
@@ -696,7 +696,7 @@
 static void reinit_ring(struct net_device *dev);
 static void init_registers(struct net_device *dev);
 static int start_tx(struct sk_buff *skb, struct net_device *dev);
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
 static void netdev_error(struct net_device *dev, int intr_status);
 static void netdev_rx(struct net_device *dev);
 static void netdev_tx_done(struct net_device *dev);
@@ -1680,15 +1680,16 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
 	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
 	int boguscnt = max_interrupt_work;
+	unsigned int handled = 0;
 
 	if (np->hands_off)
-		return;
+		return IRQ_NONE;
 	do {
 		/* Reading automatically acknowledges all int sources. */
 		u32 intr_status = readl(ioaddr + IntrStatus);
@@ -1701,6 +1702,7 @@
 
 		if (intr_status == 0)
 			break;
+		handled = 1;
 
 		if (intr_status &
 		   (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
@@ -1731,6 +1733,8 @@
 
 	if (netif_msg_intr(np))
 		printk(KERN_DEBUG "%s: exiting interrupt.\n", dev->name);
+
+	return IRQ_RETVAL(handled);
 }
 
 /* This routine is logically part of the interrupt handler, but separated
diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c
--- a/drivers/net/ni5010.c	Fri Jan 10 12:05:11 2003
+++ b/drivers/net/ni5010.c	Sun Apr 20 23:00:41 2003
@@ -104,7 +104,7 @@
 static int	ni5010_probe1(struct net_device *dev, int ioaddr);
 static int	ni5010_open(struct net_device *dev);
 static int	ni5010_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void	ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void	ni5010_rx(struct net_device *dev);
 static void	ni5010_timeout(struct net_device *dev);
 static int	ni5010_close(struct net_device *dev);
@@ -451,7 +451,7 @@
  * The typical workload of the driver:
  * Handle the network interface interrupts. 
  */
-static void  ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ni5010_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct ni5010_local *lp;
@@ -479,7 +479,7 @@
 
 	if (!xmit_was_error) 
 		reset_receiver(dev); 
-	return;
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/net/ni52.c b/drivers/net/ni52.c
--- a/drivers/net/ni52.c	Fri Jan 10 12:05:11 2003
+++ b/drivers/net/ni52.c	Sun Apr 20 23:00:41 2003
@@ -193,7 +193,7 @@
 #define NI52_ADDR2 0x01
 
 static int     ni52_probe1(struct net_device *dev,int ioaddr);
-static void    ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr);
+static irqreturn_t ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr);
 static int     ni52_open(struct net_device *dev);
 static int     ni52_close(struct net_device *dev);
 static int     ni52_send_packet(struct sk_buff *,struct net_device *);
@@ -821,7 +821,7 @@
  * Interrupt Handler ...
  */
 
-static void ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr)
+static irqreturn_t ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr)
 {
 	struct net_device *dev = dev_id;
 	unsigned short stat;
@@ -830,7 +830,7 @@
 
 	if (!dev) {
 		printk ("ni5210-interrupt: irq %d for unknown device.\n",irq);
-		return;
+		return IRQ_NONE;
 	}
 	p = (struct priv *) dev->priv;
 
@@ -889,6 +889,7 @@
 
 	if(debuglevel > 1)
 		printk("i");
+	return IRQ_HANDLED;
 }
 
 /*******************************************************
diff -Nru a/drivers/net/ni65.c b/drivers/net/ni65.c
--- a/drivers/net/ni65.c	Fri Jan 10 12:05:11 2003
+++ b/drivers/net/ni65.c	Sun Apr 20 23:00:41 2003
@@ -248,7 +248,7 @@
 };
 
 static int  ni65_probe1(struct net_device *dev,int);
-static void ni65_interrupt(int irq, void * dev_id, struct pt_regs *regs);
+static irqreturn_t ni65_interrupt(int irq, void * dev_id, struct pt_regs *regs);
 static void ni65_recv_intr(struct net_device *dev,int);
 static void ni65_xmit_intr(struct net_device *dev,int);
 static int  ni65_open(struct net_device *dev);
@@ -307,7 +307,6 @@
 	if(ni65_lance_reinit(dev))
 	{
 		netif_start_queue(dev);
-		MOD_INC_USE_COUNT;
 		return 0;
 	}
 	else
@@ -341,7 +340,6 @@
 	}
 #endif
 	free_irq(dev->irq,dev);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -512,7 +510,7 @@
 	}
 
 	dev->base_addr = ioaddr;
-
+	SET_MODULE_OWNER(dev);
 	dev->open		= ni65_open;
 	dev->stop		= ni65_close;
 	dev->hard_start_xmit	= ni65_send_packet;
@@ -839,7 +837,7 @@
 /*
  * interrupt handler
  */
-static void ni65_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+static irqreturn_t ni65_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 {
 	int csr0 = 0;
 	struct net_device *dev = dev_id;
@@ -940,7 +938,7 @@
 	else
 		writedatareg(CSR0_INEA);
 
-	return;
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/net/ns83820.c b/drivers/net/ns83820.c
--- a/drivers/net/ns83820.c	Thu Feb 13 23:40:57 2003
+++ b/drivers/net/ns83820.c	Sun Apr 20 21:58:27 2003
@@ -549,7 +549,7 @@
 static inline int rx_refill(struct ns83820 *dev, int gfp)
 {
 	unsigned i;
-	long flags = 0;
+	unsigned long flags = 0;
 
 	if (unlikely(nr_rx_empty(dev) <= 2))
 		return 0;
@@ -763,7 +763,7 @@
 static void ns83820_cleanup_rx(struct ns83820 *dev)
 {
 	unsigned i;
-	long flags;
+	unsigned long flags;
 
 	dprintk("ns83820_cleanup_rx(%p)\n", dev);
 
@@ -820,7 +820,7 @@
 	struct rx_info *info = &dev->rx_info;
 	unsigned next_rx;
 	u32 cmdsts, *desc;
-	long flags;
+	unsigned long flags;
 	int nr = 0;
 
 	dprintk("rx_irq(%p)\n", dev);
@@ -1234,7 +1234,7 @@
 }
 
 static void ns83820_do_isr(struct ns83820 *dev, u32 isr);
-static void ns83820_irq(int foo, void *data, struct pt_regs *regs)
+static irqreturn_t ns83820_irq(int foo, void *data, struct pt_regs *regs)
 {
 	struct ns83820 *dev = data;
 	u32 isr;
@@ -1245,6 +1245,7 @@
 	isr = readl(dev->base + ISR);
 	dprintk("irq: %08x\n", isr);
 	ns83820_do_isr(dev, isr);
+	return IRQ_HANDLED;
 }
 
 static void ns83820_do_isr(struct ns83820 *dev, u32 isr)
@@ -1396,7 +1397,7 @@
 {
 	struct ns83820 *dev = (struct ns83820 *)_dev;
         u32 tx_done_idx, *desc;
-	long flags;
+	unsigned long flags;
 
 	local_irq_save(flags);
 
diff -Nru a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
--- a/drivers/net/pcmcia/3c574_cs.c	Mon Apr  7 11:33:22 2003
+++ b/drivers/net/pcmcia/3c574_cs.c	Sat Apr 19 23:19:00 2003
@@ -940,11 +940,9 @@
 		outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD);
 	}
 
-	dev_kfree_skb (skb);
 	pop_tx_status(dev);
-
-	spin_unlock(&lp->window_lock);
-	
+	spin_unlock_irqrestore(&lp->window_lock, flags);
+	dev_kfree_skb(skb);
 	return 0;
 }
 
diff -Nru a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
--- a/drivers/net/pcmcia/3c589_cs.c	Sun Feb  2 13:40:35 2003
+++ b/drivers/net/pcmcia/3c589_cs.c	Sun Apr 20 23:39:11 2003
@@ -249,6 +249,7 @@
     link->conf.Present = PRESENT_OPTION;
     
     /* The EL3-specific entries in the device structure. */
+    SET_MODULE_OWNER(dev);
     dev->hard_start_xmit = &el3_start_xmit;
     dev->set_config = &el3_config;
     dev->get_stats = &el3_get_stats;
@@ -740,7 +741,6 @@
 	return -ENODEV;
 
     link->open++;
-    MOD_INC_USE_COUNT;
     netif_start_queue(dev);
     
     tc589_reset(dev);
@@ -1147,8 +1147,6 @@
     del_timer_sync(&lp->media);
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
-    
-    MOD_DEC_USE_COUNT;
     
     return 0;
 }
diff -Nru a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig
--- a/drivers/net/pcmcia/Kconfig	Tue Feb 25 18:56:15 2003
+++ b/drivers/net/pcmcia/Kconfig	Sun Apr 20 12:56:51 2003
@@ -17,7 +17,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  You also want to check out the PCMCIA-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  If unsure, say N.
 
diff -Nru a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
--- a/drivers/net/pcmcia/axnet_cs.c	Tue Feb 25 02:45:03 2003
+++ b/drivers/net/pcmcia/axnet_cs.c	Sun Apr 20 23:39:11 2003
@@ -98,7 +98,7 @@
 static int axnet_open(struct net_device *dev);
 static int axnet_close(struct net_device *dev);
 static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);
 static void ei_watchdog(u_long arg);
 static void axnet_reset_8390(struct net_device *dev);
 
@@ -122,7 +122,7 @@
 static void AX88190_init(struct net_device *dev, int startp);
 static int ax_open(struct net_device *dev);
 static int ax_close(struct net_device *dev);
-static void ax_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ax_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /*====================================================================*/
 
@@ -687,7 +687,6 @@
 	return -ENODEV;
 
     link->open++;
-    MOD_INC_USE_COUNT;
 
     request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev);
 
@@ -719,8 +718,6 @@
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
 
-    MOD_DEC_USE_COUNT;
-
     return 0;
 } /* axnet_close */
 
@@ -757,11 +754,11 @@
 
 /*====================================================================*/
 
-static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
 {
     axnet_dev_t *info = dev_id;
     info->stale = 0;
-    ax_interrupt(irq, dev_id, regs);
+    return ax_interrupt(irq, dev_id, regs);
 }
 
 static void ei_watchdog(u_long arg)
@@ -1345,17 +1342,18 @@
  * needed.
  */
 
-static void ax_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t ax_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device *dev = dev_id;
 	long e8390_base;
 	int interrupts, nr_serviced = 0, i;
 	struct ei_device *ei_local;
-    
+    	int handled = 0;
+
 	if (dev == NULL) 
 	{
 		printk ("net_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
     
 	e8390_base = dev->base_addr;
@@ -1378,7 +1376,7 @@
 			   inb_p(e8390_base + EN0_IMR));
 #endif
 		spin_unlock(&ei_local->page_lock);
-		return;
+		return IRQ_NONE;
 	}
     
 	if (ei_debug > 3)
@@ -1399,6 +1397,8 @@
 			interrupts = 0;
 			break;
 		}
+		handled = 1;
+
 		/* AX88190 bug fix. */
 		outb_p(interrupts, e8390_base + EN0_ISR);
 		for (i = 0; i < 10; i++) {
@@ -1430,6 +1430,7 @@
     
 	if (interrupts && ei_debug) 
 	{
+		handled = 1;
 		if (nr_serviced >= MAX_SERVICE) 
 		{
 			/* 0xFF is valid for a card removal */
@@ -1448,7 +1449,7 @@
 	outb_p(ENISR_ALL, e8390_base + EN0_IMR);
 
 	spin_unlock(&ei_local->page_lock);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /**
@@ -1842,6 +1843,8 @@
 	if (ei_debug > 1)
 		printk(version_8390);
     
+	SET_MODULE_OWNER(dev);
+
 	if (dev->priv == NULL) 
 	{
 		struct ei_device *ei_local;
diff -Nru a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
--- a/drivers/net/pcmcia/fmvj18x_cs.c	Fri Jan 10 12:05:11 2003
+++ b/drivers/net/pcmcia/fmvj18x_cs.c	Sun Apr 20 23:39:11 2003
@@ -314,6 +314,7 @@
     link->conf.IntType = INT_MEMORY_AND_IO;
 
     /* The FMVJ18x specific entries in the device structure. */
+    SET_MODULE_OWNER(dev);
     dev->hard_start_xmit = &fjn_start_xmit;
     dev->set_config = &fjn_config;
     dev->get_stats = &fjn_get_stats;
@@ -1287,8 +1288,6 @@
     lp->open_time = jiffies;
     netif_start_queue(dev);
     
-    MOD_INC_USE_COUNT;
-
     return 0;
 } /* fjn_open */
 
@@ -1323,7 +1322,6 @@
     link->open--;
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
-    MOD_DEC_USE_COUNT;
 
     return 0;
 } /* fjn_close */
@@ -1369,9 +1367,11 @@
 	
 	memset(mc_filter, 0, sizeof(mc_filter));
 	for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-	     i++, mclist = mclist->next)
-	    set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f,
-		    mc_filter);
+	     i++, mclist = mclist->next) {
+	    unsigned int bit =
+	    	ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
+	    mc_filter[bit >> 3] |= (1 << bit);
+	}
     }
     
     save_flags(flags);
diff -Nru a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
--- a/drivers/net/pcmcia/nmclan_cs.c	Sun Feb  2 13:40:35 2003
+++ b/drivers/net/pcmcia/nmclan_cs.c	Sun Apr 20 23:39:11 2003
@@ -515,6 +515,7 @@
 
     lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
 
+    SET_MODULE_OWNER(dev);
     dev->hard_start_xmit = &mace_start_xmit;
     dev->set_config = &mace_config;
     dev->get_stats = &mace_get_stats;
@@ -974,7 +975,6 @@
     return -ENODEV;
 
   link->open++;
-  MOD_INC_USE_COUNT;
 
   MACEBANK(0);
 
@@ -1003,8 +1003,6 @@
   netif_stop_queue(dev);
   if (link->state & DEV_STALE_CONFIG)
     mod_timer(&link->release, jiffies + HZ/20);
-
-  MOD_DEC_USE_COUNT;
 
   return 0;
 } /* mace_close */
diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
--- a/drivers/net/pcmcia/pcnet_cs.c	Wed Mar 19 02:23:25 2003
+++ b/drivers/net/pcmcia/pcnet_cs.c	Sun Apr 20 23:39:11 2003
@@ -117,7 +117,7 @@
 static int pcnet_close(struct net_device *dev);
 static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static int do_ioctl_light(struct net_device *dev, struct ifreq *rq, int cmd);
-static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);
 static void ei_watchdog(u_long arg);
 static void pcnet_reset_8390(struct net_device *dev);
 static int set_config(struct net_device *dev, struct ifmap *map);
@@ -315,6 +315,7 @@
     link->conf.IntType = INT_MEMORY_AND_IO;
 
     ethdev_init(dev);
+    SET_MODULE_OWNER(dev);
     dev->init = &pcnet_init;
     dev->open = &pcnet_open;
     dev->stop = &pcnet_close;
@@ -1030,7 +1031,6 @@
 	return -ENODEV;
 
     link->open++;
-    MOD_INC_USE_COUNT;
 
     set_misc_reg(dev);
     request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev);
@@ -1064,8 +1064,6 @@
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
 
-    MOD_DEC_USE_COUNT;
-
     return 0;
 } /* pcnet_close */
 
@@ -1121,11 +1119,13 @@
 
 /*====================================================================*/
 
-static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
 {
     pcnet_dev_t *info = dev_id;
     info->stale = 0;
     ei_interrupt(irq, dev_id, regs);
+    /* FIXME! Was it really ours? */
+    return IRQ_HANDLED;
 }
 
 static void ei_watchdog(u_long arg)
diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
--- a/drivers/net/pcmcia/smc91c92_cs.c	Mon Nov 25 08:14:08 2002
+++ b/drivers/net/pcmcia/smc91c92_cs.c	Sun Apr 20 23:39:11 2003
@@ -376,6 +376,7 @@
     link->conf.IntType = INT_MEMORY_AND_IO;
 
     /* The SMC91c92-specific entries in the device structure. */
+    SET_MODULE_OWNER(dev);
     dev->hard_start_xmit = &smc_start_xmit;
     dev->get_stats = &smc_get_stats;
     dev->set_config = &s9k_config;
@@ -1301,7 +1302,6 @@
 	return -ENODEV;
     }
     link->open++;
-    MOD_INC_USE_COUNT;
 
     netif_start_queue(dev);
     smc->saved_skb = 0;
@@ -1346,8 +1346,6 @@
     del_timer(&smc->media);
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
-
-    MOD_DEC_USE_COUNT;
 
     return 0;
 } /* smc_close */
diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
--- a/drivers/net/pcmcia/xirc2ps_cs.c	Tue Feb 11 05:51:13 2003
+++ b/drivers/net/pcmcia/xirc2ps_cs.c	Sun Apr 20 23:39:12 2003
@@ -646,6 +646,7 @@
     link->irq.Instance = dev;
 
     /* Fill in card specific entries */
+    SET_MODULE_OWNER(dev);
     dev->hard_start_xmit = &do_start_xmit;
     dev->set_config = &do_config;
     dev->get_stats = &do_get_stats;
@@ -1714,7 +1715,6 @@
 
     /* okay */
     link->open++;
-    MOD_INC_USE_COUNT;
 
     netif_start_queue(dev);
     do_reset(dev,1);
@@ -2065,8 +2065,6 @@
     link->open--;
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
-
-    MOD_DEC_USE_COUNT;
 
     return 0;
 }
diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
--- a/drivers/net/pcnet32.c	Mon Mar 31 15:55:37 2003
+++ b/drivers/net/pcnet32.c	Sun Apr 20 21:26:42 2003
@@ -331,7 +331,7 @@
 static int  pcnet32_start_xmit(struct sk_buff *, struct net_device *);
 static int  pcnet32_rx(struct net_device *);
 static void pcnet32_tx_timeout (struct net_device *dev);
-static void pcnet32_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t pcnet32_interrupt(int, void *, struct pt_regs *);
 static int  pcnet32_close(struct net_device *);
 static struct net_device_stats *pcnet32_get_stats(struct net_device *);
 static void pcnet32_set_multicast_list(struct net_device *);
@@ -717,6 +717,7 @@
 
     spin_lock_init(&lp->lock);
     
+    SET_MODULE_OWNER(dev);
     dev->priv = lp;
     lp->name = chipname;
     lp->shared_irq = shared;
@@ -945,8 +946,6 @@
 	       lp->a.read_csr(ioaddr, 0));
 
 
-    MOD_INC_USE_COUNT;
-    
     return 0;	/* Always succeed */
 }
 
@@ -1148,7 +1147,7 @@
 }
 
 /* The PCNET32 interrupt handler. */
-static void
+static irqreturn_t
 pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
     struct net_device *dev = dev_id;
@@ -1161,7 +1160,7 @@
     if (!dev) {
 	printk (KERN_DEBUG "%s(): irq %d for unknown device\n",
 		__FUNCTION__, irq);
-	return;
+	return IRQ_NONE;
     }
 
     ioaddr = dev->base_addr;
@@ -1293,6 +1292,8 @@
 	       dev->name, lp->a.read_csr (ioaddr, 0));
 
     spin_unlock(&lp->lock);
+
+    return IRQ_HANDLED;
 }
 
 static int
@@ -1440,8 +1441,6 @@
         lp->tx_dma_addr[i] = 0;
     }
     
-    MOD_DEC_USE_COUNT;
-
     return 0;
 }
 
diff -Nru a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
--- a/drivers/net/ppp_async.c	Sat Aug  3 10:51:41 2002
+++ b/drivers/net/ppp_async.c	Mon Apr 21 20:58:40 2003
@@ -332,8 +332,8 @@
 	spin_unlock_bh(&ap->recv_lock);
 	ap_put(ap);
 	if (test_and_clear_bit(TTY_THROTTLED, &tty->flags)
-	    && tty->driver.unthrottle)
-		tty->driver.unthrottle(tty);
+	    && tty->driver->unthrottle)
+		tty->driver->unthrottle(tty);
 }
 
 static void
@@ -662,7 +662,7 @@
 		if (!tty_stuffed && ap->optr < ap->olim) {
 			avail = ap->olim - ap->optr;
 			set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-			sent = tty->driver.write(tty, 0, ap->optr, avail);
+			sent = tty->driver->write(tty, 0, ap->optr, avail);
 			if (sent < 0)
 				goto flush;	/* error, e.g. loss of CD */
 			ap->optr += sent;
diff -Nru a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
--- a/drivers/net/ppp_synctty.c	Sat Aug  3 10:51:41 2002
+++ b/drivers/net/ppp_synctty.c	Mon Apr 21 20:58:40 2003
@@ -385,8 +385,8 @@
 	spin_unlock_bh(&ap->recv_lock);
 	sp_put(ap);
 	if (test_and_clear_bit(TTY_THROTTLED, &tty->flags)
-	    && tty->driver.unthrottle)
-		tty->driver.unthrottle(tty);
+	    && tty->driver->unthrottle)
+		tty->driver->unthrottle(tty);
 }
 
 static void
@@ -610,7 +610,7 @@
 			tty_stuffed = 0;
 		if (!tty_stuffed && ap->tpkt != 0) {
 			set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-			sent = tty->driver.write(tty, 0, ap->tpkt->data, ap->tpkt->len);
+			sent = tty->driver->write(tty, 0, ap->tpkt->data, ap->tpkt->len);
 			if (sent < 0)
 				goto flush;	/* error, e.g. loss of CD */
 			if (sent < ap->tpkt->len) {
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
--- a/drivers/net/r8169.c	Thu Mar 27 13:19:18 2003
+++ b/drivers/net/r8169.c	Sun Apr 20 22:09:47 2003
@@ -295,7 +295,7 @@
 
 static int rtl8169_open(struct net_device *dev);
 static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void rtl8169_interrupt(int irq, void *dev_instance,
+static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance,
 			      struct pt_regs *regs);
 static void rtl8169_init_ring(struct net_device *dev);
 static void rtl8169_hw_start(struct net_device *dev);
@@ -958,7 +958,7 @@
 }
 
 /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
-static void
+static irqreturn_t
 rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
@@ -966,6 +966,7 @@
 	int boguscnt = max_interrupt_work;
 	void *ioaddr = tp->mmio_addr;
 	int status = 0;
+	int handled = 0;
 
 	do {
 		status = RTL_R16(IntrStatus);
@@ -974,6 +975,7 @@
 		if (status == 0xFFFF)
 			break;
 
+		handled = 1;
 /*
 		if (status & RxUnderrun)
 			link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit;
@@ -1006,6 +1008,7 @@
 		/* Clear all interrupt sources. */
 		RTL_W16(IntrStatus, 0xffff);
 	}
+	return IRQ_RETVAL(handled);
 }
 
 static int
diff -Nru a/drivers/net/rclanmtl.c b/drivers/net/rclanmtl.c
--- a/drivers/net/rclanmtl.c	Mon Feb  4 23:41:18 2002
+++ b/drivers/net/rclanmtl.c	Sun Apr 20 21:26:42 2003
@@ -301,13 +301,13 @@
 	PPAB pPab;
 	U32 pciBaseAddr = dev->base_addr;
 	PDPA pDpa = dev->priv;
-	PU8 p_msgbuf = pDpa->PLanApiPA;
-	PU8 p_phymsgbuf = (PU8) virt_to_bus ((void *) p_msgbuf);
+	PU8 p_msgbuf = pDpa->msgbuf;
+	PU8 p_phymsgbuf = (PU8) pDpa->msgbuf_dma;
 
 	dprintk
-	    ("InitI2O: Adapter:0x%04ux ATU:0x%08ulx msgbuf:0x%08ulx phymsgbuf:0x%08ulx\n"
+	    ("InitI2O: Adapter:0x%04ux ATU:0x%08ulx msgbuf:%p phymsgbuf:0x%08ulx\n"
 	     "TransmitCallbackFunction:0x%08ulx  ReceiveCallbackFunction:0x%08ulx\n",
-	     pDpa->id, pciBaseAddr, (u32) p_msgbuf, (u32) p_phymsgbuf,
+	     pDpa->id, pciBaseAddr, p_msgbuf, (u32) p_phymsgbuf,
 	     (u32) TransmitCallbackFunction, (u32) ReceiveCallbackFunction);
 
 	/* Check if this interface already initialized - if so, shut it down */
@@ -445,7 +445,7 @@
 		return RC_RTN_FREE_Q_EMPTY;
 	}
 
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 
 	size = FillI2OMsgSGLFromTCB (pMsg + 4, pTransCtrlBlock);
@@ -502,7 +502,7 @@
 		dprintk ("RCPostRecvBuffers(): Inbound Free Q empty!\n");
 		return RC_RTN_FREE_Q_EMPTY;
 	}
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 
 	size = FillI2OMsgSGLFromTCB (pMsg + 4, pTransCtrlBlock);
@@ -538,7 +538,7 @@
 ** Process I2O outbound message queue until empty.
 ** =========================================================================
 */
-void
+irqreturn_t
 RCProcI2OMsgQ (struct net_device *dev)
 {
 	U32 phyAddrMsg;
@@ -549,7 +549,7 @@
 	unsigned char debug_msg[20];
 
 	if (pPab == NULL)
-		return;
+		return IRQ_NONE;
 
 	phyAddrMsg = pPab->p_atu->OutQueue;
 
@@ -642,6 +642,8 @@
 		/* any more msgs? */
 		phyAddrMsg = pPab->p_atu->OutQueue;
 	}
+
+	return IRQ_HANDLED;
 }
 
 /*
@@ -677,7 +679,7 @@
 		return RC_RTN_FREE_Q_EMPTY;
 	}
 
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 
 /*dprintk("Get82558Stats - pMsg = 0x%08ulx, InQ msgOffset = 0x%08ulx\n", pMsg, msgOffset);*/
@@ -751,7 +753,7 @@
 		return RC_RTN_FREE_Q_EMPTY;
 	}
 
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 /*dprintk("Get82558LinkStatus - pMsg = 0x%08ulx, InQ msgOffset = 0x%08ulx\n", pMsg, msgOffset);*/
 /*dprintk("Get82558LinkStatus - pMsg = 0x%08X, InQ msgOffset = 0x%08X\n", pMsg, msgOffset);*/
@@ -1452,7 +1454,7 @@
 	pMsg[7] = 0;
 	pMsg[8] = 1;		/*  return 1 byte */
 
-	/* virual pointer to return buffer - clear first two dwords */
+	/* virtual pointer to return buffer - clear first two dwords */
 	p32 = (volatile PU32) pPab->pLinOutMsgBlock;
 	p32[0] = 0;
 	p32[1] = 0;
@@ -1693,7 +1695,7 @@
 		return RC_RTN_FREE_Q_EMPTY;
 	}
 
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 
 	dprintk
@@ -1711,7 +1713,7 @@
 	/* phys address to return status - area right after PAB */
 	pMsg[7] = pPab->outMsgBlockPhyAddr;
 
-	/* virual pointer to return buffer - clear first two dwords */
+	/* virtual pointer to return buffer - clear first two dwords */
 	p32 = (PU32) pPab->pLinOutMsgBlock;
 	p32[0] = 0;
 
@@ -1779,7 +1781,7 @@
 		return RC_RTN_FREE_Q_EMPTY;
 	}
 
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 
 	pMsg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_0;
@@ -1793,7 +1795,7 @@
 	pMsg[7] = 0;
 	pMsg[8] = 88;		/*  return 88 bytes */
 
-	/* virual pointer to return buffer - clear first two dwords */
+	/* virtual pointer to return buffer - clear first two dwords */
 	p32 = (volatile PU32) pPab->pLinOutMsgBlock;
 	p32[0] = 0;
 	p32[1] = 0;
@@ -1862,7 +1864,7 @@
 		return RC_RTN_FREE_Q_EMPTY;
 	}
 
-	/* calc virual address of msg - virual already mapped to physical */
+	/* calc virtual address of msg - virtual already mapped to physical */
 	pMsg = (PU32) (pPab->pPci45LinBaseAddr + msgOffset);
 
 	dprintk
@@ -1885,7 +1887,7 @@
 ** =========================================================================
 ** FillI2OMsgFromTCB()
 **
-** inputs   pMsgU32 - virual pointer (mapped to physical) of message frame
+** inputs   pMsgU32 - virtual pointer (mapped to physical) of message frame
 **          pXmitCntrlBlock - pointer to caller buffer control block.
 **
 ** fills in LAN SGL after Transaction Control Word or Bucket Count.
diff -Nru a/drivers/net/rclanmtl.h b/drivers/net/rclanmtl.h
--- a/drivers/net/rclanmtl.h	Mon Feb  4 23:41:18 2002
+++ b/drivers/net/rclanmtl.h	Sun Apr 20 21:26:42 2003
@@ -182,6 +182,7 @@
 	U32 pci_addr;		/* the pci address of the adapter */
 	U32 pci_addr_len;
 
+	struct pci_dev *pci_dev;
 	struct timer_list timer;	/*  timer */
 	struct net_device_stats stats;	/* the statistics structure */
 	unsigned long numOutRcvBuffers;	/* number of outstanding receive buffers */
@@ -189,7 +190,7 @@
 	unsigned char reboot;
 	unsigned char nexus;
 	PU8 msgbuf;		/* Pointer to Lan Api Private Area */
-	PU8 PLanApiPA;		/* Pointer to Lan Api Private Area (aligned) */
+	dma_addr_t msgbuf_dma;
 	PPAB pPab;		/* Pointer to the PCI Adapter Block */
 } *PDPA;
 
@@ -421,7 +422,7 @@
     ** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction,
     ** if a TX or RX transaction has completed.
   */
-void RCProcI2OMsgQ (struct net_device *dev);
+irqreturn_t RCProcI2OMsgQ (struct net_device *dev);
 
  /*
     ** Disable and Enable I2O interrupts.  I2O interrupts are enabled at Init time
diff -Nru a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c
--- a/drivers/net/rcpci45.c	Mon Mar 31 15:55:37 2003
+++ b/drivers/net/rcpci45.c	Sun Apr 20 21:26:42 2003
@@ -29,6 +29,8 @@
 **  along with this program; if not, write to the Free Software
 **  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 **
+**  Francois Romieu, Apr 2003: Converted to pci DMA mapping API.
+**
 **  Pete Popov, Oct 2001: Fixed a few bugs to make the driver functional
 **  again. Note that this card is not supported or manufactured by 
 **  RedCreek anymore.
@@ -47,8 +49,6 @@
 **
 ***************************************************************************/
 
-#error Please convert me to Documentation/DMA-mapping.txt
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -66,7 +66,7 @@
 #include <asm/uaccess.h>
 
 static char version[] __initdata =
-    "RedCreek Communications PCI linux driver version 2.20\n";
+    "RedCreek Communications PCI linux driver version 2.21\n";
 
 #define RC_LINUX_MODULE
 #include "rclanmtl.h"
@@ -95,13 +95,19 @@
  */
 #define MSG_BUF_SIZE  16384
 
+/* 2003/04/20: I don't know about the hardware ability but the driver won't
+ * play safe with 64 bit addressing and DAC without NETIF_F_HIGHDMA doesn't
+ * really make sense anyway. Let's play safe - romieu.
+ */
+#define RCPCI45_DMA_MASK	((u64) 0xffffffff)
+
 static U32 DriverControlWord;
 
 static void rc_timer (unsigned long);
 
 static int RCopen (struct net_device *);
 static int RC_xmit_packet (struct sk_buff *, struct net_device *);
-static void RCinterrupt (int, void *, struct pt_regs *);
+static irqreturn_t RCinterrupt (int, void *, struct pt_regs *);
 static int RCclose (struct net_device *dev);
 static struct net_device_stats *RCget_stats (struct net_device *);
 static int RCioctl (struct net_device *, struct ifreq *, int);
@@ -136,8 +142,8 @@
 	free_irq (dev->irq, dev);
 	iounmap ((void *) dev->base_addr);
 	pci_release_regions (pdev);
-	if (pDpa->msgbuf)
-		kfree (pDpa->msgbuf);
+	pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf,
+			     pDpa->msgbuf_dma);
 	if (pDpa->pPab)
 		kfree (pDpa->pPab);
 	kfree (dev);
@@ -172,6 +178,7 @@
 		error = -ENOMEM;
 		goto err_out;
 	}
+	SET_MODULE_OWNER(dev);
 
 	error = pci_enable_device (pdev);
 	if (error) {
@@ -180,7 +187,6 @@
 			card_idx);
 		goto err_out;
 	}
-	error = -ENOMEM;
 	pci_start = pci_resource_start (pdev, 0);
 	pci_len = pci_resource_len (pdev, 0);
 	printk("pci_start %lx pci_len %lx\n", pci_start, pci_len);
@@ -189,6 +195,7 @@
 
 	pDpa = dev->priv;
 	pDpa->id = card_idx;
+	pDpa->pci_dev = pdev;
 	pDpa->pci_addr = pci_start;
 
 	if (!pci_start || !(pci_resource_flags (pdev, 0) & IORESOURCE_MEM)) {
@@ -200,24 +207,21 @@
 
 	/*
 	 * pDpa->msgbuf is where the card will dma the I2O 
-	 * messages. Thus, we need contiguous physical pages of
-	 * memory.
-	 */
-	pDpa->msgbuf = kmalloc (MSG_BUF_SIZE, GFP_DMA | GFP_KERNEL);
+	 * messages. Thus, we need contiguous physical pages of memory.
+	 * 2003/04/20:  pci_alloc_consistent() provides well over the needed
+	 * alignment on a 256 bytes boundary for the LAN API private area.
+	 * Thus it isn't needed anymore to align it by hand.
+         */
+	pDpa->msgbuf = pci_alloc_consistent (pdev, MSG_BUF_SIZE,
+					     &pDpa->msgbuf_dma);
 	if (!pDpa->msgbuf) {
 		printk (KERN_ERR "(rcpci45 driver:) \
 			Could not allocate %d byte memory for the \
 				private msgbuf!\n", MSG_BUF_SIZE);
+		error = -ENOMEM;
 		goto err_out_free_dev;
 	}
 
-	/*
-	 * Save the starting address of the LAN API private area.  We'll
-	 * pass that to RCInitI2OMsgLayer().
-	 *
-	 */
-	pDpa->PLanApiPA = (void *) (((long) pDpa->msgbuf + 0xff) & ~0xff);
-
 	/* The adapter is accessible through memory-access read/write, not
 	 * I/O read/write.  Thus, we need to map it to some virtual address
 	 * area in order to access the registers as normal memory.
@@ -226,12 +230,20 @@
 	if (error)
 		goto err_out_free_msgbuf;
 
+	error = pci_set_dma_mask (pdev, RCPCI45_DMA_MASK);
+	if (error) {
+		printk (KERN_ERR
+			"(rcpci45 driver:) pci_set_dma_mask failed!\n");
+		goto err_out_free_region;
+	}
+
 	vaddr = (ulong *) ioremap (pci_start, pci_len);
 	if (!vaddr) {
 		printk (KERN_ERR
 			"(rcpci45 driver:) \
 			Unable to remap address range from %lu to %lu\n",
 			pci_start, pci_start + pci_len);
+		error = -EIO;
 		goto err_out_free_region;
 	}
 
@@ -249,13 +261,14 @@
 err_out_free_region:
 	pci_release_regions (pdev);
 err_out_free_msgbuf:
-	kfree (pDpa->msgbuf);
+	pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf,
+			     pDpa->msgbuf_dma);
 err_out_free_dev:
 	unregister_netdev (dev);
 	kfree (dev);
 err_out:
 	card_idx--;
-	return -ENODEV;
+	return error;
 }
 
 static struct pci_driver rcpci45_driver = {
@@ -283,7 +296,6 @@
 	int requested = 0;
 	int error;
 
-	MOD_INC_USE_COUNT;
 	if (pDpa->nexus) {
 		/* This is not the first time RCopen is called.  Thus,
 		 * the interface was previously opened and later closed
@@ -365,7 +377,6 @@
 err_out_free_irq:
 	free_irq (dev->irq, dev);
 err_out:
-	MOD_DEC_USE_COUNT;
 	return error;
 }
 
@@ -402,7 +413,8 @@
 	ptcb->b.context = (U32) skb;
 	ptcb->b.scount = 1;
 	ptcb->b.size = skb->len;
-	ptcb->b.addr = virt_to_bus ((void *) skb->data);
+	ptcb->b.addr = pci_map_single(pDpa->pci_dev, skb->data, skb->len,
+				      PCI_DMA_TODEVICE);
 
 	if ((status = RCI2OSendPacket (dev, (U32) NULL, (PRCTCB) ptcb))
 	    != RC_RTN_NO_ERROR) {
@@ -451,6 +463,8 @@
 	while (PcktCount--) {
 		skb = (struct sk_buff *) (BufferContext[0]);
 		BufferContext++;
+		pci_unmap_single(pDpa->pci_dev, BufferContext[1], skb->len,
+				 PCI_DMA_TODEVICE);
 		dev_kfree_skb_irq (skb);
 	}
 	netif_wake_queue (dev);
@@ -621,7 +635,7 @@
  * RCProcI2OMsgQ(), which in turn process the message and
  * calls one of our callback functions.
  */
-static void
+static irqreturn_t
 RCinterrupt (int irq, void *dev_id, struct pt_regs *regs)
 {
 
@@ -634,7 +648,7 @@
 		printk (KERN_DEBUG "%s: shutdown, service irq\n",
 				dev->name);
 
-	RCProcI2OMsgQ (dev);
+	return RCProcI2OMsgQ (dev);
 }
 
 #define REBOOT_REINIT_RETRY_LIMIT 4
@@ -706,6 +720,7 @@
 			RCDisableI2OInterrupts (dev);
 			dev->flags &= ~IFF_UP;
 			MOD_DEC_USE_COUNT;
+			/* FIXME: kill MOD_DEC_USE_COUNT, use dev_put */
 		} else {
 			printk (KERN_INFO "%s: rescheduling timer...\n",
 					dev->name);
@@ -731,7 +746,6 @@
 		printk (KERN_INFO "%s skipping reset -- adapter already in reboot mode\n", dev->name);
 		dev->flags &= ~IFF_UP;
 		pDpa->shutdown = 1;
-		MOD_DEC_USE_COUNT;
 		return 0;
 	}
 
@@ -749,7 +763,6 @@
 			   (PFNCALLBACK) RCreset_callback);
 
 	dev->flags &= ~IFF_UP;
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -984,8 +997,9 @@
 	PU32 p;
 	psingleB pB;
 	struct sk_buff *skb;
+	PDPA pDpa = dev->priv;
 	RC_RETURN status;
-	U32 res;
+	U32 res = 0;
 
 	if (!numBuffers)
 		return 0;
@@ -1001,7 +1015,7 @@
 	if (!p) {
 		printk (KERN_WARNING "%s unable to allocate TCB\n",
 				dev->name);
-		return 0;
+		goto out;
 	}
 
 	p[0] = 0;		/* Buffer Count */
@@ -1013,18 +1027,14 @@
 			printk (KERN_WARNING 
 					"%s: unable to allocate enough skbs!\n",
 					dev->name);
-			if (*p != 0) {	/* did we allocate any buffers */
-				break;
-			} else {
-				kfree (p);	/* Free the TCB */
-				return 0;
-			}
+			goto err_out_unmap;
 		}
 		skb_reserve (skb, 2);	/* Align IP on 16 byte boundaries */
 		pB->context = (U32) skb;
 		pB->scount = 1;	/* segment count */
 		pB->size = MAX_ETHER_SIZE;
-		pB->addr = virt_to_bus ((void *) skb->data);
+		pB->addr = pci_map_single(pDpa->pci_dev, skb->data, 
+					  MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE);
 		p[0]++;
 		pB++;
 	}
@@ -1032,16 +1042,21 @@
 	if ((status = RCPostRecvBuffers (dev, (PRCTCB) p)) != RC_RTN_NO_ERROR) {
 		printk (KERN_WARNING "%s: Post buffer failed, error 0x%x\n",
 				dev->name, status);
-		/* point to the first buffer */
-		pB = (psingleB) ((U32) p + sizeof (U32));
-		while (p[0]) {
-			skb = (struct sk_buff *) pB->context;
-			dev_kfree_skb (skb);
-			p[0]--;
-			pB++;
-		}
+		goto err_out_unmap;
 	}
+out_free:
 	res = p[0];
 	kfree (p);
+out:
 	return (res);		/* return the number of posted buffers */
+
+err_out_unmap:
+	for (; p[0] > 0; p[0]--) {
+		--pB;
+		skb = (struct sk_buff *) pB->context;
+		pci_unmap_single(pDpa->pci_dev, pB->addr, MAX_ETHER_SIZE,
+				 PCI_DMA_FROMDEVICE);
+		dev_kfree_skb (skb);
+	}
+	goto out_free;
 }
diff -Nru a/drivers/net/sis900.c b/drivers/net/sis900.c
--- a/drivers/net/sis900.c	Tue Mar  4 22:44:07 2003
+++ b/drivers/net/sis900.c	Sun Apr 20 21:26:42 2003
@@ -195,11 +195,11 @@
 static int sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev);
 static int sis900_rx(struct net_device *net_dev);
 static void sis900_finish_xmit (struct net_device *net_dev);
-static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int sis900_close(struct net_device *net_dev);
 static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd);
 static struct net_device_stats *sis900_get_stats(struct net_device *net_dev);
-static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision);
+static u16 sis900_mcast_bitnr(u8 *addr, u8 revision);
 static void set_rx_mode(struct net_device *net_dev);
 static void sis900_reset(struct net_device *net_dev);
 static void sis630_set_eq(struct net_device *net_dev, u8 revision);
@@ -1534,13 +1534,14 @@
  *	and cleans up after the Tx thread
  */
 
-static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *net_dev = dev_instance;
 	struct sis900_private *sis_priv = net_dev->priv;
 	int boguscnt = max_interrupt_work;
 	long ioaddr = net_dev->base_addr;
 	u32 status;
+	unsigned int handled = 0;
 
 	spin_lock (&sis_priv->lock);
 
@@ -1550,6 +1551,7 @@
 		if ((status & (HIBERR|TxURN|TxERR|TxIDLE|RxORN|RxERR|RxOK)) == 0)
 			/* nothing intresting happened */
 			break;
+		handled = 1;
 
 		/* why dow't we break after Tx/Rx case ?? keyword: full-duplex */
 		if (status & (RxORN | RxERR | RxOK))
@@ -1580,7 +1582,7 @@
 		       net_dev->name, inl(ioaddr + isr));
 	
 	spin_unlock (&sis_priv->lock);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /**
@@ -2031,7 +2033,7 @@
 }
 
 /**
- *	sis900_compute_hashtable_index: - compute hashtable index 
+ *	sis900_mcast_bitnr: - compute hashtable index 
  *	@addr: multicast address
  *	@revision: revision id of chip
  *
@@ -2041,7 +2043,7 @@
  *   	multicast hash table. 
  */
 
-static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision)
+static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision)
 {
 
 	u32 crc = ether_crc(6, addr);
@@ -2095,9 +2097,11 @@
 		struct dev_mc_list *mclist;
 		rx_mode = RFAAB;
 		for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count;
-		     i++, mclist = mclist->next)
-			set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision),
-				mc_filter);
+		     i++, mclist = mclist->next) {
+			unsigned int bit_nr =
+				sis900_mcast_bitnr(mclist->dmi_addr, revision);
+			mc_filter[bit_nr >> 4] |= (1 << bit_nr);
+		}
 	}
 
 	/* update Multicast Hash Table in Receive Filter */
diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
--- a/drivers/net/sk98lin/skge.c	Sun Mar  2 23:26:07 2003
+++ b/drivers/net/sk98lin/skge.c	Sun Apr 20 23:39:12 2003
@@ -322,8 +322,8 @@
 static void	SetupRing(SK_AC*, void*, uintptr_t, RXD**, RXD**, RXD**,
 			int*, SK_BOOL);
 
-static void	SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs);
-static void	SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs);
+static irqreturn_t SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs);
+static irqreturn_t SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs);
 static int	SkGeOpen(struct net_device *dev);
 static int	SkGeClose(struct net_device *dev);
 static int	SkGeXmit(struct sk_buff *skb, struct net_device *dev);
@@ -470,6 +470,7 @@
 		pNet->Up = 0;
 		dev->irq = pdev->irq;
 
+		SET_MODULE_OWNER(dev);
 		dev->open =		&SkGeOpen;
 		dev->stop =		&SkGeClose;
 		dev->hard_start_xmit =	&SkGeXmit;
@@ -1236,7 +1237,7 @@
  * Returns: N/A
  *
  */
-static void SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs)
+static irqreturn_t SkGeIsr(int irq, void *dev_id, struct pt_regs *ptregs)
 {
 struct net_device *dev = (struct net_device *)dev_id;
 
@@ -1252,7 +1253,7 @@
 	 */
 	SK_IN32(pAC->IoBase, B0_SP_ISRC, &IntSrc);
 	if (IntSrc == 0) {
-		return;
+		return IRQ_NONE;
 	}
 
 	while (((IntSrc & IRQ_MASK) & ~SPECIAL_IRQS) != 0) {
@@ -1380,7 +1381,7 @@
 	/* IRQ is processed - Enable IRQs again*/
 	SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK);
 
-	return;
+	return IRQ_HANDLED;
 } /* SkGeIsr */
 
 
@@ -1397,7 +1398,7 @@
  * Returns: N/A
  *
  */
-static void SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs)
+static irqreturn_t SkGeIsrOnePort(int irq, void *dev_id, struct pt_regs *ptregs)
 {
 struct net_device *dev = (struct net_device *)dev_id;
 DEV_NET		*pNet;
@@ -1412,7 +1413,7 @@
 	 */
 	SK_IN32(pAC->IoBase, B0_SP_ISRC, &IntSrc);
 	if (IntSrc == 0) {
-		return;
+		return IRQ_NONE;
 	}
 
 	while (((IntSrc & IRQ_MASK) & ~SPECIAL_IRQS) != 0) {
@@ -1498,7 +1499,7 @@
 	/* IRQ is processed - Enable IRQs again*/
 	SK_OUT32(pAC->IoBase, B0_IMSK, IRQ_MASK);
 
-	return;
+	return IRQ_HANDLED;
 } /* SkGeIsrOnePort */
 
 
@@ -1604,8 +1605,6 @@
 	pAC->MaxPorts++;
 	pNet->Up = 1;
 
-	MOD_INC_USE_COUNT;
-
 	SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
 		("SkGeOpen suceeded\n"));
 
@@ -1705,7 +1704,6 @@
 
 	pAC->MaxPorts--;
 	pNet->Up = 0;
-	MOD_DEC_USE_COUNT;
 	
 	return (0);
 } /* SkGeClose */
diff -Nru a/drivers/net/slip.c b/drivers/net/slip.c
--- a/drivers/net/slip.c	Mon Apr  7 10:56:42 2003
+++ b/drivers/net/slip.c	Mon Apr 21 20:58:43 2003
@@ -428,7 +428,7 @@
 	 *       14 Oct 1994  Dmitry Gorodchanin.
 	 */
 	sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
-	actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count);
+	actual = sl->tty->driver->write(sl->tty, 0, sl->xbuff, count);
 #ifdef SL_CHECK_TRANSMIT
 	sl->dev->trans_start = jiffies;
 #endif
@@ -462,7 +462,7 @@
 		return;
 	}
 
-	actual = tty->driver.write(tty, 0, sl->xhead, sl->xleft);
+	actual = tty->driver->write(tty, 0, sl->xhead, sl->xleft);
 	sl->xleft -= actual;
 	sl->xhead += actual;
 }
@@ -488,7 +488,7 @@
 			goto out;
 		}
 		printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name,
-		       (sl->tty->driver.chars_in_buffer(sl->tty) || sl->xleft) ?
+		       (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ?
 		       "bad line quality" : "driver error");
 		sl->xleft = 0;
 		sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
@@ -722,7 +722,7 @@
 
 /* Find a free SLIP channel, and link in this `tty' line. */
 static struct slip *
-sl_alloc(kdev_t line)
+sl_alloc(dev_t line)
 {
 	struct slip *sl;
 	slip_ctrl_t *slp = NULL;
@@ -739,7 +739,7 @@
 			break;
 
 		if (slp->ctrl.leased) {
-			if (!kdev_same(slp->ctrl.line, line))
+			if (slp->ctrl.line != line)
 				continue;
 			if (slp->ctrl.tty)
 				return NULL;
@@ -753,7 +753,7 @@
 			continue;
 
 		if (current->pid == slp->ctrl.pid) {
-			if (kdev_same(slp->ctrl.line, line) && score < 3) {
+			if (slp->ctrl.line == line && score < 3) {
 				sel = i;
 				score = 3;
 				continue;
@@ -764,7 +764,7 @@
 			}
 			continue;
 		}
-		if (kdev_same(slp->ctrl.line, line) && score < 1) {
+		if (slp->ctrl.line == line && score < 1) {
 			sel = i;
 			score = 1;
 			continue;
@@ -861,8 +861,8 @@
 	tty->disc_data = sl;
 	sl->line = tty->device;
 	sl->pid = current->pid;
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
@@ -941,7 +941,7 @@
 	tty->disc_data = 0;
 	sl->tty = NULL;
 	if (!sl->leased)
-		sl->line = NODEV;
+		sl->line = 0;
 
 	/* VSV = very important to remove timers */
 #ifdef CONFIG_SLIP_SMART
@@ -1456,7 +1456,7 @@
 			if (!netif_queue_stopped(sl->dev))
 			{
 				/* if device busy no outfill */
-				sl->tty->driver.write(sl->tty, 0, &s, 1);
+				sl->tty->driver->write(sl->tty, 0, &s, 1);
 			}
 		}
 		else
diff -Nru a/drivers/net/slip.h b/drivers/net/slip.h
--- a/drivers/net/slip.h	Tue Feb  5 09:40:00 2002
+++ b/drivers/net/slip.h	Mon Apr 21 20:58:43 2003
@@ -100,7 +100,7 @@
 
   unsigned char		mode;		/* SLIP mode			*/
   unsigned char		leased;
-  kdev_t		line;
+  dev_t			line;
   pid_t			pid;
 #define SL_MODE_SLIP	0
 #define SL_MODE_CSLIP	1
diff -Nru a/drivers/net/smc9194.c b/drivers/net/smc9194.c
--- a/drivers/net/smc9194.c	Thu Jan 16 11:15:45 2003
+++ b/drivers/net/smc9194.c	Sun Apr 20 22:41:09 2003
@@ -234,7 +234,7 @@
 /*
  . Handles the actual interrupt
 */
-static void smc_interrupt(int irq, void *, struct pt_regs *regs);
+static irqreturn_t smc_interrupt(int irq, void *, struct pt_regs *regs);
 /*
  . This is a separate procedure to handle the receipt of a packet, to
  . leave the interrupt code looking slightly cleaner
@@ -1133,7 +1133,7 @@
  .
  ---------------------------------------------------------------------*/
 
-static void smc_interrupt(int irq, void * dev_id,  struct pt_regs * regs)
+static irqreturn_t smc_interrupt(int irq, void * dev_id,  struct pt_regs * regs)
 {
 	struct net_device *dev 	= dev_id;
 	int ioaddr 		= dev->base_addr;
@@ -1146,7 +1146,7 @@
 	/* state registers */
 	word	saved_bank;
 	word	saved_pointer;
-
+	int handled = 0;
 
 
 	PRINTK3((CARDNAME": SMC interrupt started \n"));
@@ -1171,6 +1171,8 @@
 		if (!status )
 			break;
 
+		handled = 1;
+
 		PRINTK3((KERN_WARNING CARDNAME
 			": Handling interrupt status %x \n", status ));
 
@@ -1242,7 +1244,7 @@
 	SMC_SELECT_BANK( saved_bank );
 
 	PRINTK3((CARDNAME ": Interrupt done\n"));
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /*-------------------------------------------------------------
diff -Nru a/drivers/net/starfire.c b/drivers/net/starfire.c
--- a/drivers/net/starfire.c	Fri Feb 14 11:34:00 2003
+++ b/drivers/net/starfire.c	Sun Apr 20 21:58:27 2003
@@ -789,7 +789,7 @@
 static void	tx_timeout(struct net_device *dev);
 static void	init_ring(struct net_device *dev);
 static int	start_tx(struct sk_buff *skb, struct net_device *dev);
-static void	intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
 static void	netdev_error(struct net_device *dev, int intr_status);
 static int	__netdev_rx(struct net_device *dev, int *quota);
 static void	refill_rx_ring(struct net_device *dev);
@@ -1491,7 +1491,7 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
 	struct netdev_private *np;
@@ -1499,6 +1499,7 @@
 	int boguscnt = max_interrupt_work;
 	int consumer;
 	int tx_status;
+	int handled = 0;
 
 	ioaddr = dev->base_addr;
 	np = dev->priv;
@@ -1513,6 +1514,8 @@
 		if (intr_status == 0 || intr_status == (u32) -1)
 			break;
 
+		handled = 1;
+
 		if (intr_status & (IntrRxDone | IntrRxEmpty))
 			netdev_rx(dev, ioaddr);
 
@@ -1591,6 +1594,7 @@
 	if (debug > 4)
 		printk(KERN_DEBUG "%s: exiting interrupt, status=%#8.8x.\n",
 		       dev->name, (int) readl(ioaddr + IntrStatus));
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
--- a/drivers/net/sunbmac.c	Thu Feb 13 22:25:30 2003
+++ b/drivers/net/sunbmac.c	Mon Apr 21 00:00:25 2003
@@ -874,7 +874,7 @@
 		printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n", bp->dev->name);
 }
 
-static void bigmac_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t bigmac_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct bigmac *bp = (struct bigmac *) dev_id;
 	u32 qec_status, bmac_status;
@@ -895,6 +895,8 @@
 
 	if (bmac_status & CREG_STAT_RXIRQ)
 		bigmac_rx(bp);
+
+	return IRQ_HANDLED;
 }
 
 static int bigmac_open(struct net_device *dev)
diff -Nru a/drivers/net/sundance.c b/drivers/net/sundance.c
--- a/drivers/net/sundance.c	Thu Jan 16 11:15:45 2003
+++ b/drivers/net/sundance.c	Sun Apr 20 21:58:27 2003
@@ -495,7 +495,7 @@
 static void init_ring(struct net_device *dev);
 static int  start_tx(struct sk_buff *skb, struct net_device *dev);
 static int reset_tx (struct net_device *dev);
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
 static void rx_poll(unsigned long data);
 static void tx_poll(unsigned long data);
 static void refill_rx (struct net_device *dev);
@@ -951,7 +951,7 @@
 {
 	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
-	long flag;
+	unsigned long flag;
 	
 	netif_stop_queue(dev);
 	tasklet_disable(&np->tx_tasklet);
@@ -1152,7 +1152,7 @@
 
 /* The interrupt handler cleans up after the Tx thread, 
    and schedule a Rx thread work */
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = (struct net_device *)dev_instance;
 	struct netdev_private *np;
@@ -1161,6 +1161,7 @@
 	int hw_frame_id;
 	int tx_cnt;
 	int tx_status;
+	int handled = 0;
 
 	ioaddr = dev->base_addr;
 	np = dev->priv;
@@ -1176,6 +1177,8 @@
 		if (!(intr_status & DEFAULT_INTR))
 			break;
 
+		handled = 1;
+
 		if (intr_status & (IntrRxDMADone)) {
 			writew(DEFAULT_INTR & ~(IntrRxDone|IntrRxDMADone),
 					ioaddr + IntrEnable);
@@ -1284,7 +1287,7 @@
 		printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",
 			   dev->name, readw(ioaddr + IntrStatus));
 	writel(5000, ioaddr + DownCounter);
-
+	return IRQ_RETVAL(handled);
 }
 
 static void rx_poll(unsigned long data)
diff -Nru a/drivers/net/sungem.c b/drivers/net/sungem.c
--- a/drivers/net/sungem.c	Mon Apr  7 00:03:41 2003
+++ b/drivers/net/sungem.c	Mon Apr 21 00:00:25 2003
@@ -773,7 +773,7 @@
 		       gp->dev->name);
 }
 
-static void gem_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t gem_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct gem *gp = dev->priv;
@@ -792,6 +792,8 @@
 
 out:
 	spin_unlock(&gp->lock);
+
+	return IRQ_HANDLED;
 }
 
 static void gem_tx_timeout(struct net_device *dev)
diff -Nru a/drivers/net/sunhme.c b/drivers/net/sunhme.c
--- a/drivers/net/sunhme.c	Mon Apr  7 00:03:41 2003
+++ b/drivers/net/sunhme.c	Mon Apr 21 00:00:25 2003
@@ -2101,7 +2101,7 @@
 	RXD((">"));
 }
 
-static void happy_meal_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t happy_meal_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
 	struct happy_meal *hp  = dev->priv;
@@ -2135,10 +2135,12 @@
 	HMD(("done\n"));
 out:
 	spin_unlock(&hp->happy_lock);
+
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_SBUS
-static void quattro_sbus_interrupt(int irq, void *cookie, struct pt_regs *ptregs)
+static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie, struct pt_regs *ptregs)
 {
 	struct quattro *qp = (struct quattro *) cookie;
 	int i;
@@ -2183,6 +2185,8 @@
 		spin_unlock(&hp->happy_lock);
 	}
 	HMD(("done\n"));
+
+	return IRQ_HANDLED;
 }
 #endif
 
diff -Nru a/drivers/net/sunlance.c b/drivers/net/sunlance.c
--- a/drivers/net/sunlance.c	Tue Feb 25 09:56:42 2003
+++ b/drivers/net/sunlance.c	Tue Apr 22 22:43:02 2003
@@ -812,7 +812,7 @@
 	spin_unlock(&lp->lock);
 }
 
-static void lance_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *)dev_id;
 	struct lance_private *lp = (struct lance_private *)dev->priv;
@@ -871,6 +871,8 @@
 	}
 
 	sbus_writew(LE_C0_INEA, lp->lregs + RDP);
+
+	return IRQ_HANDLED;
 }
 
 /* Build a fake network packet and send it to ourselves. */
@@ -1415,7 +1417,7 @@
 				       "'tpe-link-test?'\n", dev->name);
 				printk(KERN_NOTICE "%s: warning: mail any problems "
 				       "to ecd@skynet.be\n", dev->name);
-				set_auxio(AUXIO_LINK_TEST, 0);
+				auxio_set_lte(AUXIO_LTE_ON);
 			}
 no_link_test:
 			lp->auto_select = 1;
diff -Nru a/drivers/net/sunqe.c b/drivers/net/sunqe.c
--- a/drivers/net/sunqe.c	Thu Feb 13 22:14:03 2003
+++ b/drivers/net/sunqe.c	Mon Apr 21 00:00:25 2003
@@ -456,7 +456,7 @@
  * so we just run through each qe and check to see who is signaling
  * and thus needs to be serviced.
  */
-static void qec_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t qec_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sunqec *qecp = (struct sunqec *) dev_id;
 	u32 qec_status;
@@ -495,6 +495,8 @@
 		qec_status >>= 4;
 		channel++;
 	}
+
+	return IRQ_HANDLED;
 }
 
 static int qe_open(struct net_device *dev)
diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c	Mon Apr  7 00:03:41 2003
+++ b/drivers/net/tg3.c	Sun Apr 20 23:59:45 2003
@@ -2148,7 +2148,7 @@
 	return work_exists;
 }
 
-static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct tg3 *tp = dev->priv;
@@ -2187,6 +2187,8 @@
 	}
 
 	spin_unlock_irqrestore(&tp->lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 static void tg3_init_rings(struct tg3 *);
diff -Nru a/drivers/net/tlan.c b/drivers/net/tlan.c
--- a/drivers/net/tlan.c	Mon Feb 24 12:31:17 2003
+++ b/drivers/net/tlan.c	Sun Apr 20 21:26:42 2003
@@ -288,7 +288,7 @@
 static int      TLan_Init( struct net_device * );
 static int	TLan_Open( struct net_device *dev );
 static int	TLan_StartTx( struct sk_buff *, struct net_device *);
-static void	TLan_HandleInterrupt( int, void *, struct pt_regs *);
+static irqreturn_t TLan_HandleInterrupt( int, void *, struct pt_regs *);
 static int	TLan_Close( struct net_device *);
 static struct	net_device_stats *TLan_GetStats( struct net_device *);
 static void	TLan_SetMulticastList( struct net_device *);
@@ -1106,7 +1106,7 @@
 	 *
 	 **************************************************************/
 
-static void TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	u32		ack;
 	struct net_device	*dev;
@@ -1134,6 +1134,7 @@
 
 	spin_unlock(&priv->lock);
 
+	return IRQ_HANDLED;
 } /* TLan_HandleInterrupts */
 
 
diff -Nru a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
--- a/drivers/net/tokenring/Kconfig	Mon Feb 24 10:24:37 2003
+++ b/drivers/net/tokenring/Kconfig	Sun Apr 20 12:56:51 2003
@@ -16,7 +16,7 @@
 	  connected to such a Token Ring network and want to use your Token
 	  Ring card under Linux, say Y here and to the driver for your
 	  particular card below and read the Token-Ring mini-HOWTO, available
-	  from <http://www.linuxdoc.org/docs.html#howto>. Most people can
+	  from <http://www.tldp.org/docs.html#howto>. Most people can
 	  say N here.
 
 config IBMTR
@@ -25,7 +25,7 @@
 	---help---
 	  This is support for all IBM Token Ring cards that don't use DMA. If
 	  you have such a beast, say Y and read the Token-Ring mini-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  Warning: this driver will almost definitely fail if more than one
 	  active Token Ring card is present.
@@ -44,7 +44,7 @@
 	  Wake On Lan, and PCI 100/16/4 adapters.
 
 	  If you have such an adapter, say Y and read the Token-Ring
-	  mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
+	  mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -62,7 +62,7 @@
 	  This is support for IBM Lanstreamer PCI Token Ring Cards.
 
 	  If you have such an adapter, say Y and read the Token-Ring
-	  mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
+	  mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a modules ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -78,7 +78,7 @@
 	  should use the tms380 driver instead.
 
 	  If you have such an adapter, say Y and read the Token-Ring
-	  mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
+	  mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -104,7 +104,7 @@
 
 	  If you have such an adapter and would like to use it, say Y and
 	  read the Token-Ring mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  Also read the file <file:Documentation/networking/tms380tr.txt> or
 	  check <http://www.auk.cx/tms380tr/>.
@@ -194,7 +194,7 @@
 
 	  If you have such an adapter and would like to use it, say Y or M and
 	  read the Token-Ring mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto> and the file
+	  <http://www.tldp.org/docs.html#howto> and the file
 	  <file:Documentation/networking/smctr.txt>.
 
 	  This driver is also available as a module ( = code which can be
diff -Nru a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
--- a/drivers/net/tokenring/ibmtr.c	Thu Nov 21 14:06:12 2002
+++ b/drivers/net/tokenring/ibmtr.c	Thu Apr 24 05:25:35 2003
@@ -246,7 +246,8 @@
 	void *chanid;
 	int found_turbo=0;
 	unsigned char *tchanid, ctemp;
-	int i,j;
+	int i, j;
+	unsigned long jif;
 	void *ram_mapped ;   
 
 	if (turbo_searched == 1) return;
@@ -276,7 +277,7 @@
 			writeb(0x00, ram_mapped+0x1E01+i);
 		}
 		writeb(0x00, ram_mapped+0x1E01);
-		for(i=jiffies+TR_BUSY_INTERVAL; time_before_eq(jiffies,i););
+		for(jif=jiffies+TR_BUSY_INTERVAL; time_before_eq(jiffies,jif););
 		intf_tbl=ntohs(readw(ram_mapped+ACA_OFFSET+ACA_RW+WRBR_EVEN));
 		if (intf_tbl) {
 #if IBMTR_DEBUG_MESSAGES
@@ -291,7 +292,7 @@
 			turbo_io[index]=ntohs(readw(ram_mapped+intf_tbl+4));
 			turbo_irq[index]=readb(ram_mapped+intf_tbl+3);
 			outb(0, turbo_io[index] + ADAPTRESET);
-			for(i=jiffies+TR_RST_TIME;time_before_eq(jiffies,i););
+			for(jif=jiffies+TR_RST_TIME;time_before_eq(jiffies,jif););
 			outb(0, turbo_io[index] + ADAPTRESETREL);
 			index++;
 			continue;
diff -Nru a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
--- a/drivers/net/tokenring/tms380tr.c	Sat Apr 19 13:07:22 2003
+++ b/drivers/net/tokenring/tms380tr.c	Thu Apr 24 05:18:50 2003
@@ -152,7 +152,6 @@
 static void 	tms380tr_init_ipb(struct net_local *tp);
 static void 	tms380tr_init_net_local(struct net_device *dev);
 static void 	tms380tr_init_opb(struct net_device *dev);
-void	 	tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 /* "M" */
 /* "O" */
 int		tms380tr_open(struct net_device *dev);
@@ -780,15 +779,16 @@
 /*
  * The typical workload of the driver: Handle the network interface interrupts.
  */
-void tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct net_local *tp;
 	unsigned short irq_type;
+	int handled = 0;
 
 	if(dev == NULL) {
 		printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	tp = (struct net_local *)dev->priv;
@@ -796,6 +796,7 @@
 	irq_type = SIFREADW(SIFSTS);
 
 	while(irq_type & STS_SYSTEM_IRQ) {
+		handled = 1;
 		irq_type &= STS_IRQ_MASK;
 
 		if(!tms380tr_chk_ssb(tp, irq_type)) {
@@ -870,7 +871,7 @@
 		irq_type = SIFREADW(SIFSTS);
 	}
 
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /*
diff -Nru a/drivers/net/tokenring/tms380tr.h b/drivers/net/tokenring/tms380tr.h
--- a/drivers/net/tokenring/tms380tr.h	Fri Feb 14 01:03:32 2003
+++ b/drivers/net/tokenring/tms380tr.h	Thu Apr 24 05:18:50 2003
@@ -11,10 +11,12 @@
 
 #ifdef __KERNEL__
 
+#include <linux/interrupt.h>
+
 /* module prototypes */
 int tms380tr_open(struct net_device *dev);
 int tms380tr_close(struct net_device *dev);
-void tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 int tmsdev_init(struct net_device *dev, unsigned long dmalimit,
 		struct pci_dev *pdev);
 void tmsdev_term(struct net_device *dev);
diff -Nru a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig
--- a/drivers/net/tulip/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/drivers/net/tulip/Kconfig	Sun Apr 20 12:56:51 2003
@@ -21,7 +21,7 @@
 	  (smc9332dst), you can also try the driver for "Generic DECchip"
 	  cards, above.  However, most people with a network card of this type
 	  will say Y here.) Do read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  More specific
+	  <http://www.tldp.org/docs.html#howto>.  More specific
 	  information is contained in
 	  <file:Documentation/DocBook/tulip-user.tmpl>.
 
@@ -42,7 +42,7 @@
 	  (smc9332dst), you can also try the driver for "Generic DECchip"
 	  cards, above.  However, most people with a network card of this type
 	  will say Y here.) Do read the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  More specific
+	  <http://www.tldp.org/docs.html#howto>.  More specific
 	  information is contained in 
 	  <file:Documentation/networking/tulip.txt>.
 
@@ -80,7 +80,7 @@
 	  These include the DE425, DE434, DE435, DE450 and DE500 models.  If
 	  you have a network card of this type, say Y and read the
 	  Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. More specific
+	  <http://www.tldp.org/docs.html#howto>. More specific
 	  information is contained in
 	  <file:Documentation/networking/de4x5.txt>.
 
diff -Nru a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
--- a/drivers/net/tulip/de2104x.c	Wed Dec  4 16:40:55 2002
+++ b/drivers/net/tulip/de2104x.c	Sun Apr 20 22:41:09 2003
@@ -492,7 +492,7 @@
 	de->rx_tail = rx_tail;
 }
 
-static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t de_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_instance;
 	struct de_private *de = dev->priv;
@@ -500,7 +500,7 @@
 
 	status = dr32(MacStatus);
 	if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF))
-		return;
+		return IRQ_NONE;
 
 	if (netif_msg_intr(de))
 		printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n",
@@ -532,6 +532,8 @@
 		printk(KERN_ERR "%s: PCI bus error, status=%08x, PCI status=%04x\n",
 		       dev->name, status, pci_status);
 	}
+
+	return IRQ_HANDLED;
 }
 
 static void de_tx (struct de_private *de)
diff -Nru a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
--- a/drivers/net/tulip/de4x5.c	Fri Mar 28 20:39:53 2003
+++ b/drivers/net/tulip/de4x5.c	Sun Apr 20 22:41:09 2003
@@ -909,7 +909,7 @@
 */
 static int     de4x5_open(struct net_device *dev);
 static int     de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev);
-static void    de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int     de4x5_close(struct net_device *dev);
 static struct  net_device_stats *de4x5_get_stats(struct net_device *dev);
 static void    de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len);
@@ -1349,6 +1349,7 @@
     }
     
     /* The DE4X5-specific entries in the device structure. */
+    SET_MODULE_OWNER(dev);
     dev->open = &de4x5_open;
     dev->hard_start_xmit = &de4x5_queue_pkt;
     dev->stop = &de4x5_close;
@@ -1433,8 +1434,6 @@
 	printk("\tsigr: 0x%08x\n", inl(DE4X5_SIGR));
     }
     
-    MOD_INC_USE_COUNT;
-    
     return status;
 }
 
@@ -1617,17 +1616,18 @@
 ** is high and descriptor status bits cannot be set before the associated
 ** interrupt is asserted and this routine entered.
 */
-static void
+static irqreturn_t
 de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
     struct net_device *dev = (struct net_device *)dev_id;
     struct de4x5_private *lp;
     s32 imr, omr, sts, limit;
     u_long iobase;
+    unsigned int handled = 0;
     
     if (dev == NULL) {
 	printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq);
-	return;
+	return IRQ_NONE;
     }
     lp = (struct de4x5_private *)dev->priv;
     spin_lock(&lp->lock);
@@ -1645,6 +1645,7 @@
 	outl(sts, DE4X5_STS);            /* Reset the board interrupts */
 	    
 	if (!(sts & lp->irq_mask)) break;/* All done */
+	handled = 1;
 	    
 	if (sts & (STS_RI | STS_RU))     /* Rx interrupt (packet[s] arrived) */
 	  de4x5_rx(dev);
@@ -1665,7 +1666,7 @@
 	    printk("%s: Fatal bus error occurred, sts=%#8x, device stopped.\n",
 		   dev->name, sts);
 	    spin_unlock(&lp->lock);
-	    return;
+	    return IRQ_HANDLED;
 	}
     }
 
@@ -1681,7 +1682,7 @@
     ENABLE_IRQs;
     spin_unlock(&lp->lock);
     
-    return;
+    return IRQ_RETVAL(handled);
 }
 
 static int
@@ -1923,8 +1924,6 @@
     /* Free any socket buffers */
     de4x5_free_rx_buffs(dev);
     de4x5_free_tx_buffs(dev);
-    
-    MOD_DEC_USE_COUNT;
     
     /* Put the adapter to sleep to save power */
     yawn(dev, SLEEP);
diff -Nru a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
--- a/drivers/net/tulip/dmfe.c	Fri Mar 28 21:04:10 2003
+++ b/drivers/net/tulip/dmfe.c	Sun Apr 20 23:00:42 2003
@@ -298,7 +298,7 @@
 static void dmfe_set_filter_mode(struct DEVICE *);
 static int dmfe_do_ioctl(struct DEVICE *, struct ifreq *, int);
 static u16 read_srom_word(long ,int);
-static void dmfe_interrupt(int , void *, struct pt_regs *);
+static irqreturn_t dmfe_interrupt(int , void *, struct pt_regs *);
 static void dmfe_descriptor_init(struct dmfe_board_info *, unsigned long);
 static void allocate_rx_buffer(struct dmfe_board_info *);
 static void update_cr6(u32, unsigned long);
@@ -668,13 +668,13 @@
 	if ( db->tx_queue_cnt < TX_FREE_DESC_CNT )
 		netif_wake_queue(dev);
 
-	/* free this SKB */
-	dev_kfree_skb(skb);
-
 	/* Restore CR7 to enable interrupt */
 	spin_unlock_irqrestore(&db->lock, flags);
 	outl(db->cr7_data, dev->base_addr + DCR7);
 
+	/* free this SKB */
+	dev_kfree_skb(skb);
+
 	return 0;
 }
 
@@ -726,7 +726,7 @@
  *	receive the packet to upper layer, free the transmitted packet
  */
 
-static void dmfe_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t dmfe_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct DEVICE *dev = dev_id;
 	struct dmfe_board_info *db = (struct dmfe_board_info *) dev->priv;
@@ -737,7 +737,7 @@
 
 	if (!dev) {
 		DMFE_DBUG(1, "dmfe_interrupt() without DEVICE arg", 0);
-		return;
+		return IRQ_NONE;
 	}
 
 	spin_lock_irqsave(&db->lock, flags);
@@ -747,7 +747,7 @@
 	outl(db->cr5_data, ioaddr + DCR5);
 	if ( !(db->cr5_data & 0xc1) ) {
 		spin_unlock_irqrestore(&db->lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	/* Disable all interrupt in CR7 to solve the interrupt edge problem */
@@ -760,7 +760,7 @@
 		db->reset_fatal++;
 		db->wait_reset = 1;	/* Need to RESET */
 		spin_unlock_irqrestore(&db->lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	 /* Received the coming packet */
@@ -786,6 +786,7 @@
 	outl(db->cr7_data, ioaddr + DCR7);
 
 	spin_unlock_irqrestore(&db->lock, flags);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
--- a/drivers/net/tulip/interrupt.c	Mon Feb 24 10:16:42 2003
+++ b/drivers/net/tulip/interrupt.c	Sun Apr 20 22:41:09 2003
@@ -291,7 +291,7 @@
 #endif
 }
 
-static inline void phy_interrupt (struct net_device *dev)
+static inline unsigned int phy_interrupt (struct net_device *dev)
 {
 #ifdef __hppa__
 	int csr12 = inl(dev->base_addr + CSR12) & 0xff;
@@ -307,13 +307,17 @@
 		spin_unlock(&tp->lock);
 		/* clear irq ack bit */
 		outl(csr12 & ~0x02, dev->base_addr + CSR12);
+
+		return 1;
 	}
 #endif
+
+	return 0;
 }
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *)dev_instance;
 	struct tulip_private *tp = (struct tulip_private *)dev->priv;
@@ -328,15 +332,16 @@
 	int maxtx = TX_RING_SIZE;
 	int maxoi = TX_RING_SIZE;
 	unsigned int work_count = tulip_max_interrupt_work;
+	unsigned int handled = 0;
 
 	/* Let's see whether the interrupt really is for us */
 	csr5 = inl(ioaddr + CSR5);
 
-        if (tp->flags & HAS_PHY_IRQ)
-	        phy_interrupt (dev);
+        if (tp->flags & HAS_PHY_IRQ) 
+	        handled = phy_interrupt (dev);
     
 	if ((csr5 & (NormalIntr|AbnormalIntr)) == 0)
-		return;
+		return IRQ_RETVAL(handled);
 
 	tp->nir++;
 
@@ -578,4 +583,5 @@
 		printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n",
 			   dev->name, inl(ioaddr + CSR5));
 
+	return IRQ_HANDLED;
 }
diff -Nru a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
--- a/drivers/net/tulip/tulip.h	Wed Sep 18 19:56:43 2002
+++ b/drivers/net/tulip/tulip.h	Sun Apr 20 22:41:09 2003
@@ -423,7 +423,7 @@
 /* interrupt.c */
 extern unsigned int tulip_max_interrupt_work;
 extern int tulip_rx_copybreak;
-void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 int tulip_refill_rx(struct net_device *dev);
 
 /* media.c */
diff -Nru a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
--- a/drivers/net/tulip/winbond-840.c	Thu Mar 20 10:48:31 2003
+++ b/drivers/net/tulip/winbond-840.c	Sun Apr 20 23:00:42 2003
@@ -385,7 +385,7 @@
 static int alloc_ringdesc(struct net_device *dev);
 static void free_ringdesc(struct netdev_private *np);
 static int  start_tx(struct sk_buff *skb, struct net_device *dev);
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
 static void netdev_error(struct net_device *dev, int intr_status);
 static int  netdev_rx(struct net_device *dev);
 static u32 __set_rx_mode(struct net_device *dev);
@@ -1165,15 +1165,16 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = (struct net_device *)dev_instance;
 	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
 	int work_limit = max_interrupt_work;
+	int handled = 0;
 
 	if (!netif_device_present(dev))
-		return;
+		return IRQ_NONE;
 	do {
 		u32 intr_status = readl(ioaddr + IntrStatus);
 
@@ -1187,6 +1188,8 @@
 		if ((intr_status & (NormalIntr|AbnormalIntr)) == 0)
 			break;
 
+		handled = 1;
+
 		if (intr_status & (IntrRxDone | RxNoBuf))
 			netdev_rx(dev);
 		if (intr_status & RxNoBuf)
@@ -1222,6 +1225,7 @@
 	if (debug > 3)
 		printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",
 			   dev->name, (int)readl(ioaddr + IntrStatus));
+	return IRQ_RETVAL(handled);
 }
 
 /* This routine is logically part of the interrupt handler, but separated
diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
--- a/drivers/net/tulip/xircom_cb.c	Mon Feb 24 10:34:56 2003
+++ b/drivers/net/tulip/xircom_cb.c	Sun Apr 20 23:39:12 2003
@@ -111,7 +111,7 @@
 /* Function prototypes */
 static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id);
 static void xircom_remove(struct pci_dev *pdev);
-static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int xircom_open(struct net_device *dev);
 static int xircom_close(struct net_device *dev);
@@ -344,7 +344,7 @@
 	leave("xircom_remove");
 } 
 
-static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
 	struct xircom_private *card = (struct xircom_private *) dev->priv;
@@ -388,6 +388,7 @@
 	
 	spin_unlock(&card->lock);
 	leave("xircom_interrupt");
+	return IRQ_HANDLED;
 }
 
 static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
diff -Nru a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c
--- a/drivers/net/tulip/xircom_tulip_cb.c	Mon Feb 24 10:35:04 2003
+++ b/drivers/net/tulip/xircom_tulip_cb.c	Sun Apr 20 23:39:12 2003
@@ -340,7 +340,7 @@
 static void xircom_init_ring(struct net_device *dev);
 static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int xircom_rx(struct net_device *dev);
-static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int xircom_close(struct net_device *dev);
 static struct net_device_stats *xircom_get_stats(struct net_device *dev);
 static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -355,7 +355,7 @@
 	const int strict_bits =
 		TxThresh10 | TxStoreForw | TxThreshMask | EnableTxRx | FullDuplexBit;
     int csr5, csr5_22_20, csr5_19_17, currcsr6, attempts = 200;
-    long flags;
+    unsigned long flags;
     save_flags(flags);
     cli();
 	/* mask out the reserved bits that always read 0 on the Xircom cards */
@@ -1054,12 +1054,13 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_instance;
 	struct xircom_private *tp = dev->priv;
 	long ioaddr = dev->base_addr;
 	int csr5, work_budget = max_interrupt_work;
+	int handled = 0;
 
 	spin_lock (&tp->lock);
 
@@ -1078,6 +1079,8 @@
 		if ((csr5 & (NormalIntr|AbnormalIntr)) == 0)
 			break;
 
+		handled = 1;
+
 		if (csr5 & (RxIntr | RxNoBuf))
 			work_budget -= xircom_rx(dev);
 
@@ -1185,6 +1188,7 @@
 			   dev->name, inl(ioaddr + CSR5));
 
 	spin_unlock (&tp->lock);
+	return IRQ_RETVAL(handled);
 }
 
 
@@ -1461,7 +1465,7 @@
 	struct xircom_private *tp = dev->priv;
 	u16 *data = (u16 *)&rq->ifr_data;
 	int phy = tp->phys[0] & 0x1f;
-	long flags;
+	unsigned long flags;
 
 	switch(cmd) {
 	case SIOCETHTOOL:
diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c
--- a/drivers/net/typhoon.c	Mon Apr  7 00:03:41 2003
+++ b/drivers/net/typhoon.c	Sun Apr 20 22:41:09 2003
@@ -1790,7 +1790,7 @@
 	return (done ? 0 : 1);
 }
 
-static void
+static irqreturn_t
 typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
@@ -1799,7 +1799,7 @@
 
 	intr_status = readl(ioaddr + TYPHOON_REG_INTR_STATUS);
 	if(!intr_status)
-		return;
+		return IRQ_NONE;
 
 	writel(intr_status, ioaddr + TYPHOON_REG_INTR_STATUS);
 
@@ -1811,6 +1811,7 @@
 		printk(KERN_ERR "%s: Error, poll already scheduled\n",
                        dev->name);
 	}
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
--- a/drivers/net/via-rhine.c	Sat Mar  1 04:53:03 2003
+++ b/drivers/net/via-rhine.c	Sun Apr 20 21:58:28 2003
@@ -530,7 +530,7 @@
 static void via_rhine_timer(unsigned long data);
 static void via_rhine_tx_timeout(struct net_device *dev);
 static int  via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
-static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static void via_rhine_tx(struct net_device *dev);
 static void via_rhine_rx(struct net_device *dev);
 static void via_rhine_error(struct net_device *dev, int intr_status);
@@ -1330,16 +1330,19 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
 	long ioaddr;
 	u32 intr_status;
 	int boguscnt = max_interrupt_work;
+	int handled = 0;
 
 	ioaddr = dev->base_addr;
 	
 	while ((intr_status = get_intr_status(dev))) {
+		handled = 1;
+
 		/* Acknowledge all of the current interrupt sources ASAP. */
 		if (intr_status & IntrTxDescRace)
 			writeb(0x08, ioaddr + IntrStatus2);
@@ -1385,6 +1388,7 @@
 	if (debug > 3)
 		printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n",
 			   dev->name, readw(ioaddr + IntrStatus));
+	return IRQ_RETVAL(handled);
 }
 
 /* This routine is logically part of the interrupt handler, but isolated
diff -Nru a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
--- a/drivers/net/wan/c101.c	Thu Apr  3 14:24:36 2003
+++ b/drivers/net/wan/c101.c	Thu Apr 24 05:18:50 2003
@@ -155,11 +155,12 @@
 {
 	hdlc_device *hdlc = dev_to_hdlc(dev);
 	port_t *port = hdlc_to_port(hdlc);
+	int result;
 
 	if (!try_module_get(THIS_MODULE))
 		return -EFAULT;	/* rmmod in progress */
 
-	int result = hdlc_open(hdlc);
+	result = hdlc_open(hdlc);
 	if (result) {
 		return result;
 		module_put(THIS_MODULE);
diff -Nru a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
--- a/drivers/net/wan/cycx_x25.c	Mon Oct  7 07:39:27 2002
+++ b/drivers/net/wan/cycx_x25.c	Thu Apr 24 05:17:37 2003
@@ -1347,7 +1347,7 @@
 {
 	x25_channel_t *chan = dev->priv;
 	cycx_t *card = chan->card;
-	long flags;
+	unsigned long flags;
 	char *string_state = NULL;
 
 	spin_lock_irqsave(&card->lock, flags);
diff -Nru a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
--- a/drivers/net/wan/farsync.c	Sun Mar 30 12:36:39 2003
+++ b/drivers/net/wan/farsync.c	Thu Apr 24 05:18:50 2003
@@ -772,7 +772,7 @@
  *      The interrupt service routine
  *      Dev_id is our fst_card_info pointer
  */
-static void
+static irqreturn_t
 fst_intr ( int irq, void *dev_id, struct pt_regs *regs )
 {
         struct fst_card_info *card;
@@ -785,7 +785,7 @@
         if (( card = dev_id ) == NULL )
         {
                 dbg ( DBG_INTR,"intr: spurious %d\n", irq );
-                return;
+                return IRQ_NONE;
         }
 
         dbg ( DBG_INTR,"intr: %d %p\n", irq, card );
@@ -882,6 +882,7 @@
         }
 
         spin_unlock ( &card->card_lock );
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c
--- a/drivers/net/wan/hd6457x.c	Thu Apr  3 13:59:09 2003
+++ b/drivers/net/wan/hd6457x.c	Thu Apr 24 05:18:50 2003
@@ -408,17 +408,19 @@
 
 
 
-static void sca_intr(int irq, void* dev_id, struct pt_regs *regs)
+static irqreturn_t sca_intr(int irq, void* dev_id, struct pt_regs *regs)
 {
 	card_t *card = dev_id;
 	int i;
 	u8 stat;
+	int handled = 0;
 
 #ifndef ALL_PAGES_ALWAYS_MAPPED
 	u8 page = sca_get_page(card);
 #endif
 
 	while((stat = sca_intr_status(card)) != 0) {
+		handled = 1;
 		for (i = 0; i < 2; i++) {
 			port_t *port = get_port(card, i);
 			if (port) {
@@ -437,6 +439,7 @@
 #ifndef ALL_PAGES_ALWAYS_MAPPED
 	openwin(card, page);		/* Restore original page */
 #endif
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
--- a/drivers/net/wan/n2.c	Thu Apr  3 14:24:44 2003
+++ b/drivers/net/wan/n2.c	Thu Apr 24 05:18:50 2003
@@ -216,12 +216,13 @@
 	port_t *port = hdlc_to_port(hdlc);
 	int io = port->card->io;
 	u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0);
+	int result;
 
 
 	if (!try_module_get(THIS_MODULE))
 		return -EFAULT;	/* rmmod in progress */
 
-	int result = hdlc_open(hdlc);
+	result = hdlc_open(hdlc);
 	if (result) {
 		return result;
 		module_put(THIS_MODULE);
diff -Nru a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
--- a/drivers/net/wan/pc300_tty.c	Mon Mar 31 15:55:32 2003
+++ b/drivers/net/wan/pc300_tty.c	Mon Apr 21 20:58:42 2003
@@ -318,18 +318,18 @@
 		return -ENODEV;
 	} 
 
-	port = minor(tty->device) - tty->driver.minor_start; 
+	port = tty->index;
 
 	if ((port < 0) || (port >= CPC_TTY_NPORTS)){ 
-		CPC_TTY_DBG("pc300_tty: open invalid minor %i\n",MINOR(tty->device));
+		CPC_TTY_DBG("pc300_tty: open invalid port %d\n", port);
 		return -ENODEV;
 	} 
 
 	cpc_tty = &cpc_tty_area[port];
 	
 	if (cpc_tty->state == CPC_TTY_ST_IDLE){
-		CPC_TTY_DBG("%s: open - invalid interface, minor=%i\n",
-					cpc_tty->name, MINOR(tty->device));
+		CPC_TTY_DBG("%s: open - invalid interface, port=%d\n",
+					cpc_tty->name, tty->index);
 		return -ENODEV;
 	}
 
diff -Nru a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c
--- a/drivers/net/wan/sdla_chdlc.c	Mon Mar 31 15:55:32 2003
+++ b/drivers/net/wan/sdla_chdlc.c	Mon Apr 21 20:58:42 2003
@@ -3698,7 +3698,7 @@
 	
 	if (!tty->driver_data){
 		int port;
-		port = minor(tty->device) - tty->driver.minor_start;
+		port = tty->index;
 		if ((port < 0) || (port >= NR_PORTS)) 
 			return -ENODEV;
 		
diff -Nru a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
--- a/drivers/net/wan/x25_asy.c	Wed Nov 27 11:25:41 2002
+++ b/drivers/net/wan/x25_asy.c	Mon Apr 21 20:58:40 2003
@@ -288,7 +288,7 @@
 	 *       14 Oct 1994  Dmitry Gorodchanin.
 	 */
 	sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
-	actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count);
+	actual = sl->tty->driver->write(sl->tty, 0, sl->xbuff, count);
 	sl->xleft = count - actual;
 	sl->xhead = sl->xbuff + actual;
 	/* VSV */
@@ -318,7 +318,7 @@
 		return;
 	}
 
-	actual = tty->driver.write(tty, 0, sl->xhead, sl->xleft);
+	actual = tty->driver->write(tty, 0, sl->xhead, sl->xleft);
 	sl->xleft -= actual;
 	sl->xhead += actual;
 }
@@ -330,7 +330,7 @@
 	 *      14 Oct 1994 Dmitry Gorodchanin.
 	 */
 	printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name,
-	       (sl->tty->driver.chars_in_buffer(sl->tty) || sl->xleft) ?
+	       (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ?
 	       "bad line quality" : "driver error");
 	sl->xleft = 0;
 	sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
@@ -620,8 +620,8 @@
 
 	sl->tty = tty;
 	tty->disc_data = sl;
-	if (tty->driver.flush_buffer)  {
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)  {
+		tty->driver->flush_buffer(tty);
 	}
 	if (tty->ldisc.flush_buffer)  {
 		tty->ldisc.flush_buffer(tty);
diff -Nru a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c
--- a/drivers/net/wan/z85230.c	Tue Feb 25 02:45:32 2003
+++ b/drivers/net/wan/z85230.c	Thu Apr 24 05:18:50 2003
@@ -718,7 +718,7 @@
  *	channel). c->lock for both channels points to dev->lock
  */
 
-void z8530_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t z8530_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct z8530_dev *dev=dev_id;
 	u8 intr;
@@ -729,7 +729,7 @@
 	if(locker)
 	{
 		printk(KERN_ERR "IRQ re-enter\n");
-		return;
+		return IRQ_NONE;
 	}
 	locker=1;
 
@@ -775,6 +775,7 @@
 		printk(KERN_ERR "%s: interrupt jammed - abort(0x%X)!\n", dev->name, intr);
 	/* Ok all done */
 	locker=0;
+	return IRQ_HANDLED;
 }
 
 EXPORT_SYMBOL(z8530_interrupt);
diff -Nru a/drivers/net/wan/z85230.h b/drivers/net/wan/z85230.h
--- a/drivers/net/wan/z85230.h	Mon Feb  4 23:55:11 2002
+++ b/drivers/net/wan/z85230.h	Thu Apr 24 05:18:50 2003
@@ -9,6 +9,7 @@
 #define _Z8530_H
 
 #include <linux/tty.h>
+#include <linux/interrupt.h>
 
 /* Conversion routines to/from brg time constants from/to bits
  * per second.
@@ -399,7 +400,7 @@
 extern u8 z8530_dead_port[];
 extern u8 z8530_hdlc_kilostream_85230[];
 extern u8 z8530_hdlc_kilostream[];
-extern void z8530_interrupt(int, void *, struct pt_regs *);
+extern irqreturn_t z8530_interrupt(int, void *, struct pt_regs *);
 extern void z8530_describe(struct z8530_dev *, char *mapping, unsigned long io);
 extern int z8530_init(struct z8530_dev *);
 extern int z8530_shutdown(struct z8530_dev *);
diff -Nru a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig	Tue Feb 25 18:56:15 2003
+++ b/drivers/net/wireless/Kconfig	Sun Apr 20 12:56:51 2003
@@ -88,7 +88,7 @@
 
 	  If you want to use an ISA WaveLAN card under Linux, say Y and read
 	  the Ethernet-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. Some more specific
+	  <http://www.tldp.org/docs.html#howto>. Some more specific
 	  information is contained in
 	  <file:Documentation/networking/wavelan.txt> and in the source code
 	  <file:drivers/net/wavelan.p.h>.
@@ -240,7 +240,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  You also want to check out the PCMCIA-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  You will also very likely also need the Wireless Tools in order to
 	  configure your card and that /etc/pcmcia/wireless.opts works:
@@ -266,7 +266,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  You also want to check out the PCMCIA-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 # yes, this works even when no drivers are selected
 config NET_WIRELESS
diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
--- a/drivers/net/wireless/airo.c	Fri Mar 21 14:14:01 2003
+++ b/drivers/net/wireless/airo.c	Sun Apr 20 23:39:12 2003
@@ -947,7 +947,7 @@
 static int transmit_802_3_packet(struct airo_info*, int len, char *pPacket);
 static int transmit_802_11_packet(struct airo_info*, int len, char *pPacket);
 
-static void airo_interrupt( int irq, void* dev_id, struct pt_regs
+static irqreturn_t airo_interrupt( int irq, void* dev_id, struct pt_regs
 			    *regs);
 static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 #ifdef WIRELESS_EXT
@@ -1837,20 +1837,23 @@
 	}
 }
 
-static void airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs) {
+static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs) {
 	struct net_device *dev = (struct net_device *)dev_id;
 	u16 status;
 	u16 fid;
 	struct airo_info *apriv = dev->priv;
 	u16 savedInterrupts = 0;
+	int handled = 0;
 
 	if (!netif_device_present(dev))
-		return;
+		return IRQ_NONE;
 
 	for (;;) {
 		status = IN4500( apriv, EVSTAT );
 		if ( !(status & STATUS_INTS) || status == 0xffff ) break;
 
+		handled = 1;
+
 		if ( status & EV_AWAKE ) {
 			OUT4500( apriv, EVACK, EV_AWAKE );
 			OUT4500( apriv, EVACK, EV_AWAKE );
@@ -2133,7 +2136,7 @@
 		OUT4500( apriv, EVINTEN, savedInterrupts );
 
 	/* done.. */
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /*
@@ -2494,7 +2497,7 @@
 	u16 next;
 	int words;
 	int i;
-	long flags;
+	unsigned long flags;
 
 	spin_lock_irqsave(&ai->aux_lock, flags);
 	page = IN4500(ai, SWS0+whichbap);
diff -Nru a/drivers/net/wireless/arlan.c b/drivers/net/wireless/arlan.c
--- a/drivers/net/wireless/arlan.c	Tue Feb 25 02:08:46 2003
+++ b/drivers/net/wireless/arlan.c	Sun Apr 20 23:39:12 2003
@@ -113,7 +113,7 @@
 static  int 	arlan_probe_here(struct net_device *dev, int ioaddr);
 static  int 	arlan_open(struct net_device *dev);
 static  int 	arlan_tx(struct sk_buff *skb, struct net_device *dev);
-static  void 	arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static  irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static  int 	arlan_close(struct net_device *dev);
 static  struct net_device_stats *
 		arlan_statistics		(struct net_device *dev);
@@ -1840,7 +1840,7 @@
 	return;
 }
 
-static void arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
 	struct arlan_private *priv = (struct arlan_private *) dev->priv;
@@ -1859,7 +1859,7 @@
 	priv->irq_test_done = 1;
 
 	ARLAN_DEBUG_EXIT("arlan_interrupt");
-	return;
+	return IRQ_HANDLED;
 
 }
 
diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h
--- a/drivers/net/wireless/arlan.h	Tue Feb 18 17:22:50 2003
+++ b/drivers/net/wireless/arlan.h	Sun Apr 20 23:39:12 2003
@@ -376,7 +376,7 @@
       volatile int txNew;
       volatile int txOffset;
       volatile char ReTransmitRequested;
-      volatile long long tx_done_delayed;
+      volatile unsigned long tx_done_delayed;
       volatile long long registrationLastSeen;
       volatile char under_command;
       volatile char under_toggle;
diff -Nru a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
--- a/drivers/net/wireless/netwave_cs.c	Sun Feb  2 13:40:35 2003
+++ b/drivers/net/wireless/netwave_cs.c	Sun Apr 20 23:39:12 2003
@@ -495,6 +495,7 @@
     spin_lock_init(&priv->spinlock);
 
     /* Netwave specific entries in the device structure */
+    SET_MODULE_OWNER(dev);
     dev->hard_start_xmit = &netwave_start_xmit;
     dev->set_config = &netwave_config;
     dev->get_stats  = &netwave_get_stats;
@@ -1727,7 +1728,6 @@
 	return -ENODEV;
 
     link->open++;
-    MOD_INC_USE_COUNT;
 
     netif_start_queue(dev);
     netwave_reset(dev);
@@ -1746,7 +1746,6 @@
     if (link->state & DEV_STALE_CONFIG)
 	mod_timer(&link->release, jiffies + HZ/20);
 	
-    MOD_DEC_USE_COUNT;
     return 0;
 }
 
diff -Nru a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
--- a/drivers/net/wireless/orinoco.c	Mon Feb 24 12:16:14 2003
+++ b/drivers/net/wireless/orinoco.c	Sun Apr 20 23:39:12 2003
@@ -1337,7 +1337,7 @@
 /*
  * Interrupt handler
  */
-void orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct orinoco_private *priv = (struct orinoco_private *) dev_id;
 	hermes_t *hw = &priv->hw;
@@ -1353,7 +1353,7 @@
 
 	if (orinoco_lock(priv, &flags) != 0) {
 		/* If hw is unavailable */
-		return;
+		return IRQ_NONE;
 	}
 
 	evstat = hermes_read_regn(hw, EVSTAT);
@@ -1403,6 +1403,8 @@
 	};
 
 	orinoco_unlock(priv, &flags);
+
+	return IRQ_HANDLED;
 }
 
 static void __orinoco_ev_tick(struct orinoco_private *priv, hermes_t *hw)
diff -Nru a/drivers/net/wireless/orinoco.h b/drivers/net/wireless/orinoco.h
--- a/drivers/net/wireless/orinoco.h	Fri Feb  7 00:20:34 2003
+++ b/drivers/net/wireless/orinoco.h	Sun Apr 20 23:39:12 2003
@@ -114,7 +114,7 @@
 
 extern int orinoco_proc_dev_init(struct net_device *dev);
 extern void orinoco_proc_dev_cleanup(struct net_device *dev);
-extern void orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
+extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
 
 /********************************************************************/
 /* Locking and synchronization functions                            */
diff -Nru a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
--- a/drivers/net/wireless/orinoco_cs.c	Sun Feb  2 13:40:35 2003
+++ b/drivers/net/wireless/orinoco_cs.c	Wed Apr 23 12:54:13 2003
@@ -35,7 +35,6 @@
 #include <pcmcia/cistpl.h>
 #include <pcmcia/cisreg.h>
 #include <pcmcia/ds.h>
-#include <pcmcia/bus_ops.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
diff -Nru a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
--- a/drivers/net/wireless/ray_cs.c	Sun Mar 23 03:27:36 2003
+++ b/drivers/net/wireless/ray_cs.c	Sun Apr 20 23:39:12 2003
@@ -423,6 +423,7 @@
     dev->set_multicast_list = &set_multicast_list;
 
     DEBUG(2,"ray_cs ray_attach calling ether_setup.)\n");
+    SET_MODULE_OWNER(dev);
     ether_setup(dev);
     dev->init = &ray_dev_init;
     dev->open = &ray_open;
@@ -1724,14 +1725,11 @@
     dev_link_t *link;
     ray_dev_t *local = (ray_dev_t *)dev->priv;
     
-    MOD_INC_USE_COUNT;
-
     DEBUG(1, "ray_open('%s')\n", dev->name);
 
     for (link = dev_list; link; link = link->next)
         if (link->priv == dev) break;
     if (!DEV_OK(link)) {
-        MOD_DEC_USE_COUNT;
         return -ENODEV;
     }
 
@@ -1780,8 +1778,6 @@
      * and set local->card_status to CARD_AWAITING_PARAM, so that while the
      * card is closed we can chage its configuration.
      * Probably also need a COR reset to get sane state - Jean II */
-
-    MOD_DEC_USE_COUNT;
 
     return 0;
 } /* end ray_dev_close */
diff -Nru a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
--- a/drivers/net/wireless/strip.c	Mon Apr  7 10:48:34 2003
+++ b/drivers/net/wireless/strip.c	Thu Apr 24 05:25:35 2003
@@ -801,7 +801,7 @@
 	struct termios old_termios = *(tty->termios);
 	tty->termios->c_cflag &= ~CBAUD;	/* Clear the old baud setting */
 	tty->termios->c_cflag |= baudcode;	/* Set the new baud setting */
-	tty->driver.set_termios(tty, &old_termios);
+	tty->driver->set_termios(tty, &old_termios);
 }
 
 /*
@@ -1048,8 +1048,10 @@
 		if (table->num_nodes)
 			ptr += sprintf(ptr, "\n %s\n", title);
 		for (i = 0; i < table->num_nodes; i++) {
+			MetricomNode node;
+
 			spin_lock_irqsave(&strip_lock, flags);
-			MetricomNode node = table->node[i];
+			node = table->node[i];
 			spin_unlock_irqrestore(&strip_lock, flags);
 			ptr += sprintf(ptr, "  %s\n", node.c);
 		}
@@ -1266,7 +1268,7 @@
 			set_baud(tty, strip_info->user_baud);
 	}
 
-	tty->driver.write(tty, 0, s.string, s.length);
+	tty->driver->write(tty, 0, s.string, s.length);
 #ifdef EXT_COUNTERS
 	strip_info->tx_ebytes += s.length;
 #endif
@@ -1288,7 +1290,7 @@
 
 	if (strip_info->tx_left > 0) {
 		int num_written =
-		    tty->driver.write(tty, 0, strip_info->tx_head,
+		    tty->driver->write(tty, 0, strip_info->tx_head,
 				      strip_info->tx_left);
 		strip_info->tx_left -= num_written;
 		strip_info->tx_head += num_written;
@@ -2688,8 +2690,8 @@
 
 	strip_info->tty = tty;
 	tty->disc_data = strip_info;
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
--- a/drivers/net/wireless/wavelan.c	Fri Jan 10 12:06:02 2003
+++ b/drivers/net/wireless/wavelan.c	Sun Apr 20 23:39:12 2003
@@ -3858,7 +3858,7 @@
  * This function is the interrupt handler for the WaveLAN card. This
  * routine will be called whenever: 
  */
-static void wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	device *dev;
 	unsigned long ioaddr;
@@ -3934,7 +3934,7 @@
 		       dev->name, hasr);
 #endif
 		spin_unlock (&lp->spinlock);
-		return;
+		return IRQ_NONE;
 	}
 
 	/* Read interrupt data. */
@@ -4004,6 +4004,7 @@
 #ifdef DEBUG_INTERRUPT_TRACE
 	printk(KERN_DEBUG "%s: <-wavelan_interrupt()\n", dev->name);
 #endif
+	return IRQ_HANDLED;
 }
 
 /*------------------------------------------------------------------*/
diff -Nru a/drivers/net/wireless/wavelan.p.h b/drivers/net/wireless/wavelan.p.h
--- a/drivers/net/wireless/wavelan.p.h	Fri Oct 18 16:11:24 2002
+++ b/drivers/net/wireless/wavelan.p.h	Sun Apr 20 23:39:13 2003
@@ -650,7 +650,7 @@
 	wv_check_ioaddr(u_long,		/* ioaddr */
 			u_char *);	/* mac address (read) */
 /* ---------------------- INTERRUPT HANDLING ---------------------- */
-static void
+static irqreturn_t
 	wavelan_interrupt(int,		/* interrupt handler */
 			  void *,
 			  struct pt_regs *);
diff -Nru a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
--- a/drivers/net/wireless/wavelan_cs.c	Mon Sep 23 22:49:28 2002
+++ b/drivers/net/wireless/wavelan_cs.c	Sun Apr 20 23:39:13 2003
@@ -5020,7 +5020,6 @@
 
   /* Mark the device as used */
   link->open++;
-  MOD_INC_USE_COUNT;
 
 #ifdef WAVELAN_ROAMING
   if(do_roaming)
@@ -5065,7 +5064,6 @@
 #endif	/* WAVELAN_ROAMING */
 
   link->open--;
-  MOD_DEC_USE_COUNT;
 
   /* If the card is still present */
   if(netif_running(dev))
@@ -5186,6 +5184,7 @@
   ether_setup(dev);
 
   /* wavelan NET3 callbacks */
+  SET_MODULE_OWNER(dev);
   dev->open = &wavelan_open;
   dev->stop = &wavelan_close;
   dev->hard_start_xmit = &wavelan_packet_xmit;
diff -Nru a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
--- a/drivers/net/yellowfin.c	Fri Jan 10 12:06:02 2003
+++ b/drivers/net/yellowfin.c	Sun Apr 20 21:58:28 2003
@@ -406,7 +406,7 @@
 static void yellowfin_tx_timeout(struct net_device *dev);
 static void yellowfin_init_ring(struct net_device *dev);
 static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int yellowfin_rx(struct net_device *dev);
 static void yellowfin_error(struct net_device *dev, int intr_status);
 static int yellowfin_close(struct net_device *dev);
@@ -942,17 +942,18 @@
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static void yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_instance;
 	struct yellowfin_private *yp;
 	long ioaddr;
 	int boguscnt = max_interrupt_work;
+	unsigned int handled = 0;
 
 #ifndef final_version			/* Can never occur. */
 	if (dev == NULL) {
 		printk (KERN_ERR "yellowfin_interrupt(): irq %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 #endif
 
@@ -970,6 +971,7 @@
 
 		if (intr_status == 0)
 			break;
+		handled = 1;
 
 		if (intr_status & (IntrRxDone | IntrEarlyRx)) {
 			yellowfin_rx(dev);
@@ -1091,7 +1093,7 @@
 			   dev->name, inw(ioaddr + IntrStatus));
 
 	spin_unlock (&yp->lock);
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 /* This routine is logically part of the interrupt handler, but separated
@@ -1371,18 +1373,20 @@
 		memset(hash_table, 0, sizeof(hash_table));
 		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
 			 i++, mclist = mclist->next) {
+			unsigned int bit;
+
 			/* Due to a bug in the early chip versions, multiple filter
 			   slots must be set for each address. */
 			if (yp->drv_flags & HasMulticastBug) {
-				set_bit((ether_crc_le(3, mclist->dmi_addr) >> 3) & 0x3f,
-						hash_table);
-				set_bit((ether_crc_le(4, mclist->dmi_addr) >> 3) & 0x3f,
-						hash_table);
-				set_bit((ether_crc_le(5, mclist->dmi_addr) >> 3) & 0x3f,
-						hash_table);
+				bit = (ether_crc_le(3, mclist->dmi_addr) >> 3) & 0x3f;
+				hash_table[bit >> 4] |= (1 << bit);
+				bit = (ether_crc_le(4, mclist->dmi_addr) >> 3) & 0x3f;
+				hash_table[bit >> 4] |= (1 << bit);
+				bit = (ether_crc_le(5, mclist->dmi_addr) >> 3) & 0x3f;
+				hash_table[bit >> 4] |= (1 << bit);
 			}
-			set_bit((ether_crc_le(6, mclist->dmi_addr) >> 3) & 0x3f,
-					hash_table);
+			bit = (ether_crc_le(6, mclist->dmi_addr) >> 3) & 0x3f;
+			hash_table[bit >> 4] |= (1 << bit);
 		}
 		/* Copy the hash table to the chip. */
 		for (i = 0; i < 4; i++)
diff -Nru a/drivers/net/znet.c b/drivers/net/znet.c
--- a/drivers/net/znet.c	Mon Mar 31 15:55:38 2003
+++ b/drivers/net/znet.c	Sun Apr 20 23:39:13 2003
@@ -159,7 +159,7 @@
 
 static int	znet_open(struct net_device *dev);
 static int	znet_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void	znet_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t znet_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void	znet_rx(struct net_device *dev);
 static int	znet_close(struct net_device *dev);
 static struct net_device_stats *net_get_stats(struct net_device *dev);
@@ -604,16 +604,17 @@
 }
 
 /* The ZNET interrupt handler. */
-static void	znet_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t znet_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct net_device *dev = dev_id;
 	struct znet_private *znet = dev->priv;
 	int ioaddr;
 	int boguscnt = 20;
+	int handled = 0;
 
 	if (dev == NULL) {
 		printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	spin_lock (&znet->lock);
@@ -637,6 +638,8 @@
 		if ((status & SR0_INTERRUPT) == 0)
 			break;
 
+		handled = 1;
+
 		if ((status & SR0_EVENT_MASK) == SR0_TRANSMIT_DONE ||
 		    (status & SR0_EVENT_MASK) == SR0_RETRANSMIT_DONE ||
 		    (status & SR0_EVENT_MASK) == SR0_TRANSMIT_NO_CRC_DONE) {
@@ -682,7 +685,7 @@
 
 	spin_unlock (&znet->lock);
 	
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 static void znet_rx(struct net_device *dev)
diff -Nru a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
--- a/drivers/parport/parport_pc.c	Sun Mar 23 14:28:44 2003
+++ b/drivers/parport/parport_pc.c	Sun Apr 20 14:14:29 2003
@@ -262,9 +262,11 @@
  * of these are in parport_pc.h.
  */
 
-static void parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	parport_generic_irq(irq, (struct parport *) dev_id, regs);
+	/* FIXME! Was it really ours? */
+	return IRQ_HANDLED;
 }
 
 void parport_pc_write_data(struct parport *p, unsigned char d)
diff -Nru a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
--- a/drivers/parport/parport_serial.c	Thu Nov 21 10:00:10 2002
+++ b/drivers/parport/parport_serial.c	Mon Apr 21 02:00:08 2003
@@ -26,6 +26,7 @@
 #include <linux/serial.h>
 #include <linux/serialP.h>
 #include <linux/list.h>
+#include <linux/8250_pci.h>
 
 #include <asm/serial.h>
 
@@ -150,12 +151,12 @@
 
 static int __devinit siig10x_init_fn(struct pci_dev *dev, struct pci_board_no_ids *board, int enable)
 {
-	return pci_siig10x_fn(dev, NULL, enable);
+	return pci_siig10x_fn(dev, enable);
 }
 
 static int __devinit siig20x_init_fn(struct pci_dev *dev, struct pci_board_no_ids *board, int enable)
 {
-	return pci_siig20x_fn(dev, NULL, enable);
+	return pci_siig20x_fn(dev, enable);
 }
 
 static struct pci_board_no_ids pci_boards[] __devinitdata = {
diff -Nru a/drivers/pci/Makefile b/drivers/pci/Makefile
--- a/drivers/pci/Makefile	Sun Mar 23 04:17:50 2003
+++ b/drivers/pci/Makefile	Fri Mar 28 08:40:01 2003
@@ -20,6 +20,7 @@
 obj-$(CONFIG_PARISC) += setup-bus.o
 obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o
 obj-$(CONFIG_PPC32) += setup-irq.o
+obj-$(CONFIG_PPC64) += setup-bus.o
 obj-$(CONFIG_DDB5476) += setup-bus.o
 obj-$(CONFIG_SGI_IP27) += setup-irq.o
 obj-$(CONFIG_X86_VISWS) += setup-irq.o
diff -Nru a/drivers/pci/bus.c b/drivers/pci/bus.c
--- a/drivers/pci/bus.c	Mon Mar  3 13:26:41 2003
+++ b/drivers/pci/bus.c	Sat Apr 19 23:22:31 2003
@@ -75,7 +75,8 @@
  * Add newly discovered PCI devices (which are on the bus->devices
  * list) to the global PCI device list, add the sysfs and procfs
  * entries.  Where a bridge is found, add the discovered bus to
- * the parents list of child buses, and recurse.
+ * the parents list of child buses, and recurse (breadth-first
+ * to be compatible with 2.4)
  *
  * Call hotplug for each new devices.
  */
@@ -97,6 +98,12 @@
 		pci_proc_attach_device(dev);
 #endif
 		pci_create_sysfs_dev_files(dev);
+
+	}
+
+	list_for_each_entry(dev, &bus->devices, bus_list) {
+
+		BUG_ON(list_empty(&dev->global_list));
 
 		/*
 		 * If there is an unattached subordinate bus, attach
diff -Nru a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
--- a/drivers/pcmcia/Kconfig	Sun Mar 30 00:13:46 2003
+++ b/drivers/pcmcia/Kconfig	Sun Apr 20 12:56:51 2003
@@ -21,7 +21,7 @@
 	  To use your PC-cards, you will need supporting software from David
 	  Hinds' pcmcia-cs package (see the file <file:Documentation/Changes>
 	  for location).  Please also read the PCMCIA-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
diff -Nru a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
--- a/drivers/pcmcia/cardbus.c	Thu Apr 17 16:50:39 2003
+++ b/drivers/pcmcia/cardbus.c	Wed Apr 23 14:03:15 2003
@@ -123,7 +123,7 @@
     
 =====================================================================*/
 
-void cb_release_cis_mem(socket_info_t * s)
+static void cb_release_cis_mem(socket_info_t * s)
 {
 	if (s->cb_cis_virt) {
 		DEBUG(1, "cs: cb_release_cis_mem()\n");
@@ -269,6 +269,8 @@
 void cb_free(socket_info_t * s)
 {
 	struct pci_dev *bridge = s->cap.cb_dev;
+
+	cb_release_cis_mem(s);
 
 	if (bridge)
 		pci_remove_behind_bridge(bridge);
diff -Nru a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
--- a/drivers/pcmcia/cistpl.c	Wed Mar 26 08:49:31 2003
+++ b/drivers/pcmcia/cistpl.c	Wed Apr 23 13:17:22 2003
@@ -269,8 +269,8 @@
 static void read_cis_cache(socket_info_t *s, int attr, u_int addr,
 			   u_int len, void *ptr)
 {
-    int i, ret;
-    char *caddr;
+    struct cis_cache_entry *cis;
+    int ret;
 
     if (s->fake_cis) {
 	if (s->fake_cis_len > addr+len)
@@ -279,32 +279,55 @@
 	    memset(ptr, 0xff, len);
 	return;
     }
-    caddr = s->cis_cache;
-    for (i = 0; i < s->cis_used; i++) {
-	if ((s->cis_table[i].addr == addr) &&
-	    (s->cis_table[i].len == len) &&
-	    (s->cis_table[i].attr == attr)) break;
-	caddr += s->cis_table[i].len;
-    }
-    if (i < s->cis_used) {
-	memcpy(ptr, caddr, len);
-	return;
+
+    list_for_each_entry(cis, &s->cis_cache, node) {
+	if (cis->addr == addr && cis->len == len && cis->attr == attr) {
+	    memcpy(ptr, cis->cache, len);
+	    return;
+	}
     }
+
 #ifdef CONFIG_CARDBUS
     if (s->state & SOCKET_CARDBUS)
 	ret = read_cb_mem(s, attr, addr, len, ptr);
     else
 #endif
 	ret = read_cis_mem(s, attr, addr, len, ptr);
-    /* Copy data into the cache, if there is room */
-    if ((ret == 0) && (i < MAX_CIS_TABLE) &&
-	(caddr+len < s->cis_cache+MAX_CIS_DATA)) {
-	s->cis_table[i].addr = addr;
-	s->cis_table[i].len = len;
-	s->cis_table[i].attr = attr;
-	s->cis_used++;
-	memcpy(caddr, ptr, len);
-    }	    
+
+    /* Copy data into the cache */
+    cis = kmalloc(sizeof(struct cis_cache_entry) + len, GFP_KERNEL);
+    if (cis) {
+	cis->addr = addr;
+	cis->len = len;
+	cis->attr = attr;
+	memcpy(cis->cache, ptr, len);
+	list_add(&cis->node, &s->cis_cache);
+    }
+}
+
+static void
+remove_cis_cache(socket_info_t *s, int attr, u_int addr, u_int len)
+{
+	struct cis_cache_entry *cis;
+
+	list_for_each_entry(cis, &s->cis_cache, node)
+		if (cis->addr == addr && cis->len == len && cis->attr == attr) {
+			list_del(&cis->node);
+			kfree(cis);
+			break;
+		}
+}
+
+void destroy_cis_cache(socket_info_t *s)
+{
+	struct list_head *l, *n;
+
+	list_for_each_safe(l, n, &s->cis_cache) {
+		struct cis_cache_entry *cis = list_entry(l, struct cis_cache_entry, node);
+
+		list_del(&cis->node);
+		kfree(cis);
+	}
 }
 
 /*======================================================================
@@ -316,24 +339,25 @@
 
 int verify_cis_cache(socket_info_t *s)
 {
-    char buf[256], *caddr;
-    int i;
-    
-    caddr = s->cis_cache;
-    for (i = 0; i < s->cis_used; i++) {
+	struct cis_cache_entry *cis;
+	char buf[256];
+
+	list_for_each_entry(cis, &s->cis_cache, node) {
+		int len = cis->len;
+
+		if (len > 256)
+			len = 256;
 #ifdef CONFIG_CARDBUS
-	if (s->state & SOCKET_CARDBUS)
-	    read_cb_mem(s, s->cis_table[i].attr, s->cis_table[i].addr,
-			s->cis_table[i].len, buf);
-	else
+		if (s->state & SOCKET_CARDBUS)
+			read_cb_mem(s, cis->attr, cis->addr, len, buf);
+		else
 #endif
-	    read_cis_mem(s, s->cis_table[i].attr, s->cis_table[i].addr,
-			 s->cis_table[i].len, buf);
-	if (memcmp(buf, caddr, s->cis_table[i].len) != 0)
-	    break;
-	caddr += s->cis_table[i].len;
-    }
-    return (i < s->cis_used);
+			read_cis_mem(s, cis->attr, cis->addr, len, buf);
+
+		if (memcmp(buf, cis->cache, len) != 0)
+			return -1;
+	}
+	return 0;
 }
 
 /*======================================================================
@@ -449,14 +473,16 @@
 	if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) &&
 	    (strncmp(link+2, "CIS", 3) == 0))
 	    return ofs;
+	remove_cis_cache(s, SPACE(tuple->Flags), ofs, 5);
 	/* Then, we try the wrong spot... */
 	ofs = ofs >> 1;
     }
     read_cis_cache(s, SPACE(tuple->Flags), ofs, 5, link);
-    if ((link[0] != CISTPL_LINKTARGET) || (link[1] < 3) ||
-	(strncmp(link+2, "CIS", 3) != 0))
-	return -1;
-    return ofs;
+    if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) &&
+	(strncmp(link+2, "CIS", 3) == 0))
+	return ofs;
+    remove_cis_cache(s, SPACE(tuple->Flags), ofs, 5);
+    return -1;
 }
 
 int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple)
diff -Nru a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
--- a/drivers/pcmcia/cs.c	Fri Mar 28 15:54:19 2003
+++ b/drivers/pcmcia/cs.c	Wed Apr 23 14:03:15 2003
@@ -342,6 +342,7 @@
 		s->cis_mem.flags = 0;
 		s->cis_mem.speed = cis_speed;
 		s->erase_busy.next = s->erase_busy.prev = &s->erase_busy;
+		INIT_LIST_HEAD(&s->cis_cache);
 		spin_lock_init(&s->lock);
     
 		/* TBD: remove usage of socket_table, use class_for_each_dev instead */
@@ -469,7 +470,7 @@
     init_socket(s);
     s->irq.AssignedIRQ = s->irq.Config = 0;
     s->lock_count = 0;
-    s->cis_used = 0;
+    destroy_cis_cache(s);
     if (s->fake_cis) {
 	kfree(s->fake_cis);
 	s->fake_cis = NULL;
@@ -484,7 +485,6 @@
     set_socket(s, &s->socket);
     /* */
 #ifdef CONFIG_CARDBUS
-    cb_release_cis_mem(s);
     cb_free(s);
 #endif
     s->functions = 0;
diff -Nru a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
--- a/drivers/pcmcia/cs_internal.h	Fri Mar 28 15:51:04 2003
+++ b/drivers/pcmcia/cs_internal.h	Wed Apr 23 14:03:15 2003
@@ -114,9 +114,13 @@
 /* Maximum number of memory windows per socket */
 #define MAX_WIN 4
 
-/* The size of the CIS cache */
-#define MAX_CIS_TABLE	64
-#define MAX_CIS_DATA	512
+struct cis_cache_entry {
+	struct list_head	node;
+	unsigned int		addr;
+	unsigned int		len;
+	unsigned int		attr;
+	unsigned char		cache[0];
+};
 
 typedef struct socket_info_t {
     spinlock_t			lock;
@@ -145,13 +149,7 @@
     window_t			win[MAX_WIN];
     region_t			*c_region, *a_region;
     erase_busy_t		erase_busy;
-    int				cis_used;
-    struct {
-	u_int			addr;
-	u_short			len;
-	u_short			attr;
-    }				cis_table[MAX_CIS_TABLE];
-    char			cis_cache[MAX_CIS_DATA];
+    struct list_head		cis_cache;
     u_int			fake_cis_len;
     char			*fake_cis;
 #ifdef CONFIG_PROC_FS
@@ -198,7 +196,6 @@
 int cb_alloc(socket_info_t *s);
 void cb_free(socket_info_t *s);
 int read_cb_mem(socket_info_t *s, int space, u_int addr, u_int len, void *ptr);
-void cb_release_cis_mem(socket_info_t *s);
 
 /* In cistpl.c */
 int read_cis_mem(socket_info_t *s, int attr,
@@ -206,6 +203,7 @@
 void write_cis_mem(socket_info_t *s, int attr,
 		   u_int addr, u_int len, void *ptr);
 void release_cis_mem(socket_info_t *s);
+void destroy_cis_cache(socket_info_t *s);
 int verify_cis_cache(socket_info_t *s);
 void preload_cis_cache(socket_info_t *s);
 int get_first_tuple(client_handle_t handle, tuple_t *tuple);
diff -Nru a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
--- a/drivers/pcmcia/i82092.c	Fri Mar 28 15:51:04 2003
+++ b/drivers/pcmcia/i82092.c	Mon Apr 21 02:40:59 2003
@@ -219,6 +219,7 @@
 	return val;
 }
 
+#if 0
 static unsigned short indirect_read16(int socket, unsigned short reg)
 {
 	unsigned short int port;
@@ -235,6 +236,7 @@
 	spin_unlock_irqrestore(&port_lock,flags);
 	return tmp;
 }
+#endif
 
 static void indirect_write(int socket, unsigned short reg, unsigned char value)
 {
@@ -334,11 +336,12 @@
 static DECLARE_WORK(i82092aa_task, i82092aa_bh, NULL);
         
 
-static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
+static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs)
 {
 	int i;
 	int loopcount = 0;
-	
+	int handled = 0;
+
 	unsigned int events, active=0;
 	
 /*	enter("i82092aa_interrupt");*/
@@ -362,6 +365,7 @@
 			if ((csc==0) ||  /* no events on this socket */
 			   (sockets[i].handler==NULL)) /* no way to handle events */
 			   	continue;
+			handled = 1;
 			events = 0;
 			 
 			if (csc & I365_CSC_DETECT) {
@@ -390,7 +394,7 @@
 			break;				
 		
 	}
-	
+	return IRQ_RETVAL(handled);
 /*	leave("i82092aa_interrupt");*/
 }
 
diff -Nru a/drivers/pcmcia/i82092aa.h b/drivers/pcmcia/i82092aa.h
--- a/drivers/pcmcia/i82092aa.h	Mon Mar 17 07:38:32 2003
+++ b/drivers/pcmcia/i82092aa.h	Mon Apr 21 02:40:59 2003
@@ -1,6 +1,8 @@
 #ifndef _INCLUDE_GUARD_i82092aa_H_
 #define _INCLUDE_GUARD_i82092aa_H_
 
+#include <linux/interrupt.h>
+
 /* $Id: i82092aa.h,v 1.1.1.1 2001/09/19 14:53:15 dwmw2 Exp $ */
 
 /* Debuging defines */
@@ -21,7 +23,7 @@
 static int  i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id);
 static void i82092aa_pci_remove(struct pci_dev *dev);
 static int card_present(int socketno);
-static void i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);
+static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);
 
 
 
diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
--- a/drivers/pcmcia/i82365.c	Fri Mar 28 15:51:04 2003
+++ b/drivers/pcmcia/i82365.c	Mon Apr 21 02:40:59 2003
@@ -78,7 +78,7 @@
 #define DEBUG(n, args...) do { } while (0)
 #endif
 
-static void i365_count_irq(int, void *, struct pt_regs *);
+static irqreturn_t i365_count_irq(int, void *, struct pt_regs *);
 static inline int _check_irq(int irq, int flags)
 {
     if (request_irq(irq, i365_count_irq, flags, "x", i365_count_irq) != 0)
@@ -535,11 +535,12 @@
 static volatile u_int irq_hits;
 static u_short irq_sock;
 
-static void i365_count_irq(int irq, void *dev, struct pt_regs *regs)
+static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs)
 {
     i365_get(irq_sock, I365_CSC);
     irq_hits++;
     DEBUG(2, "-> hit on irq %d\n", irq);
+    return IRQ_HANDLED;
 }
 
 static u_int __init test_irq(u_short sock, int irq)
@@ -627,11 +628,6 @@
     return ns/cycle_time;
 }
 
-static int to_ns(int cycles)
-{
-    return cycle_time*cycles;
-}
-
 /*====================================================================*/
 
 #ifdef CONFIG_ISA
@@ -939,7 +935,7 @@
 
 static unsigned long last_detect_jiffies;
 
-static void pcic_interrupt(int irq, void *dev,
+static irqreturn_t pcic_interrupt(int irq, void *dev,
 				    struct pt_regs *regs)
 {
     int i, j, csc;
@@ -947,7 +943,8 @@
 #ifdef CONFIG_ISA
     u_long flags = 0;
 #endif
-    
+    int handled = 0;
+
     DEBUG(4, "i82365: pcic_interrupt(%d)\n", irq);
 
     for (j = 0; j < 20; j++) {
@@ -956,6 +953,7 @@
 	    if ((socket[i].cs_irq != irq) &&
 		(socket[i].cap.pci_irq != irq))
 		continue;
+	    handled = 1;
 	    ISA_LOCK(i, flags);
 	    csc = i365_get(i, I365_CSC);
 	    if ((csc == 0) || (!socket[i].handler) ||
@@ -1002,6 +1000,7 @@
 	printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n");
 
     DEBUG(4, "i82365: interrupt done\n");
+    return IRQ_RETVAL(handled);
 } /* pcic_interrupt */
 
 static void pcic_interrupt_wrapper(u_long data)
diff -Nru a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
--- a/drivers/pcmcia/rsrc_mgr.c	Wed Mar 26 08:49:33 2003
+++ b/drivers/pcmcia/rsrc_mgr.c	Wed Apr 23 15:35:29 2003
@@ -351,7 +351,7 @@
     ret = pcmcia_validate_cis(s->clients, &info1);
     /* invalidate mapping and CIS cache */
     iounmap(s->cis_virt);
-    s->cis_used = 0;
+    destroy_cis_cache(s);
     if ((ret != 0) || (info1.Chains == 0))
 	return 0;
     s->cis_mem.sys_start = base+s->cap.map_size;
@@ -359,7 +359,7 @@
     s->cis_virt = ioremap(base+s->cap.map_size, s->cap.map_size);
     ret = pcmcia_validate_cis(s->clients, &info2);
     iounmap(s->cis_virt);
-    s->cis_used = 0;
+    destroy_cis_cache(s);
     return ((ret == 0) && (info1.Chains == info2.Chains));
 }
 
@@ -499,14 +499,16 @@
 
 void validate_mem(socket_info_t *s)
 {
-    resource_map_t *m;
+    resource_map_t *m, *n;
     static int done = 0;
     
     if (probe_mem && done++ == 0) {
 	down(&rsrc_sem);
-	for (m = mem_db.next; m != &mem_db; m = m->next)
+	for (m = mem_db.next; m != &mem_db; m = n) {
+	    n = m->next;
 	    if (do_mem_probe(m->base, m->num, s))
 		break;
+	}
 	up(&rsrc_sem);
     }
 }
@@ -599,7 +601,7 @@
 
 #ifdef CONFIG_PCMCIA_PROBE
 
-static void fake_irq(int i, void *d, struct pt_regs *r) { }
+static irqreturn_t fake_irq(int i, void *d, struct pt_regs *r) { return IRQ_NONE; }
 static inline int check_irq(int irq)
 {
     if (request_irq(irq, fake_irq, 0, "bogus", NULL) != 0)
@@ -743,9 +745,6 @@
 	if (ret == CS_SUCCESS) {
 	    for (i = 0; i < sockets; i++) {
 		release_cis_mem(socket_table[i]);
-#ifdef CONFIG_CARDBUS
-		cb_release_cis_mem(socket_table[i]);
-#endif
 	    }
 	}
 	break;
diff -Nru a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
--- a/drivers/pcmcia/tcic.c	Fri Mar 28 15:51:05 2003
+++ b/drivers/pcmcia/tcic.c	Mon Apr 21 02:40:59 2003
@@ -111,7 +111,7 @@
 
 /*====================================================================*/
 
-static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs);
+static irqreturn_t tcic_interrupt(int irq, void *dev, struct pt_regs *regs);
 static void tcic_timer(u_long data);
 static struct pccard_operations tcic_operations;
 
@@ -229,9 +229,10 @@
 
 static volatile u_int irq_hits;
 
-static void __init tcic_irq_count(int irq, void *dev, struct pt_regs *regs)
+static irqreturn_t __init tcic_irq_count(int irq, void *dev, struct pt_regs *regs)
 {
     irq_hits++;
+    return IRQ_HANDLED;
 }
 
 static u_int __init try_irq(int irq)
@@ -565,7 +566,7 @@
 
 static DECLARE_WORK(tcic_task, tcic_bh, NULL);
 
-static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
+static irqreturn_t tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
 {
     int i, quick = 0;
     u_char latch, sstat;
@@ -575,7 +576,7 @@
 
     if (active) {
 	printk(KERN_NOTICE "tcic: reentered interrupt handler!\n");
-	return;
+	return IRQ_NONE;
     } else
 	active = 1;
 
@@ -620,7 +621,7 @@
     active = 0;
     
     DEBUG(2, "tcic: interrupt done\n");
-    
+    return IRQ_HANDLED;
 } /* tcic_interrupt */
 
 static void tcic_timer(u_long data)
diff -Nru a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c
--- a/drivers/pcmcia/yenta.c	Mon Mar 17 07:43:04 2003
+++ b/drivers/pcmcia/yenta.c	Sun Apr 20 14:14:29 2003
@@ -429,7 +429,7 @@
 		socket->handler(socket->info, events);
 }
 
-static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned int events;
 	pci_socket_t *socket = (pci_socket_t *) dev_id;
@@ -440,7 +440,9 @@
 		socket->events |= events;
 		spin_unlock(&socket->event_lock);
 		schedule_work(&socket->tq_task);
+		return IRQ_HANDLED;
 	}
+	return IRQ_NONE;
 }
 
 static void yenta_interrupt_wrapper(unsigned long data)
diff -Nru a/drivers/pnp/resource.c b/drivers/pnp/resource.c
--- a/drivers/pnp/resource.c	Thu Mar  6 13:50:22 2003
+++ b/drivers/pnp/resource.c	Sun Apr 20 14:14:29 2003
@@ -420,8 +420,9 @@
 	return NULL;
 }
 
-static void pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
+	return IRQ_NONE;
 }
 
 int pnp_check_irq(struct pnp_dev * dev, int idx)
diff -Nru a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
--- a/drivers/s390/block/dasd.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/s390/block/dasd.c	Mon Apr 21 06:28:58 2003
@@ -10,8 +10,6 @@
  * $Revision: 1.94 $
  */
 
-#define LOCAL_END_REQUEST /* Don't generate end_request in blk.h */
-
 #include <linux/config.h>
 #include <linux/kmod.h>
 #include <linux/init.h>
@@ -141,38 +139,15 @@
 static inline int
 dasd_state_new_to_known(struct dasd_device *device)
 {
-	umode_t devfs_perm;
-	kdev_t kdev;
-	char buf[20];
-
-	kdev = dasd_get_kdev(device);
-	if (kdev_none(kdev))
-		return -ENODEV;
-
 	/*
 	 * As long as the device is not in state DASD_STATE_NEW we want to 
 	 * keep the reference count > 0.
 	 */
 	dasd_get_device(device);
 
-#ifdef CONFIG_DEVFS_FS
-	/* Add a proc directory and the dasd device entry to devfs. */
  	sprintf(device->gdp->devfs_name, "dasd/%04x",
 		_ccw_device_get_device_number(device->cdev));
-#endif
 
-	if (device->ro_flag)
-		devfs_perm = S_IFBLK | S_IRUSR;
-	else
-		devfs_perm = S_IFBLK | S_IRUSR | S_IWUSR;
-
-	snprintf(buf, sizeof(buf), "dasd/%04x/device",
-		 _ccw_device_get_device_number(device->cdev));
-	device->devfs_entry = devfs_register(NULL, buf, 0,
-					     major(kdev),
-					     minor(kdev) << DASD_PARTN_BITS,
-					     devfs_perm,
-					     &dasd_device_operations, NULL);
 	device->state = DASD_STATE_KNOWN;
 	return 0;
 }
@@ -183,10 +158,6 @@
 static inline void
 dasd_state_known_to_new(struct dasd_device * device)
 {
-	/* Remove device entry and devfs directory. */
-	devfs_unregister(device->devfs_entry);
-	devfs_unregister(device->gdp->de);
-
 	/* Forget the discipline information. */
 	device->discipline = NULL;
 	device->state = DASD_STATE_NEW;
@@ -1721,50 +1692,51 @@
 static int
 dasd_open(struct inode *inp, struct file *filp)
 {
-	struct dasd_device *device;
+	struct gendisk *disk = inp->i_bdev->bd_disk;
+	struct dasd_device *device = disk->private_data;
 	int rc;
+
+	if (!try_module_get(device->discipline->owner))
+		return -EINVAL;
 	
 	if (dasd_probeonly) {
 		MESSAGE(KERN_INFO,
-			"No access to device (%d:%d) due to probeonly mode",
-			major(inp->i_rdev), minor(inp->i_rdev));
-		return -EPERM;
+			"No access to device %s due to probeonly mode",
+			disk->disk_name);
+		rc = -EPERM;
+		goto out;
 	}
 
-	device = inp->i_bdev->bd_disk->private_data;
+	rc = -ENODEV;
 	if (device->state < DASD_STATE_BASIC) {
 		DBF_DEV_EVENT(DBF_ERR, device, " %s",
 			      " Cannot open unrecognized device");
-		return -ENODEV;
+		rc = -ENODEV;
+		goto out;
 	}
-	rc = 0;
 
-	if (atomic_inc_return(&device->open_count) == 1) {
-		if (!try_module_get(device->discipline->owner)) {
-			/* Discipline is currently unloaded! */
-			atomic_dec(&device->open_count);
-			rc = -ENODEV;
-		}
-	}
+	atomic_inc(&device->open_count);
+	return 0;
+
+out:
+	module_put(device->discipline->owner);
 	return rc;
 }
 
 static int
 dasd_release(struct inode *inp, struct file *filp)
 {
-	struct dasd_device *device;
-
-	device = inp->i_bdev->bd_disk->private_data;
+	struct gendisk *disk = inp->i_bdev->bd_disk;
+	struct dasd_device *device = isk->private_data;
 
 	if (device->state < DASD_STATE_ACCEPT) {
 		DBF_DEV_EVENT(DBF_ERR, device, " %s",
 			      " Cannot release unrecognized device");
 		return -EINVAL;
 	}
-	if (atomic_dec_return(&device->open_count) == 0) {
-		invalidate_buffers(inp->i_rdev);
-		module_put(device->discipline->owner);
-	}
+
+	atomic_dec(&device->open_count);
+	module_put(device->discipline->owner);
 	return 0;
 }
 
@@ -2084,13 +2056,9 @@
 
 	DBF_EVENT(DBF_EMERG, "%s", "debug area created");
 
-#ifdef CONFIG_DEVFS_FS
-	if (!devfs_mk_dir("dasd")) {
-		DBF_EVENT(DBF_ALERT, "%s", "no devfs");
-		rc = -ENOSYS;
+	rc = devfs_mk_dir("dasd");
+	if (rc)
 		goto failed;
-	}
-#endif
 	rc = dasd_devmap_init();
 	if (rc)
 		goto failed;
diff -Nru a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
--- a/drivers/s390/block/dasd_devmap.c	Mon Apr 14 12:11:53 2003
+++ b/drivers/s390/block/dasd_devmap.c	Sun Apr 20 06:55:08 2003
@@ -406,27 +406,6 @@
 }
 
 /*
- * Return kdev for a dasd device.
- */
-kdev_t
-dasd_get_kdev(struct dasd_device *device)
-{
-	struct dasd_devmap *devmap;
-	int major, minor;
-	int devno;
-
-	devno = _ccw_device_get_device_number(device->cdev);
-	devmap = dasd_devmap_from_devno(devno);
-	if (devmap == NULL)
-		return NODEV;
-	major = dasd_gendisk_index_major(devmap->devindex);
-	if (major < 0)
-		return NODEV;
-	minor = devmap->devindex % DASD_PER_MAJOR;
-	return mk_kdev(major, minor);
-}
-
-/*
  * Create a dasd device structure for cdev.
  */
 struct dasd_device *
diff -Nru a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
--- a/drivers/s390/block/dasd_int.h	Mon Apr 14 12:11:54 2003
+++ b/drivers/s390/block/dasd_int.h	Sun Apr 20 06:54:52 2003
@@ -264,7 +264,6 @@
 struct dasd_device {
 	/* Block device stuff. */
 	struct gendisk *gdp;
-	devfs_handle_t devfs_entry;
 	request_queue_t *request_queue;
 	spinlock_t request_queue_lock;
 	unsigned long blocks;		/* size of volume in blocks */
@@ -471,7 +470,6 @@
 struct dasd_device *dasd_create_device(struct ccw_device *);
 void dasd_delete_device(struct dasd_device *);
 
-kdev_t dasd_get_kdev(struct dasd_device *);
 struct dasd_device *dasd_device_from_devindex(int);
 
 int dasd_parse(void);
diff -Nru a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
--- a/drivers/s390/block/xpram.c	Sat Mar 22 07:38:05 2003
+++ b/drivers/s390/block/xpram.c	Sat Apr 19 14:18:27 2003
@@ -449,7 +449,6 @@
 	offset = 0;
 	for (i = 0; i < xpram_devs; i++) {
 		struct gendisk *disk = xpram_disks[i];
-		char name[16];
 
 		xpram_devices[i].size = xpram_sizes[i] / 4;
 		xpram_devices[i].offset = offset;
@@ -460,13 +459,9 @@
 		disk->private_data = &xpram_devices[i];
 		disk->queue = &xpram_queue;
 		sprintf(disk->disk_name, "slram%d", i);
+		sprintf(disk->disk_name, "slram/%d", i);
 		set_capacity(disk, xpram_sizes[i] << 1);
 		add_disk(disk);
-		sprintf(name, "slram/%d", i);
-		devfs_register(NULL, name, DEVFS_FL_DEFAULT,
-			       disk->major, disk->first_minor,
-			       S_IFBLK | S_IRUSR | S_IWUSR,
-			       disk->fops, NULL);
 	}
 
 	return 0;
@@ -485,7 +480,6 @@
 	for (i = 0; i < xpram_devs; i++) {
 		del_gendisk(xpram_disks[i]);
 		put_disk(xpram_disks[i]);
-		devfs_remove("slram/%d", i);
 	}
 	unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
 	devfs_remove("slram");
diff -Nru a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
--- a/drivers/s390/char/con3215.c	Mon Apr 14 12:11:51 2003
+++ b/drivers/s390/char/con3215.c	Thu Apr 24 03:30:40 2003
@@ -840,10 +840,10 @@
 	}
 }
 
-static kdev_t
-con3215_device(struct console *c)
+static struct tty_driver *con3215_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, c->index + 64 );
+	*index = c->index;
+	return &tty3215_driver;
 }
 
 /*
@@ -957,7 +957,7 @@
 	struct raw3215_info *raw;
 	int retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_3215))
 		return -ENODEV;
 
@@ -1182,7 +1182,6 @@
 	tty3215_driver.owner = THIS_MODULE;
 	tty3215_driver.driver_name = "tty3215";
 	tty3215_driver.name = "ttyS";
-	tty3215_driver.name_base = 0;
 	tty3215_driver.major = TTY_MAJOR;
 	tty3215_driver.minor_start = 64;
 	tty3215_driver.num = NR_3215;
diff -Nru a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
--- a/drivers/s390/char/sclp_tty.c	Mon Apr 14 12:11:51 2003
+++ b/drivers/s390/char/sclp_tty.c	Mon Apr 21 20:58:43 2003
@@ -761,7 +761,6 @@
 	sclp_tty_driver.owner = THIS_MODULE;
 	sclp_tty_driver.driver_name = "sclp_line";
 	sclp_tty_driver.name = "ttyS";
-	sclp_tty_driver.name_base = 0;
 	sclp_tty_driver.major = TTY_MAJOR;
 	sclp_tty_driver.minor_start = 64;
 	sclp_tty_driver.num = 1;
diff -Nru a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h
--- a/drivers/s390/char/tape.h	Mon Feb 24 10:24:47 2003
+++ b/drivers/s390/char/tape.h	Mon Apr 21 06:43:55 2003
@@ -23,6 +23,8 @@
 #include <asm/debug.h>
 #include <asm/idals.h>
 
+struct gendisk;
+
 /*
  * macros s390 debug feature (dbf)
  */
@@ -173,6 +175,7 @@
 	struct tasklet_struct tasklet;
 	/* Current position on the tape. */
 	long block_position;
+	struct gendisk *disk;
 };
 #endif
 
diff -Nru a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
--- a/drivers/s390/char/tape_block.c	Mon Apr  7 06:36:32 2003
+++ b/drivers/s390/char/tape_block.c	Mon Apr 21 06:47:29 2003
@@ -208,38 +208,65 @@
 int
 tapeblock_setup_device(struct tape_device * device)
 {
-	request_queue_t *blk_queue;
+	struct tape_blk_data *d = &device->blk_data;
+	request_queue_t *q = &d->request_queue;
+	struct gendisk *disk = alloc_disk(1);
 	int rc;
 
-	/* Setup request queue and initialize gendisk for this device. */
-	tasklet_init(&device->blk_data.tasklet, tapeblock_tasklet,
-		     (unsigned long) device);
-	spin_lock_init(&device->blk_data.request_queue_lock);
-	blk_queue = &device->blk_data.request_queue;
-	rc = blk_init_queue(blk_queue, tapeblock_request_fn,
-			    &device->blk_data.request_queue_lock);
-
-	elevator_exit(blk_queue);
-	rc = elevator_init(blk_queue, &elevator_noop);
-	if (rc) {
-		blk_cleanup_queue(blk_queue);
-		return rc;
-	}
+	if (!disk)
+		return -ENOMEM;
+
+	tasklet_init(&d->tasklet, tapeblock_tasklet, (unsigned long)device);
+
+	spin_lock_init(&d->request_queue_lock);
+	rc = blk_init_queue(q, tapeblock_request_fn, &d->request_queue_lock);
+	if (rc)
+		goto put_disk;
+
+	elevator_exit(q);
+	rc = elevator_init(q, &elevator_noop);
+	if (rc)
+		goto cleanup_queue;
+
 	/* FIXME: We should be able to sense the sectore size */
-	blk_queue_hardsect_size(blk_queue, TAPEBLOCK_HSEC_SIZE);
-	blk_queue_max_sectors(blk_queue, TAPEBLOCK_MAX_SEC);
-	blk_queue_max_phys_segments(blk_queue, -1L);
-	blk_queue_max_hw_segments(blk_queue, -1L);
-	blk_queue_max_segment_size(blk_queue, -1L);
-	blk_queue_segment_boundary(blk_queue, -1L);
+	blk_queue_hardsect_size(q, TAPEBLOCK_HSEC_SIZE);
+	blk_queue_max_sectors(q, TAPEBLOCK_MAX_SEC);
+	blk_queue_max_phys_segments(q, -1L);
+	blk_queue_max_hw_segments(q, -1L);
+	blk_queue_max_segment_size(q, -1L);
+	blk_queue_segment_boundary(q, -1L);
+
+	disk->major = tapeblock_major;
+	disk->first_minor = i;
+	disk->fops = &tapeblock_fops;
+	disk->private_data = device;
+	disk->queue = q;
+	set_capacity(disk, size);
+
+	sprintf(disk->disk_name, "tBLK%d", i);
+	sprintf(disk->disk_name, "tBLK/%d", i);
+
+	add_disk(disk);
+	d->disk = disk;
 	return 0;
+
+ cleanup_queue:
+	blk_cleanup_queue(q);
+ put_disk:
+	put_disk(disk);
+	return rc;
 }
 
 void
 tapeblock_cleanup_device(struct tape_device *device)
 {
-	blk_cleanup_queue(&device->blk_data.request_queue);
-	tasklet_kill(&device->blk_data.tasklet);
+	struct tape_blk_data *d = &device->blk_data;
+
+	del_gendisk(d->disk);
+	put_disk(d->disk);
+	blk_cleanup_queue(&d->request_queue);
+
+	tasklet_kill(&d->tasklet);
 }
 
 /*
@@ -272,55 +299,47 @@
 /*
  * Block frontend tape device open function.
  */
-int
-tapeblock_open(struct inode *inode, struct file *filp) {
-	struct tape_device *device;
-	int minor, rc;
-
-	MOD_INC_USE_COUNT;
-	if (major(filp->f_dentry->d_inode->i_rdev) != tapeblock_major)
-		return -ENODEV;
-	minor = minor(filp->f_dentry->d_inode->i_rdev);
-	device = tape_get_device(minor >> TAPE_MINORS_PER_DEV);
-	if (IS_ERR(device)) {
-		MOD_DEC_USE_COUNT;
-		return PTR_ERR(device);
-	}
-	DBF_EVENT(6, "TBLOCK:open:  %x\n", device->first_minor);
+static int
+tapeblock_open(struct inode *inode, struct file *filp)
+{
+	struct gendisk *disk = inp->i_bdev->bd_disk;
+	struct tape_device *device = disk->private_data;
+	int rc;
+
 	rc = tape_open(device);
-	if (rc == 0) {
-		rc = tape_assign(device);
-		if (rc == 0) {
-			device->blk_data.block_position = -1;
-			rc = tapeblock_mediumdetect(device);
-			if (rc == 0) {
-				filp->private_data = device;
-				return 0;
-			}
-			tape_unassign(device);
-		}
-		tape_release(device);
-	}
+	if (rc)
+		goto put_device;
+	rc = tape_assign(device);
+	if (rc)
+		goto release;
+	device->blk_data.block_position = -1;
+	rc = tapeblock_mediumdetect(device);
+	if (rc)
+		goto unassign;
+	return 0;
+
+ unassign:
+	tape_unassign(device);
+ release:
+	tape_release(device);
+ put_device:
 	tape_put_device(device);
-	MOD_DEC_USE_COUNT;
 	return rc;
 }
 
 /*
  * Block frontend tape device release function.
  */
-int
-tapeblock_release(struct inode *inode, struct file *filp) {
-	struct tape_device *device;
-
-	/* Remove all buffers at device close. */
-	/* FIXME: can we do that a tape unload ? */
-	invalidate_buffers(inode->i_rdev);
-	device = (struct tape_device *) filp->private_data;
+static int
+tapeblock_release(struct inode *inode, struct file *filp)
+{
+	struct gendisk *disk = inp->i_bdev->bd_disk;
+	struct tape_device *device = disk->private_data;
+
 	tape_release(device);
 	tape_unassign(device);
 	tape_put_device(device);
-	MOD_DEC_USE_COUNT;
+
 	return 0;
 }
 
diff -Nru a/drivers/s390/char/tuball.c b/drivers/s390/char/tuball.c
--- a/drivers/s390/char/tuball.c	Mon Mar 31 15:55:36 2003
+++ b/drivers/s390/char/tuball.c	Thu Apr 24 03:30:40 2003
@@ -82,7 +82,7 @@
  * Can't have this driver a module & support console at the same time
  */
 #ifdef CONFIG_TN3270_CONSOLE
-static kdev_t tub3270_con_device(struct console *);
+static struct tty_driver *tub3270_con_device(struct console *, int *);
 static void tub3270_con_unblank(void);
 static void tub3270_con_write(struct console *, const char *,
 	unsigned int);
@@ -144,10 +144,11 @@
 
 #endif
 
-static kdev_t
-tub3270_con_device(struct console *conp)
+static struct tty_driver *tub3270_con_device(struct console *conp, int *index)
 {
-	return tub_mkdev(IBM_TTY3270_MAJOR, conp->index + 1);
+	*index = conp->index + 1;
+	extern struct tty_driver tty3270_driver;
+	return &tty3270_driver;
 }
 
 static void
diff -Nru a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c
--- a/drivers/s390/char/tubfs.c	Mon Mar 31 15:55:36 2003
+++ b/drivers/s390/char/tubfs.c	Fri Apr 18 11:14:59 2003
@@ -34,10 +34,6 @@
 };
 
 #ifdef CONFIG_DEVFS_FS
-static devfs_handle_t fs3270_devfs_dir;
-static devfs_handle_t fs3270_devfs_tub;
-extern struct file_operations tty_fops;
-
 void fs3270_devfs_register(tub_t *tubp)
 {
 	char name[16];
@@ -48,7 +44,7 @@
 		       S_IFCHR | S_IRUSR | S_IWUSR, &fs3270_fops, NULL);
 	sprintf(name, "tty%.4x", tubp->devno);
 	tty_register_devfs_name(&tty3270_driver, 0, tubp->minor,
-				fs3270_devfs_dir, name);
+				NULL, name);
 }
 
 void fs3270_devfs_unregister(tub_t *tubp)
@@ -72,13 +68,11 @@
 			IBM_FS3270_MAJOR, rc);
 		return -1;
 	}
-#ifdef CONFIG_DEVFS_FS
-	fs3270_devfs_dir = devfs_mk_dir("3270");
-	fs3270_devfs_tub = devfs_register(NULL, "3270/tub", 0,
+	devfs_mk_dir("3270");
+	devfs_register(NULL, "3270/tub", 0,
 			       IBM_FS3270_MAJOR, 0,
 			       S_IFCHR | S_IRUGO | S_IWUGO, 
 			       &fs3270_fops, NULL);
-#endif
 	fs3270_major = IBM_FS3270_MAJOR;
 	return 0;
 }
@@ -90,10 +84,8 @@
 fs3270_fini(void)
 {
 	if (fs3270_major != -1) {
-#ifdef CONFIG_DEVFS_FS
-		devfs_unregister(fs3270_devfs_tub);
-		devfs_unregister(fs3270_devfs_dir);
-#endif
+		devfs_remove("3270");
+		devfs_remove("3270/tub");
 		unregister_chrdev(fs3270_major, "fs3270");
 		fs3270_major = -1;
 	}
diff -Nru a/drivers/s390/char/tubio.h b/drivers/s390/char/tubio.h
--- a/drivers/s390/char/tubio.h	Mon Mar 31 15:55:36 2003
+++ b/drivers/s390/char/tubio.h	Mon Apr 21 20:58:42 2003
@@ -338,7 +338,6 @@
 extern enum tubwhat tty3270_proc_what;
 extern struct tty_driver tty3270_driver;
 #ifdef CONFIG_DEVFS_FS
-extern devfs_handle_t fs3270_devfs_dir;
 extern void fs3270_devfs_register(tub_t *);
 extern void fs3270_devfs_unregister(tub_t *);
 #endif
@@ -384,17 +383,9 @@
 {
 	unsigned int minor = minor(ip->i_rdev);
 	tub_t *tubp = NULL;
-	if (minor == 0 && current->tty != NULL) {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-#ifdef CONFIG_TN3270_CONSOLE
-		if (tub3270_con_tubp != NULL &&
-		    current->tty->device == S390_CONSOLE_DEV)
-			minor = tub3270_con_tubp->minor;
-		else
-#endif
-#endif
-		if (tub_major(current->tty->device) == IBM_TTY3270_MAJOR)
-			minor = tub_minor(current->tty->device);
+	if (minor == 0 && current->tty) {
+		if (current->tty->driver == &tty3270_driver)
+			minor = current->tty->index;
 	}
 	if (minor <= tubnummins && minor > 0)
 		tubp = (*tubminors)[minor];
@@ -406,18 +397,11 @@
  */
 extern inline tub_t *TTY2TUB(struct tty_struct *tty)
 {
-	unsigned int minor = minor(tty->device);
+	unsigned index = tty->index;
 	tub_t *tubp = NULL;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-#ifdef CONFIG_TN3270_CONSOLE
-	if (tty->device == S390_CONSOLE_DEV)
-		tubp = tub3270_con_tubp;
-	else
-#endif
-#endif
-	if (minor <= tubnummins && minor > 0)
-		tubp = (*tubminors)[minor];
+	if (index <= tubnummins && index > 0)
+		tubp = (*tubminors)[index];
 	return tubp;
 }
 
diff -Nru a/drivers/s390/char/tubtty.c b/drivers/s390/char/tubtty.c
--- a/drivers/s390/char/tubtty.c	Mon Mar 31 15:55:36 2003
+++ b/drivers/s390/char/tubtty.c	Mon Apr 21 20:58:42 2003
@@ -539,16 +539,8 @@
 	 */
 	tubp = NULL;
 	tty = current->tty;
-	if (tty) {
-		if (tub_major(tty->device) == IBM_TTY3270_MAJOR)
-			tubp = (*tubminors)[tub_minor(tty->device)];
-#ifdef CONFIG_TN3270_CONSOLE
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-		if (CONSOLE_IS_3270 && tty->device == S390_CONSOLE_DEV)
-			tubp = tub3270_con_tubp;
-#endif /* LINUX_VERSION_CODE */
-#endif /* CONFIG_TN3270_CONSOLE */
-	}
+	if (tty && tty->driver == &tty3270_driver)
+		tubp = (*tubminors)[tty->index];
 	if (tubp) {
 		if ((rc = tty3270_aid_set(tubp, mybuf, mycount + 1)))
 			return rc > 0? count: rc;
diff -Nru a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
--- a/drivers/s390/net/ctctty.c	Mon Apr 14 12:11:51 2003
+++ b/drivers/s390/net/ctctty.c	Mon Apr 21 20:58:42 2003
@@ -332,17 +332,17 @@
  ************************************************************/
 
 static inline int
-ctc_tty_paranoia_check(ctc_tty_info * info, kdev_t device, const char *routine)
+ctc_tty_paranoia_check(ctc_tty_info * info, char *name, const char *routine)
 {
 #ifdef MODEM_PARANOIA_CHECK
 	if (!info) {
-		printk(KERN_WARNING "ctc_tty: null info_struct for (%d, %d) in %s\n",
-		       major(device), minor(device), routine);
+		printk(KERN_WARNING "ctc_tty: null info_struct for %s in %s\n",
+		       name, routine);
 		return 1;
 	}
 	if (info->magic != CTC_ASYNC_MAGIC) {
-		printk(KERN_WARNING "ctc_tty: bad magic for info struct (%d, %d) in %s\n",
-		       major(device), minor(device), routine);
+		printk(KERN_WARNING "ctc_tty: bad magic for info struct %s in %s\n",
+		       name, routine);
 		return 1;
 	}
 #endif
@@ -502,7 +502,7 @@
 
 	if (ctc_tty_shuttingdown)
 		return 0;
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_write"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_write"))
 		return 0;
 	if (!tty)
 		return 0;
@@ -551,7 +551,7 @@
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_write_room"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_write_room"))
 		return 0;
 	return CTC_TTY_XMIT_SIZE;
 }
@@ -561,7 +561,7 @@
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_chars_in_buffer"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_chars_in_buffer"))
 		return 0;
 	return 0;
 }
@@ -576,7 +576,7 @@
 		return;
 	spin_lock_irqsave(&ctc_tty_lock, flags);
 	info = (ctc_tty_info *) tty->driver_data;
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_flush_buffer")) {
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_flush_buffer")) {
 		spin_unlock_irqrestore(&ctc_tty_lock, flags);
 		return;
 	}
@@ -596,7 +596,7 @@
 
 	if (ctc_tty_shuttingdown)
 		return;
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_flush_chars"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_flush_chars"))
 		return;
 	if (tty->stopped || tty->hw_stopped || (!skb_queue_len(&info->tx_queue)))
 		return;
@@ -616,7 +616,7 @@
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_throttle"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_throttle"))
 		return;
 	info->mcr &= ~UART_MCR_RTS;
 	if (I_IXOFF(tty))
@@ -629,7 +629,7 @@
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_unthrottle"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_unthrottle"))
 		return;
 	info->mcr |= UART_MCR_RTS;
 	if (I_IXOFF(tty))
@@ -744,7 +744,7 @@
 	int error;
 	int retval;
 
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_ioctl"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
 		return -ENODEV;
 	if (tty->flags & (1 << TTY_IO_ERROR))
 		return -EIO;
@@ -973,17 +973,17 @@
 	int retval,
 	 line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if (line < 0 || line > CTC_TTY_MAX_DEVICES)
 		return -ENODEV;
 	info = &driver->info[line];
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_open"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_open"))
 		return -ENODEV;
 	if (!info->netdev)
 		return -ENODEV;
 #ifdef CTC_DEBUG_MODEM_OPEN
-	printk(KERN_DEBUG "ctc_tty_open %s%d, count = %d\n", tty->driver.name,
-	       info->line, info->count);
+	printk(KERN_DEBUG "ctc_tty_open %s, count = %d\n", tty->name,
+	       info->count);
 #endif
 	spin_lock_irqsave(&ctc_tty_lock, saveflags);
 	info->count++;
@@ -1012,7 +1012,7 @@
 		ctc_tty_change_speed(info);
 	}
 #ifdef CTC_DEBUG_MODEM_OPEN
-	printk(KERN_DEBUG "ctc_tty_open %s%d successful...\n", CTC_TTY_NAME, info->line);
+	printk(KERN_DEBUG "ctc_tty_open %s successful...\n", tty->name);
 #endif
 	return 0;
 }
@@ -1024,7 +1024,7 @@
 	ulong flags;
 	ulong timeout;
 
-	if (!info || ctc_tty_paranoia_check(info, tty->device, "ctc_tty_close"))
+	if (!info || ctc_tty_paranoia_check(info, tty->name, "ctc_tty_close"))
 		return;
 	spin_lock_irqsave(&ctc_tty_lock, flags);
 	if (tty_hung_up_p(filp)) {
@@ -1091,8 +1091,8 @@
 		}
 	}
 	ctc_tty_shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	info->tty = 0;
@@ -1119,7 +1119,7 @@
 	ctc_tty_info *info = (ctc_tty_info *)tty->driver_data;
 	unsigned long saveflags;
 
-	if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_hangup"))
+	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_hangup"))
 		return;
 	ctc_tty_shutdown(info);
 	info->count = 0;
diff -Nru a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c
--- a/drivers/sbus/char/aurora.c	Thu Apr  3 04:51:47 2003
+++ b/drivers/sbus/char/aurora.c	Mon Apr 21 20:58:42 2003
@@ -107,7 +107,7 @@
 DECLARE_TASK_QUEUE(tq_aurora);
 
 static inline int aurora_paranoia_check(struct Aurora_port const * port,
-				    kdev_t device, const char *routine)
+				    char *name, const char *routine)
 {
 #ifdef AURORA_PARANOIA_CHECK
 	static const char *badmagic =
@@ -116,11 +116,11 @@
 		KERN_DEBUG "aurora: Warning: null aurora port for device %s in %s\n";
 
 	if (!port) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (port->magic != AURORA_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -265,7 +265,7 @@
 return 0;
 }
 
-static void aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs);
+static irqreturn_t aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs);
 
 /* Main probing routine, also sets irq. */
 static int aurora_probe(void)
@@ -701,7 +701,7 @@
 }
 
 /* The main interrupt processing routine */
-static void aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+static irqreturn_t aurora_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 {
 	unsigned char status;
 	unsigned char ack,chip/*,chip_id*/;
@@ -719,7 +719,7 @@
 /* old	bp = IRQ_to_board[irq&0x0f];*/
 	
 	if (!bp || !(bp->flags & AURORA_BOARD_ACTIVE))
-		return;
+		return IRQ_NONE;
 
 /*	The while() below takes care of this.
 	status = sbus_readb(&bp->r[0]->r[CD180_SRSR]);
@@ -727,7 +727,7 @@
 	printk("mumu: %02x\n", status);
 #endif
 	if (!(status&SRSR_ANYINT))
-		return; * Nobody has anything to say, so exit *
+		return IRQ_NONE; * Nobody has anything to say, so exit *
 */
 	while ((loop++ < 48) &&
 	       (status = sbus_readb(&bp->r[0]->r[CD180_SRSR]) & SRSR_ANYINT)){
@@ -875,6 +875,8 @@
 		}
 	}
 #endif
+
+	return IRQ_HANDLED;
 }
 
 #ifdef AURORA_INT_DEBUG
@@ -1419,7 +1421,7 @@
 	printk("aurora_open: start\n");
 #endif
 	
-	board = AURORA_BOARD(minor(tty->device));
+	board = AURORA_BOARD(tty->index);
 	if (board > AURORA_NBOARD ||
 	    !(aurora_board[board].flags & AURORA_BOARD_PRESENT)) {
 #ifdef AURORA_DEBUG
@@ -1430,8 +1432,8 @@
 	}
 	
 	bp = &aurora_board[board];
-	port = aurora_port + board * AURORA_NPORT * AURORA_NCD180 + AURORA_PORT(minor(tty->device));
-	if (aurora_paranoia_check(port, tty->device, "aurora_open")) {
+	port = aurora_port + board * AURORA_NPORT * AURORA_NCD180 + AURORA_PORT(tty->index);
+	if ((aurora_paranoia_check(port, tty->name, "aurora_open")) {
 #ifdef AURORA_DEBUG
 		printk("aurora_open: error paranoia check\n");
 #endif
@@ -1483,7 +1485,7 @@
 	printk("aurora_close: start\n");
 #endif
 	
-	if (!port || aurora_paranoia_check(port, tty->device, "close"))
+	if (!port || (aurora_paranoia_check(port, tty->name, "close"))
 		return;
 	
 	chip = AURORA_CD180(port_No(port));
@@ -1562,8 +1564,8 @@
 	printk("aurora_close: shutdown_port\n");
 #endif
 	aurora_shutdown_port(bp, port);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1597,7 +1599,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_write: start %d\n",count);
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_write"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_write"))
 		return 0;
 		
 	chip = AURORA_CD180(port_No(port));
@@ -1679,7 +1681,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_put_char: start %c\n",ch);
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_put_char"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_put_char"))
 		return;
 
 	if (!tty || !port->xmit_buf)
@@ -1710,7 +1712,7 @@
 /*#ifdef AURORA_DEBUG
 	printk("aurora_flush_chars: start\n");
 #endif*/
-	if (aurora_paranoia_check(port, tty->device, "aurora_flush_chars"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_flush_chars"))
 		return;
 		
 	chip = AURORA_CD180(port_No(port));
@@ -1740,7 +1742,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_write_room: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_write_room"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_write_room"))
 		return 0;
 
 	ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1756,7 +1758,7 @@
 {
 	struct Aurora_port *port = (struct Aurora_port *) tty->driver_data;
 				
-	if (aurora_paranoia_check(port, tty->device, "aurora_chars_in_buffer"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_chars_in_buffer"))
 		return 0;
 	
 	return port->xmit_cnt;
@@ -1770,7 +1772,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_flush_buffer: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_flush_buffer"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_flush_buffer"))
 		return;
 
 	save_flags(flags); cli();
@@ -1999,7 +2001,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_ioctl: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_ioctl"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_ioctl"))
 		return -ENODEV;
 	
 	switch (cmd) {
@@ -2060,7 +2062,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_throttle: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_throttle"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_throttle"))
 		return;
 	
 	bp = port_Board(port);
@@ -2092,7 +2094,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_unthrottle: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_unthrottle"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_unthrottle"))
 		return;
 	
 	bp = port_Board(port);
@@ -2127,7 +2129,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_stop: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_stop"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_stop"))
 		return;
 	
 	bp = port_Board(port);
@@ -2157,7 +2159,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_start: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_start"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_start"))
 		return;
 	
 	bp = port_Board(port);
@@ -2213,7 +2215,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_hangup: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_hangup"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_hangup"))
 		return;
 	
 	bp = port_Board(port);
@@ -2237,7 +2239,7 @@
 #ifdef AURORA_DEBUG
 	printk("aurora_set_termios: start\n");
 #endif
-	if (aurora_paranoia_check(port, tty->device, "aurora_set_termios"))
+	if ((aurora_paranoia_check(port, tty->name, "aurora_set_termios"))
 		return;
 	
 	if (tty->termios->c_cflag == old_termios->c_cflag &&
diff -Nru a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
--- a/drivers/sbus/char/bbc_i2c.c	Mon Nov 18 14:21:09 2002
+++ b/drivers/sbus/char/bbc_i2c.c	Sun Apr 20 23:48:19 2003
@@ -331,7 +331,7 @@
 EXPORT_SYMBOL(bbc_i2c_write_buf);
 EXPORT_SYMBOL(bbc_i2c_read_buf);
 
-static void bbc_i2c_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct bbc_i2c_bus *bp = dev_id;
 
@@ -341,6 +341,8 @@
 	if (bp->waiting &&
 	    !(readb(bp->i2c_control_regs + 0x0) & I2C_PCF_PIN))
 		wake_up(&bp->wq);
+
+	return IRQ_HANDLED;
 }
 
 static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
diff -Nru a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
--- a/drivers/sbus/char/cpwatchdog.c	Mon Nov  4 13:05:02 2002
+++ b/drivers/sbus/char/cpwatchdog.c	Tue Apr 22 23:40:00 2003
@@ -201,7 +201,7 @@
 #ifdef WD_DEBUG
 static void wd_dumpregs(void);
 #endif
-static void wd_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t wd_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static void wd_toggleintr(struct wd_timer* pTimer, int enable);
 static void wd_pingtimer(struct wd_timer* pTimer);
 static void wd_starttimer(struct wd_timer* pTimer);
@@ -325,13 +325,11 @@
 		wd_dev.initialized = 1;
 	}
 
-	MOD_INC_USE_COUNT;
 	return(0);
 }
 
 static int wd_release(struct inode *inode, struct file *file)
 {
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -444,7 +442,7 @@
 #endif /* ifdef WD_DEBUG */
 }
 
-static void wd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t wd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/* Only WD0 will interrupt-- others are NMI and we won't
 	 * see them here....
@@ -456,7 +454,7 @@
 		wd_dev.watchdog[WD0_ID].runstatus |=  WD_STAT_SVCD;
 	}
 	spin_unlock_irq(&wd_dev.lock);
-	return;
+	return IRQ_HANDLED;
 }
 
 static struct file_operations wd_fops = {
diff -Nru a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
--- a/drivers/sbus/char/envctrl.c	Tue Feb 25 09:45:01 2003
+++ b/drivers/sbus/char/envctrl.c	Tue Apr 22 23:40:00 2003
@@ -707,7 +707,6 @@
 envctrl_open(struct inode *inode, struct file *file)
 {
 	file->private_data = 0;
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -717,7 +716,6 @@
 static int
 envctrl_release(struct inode *inode, struct file *file)
 {
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
diff -Nru a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
--- a/drivers/sbus/char/uctrl.c	Fri Oct 11 03:02:14 2002
+++ b/drivers/sbus/char/uctrl.c	Sun Apr 20 23:48:19 2003
@@ -217,10 +217,11 @@
 	return 0;
 }
 
-void uctrl_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t uctrl_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct uctrl_driver *driver = (struct uctrl_driver *)dev_id;
 	printk("in uctrl_interrupt\n");
+	return IRQ_HANDLED;
 }
 
 static struct file_operations uctrl_fops = {
diff -Nru a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
--- a/drivers/scsi/3w-xxxx.c	Wed Mar 26 12:10:23 2003
+++ b/drivers/scsi/3w-xxxx.c	Thu Apr 24 05:17:32 2003
@@ -213,7 +213,6 @@
 static int tw_chrdev_release(struct inode *inode, struct file *file);
 static int tw_copy_info(TW_Info *info, char *fmt, ...);
 static void tw_copy_mem_info(TW_Info *info, char *data, int len);
-static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
 static int tw_halt(struct notifier_block *nb, ulong event, void *buf);
 static int tw_map_scsi_sg_data(struct pci_dev *pdev, Scsi_Cmnd *cmd);
 static u32 tw_map_scsi_single_data(struct pci_dev *pdev, Scsi_Cmnd *cmd);
@@ -1471,7 +1470,8 @@
 } /* End tw_initialize_units() */
 
 /* This function is the interrupt service routine */
-static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs) 
+static irqreturn_t tw_interrupt(int irq, void *dev_instance,
+					struct pt_regs *regs) 
 {
 	int request_id;
 	u32 status_reg_addr, status_reg_value;
@@ -1481,12 +1481,13 @@
 	int error = 0, retval = 0;
 	unsigned long flags = 0;
 	TW_Command *command_packet;
+	int handled = 0;
 
 	dprintk(KERN_WARNING "3w-xxxx: tw_interrupt()\n");
 
 	/* See if we are already running on another processor */
 	if (test_and_set_bit(TW_IN_INTR, &tw_dev->flags))
-		return;
+		return IRQ_NONE;
 
 	/* Get the host lock for io completions */
 	spin_lock_irqsave(tw_dev->host->host_lock, flags);
@@ -1494,6 +1495,7 @@
 	/* See if the interrupt matches this instance */
 	if (tw_dev->tw_pci_dev->irq == irq) {
 
+		handled = 1;
 		/* Make sure io isn't queueing */
 		spin_lock(&tw_dev->tw_lock);
 
@@ -1683,6 +1685,7 @@
 
 	spin_unlock_irqrestore(tw_dev->host->host_lock, flags);
 	clear_bit(TW_IN_INTR, &tw_dev->flags);
+	return IRQ_RETVAL(handled);
 } /* End tw_interrupt() */
 
 /* This function handles ioctls from userspace to the driver */
diff -Nru a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
--- a/drivers/scsi/53c700.c	Sat Feb 22 08:15:06 2003
+++ b/drivers/scsi/53c700.c	Thu Apr 24 05:17:33 2003
@@ -1432,7 +1432,7 @@
 	return 1;
 }
 
-void
+irqreturn_t
 NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct Scsi_Host *host = (struct Scsi_Host *)dev_id;
@@ -1442,6 +1442,7 @@
 	__u32 resume_offset = 0;
 	__u8 pun = 0xff, lun = 0xff;
 	unsigned long flags;
+	int handled = 0;
 
 	/* Use the host lock to serialise acess to the 53c700
 	 * hardware.  Note: In future, we may need to take the queue
@@ -1457,6 +1458,7 @@
 		Scsi_Cmnd *SCp = hostdata->cmd;
 		enum NCR_700_Host_State state;
 
+		handled = 1;
 		state = hostdata->state;
 		SCp = hostdata->cmd;
 
@@ -1697,6 +1699,7 @@
 	}
  out_unlock:
 	spin_unlock_irqrestore(host->host_lock, flags);
+	return IRQ_RETVAL(handled);
 }
 
 /* FIXME: Need to put some proc information in and plumb it
diff -Nru a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h
--- a/drivers/scsi/53c700.h	Sat Feb 22 08:15:06 2003
+++ b/drivers/scsi/53c700.h	Thu Apr 24 05:17:33 2003
@@ -8,6 +8,8 @@
 #ifndef _53C700_H
 #define _53C700_H
 
+#include <linux/interrupt.h>
+
 #include <asm/io.h>
 
 /* Turn on for general debugging---too verbose for normal use */
@@ -52,7 +54,7 @@
 /* These are the externally used routines */
 struct Scsi_Host *NCR_700_detect(Scsi_Host_Template *, struct NCR_700_Host_Parameters *);
 int NCR_700_release(struct Scsi_Host *host);
-void NCR_700_intr(int, void *, struct pt_regs *);
+irqreturn_t NCR_700_intr(int, void *, struct pt_regs *);
 
 
 enum NCR_700_Host_State {
diff -Nru a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
--- a/drivers/scsi/53c7xx.c	Thu Feb 13 08:12:27 2003
+++ b/drivers/scsi/53c7xx.c	Thu Apr 24 05:16:59 2003
@@ -6056,7 +6056,7 @@
 	(struct NCR53c7x0_hostdata *) host->hostdata[0];
     struct NCR53c7x0_cmd *cmd, *tmp;
     shutdown (host);
-    if (host->irq != IRQ_NONE)
+    if (host->irq != SCSI_IRQ_NONE)
 	{
 	    int irq_count;
 	    struct Scsi_Host *tmp;
diff -Nru a/drivers/scsi/53c7xx.h b/drivers/scsi/53c7xx.h
--- a/drivers/scsi/53c7xx.h	Mon Feb  4 23:53:47 2002
+++ b/drivers/scsi/53c7xx.h	Thu Apr 24 05:16:59 2003
@@ -1450,7 +1450,7 @@
 
 };
 
-#define IRQ_NONE	255
+#define SCSI_IRQ_NONE	255
 #define DMA_NONE	255
 #define IRQ_AUTO	254
 #define DMA_AUTO	254
diff -Nru a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
--- a/drivers/scsi/BusLogic.c	Fri Jan  3 10:58:49 2003
+++ b/drivers/scsi/BusLogic.c	Thu Apr 24 05:17:33 2003
@@ -3339,7 +3339,7 @@
   Adapters.
 */
 
-static void BusLogic_InterruptHandler(int IRQ_Channel,
+static irqreturn_t BusLogic_InterruptHandler(int IRQ_Channel,
 				      void *DeviceIdentifier,
 				      Registers_T *InterruptRegisters)
 {
@@ -3420,6 +3420,7 @@
     Release exclusive access to Host Adapter.
   */
   BusLogic_ReleaseHostAdapterLockIH(HostAdapter, &ProcessorFlags);
+  return IRQ_HANDLED;
 }
 
 
@@ -4261,7 +4262,7 @@
       PartitionTable_T *FirstPartitionEntry = (PartitionTable_T *) buf;
       PartitionTable_T *PartitionEntry = FirstPartitionEntry;
       int SavedCylinders = DiskParameters->Cylinders, PartitionNumber;
-      unsigned char PartitionEntryEndHead, PartitionEntryEndSector;
+      unsigned char PartitionEntryEndHead=0, PartitionEntryEndSector=0;
       for (PartitionNumber = 0; PartitionNumber < 4; PartitionNumber++)
 	{
 	  PartitionEntryEndHead = PartitionEntry->end_head;
diff -Nru a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h
--- a/drivers/scsi/BusLogic.h	Tue Dec 10 12:28:34 2002
+++ b/drivers/scsi/BusLogic.h	Thu Apr 24 05:17:33 2003
@@ -1763,7 +1763,7 @@
 */
 
 static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *);
-static void BusLogic_InterruptHandler(int, void *, Registers_T *);
+static irqreturn_t BusLogic_InterruptHandler(int, void *, Registers_T *);
 static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *,
 				     SCSI_Command_T *, unsigned int);
 static void BusLogic_Message(BusLogic_MessageLevel_T, char *,
diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig	Tue Mar  4 22:34:46 2003
+++ b/drivers/scsi/Kconfig	Sun Apr 20 12:56:51 2003
@@ -8,7 +8,7 @@
 	  If you want to use a SCSI hard disk or the SCSI or parallel port
 	  version of the IOMEGA ZIP drive under Linux, say Y and read the
 	  SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. This is NOT for SCSI
+	  <http://www.tldp.org/docs.html#howto>. This is NOT for SCSI
 	  CD-ROMs.
 
 	  This driver is also available as a module ( = code which can be
@@ -26,7 +26,7 @@
 	---help---
 	  If you want to use a SCSI tape drive under Linux, say Y and read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, and
+	  <http://www.tldp.org/docs.html#howto>, and
 	  <file:Documentation/scsi/st.txt> in the kernel source.  This is NOT for
 	  SCSI CD-ROMs.
 
@@ -48,7 +48,7 @@
 	  tape drives (ADR-x0) that supports the standard SCSI-2 commands for
 	  tapes (QIC-157) and can be driven by the standard driver st.
 	  For more information, you may have a look at the SCSI-HOWTO
-	  <http://www.linuxdoc.org/docs.html#howto>  and
+	  <http://www.tldp.org/docs.html#howto>  and
 	  <file:Documentation/scsi/osst.txt>  in the kernel source.
 	  More info on the OnStream driver may be found on
 	  <http://linux1.onstream.nl/test/>
@@ -67,7 +67,7 @@
 	---help---
 	  If you want to use a SCSI CD-ROM under Linux, say Y and read the
 	  SCSI-HOWTO and the CD-ROM-HOWTO at
-	  <http://www.linuxdoc.org/docs.html#howto>. Also make sure to say Y
+	  <http://www.tldp.org/docs.html#howto>. Also make sure to say Y
 	  or M to "ISO 9660 CD-ROM file system support" later.
 
 	  This driver is also available as a module ( = code which can be
@@ -238,7 +238,7 @@
 	  must be manually specified in this case.
 
 	  It is explained in section 3.3 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. You might also want to
+	  <http://www.tldp.org/docs.html#howto>. You might also want to
 	  read the file <file:Documentation/scsi/aha152x.txt>.
 
 	  This driver is also available as a module ( = code which can be
@@ -252,7 +252,7 @@
 	---help---
 	  This is support for a SCSI host adapter.  It is explained in section
 	  3.4 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Note that Trantor was
+	  <http://www.tldp.org/docs.html#howto>.  Note that Trantor was
 	  purchased by Adaptec, and some former Trantor products are being
 	  sold under the Adaptec name.  If it doesn't work out of the box, you
 	  may have to change some settings in <file:drivers/scsi/aha1542.h>.
@@ -268,7 +268,7 @@
 	---help---
 	  This is support for a SCSI host adapter.  It is explained in section
 	  3.5 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/aha1740.h>.
 
@@ -316,7 +316,7 @@
 	  configuration options. You should read
 	  <file:Documentation/scsi/aic7xxx_old.txt> at a minimum before
 	  contacting the maintainer with any questions.  The SCSI-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>, can also
+	  available from <http://www.tldp.org/docs.html#howto>, can also
 	  be of great help.
 
 	  If you want to compile this driver as a module ( = code which can be
@@ -377,7 +377,7 @@
 	  This is support for the AM53/79C974 SCSI host adapters.  Please read
 	  <file:Documentation/scsi/AM53C974.txt> for details.  Also, the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, is for you.
+	  <http://www.tldp.org/docs.html#howto>, is for you.
 
 	  Note that there is another driver for AM53C974 based adapters:
 	  "Tekram DC390(T) and Am53/79C974 (PCscsi) SCSI support", above.  You
@@ -406,7 +406,7 @@
 	---help---
 	  This is support for BusLogic MultiMaster and FlashPoint SCSI Host
 	  Adapters. Consult the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, and the files
+	  <http://www.tldp.org/docs.html#howto>, and the files
 	  <file:Documentation/scsi/BusLogic.txt> and
 	  <file:Documentation/scsi/FlashPoint.txt> for more information. If this
 	  driver does not work correctly without modification, please contact
@@ -451,7 +451,7 @@
 	help
 	  This is support for DTC 3180/3280 SCSI Host Adapters.  Please read
 	  the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, and the file
+	  <http://www.tldp.org/docs.html#howto>, and the file
 	  <file:Documentation/scsi/dtc3x80.txt>.
 
 	  This driver is also available as a module ( = code which can be
@@ -470,7 +470,7 @@
 
 	  You want to read the start of <file:drivers/scsi/eata.c> and the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -518,7 +518,7 @@
 	  host adapters could also use this driver but are discouraged from
 	  doing so, since this driver only supports hard disks and lacks
 	  numerous features.  You might want to have a look at the SCSI-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -534,7 +534,7 @@
 	  other adapters based on the Future Domain chipsets (Quantum
 	  ISA-200S, ISA-250MG; Adaptec AHA-2920A; and at least one IBM board).
 	  It is explained in section 3.7 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  NOTE: Newer Adaptec AHA-2920C boards use the Adaptec AIC-7850 chip
 	  and should use the aic7xxx driver ("Adaptec AIC7xxx chipset SCSI
@@ -589,7 +589,7 @@
 	  generic 5380 support.
 
 	  It is explained in section 3.8 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/g_NCR5380.h>.
 
@@ -605,7 +605,7 @@
 	  This is a driver for the old NCR 53c80 series of SCSI controllers
 	  on boards using memory mapped I/O. 
 	  It is explained in section 3.8 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/g_NCR5380.h>.
 
@@ -719,7 +719,7 @@
 	help
 	  This is support for the Initio 91XXU(W) SCSI host adapter.  Please
 	  read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -732,7 +732,7 @@
 	help
 	  This is support for the Initio INI-A100U2W SCSI host adapter.
 	  Please read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -758,7 +758,7 @@
 	  For more information about this driver and how to use it you should
 	  read the file <file:Documentation/scsi/ppa.txt>.  You should also read
 	  the SCSI-HOWTO, which is available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If you use this driver,
+	  <http://www.tldp.org/docs.html#howto>.  If you use this driver,
 	  you will still be able to use the parallel port for other tasks,
 	  such as a printer; it is safe to compile both drivers into the
 	  kernel.
@@ -787,7 +787,7 @@
 	  For more information about this driver and how to use it you should
 	  read the file <file:Documentation/scsi/ppa.txt>.  You should also read
 	  the SCSI-HOWTO, which is available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If you use this driver,
+	  <http://www.tldp.org/docs.html#howto>.  If you use this driver,
 	  you will still be able to use the parallel port for other tasks,
 	  such as a printer; it is safe to compile both drivers into the
 	  kernel.
@@ -833,7 +833,7 @@
 	  This is support for the NCR53c406a SCSI host adapter.  For user
 	  configurable parameters, check out <file:drivers/scsi/NCR53c406a.c>
 	  in the kernel source.  Also read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this driver as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
@@ -883,7 +883,7 @@
 	  This is a driver for the 53c7 and 8xx NCR family of SCSI
 	  controllers, not to be confused with the NCR 5380 controllers.  It
 	  is explained in section 3.8 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/53c7,8xx.h>.  Please read
 	  <file:Documentation/scsi/ncr53c7xx.txt> for the available boot time
@@ -1220,7 +1220,7 @@
 	---help---
 	  This is support for a SCSI host adapter.  It is explained in section
 	  3.10 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/pas16.h>.
 
@@ -1235,7 +1235,7 @@
 	help
 	  This is support for the PCI2000I EIDE interface card which acts as a
 	  SCSI host adapter.  Please read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module called pci2000 ( = code
 	  which can be inserted in and removed from the running kernel
@@ -1248,7 +1248,7 @@
 	help
 	  This is support for the PCI2220i EIDE interface card which acts as a
 	  SCSI host adapter.  Please read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module called pci2220i ( = code
 	  which can be inserted in and removed from the running kernel
@@ -1261,7 +1261,7 @@
 	help
 	  This is support for the PSI240i EIDE interface card which acts as a
 	  SCSI host adapter.  Please read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module called psi240i ( = code
 	  which can be inserted in and removed from the running kernel
@@ -1283,7 +1283,7 @@
 	  Information about this driver is contained in
 	  <file:Documentation/scsi/qlogicfas.txt>.  You should also read the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1303,7 +1303,7 @@
 
 	  Please read the file <file:Documentation/scsi/qlogicisp.txt>.  You
 	  should also read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1346,7 +1346,7 @@
 	---help---
 	  These are 8-bit SCSI controllers; the ST-01 is also supported by
 	  this driver.  It is explained in section 3.9 of the SCSI-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.  If it
+	  available from <http://www.tldp.org/docs.html#howto>.  If it
 	  doesn't work out of the box, you may have to change some settings in
 	  <file:drivers/scsi/seagate.h>.
 
@@ -1433,7 +1433,7 @@
 	---help---
 	  This is support for a SCSI host adapter. It is explained in section
 	  3.11 of the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/t128.h>.  Note that Trantor was purchased by
 	  Adaptec, and some former Trantor products are being sold under the
@@ -1453,7 +1453,7 @@
 	  information about this hardware.  If the driver doesn't work out of
 	  the box, you may have to change some settings in
 	  <file: drivers/scsi/u14-34f.c>.  Read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  Note that there is also
+	  <http://www.tldp.org/docs.html#howto>.  Note that there is also
 	  another driver for the same hardware: "UltraStor SCSI support",
 	  below.  You should say Y to both only if you want 24F support as
 	  well.
@@ -1502,7 +1502,7 @@
 	  This is support for the UltraStor 14F, 24F and 34F SCSI-2 host
 	  adapter family.  This driver is explained in section 3.12 of the
 	  SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  If it doesn't work out
+	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
 	  of the box, you may have to change some settings in
 	  <file:drivers/scsi/ultrastor.h>.
 
@@ -1520,7 +1520,7 @@
 	help
 	  This is support for the Workbit NinjaSCSI-32Bi/UDE PCI/Cardbus
 	  SCSI host adapter. Please read the SCSI-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
diff -Nru a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
--- a/drivers/scsi/NCR5380.c	Wed Feb 26 11:28:29 2003
+++ b/drivers/scsi/NCR5380.c	Thu Apr 24 05:17:33 2003
@@ -677,9 +677,11 @@
  *	used by the IRQ probe code.
  */
  
-static void __init probe_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t __init probe_intr(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	probe_irq = irq;
+	return IRQ_HANDLED;
 }
 
 /**
@@ -706,7 +708,7 @@
 			trying_irqs |= mask;
 
 	timeout = jiffies + (250 * HZ / 1000);
-	probe_irq = IRQ_NONE;
+	probe_irq = SCSI_IRQ_NONE;
 
 	/*
 	 * A interrupt is triggered whenever BSY = false, SEL = true
@@ -723,7 +725,7 @@
 	NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask);
 	NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_SEL);
 
-	while (probe_irq == IRQ_NONE && time_before(jiffies, timeout))
+	while (probe_irq == SCSI_IRQ_NONE && time_before(jiffies, timeout))
 	{
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(1);
@@ -892,7 +894,7 @@
 
 	SPRINTF("\nBase Addr: 0x%05lX    ", (long) instance->base);
 	SPRINTF("io_port: %04x      ", (int) instance->io_port);
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 		SPRINTF("IRQ: None.\n");
 	else
 		SPRINTF("IRQ: %d.\n", instance->irq);
@@ -1191,7 +1193,7 @@
 	Scsi_Cmnd *tmp, *prev;
 	struct Scsi_Host *instance;
 	int done;
-	unsigned long flags;
+	unsigned long flags = 0;
 	
 	/*
 	 * We run (with interrupts disabled) until we're sure that none of 
@@ -1207,7 +1209,7 @@
 
 	instance = hostdata->host;
 
-	if(instance->irq != IRQ_NONE)
+	if(instance->irq != SCSI_IRQ_NONE)
 		spin_lock_irqsave(instance->host_lock, flags);
 
 	do {
@@ -1308,7 +1310,7 @@
 			break;
 	} while (!done);
 	
-	if(instance->irq != IRQ_NONE)
+	if(instance->irq != SCSI_IRQ_NONE)
 		spin_unlock_irqrestore(instance->host_lock, flags);
 }
 
@@ -1327,13 +1329,14 @@
  *	Locks: takes the needed instance locks
  */
 
-static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) 
+static irqreturn_t NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) 
 {
 	NCR5380_local_declare();
 	struct Scsi_Host *instance;
 	int done;
 	unsigned char basr;
 	struct NCR5380_hostdata *hostdata;
+	int handled = 0;
 
 	dprintk(NDEBUG_INTR, ("scsi : NCR5380 irq %d triggered\n", irq));
 
@@ -1345,6 +1348,7 @@
 		{
 			instance = hostdata->host;
 			if (instance->irq == irq) {
+				handled = 1;
 				spin_lock_irq(instance->host_lock);
 				/* Look for pending interrupts */
 				NCR5380_setup(instance);
@@ -1402,6 +1406,7 @@
 			}	/* if (instance->irq == irq) */
 		}
 	} while (!done);
+	return IRQ_RETVAL(handled);
 }
 
 #endif 
@@ -1481,7 +1486,7 @@
 	NCR5380_setup(instance);
 
 	if (hostdata->selecting) {
-		if(instance->irq != IRQ_NONE)
+		if(instance->irq != SCSI_IRQ_NONE)
 			spin_unlock_irq(instance->host_lock);
 		goto part2;	/* RvC: sorry prof. Dijkstra, but it keeps the
 				   rest of the code nearly the same */
@@ -1506,14 +1511,14 @@
 	NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask);
 	NCR5380_write(MODE_REG, MR_ARBITRATE);
 
-	if(instance->irq != IRQ_NONE)
+	if(instance->irq != SCSI_IRQ_NONE)
 		spin_unlock_irq(instance->host_lock);
 
 	/* We can be relaxed here, interrupts are on, we are
 	   in workqueue context, the birds are singing in the trees */
 
 	err = NCR5380_poll_politely(instance, INITIATOR_COMMAND_REG, ICR_ARBITRATION_PROGRESS, ICR_ARBITRATION_PROGRESS, 5*HZ);
-	if(instance->irq != IRQ_NONE)
+	if(instance->irq != SCSI_IRQ_NONE)
 		spin_lock_irq(instance->host_lock);
 
 	if (err < 0) {
@@ -1649,7 +1654,7 @@
 					   waiting period */
 	if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) {
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-		if(instance->irq != IRQ_NONE)
+		if(instance->irq != SCSI_IRQ_NONE)
 			spin_lock_irq(instance->host_lock);
 		NCR5380_reselect(instance);
 		printk("scsi%d : reselection after won arbitration?\n", instance->host_no);
@@ -1676,7 +1681,7 @@
 			NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
 			return -1;
 		}
-		if(instance->irq != IRQ_NONE)
+		if(instance->irq != SCSI_IRQ_NONE)
 			spin_lock_irq(instance->host_lock);
 		cmd->result = DID_BAD_TARGET << 16;
 		collect_stats(hostdata, cmd);
@@ -1714,9 +1719,9 @@
 	}
 
 	dprintk(NDEBUG_SELECTION, ("scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->device->id));
-	tmp[0] = IDENTIFY(((instance->irq == IRQ_NONE) ? 0 : 1), cmd->device->lun);
+	tmp[0] = IDENTIFY(((instance->irq == SCSI_IRQ_NONE) ? 0 : 1), cmd->device->lun);
 
-	if(instance->irq != IRQ_NONE)
+	if(instance->irq != SCSI_IRQ_NONE)
 		spin_lock_irq(instance->host_lock);
 		
 	len = 1;
@@ -1738,7 +1743,7 @@
 
 	/* Selection failed */
 failed:
-	if(instance->irq != IRQ_NONE)
+	if(instance->irq != SCSI_IRQ_NONE)
 		spin_lock_irq(instance->host_lock);
 	return -1;
 
diff -Nru a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
--- a/drivers/scsi/NCR5380.h	Sun Oct 27 06:53:17 2002
+++ b/drivers/scsi/NCR5380.h	Thu Apr 24 05:17:33 2003
@@ -28,6 +28,8 @@
 #ifndef NCR5380_H
 #define NCR5380_H
 
+#include <linux/interrupt.h>
+
 #define NCR5380_PUBLIC_RELEASE 7
 #define NCR53C400_PUBLIC_RELEASE 2
 
@@ -233,7 +235,7 @@
  * Scsi_Host structure
  */
 
-#define IRQ_NONE	255
+#define SCSI_IRQ_NONE	255
 #define DMA_NONE	255
 #define IRQ_AUTO	254
 #define DMA_AUTO	254
@@ -295,7 +297,7 @@
 static int NCR5380_init(struct Scsi_Host *instance, int flags);
 static void NCR5380_information_transfer(struct Scsi_Host *instance);
 #ifndef DONT_USE_INTR
-static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs);
 #endif
 static void NCR5380_main(void *ptr);
 static void NCR5380_print_options(struct Scsi_Host *instance);
diff -Nru a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
--- a/drivers/scsi/NCR53C9x.c	Fri Feb 14 05:25:53 2003
+++ b/drivers/scsi/NCR53C9x.c	Thu Apr 24 05:17:33 2003
@@ -30,6 +30,7 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/blk.h>
+#include <linux/interrupt.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/init.h>
@@ -96,7 +97,7 @@
 struct NCR_ESP *espchain = 0;
 int nesps = 0, esps_in_use = 0, esps_running = 0;
 
-void esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
+irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
 
 /* Debugging routines */
 struct esp_cmdstrings {
@@ -3559,7 +3560,7 @@
 }
 
 #ifndef CONFIG_SMP
-void esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
+irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
 {
 	struct NCR_ESP *esp;
 	unsigned long flags;
@@ -3592,10 +3593,11 @@
 	if(again)
 		goto repeat;
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 #else
 /* For SMP we only service one ESP on the list list at our IRQ level! */
-void esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
+irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
 {
 	struct NCR_ESP *esp;
 	unsigned long flags;
@@ -3620,6 +3622,7 @@
 	}
 out:
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 #endif
 
diff -Nru a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h
--- a/drivers/scsi/NCR53C9x.h	Mon Nov 11 13:23:24 2002
+++ b/drivers/scsi/NCR53C9x.h	Thu Apr 24 05:17:33 2003
@@ -14,6 +14,7 @@
 #define NCR53C9X_H
 
 #include <linux/config.h>
+#include <linux/interrupt.h>
 
 /* djweis for mac driver */
 #if defined(CONFIG_MAC)
@@ -657,7 +658,7 @@
 extern void esp_deallocate(struct NCR_ESP *);
 extern void esp_release(void);
 extern void esp_initialize(struct NCR_ESP *);
-extern void esp_intr(int, void *, struct pt_regs *);
+extern irqreturn_t esp_intr(int, void *, struct pt_regs *);
 extern const char *esp_info(struct Scsi_Host *);
 extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
 extern int esp_command(Scsi_Cmnd *);
diff -Nru a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
--- a/drivers/scsi/NCR53c406a.c	Wed Feb 26 09:43:27 2003
+++ b/drivers/scsi/NCR53c406a.c	Thu Apr 24 05:17:33 2003
@@ -169,7 +169,7 @@
 
 /* Static function prototypes */
 static void NCR53c406a_intr(int, void *, struct pt_regs *);
-static void do_NCR53c406a_intr(int, void *, struct pt_regs *);
+static irqreturn_t do_NCR53c406a_intr(int, void *, struct pt_regs *);
 static void internal_done(Scsi_Cmnd *);
 static void wait_intr(void);
 static void chip_init(void);
@@ -658,7 +658,7 @@
 
 static void wait_intr(void)
 {
-	int i = jiffies + WATCHDOG;
+	unsigned long i = jiffies + WATCHDOG;
 
 	while (time_after(i, jiffies) && !(inb(STAT_REG) & 0xe0)) {	/* wait for a pseudo-interrupt */
 		cpu_relax();
@@ -773,7 +773,8 @@
 	return 0;
 }
 
-static void do_NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_NCR53c406a_intr(int unused, void *dev_id,
+					struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
@@ -781,6 +782,7 @@
 	spin_lock_irqsave(dev->host_lock, flags);
 	NCR53c406a_intr(0, dev_id, regs);
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 static void NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs)
@@ -970,7 +972,7 @@
 static int irq_probe(void)
 {
 	int irqs, irq;
-	int i;
+	unsigned long i;
 
 	inb(INT_REG);		/* clear the interrupt register */
 	irqs = probe_irq_on();
diff -Nru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
--- a/drivers/scsi/aacraid/linit.c	Fri Mar 14 00:04:51 2003
+++ b/drivers/scsi/aacraid/linit.c	Thu Apr 24 05:17:33 2003
@@ -48,6 +48,7 @@
 #include <linux/spinlock.h>
 #include <linux/slab.h>
 #include <linux/completion.h>
+#include <linux/interrupt.h>
 #include <asm/semaphore.h>
 #include <linux/blk.h>
 #include "scsi.h"
diff -Nru a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
--- a/drivers/scsi/aacraid/rx.c	Wed Oct  2 13:37:46 2002
+++ b/drivers/scsi/aacraid/rx.c	Thu Apr 24 05:17:32 2003
@@ -39,13 +39,14 @@
 #include <linux/blk.h>
 #include <linux/delay.h>
 #include <linux/completion.h>
+#include <linux/interrupt.h>
 #include <asm/semaphore.h>
 #include "scsi.h"
 #include "hosts.h"
 
 #include "aacraid.h"
 
-static void aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct aac_dev *dev = dev_id;
 	unsigned long bellbits;
@@ -81,7 +82,9 @@
 			rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdNotFull);
 			rx_writel(dev, MUnit.ODR, DoorBellAdapterNormRespNotFull);
 		}
+		return IRQ_HANDLED;
 	}
+	return IRQ_NONE;
 }
 
 /**
diff -Nru a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
--- a/drivers/scsi/aacraid/sa.c	Wed Oct  2 13:37:46 2002
+++ b/drivers/scsi/aacraid/sa.c	Thu Apr 24 05:17:32 2003
@@ -39,13 +39,14 @@
 #include <linux/blk.h>
 #include <linux/delay.h>
 #include <linux/completion.h>
+#include <linux/interrupt.h>
 #include <asm/semaphore.h>
 #include "scsi.h"
 #include "hosts.h"
 
 #include "aacraid.h"
 
-static void aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct aac_dev *dev = dev_id;
 	unsigned short intstat, mask;
@@ -75,7 +76,9 @@
 		} else if (intstat & DOORBELL_4) {	// dev -> Host Normal Response Not Full
 			sa_writew(dev, DoorbellClrReg_p, DOORBELL_4);
 		}
+		return IRQ_HANDLED;
 	}
+	return IRQ_NONE;
 }
 
 /**
diff -Nru a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
--- a/drivers/scsi/advansys.c	Thu Mar  6 14:05:42 2003
+++ b/drivers/scsi/advansys.c	Thu Apr 24 05:17:33 2003
@@ -4208,7 +4208,7 @@
  * advansys.h contains function prototypes for functions global to Linux.
  */
 
-STATIC void       advansys_interrupt(int, void *, struct pt_regs *);
+STATIC irqreturn_t advansys_interrupt(int, void *, struct pt_regs *);
 STATIC int	  advansys_slave_configure(Scsi_Device *);
 STATIC void       asc_scsi_done_list(Scsi_Cmnd *, int from_isr);
 STATIC int        asc_execute_scsi_cmnd(Scsi_Cmnd *);
@@ -6246,7 +6246,7 @@
  * to the AdvanSys driver which is for a device sharing an interrupt with
  * an AdvanSys adapter.
  */
-STATIC void
+STATIC irqreturn_t
 advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
     ulong           flags;
@@ -6336,7 +6336,7 @@
     asc_scsi_done_list(done_scp, 1);
 
     ASC_DBG(1, "advansys_interrupt: end\n");
-    return;
+    return IRQ_HANDLED;
 }
 
 /*
@@ -8370,7 +8370,6 @@
     int                    totlen;
     int                    len;
     int                    chip_scsi_id;
-    int                    i;
 
     boardp = ASC_BOARDP(shp);
 
diff -Nru a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
--- a/drivers/scsi/aha152x.c	Thu Mar 27 06:31:56 2003
+++ b/drivers/scsi/aha152x.c	Thu Apr 24 05:17:33 2003
@@ -646,7 +646,7 @@
 };
 
 /* setup & interrupt */
-static void intr(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *);
 static void reset_ports(struct Scsi_Host *shpnt);
 static void aha152x_error(struct Scsi_Host *shpnt, char *msg);
 static void done(struct Scsi_Host *shpnt, int error);
@@ -936,18 +936,19 @@
 	return 0;
 }
 
-static void swintr(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t swintr(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	struct Scsi_Host *shpnt = lookup_irq(irqno);
 
 	if (!shpnt) {
         	printk(KERN_ERR "aha152x%d: catched software interrupt %d for unknown controller.\n", HOSTNO, irqno);
-		return;
+		return IRQ_NONE;
 	}
 
 	HOSTDATA(shpnt)->swint++;
 
 	SETPORT(DMACNTRL0, INTEN);
+	return IRQ_HANDLED;
 }
 
 #ifdef __ISAPNP__
@@ -1873,13 +1874,13 @@
  *
  */
 
-static void intr(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	struct Scsi_Host *shpnt = lookup_irq(irqno);
 
 	if (!shpnt) {
 		printk(KERN_ERR "aha152x: catched interrupt %d for unknown controller.\n", irqno);
-		return;
+		return IRQ_NONE;
 	}
 
 	/* no more interrupts from the controller, while we're busy.
@@ -1899,6 +1900,7 @@
 	HOSTDATA(shpnt)->service++;
 	INIT_WORK(&aha152x_tq, (void *) run, NULL);
 	schedule_work(&aha152x_tq);
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
--- a/drivers/scsi/aha1542.c	Thu Mar  6 14:15:12 2003
+++ b/drivers/scsi/aha1542.c	Thu Apr 24 05:17:33 2003
@@ -176,7 +176,8 @@
 static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt);
 static int aha1542_restart(struct Scsi_Host *shost);
 static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt_regs *regs);
-static void do_aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id,
+					struct pt_regs *regs);
 
 #define aha1542_intr_reset(base)  outb(IRST, CONTROL(base))
 
@@ -416,7 +417,8 @@
 }
 
 /* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */
-static void do_aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *shost;
@@ -428,6 +430,7 @@
 	spin_lock_irqsave(shost->host_lock, flags);
 	aha1542_intr_handle(shost, dev_id, regs);
 	spin_unlock_irqrestore(shost->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 /* A "high" level interrupt handler */
diff -Nru a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
--- a/drivers/scsi/aha1740.c	Fri Feb 14 12:14:18 2003
+++ b/drivers/scsi/aha1740.c	Thu Apr 24 05:17:33 2003
@@ -220,7 +220,8 @@
 }
 
 /* A "high" level interrupt handler */
-static void aha1740_intr_handle(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t aha1740_intr_handle(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
     struct Scsi_Host *host = aha_host[irq - 9];
     void (*my_done)(Scsi_Cmnd *);
@@ -230,6 +231,7 @@
     Scsi_Cmnd *SCtmp;
     unsigned int base;
     unsigned long flags;
+    int handled = 0;
 
     if (!host)
 	panic("aha1740.c: Irq from unknown host!\n");
@@ -239,6 +241,7 @@
 
     while(inb(G2STAT(base)) & G2STAT_INTPEND)
     {
+	handled = 1;
 	DEB(printk("aha1740_intr top of loop.\n"));
 	adapstat = inb(G2INTST(base));
 	ecbptr = (struct ecb *) isa_bus_to_virt(inl(MBOXIN0(base)));
@@ -309,6 +312,7 @@
     }
 
     spin_unlock_irqrestore(host->host_lock, flags);
+    return IRQ_RETVAL(handled);
 }
 
 static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c	Wed Apr  9 07:55:37 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c	Sun Apr 20 14:14:29 2003
@@ -3863,7 +3863,7 @@
 /*
  * SCSI controller interrupt handler.
  */
-void
+irqreturn_t
 ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs)
 {
 	struct	ahc_softc *ahc;
@@ -3883,6 +3883,8 @@
 			ahc_schedule_completeq(ahc, acmd);
 	}
 	ahc_unlock(ahc, &flags);
+	/* FIXME! Was it really ours? */
+	return IRQ_HANDLED;
 }
 
 void
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h	Tue Mar 25 16:32:23 2003
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h	Sun Apr 20 14:14:29 2003
@@ -1224,7 +1224,7 @@
 int	ahc_platform_abort_scbs(struct ahc_softc *ahc, int target,
 				char channel, int lun, u_int tag,
 				role_t role, uint32_t status);
-void	ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs);
+irqreturn_t ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs);
 void	ahc_platform_flushwork(struct ahc_softc *ahc);
 int	ahc_softc_comp(struct ahc_softc *, struct ahc_softc *);
 void	ahc_done(struct ahc_softc*, struct scb*);
diff -Nru a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
--- a/drivers/scsi/aic7xxx_old.c	Wed Feb 26 19:03:00 2003
+++ b/drivers/scsi/aic7xxx_old.c	Sun Apr 20 23:56:10 2003
@@ -6484,7 +6484,7 @@
  *   above.  Please, children, do not try this at home, and if you ever see
  *   anything like it, please inform the Gross Hack Police immediately
  *-F*************************************************************************/
-static void
+static irqreturn_t
 do_aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
 {
   unsigned long cpu_flags;
@@ -6492,7 +6492,7 @@
   
   p = (struct aic7xxx_host *)dev_id;
   if(!p)
-    return;
+    return IRQ_NONE;
   spin_lock_irqsave(p->host->host_lock, cpu_flags);
   p->flags |= AHC_IN_ISR;
   do
@@ -6503,6 +6503,8 @@
   aic7xxx_run_waiting_queues(p);
   p->flags &= ~AHC_IN_ISR;
   spin_unlock_irqrestore(p->host->host_lock, cpu_flags);
+
+  return IRQ_HANDLED;
 }
 
 /*+F*************************************************************************
diff -Nru a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
--- a/drivers/scsi/atp870u.c	Fri Jan  3 10:58:49 2003
+++ b/drivers/scsi/atp870u.c	Thu Apr 24 05:17:33 2003
@@ -86,7 +86,8 @@
 
 static void send_s870(struct Scsi_Host *);
 
-static void atp870u_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t atp870u_intr_handle(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	unsigned long flags;
 	unsigned short int tmpcip, id;
@@ -108,7 +109,7 @@
 		j = inb(tmport);
 		if ((j & 0x80) == 0) {
 			dev->in_int = 0;
-			return;
+			return IRQ_NONE;
 		}
 
 		tmpcip = dev->pciport;
@@ -175,13 +176,13 @@
 			 *      Done
 			 */
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 
 		if (i == 0x40) {
 			dev->last_cmd |= 0x40;
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 
 		if (i == 0x21) {
@@ -202,7 +203,7 @@
 			tmport += 0x08;
 			outb(0x08, tmport);
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 		if ((i == 0x80) || (i == 0x8f)) {
 			lun = 0;
@@ -228,7 +229,7 @@
 					tmport += 0x04;
 					outb(0x08, tmport);
 					dev->in_int = 0;
-					return;
+					goto out;
 				} else {
 					outb(0x46, tmport);
 					dev->id[target_id].dirctu = 0x00;
@@ -239,7 +240,7 @@
 					tmport += 0x03;
 					outb(0x08, tmport);
 					dev->in_int = 0;
-					return;
+					goto out;
 				}
 			}
 			if (dev->last_cmd != 0xff) {
@@ -313,7 +314,7 @@
 				tmport = workportu + 0x18;
 				outb(0x08, tmport);
 				dev->in_int = 0;
-				return;
+				goto out;
 			}
 			prd = dev->id[target_id].prd_posu;
 			while (adrcntu != 0) {
@@ -352,12 +353,12 @@
 				outb(0x08, tmport);
 				outb(0x01, tmpcip);
 				dev->in_int = 0;
-				return;
+				goto out;
 			}
 			outb(0x08, tmport);
 			outb(0x09, tmpcip);
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 
 		/*
@@ -417,7 +418,7 @@
 				send_s870(host);
 			}
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 		if ((dev->last_cmd & 0xf0) != 0x40) {
 			dev->last_cmd = 0xff;
@@ -440,7 +441,7 @@
 			outb(0x08, tmport);
 			outb(0x09, tmpcip);
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 		if (i == 0x08) {
 			tmpcip = tmpcip + 4;
@@ -458,7 +459,7 @@
 			outb(0x08, tmport);
 			outb(0x01, tmpcip);
 			dev->in_int = 0;
-			return;
+			goto out;
 		}
 		tmport -= 0x07;
 		if (i == 0x0a) {
@@ -474,14 +475,15 @@
 		tmport += 0x03;
 		outb(0x08, tmport);
 		dev->in_int = 0;
-		return;
+		goto out;
 	} else {
 //              tmport = workportu + 0x17;
 //              inb(tmport);
 //              dev->working = 0;
 		dev->in_int = 0;
-		return;
 	}
+out:
+	return IRQ_HANDLED;
 }
 
 static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *))
diff -Nru a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c
--- a/drivers/scsi/cpqfcTSinit.c	Thu Mar 13 16:43:25 2003
+++ b/drivers/scsi/cpqfcTSinit.c	Thu Apr 24 05:17:33 2003
@@ -1716,7 +1716,7 @@
 
 
 
-void cpqfcTS_intr_handler( int irq, 
+irqreturn_t cpqfcTS_intr_handler( int irq, 
 		void *dev_id, 
 		struct pt_regs *regs)
 {
@@ -1726,7 +1726,8 @@
   CPQFCHBA *cpqfcHBA = (CPQFCHBA *)HostAdapter->hostdata;
   int MoreMessages = 1; // assume we have something to do
   UCHAR IntPending;
-  
+  int handled = 0;
+
   ENTER("intr_handler");
   spin_lock_irqsave( HostAdapter->host_lock, flags);
   // is this our INT?
@@ -1737,7 +1738,7 @@
 #define INFINITE_IMQ_BREAK 10000
   if( IntPending )
   {
-    
+    handled = 1;
     // mask our HBA interrupts until we handle it...
     writeb( 0, cpqfcHBA->fcChip.Registers.INTEN.address);
 
@@ -1791,6 +1792,7 @@
   }
   spin_unlock_irqrestore( HostAdapter->host_lock, flags);
   LEAVE("intr_handler");
+  return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/drivers/scsi/cpqfcTSstructs.h b/drivers/scsi/cpqfcTSstructs.h
--- a/drivers/scsi/cpqfcTSstructs.h	Sat Oct 12 12:57:02 2002
+++ b/drivers/scsi/cpqfcTSstructs.h	Thu Apr 24 05:17:33 2003
@@ -21,6 +21,7 @@
 #define CPQFCTSSTRUCTS_H
 
 #include <linux/timer.h>  // timer declaration in our host data
+#include <linux/interrupt.h>
 #include <asm/atomic.h>
 #include "cpqfcTSioctl.h"
 
@@ -861,7 +862,7 @@
                   
 
 // Linux interrupt handler
-void cpqfcTS_intr_handler( int irq,void *dev_id,struct pt_regs *regs);
+irqreturn_t cpqfcTS_intr_handler( int irq,void *dev_id,struct pt_regs *regs);
 void cpqfcTSheartbeat( unsigned long ptr );
 
 
diff -Nru a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
--- a/drivers/scsi/dmx3191d.c	Wed Feb 12 14:01:01 2003
+++ b/drivers/scsi/dmx3191d.c	Thu Apr 24 05:16:59 2003
@@ -96,7 +96,7 @@
 			printk(KERN_WARNING "dmx3191: IRQ %d not available - switching to polled mode.\n", pdev->irq);
 			/* Steam powered scsi controllers run without an IRQ
 			   anyway */
-			instance->irq = IRQ_NONE;
+			instance->irq = SCSI_IRQ_NONE;
 		}
 
 		boards++;
@@ -113,7 +113,7 @@
 static int dmx3191d_release_resources(struct Scsi_Host *instance)
 {
 	release_region(instance->io_port, DMX3191D_REGION);
-	if(instance->irq!=IRQ_NONE)
+	if(instance->irq!=SCSI_IRQ_NONE)
 		free_irq(instance->irq, instance);
 
 	return 0;
diff -Nru a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
--- a/drivers/scsi/dtc.c	Mon Nov 25 10:45:37 2002
+++ b/drivers/scsi/dtc.c	Thu Apr 24 05:16:59 2003
@@ -269,27 +269,27 @@
 #ifndef DONT_USE_INTR
 		/* With interrupts enabled, it will sometimes hang when doing heavy
 		 * reads. So better not enable them until I finger it out. */
-		if (instance->irq != IRQ_NONE)
+		if (instance->irq != SCSI_IRQ_NONE)
 			if (request_irq(instance->irq, dtc_intr, SA_INTERRUPT, "dtc", instance)) {
 				printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
-				instance->irq = IRQ_NONE;
+				instance->irq = SCSI_IRQ_NONE;
 			}
 
-		if (instance->irq == IRQ_NONE) {
+		if (instance->irq == SCSI_IRQ_NONE) {
 			printk(KERN_WARNING "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
 			printk(KERN_WARNING "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
 		}
 #else
-		if (instance->irq != IRQ_NONE)
+		if (instance->irq != SCSI_IRQ_NONE)
 			printk(KERN_WARNING "scsi%d : interrupts not used. Might as well not jumper it.\n", instance->host_no);
-		instance->irq = IRQ_NONE;
+		instance->irq = SCSI_IRQ_NONE;
 #endif
 #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT)
 		printk("scsi%d : irq = %d\n", instance->host_no, instance->irq);
 #endif
 
 		printk(KERN_INFO "scsi%d : at 0x%05X", instance->host_no, (int) instance->base);
-		if (instance->irq == IRQ_NONE)
+		if (instance->irq == SCSI_IRQ_NONE)
 			printk(" interrupts disabled");
 		else
 			printk(" irq %d", instance->irq);
@@ -361,7 +361,7 @@
 	i = 0;
 	NCR5380_read(RESET_PARITY_INTERRUPT_REG);
 	NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE);
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 		NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ);
 	else
 		NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ | CSR_INT_BASE);
@@ -412,7 +412,7 @@
 	NCR5380_read(RESET_PARITY_INTERRUPT_REG);
 	NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE);
 	/* set direction (write) */
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 		NCR5380_write(DTC_CONTROL_REG, 0);
 	else
 		NCR5380_write(DTC_CONTROL_REG, CSR_5380_INTR);
diff -Nru a/drivers/scsi/eata.c b/drivers/scsi/eata.c
--- a/drivers/scsi/eata.c	Fri Feb 21 16:41:13 2003
+++ b/drivers/scsi/eata.c	Thu Apr 24 05:17:33 2003
@@ -815,7 +815,7 @@
 /* But transfer orientation from the 16 bit data register is Little Endian */
 #define REG2H(x)   le16_to_cpu(x)
 
-static void do_interrupt_handler(int, void *, struct pt_regs *);
+static irqreturn_t do_interrupt_handler(int, void *, struct pt_regs *);
 static void flush_dev(Scsi_Device *, unsigned long, unsigned int, unsigned int);
 static int do_trace = FALSE;
 static int setup_done = FALSE;
@@ -2332,16 +2332,19 @@
    return;
 }
 
-static void do_interrupt_handler(int irq, void *shap, struct pt_regs *regs) {
+static irqreturn_t do_interrupt_handler(int irq, void *shap,
+					struct pt_regs *regs) {
    unsigned int j;
    unsigned long spin_flags;
 
    /* Check if the interrupt must be processed by this handler */
-   if ((j = (unsigned int)((char *)shap - sha)) >= num_boards) return;
+   if ((j = (unsigned int)((char *)shap - sha)) >= num_boards)
+	return IRQ_NONE;
 
    spin_lock_irqsave(sh[j]->host_lock, spin_flags);
    ihdlr(irq, j);
    spin_unlock_irqrestore(sh[j]->host_lock, spin_flags);
+   return IRQ_HANDLED;
 }
 
 static int eata2x_release(struct Scsi_Host *shpnt) {
diff -Nru a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
--- a/drivers/scsi/eata_pio.c	Thu Feb 20 09:57:04 2003
+++ b/drivers/scsi/eata_pio.c	Thu Apr 24 05:17:33 2003
@@ -213,7 +213,8 @@
 
 static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs);
 
-static void do_eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_eata_pio_int_handler(int irq, void *dev_id,
+						struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
@@ -221,6 +222,7 @@
 	spin_lock_irqsave(dev->host_lock, flags);
 	eata_pio_int_handler(irq, dev_id, regs);
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
diff -Nru a/drivers/scsi/esp.c b/drivers/scsi/esp.c
--- a/drivers/scsi/esp.c	Mon Feb 24 10:10:00 2003
+++ b/drivers/scsi/esp.c	Sun Apr 20 23:54:46 2003
@@ -186,7 +186,7 @@
 static int esps_running = 0;
 
 /* Forward declarations. */
-static void esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
+static irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
 
 /* Debugging routines */
 struct esp_cmdstrings {
@@ -4321,7 +4321,7 @@
 }
 
 /* Service only the ESP described by dev_id. */
-static void esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
+static irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
 {
 	struct esp *esp = dev_id;
 	unsigned long flags;
@@ -4337,6 +4337,8 @@
 		ESP_INTSON(esp->dregs);
 	}
 	spin_unlock_irqrestore(esp->ehost->host_lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 static int esp_slave_alloc(Scsi_Device *SDptr)
diff -Nru a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
--- a/drivers/scsi/fd_mcs.c	Fri Feb 14 12:17:01 2003
+++ b/drivers/scsi/fd_mcs.c	Thu Apr 24 05:17:33 2003
@@ -283,7 +283,7 @@
 
 #define FD_BRDS sizeof(fd_mcs_adapters)/sizeof(struct fd_mcs_adapters_struct)
 
-static void fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs);
 
 static unsigned long addresses[] = { 0xc8000, 0xca000, 0xce000, 0xde000 };
 static unsigned short ports[] = { 0x140, 0x150, 0x160, 0x170 };
@@ -679,7 +679,7 @@
 }
 
 /* only my_done needs to be protected  */
-static void fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	int status;
@@ -699,7 +699,7 @@
 
 	/* return if some other device on this IRQ caused the interrupt */
 	if (!shpnt) {
-		return;
+		return IRQ_NONE;
 	}
 
 	INTR_Processed++;
@@ -711,7 +711,7 @@
 #if DEBUG_ABORT
 		printk("Interrupt after abort, ignoring\n");
 #endif
-		/* return; */
+		/* return IRQ_HANDLED; */
 	}
 #if DEBUG_RACE
 	++in_interrupt_flag;
@@ -726,7 +726,7 @@
 			spin_lock_irqsave(shpnt->host_lock, flags);
 			my_done(shpnt, DID_BUS_BUSY << 16);
 			spin_unlock_irqrestore(shpnt->host_lock, flags);
-			return;
+			return IRQ_HANDLED;
 		}
 		current_SC->SCp.phase = in_selection;
 
@@ -752,7 +752,7 @@
 				spin_lock_irqsave(shpnt->host_lock, flags);
 				my_done(shpnt, DID_NO_CONNECT << 16);
 				spin_unlock_irqrestore(shpnt->host_lock, flags);
-				return;
+				return IRQ_HANDLED;
 			} else {
 #if EVERY_ACCESS
 				printk(" AltSel ");
@@ -767,7 +767,7 @@
 #if DEBUG_RACE
 		in_interrupt_flag = 0;
 #endif
-		return;
+		return IRQ_HANDLED;
 	}
 
 	/* current_SC->SCp.phase == in_other: this is the body of the routine */
@@ -1117,7 +1117,7 @@
 #if DEBUG_RACE
 	in_interrupt_flag = 0;
 #endif
-	return;
+	return IRQ_HANDLED;
 }
 
 static int fd_mcs_release(struct Scsi_Host *shpnt)
diff -Nru a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
--- a/drivers/scsi/fdomain.c	Thu Feb 27 09:39:04 2003
+++ b/drivers/scsi/fdomain.c	Thu Apr 24 05:17:33 2003
@@ -418,7 +418,7 @@
 static int               FIFO_Size = 0x2000; /* 8k FIFO for
 						pre-tmc18c30 chips */
 
-static void              do_fdomain_16x0_intr( int irq, void *dev_id,
+static irqreturn_t       do_fdomain_16x0_intr( int irq, void *dev_id,
 					    struct pt_regs * regs );
 int		 	fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
 
@@ -1201,7 +1201,8 @@
 #endif
 }
 
-static void do_fdomain_16x0_intr( int irq, void *dev_id, struct pt_regs * regs )
+static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id,
+					struct pt_regs * regs )
 {
    unsigned long flags;
    int      status;
@@ -1216,7 +1217,7 @@
 
    /* Check for other IRQ sources */
    if((inb(TMC_Status_port)&0x01)==0)   
-   	return;
+   	return IRQ_NONE;
 
    /* It is our IRQ */   	
    outb( 0x00, Interrupt_Cntl_port );
@@ -1227,7 +1228,7 @@
       printk( "Spurious interrupt, in_command = %d, current_SC = %x\n",
 	      in_command, current_SC );
 #endif
-      return;
+      return IRQ_NONE;
    }
 
    /* Abort calls my_done, so we do nothing here. */
@@ -1236,7 +1237,7 @@
       printk( "scsi: <fdomain> Interrupt after abort, ignoring\n" );
 #endif
       /*
-      return; */
+      return IRQ_HANDLED; */
    }
 
 #if DEBUG_RACE
@@ -1252,7 +1253,7 @@
          spin_lock_irqsave(current_SC->device->host->host_lock, flags);
 	 my_done( DID_BUS_BUSY << 16 );
          spin_unlock_irqrestore(current_SC->device->host->host_lock, flags);
-	 return;
+	 return IRQ_HANDLED;
       }
       current_SC->SCp.phase = in_selection;
       
@@ -1266,7 +1267,7 @@
 #if DEBUG_RACE
       in_interrupt_flag = 0;
 #endif
-      return;
+      return IRQ_HANDLED;
    } else if (current_SC->SCp.phase & in_selection) {
       status = inb( SCSI_Status_port );
       if (!(status & 0x01)) {
@@ -1278,7 +1279,7 @@
             spin_lock_irqsave(current_SC->device->host->host_lock, flags);
 	    my_done( DID_NO_CONNECT << 16 );
             spin_unlock_irqrestore(current_SC->device->host->host_lock, flags);
-	    return;
+	    return IRQ_HANDLED;
 	 } else {
 #if EVERY_ACCESS
 	    printk( " AltSel " );
@@ -1293,7 +1294,7 @@
 #if DEBUG_RACE
       in_interrupt_flag = 0;
 #endif
-      return;
+      return IRQ_HANDLED;
    }
    
    /* current_SC->SCp.phase == in_other: this is the body of the routine */
@@ -1492,7 +1493,7 @@
 #if DEBUG_RACE
    in_interrupt_flag = 0;
 #endif
-   return;
+   return IRQ_HANDLED;
 }
 
 static int fdomain_16x0_queue( Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
diff -Nru a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
--- a/drivers/scsi/g_NCR5380.c	Wed Feb 26 19:03:02 2003
+++ b/drivers/scsi/g_NCR5380.c	Thu Apr 24 05:17:33 2003
@@ -115,6 +115,7 @@
 #include <linux/ioport.h>
 #include <linux/isapnp.h>
 #include <linux/delay.h>
+#include <linux/interrupt.h>
 
 #define NCR_NOT_SET 0
 static int ncr_irq = NCR_NOT_SET;
@@ -336,7 +337,7 @@
 			if (pnp_irq_valid(dev, 0))
 				overrides[count].irq = pnp_irq(dev, 0);
 			else
-				overrides[count].irq = IRQ_NONE;
+				overrides[count].irq = SCSI_IRQ_NONE;
 			if (pnp_dma_valid(dev, 0))
 				overrides[count].dma = pnp_dma(dev, 0);
 			else
@@ -433,19 +434,19 @@
 		else
 			instance->irq = NCR5380_probe_irq(instance, 0xffff);
 
-		if (instance->irq != IRQ_NONE)
+		if (instance->irq != SCSI_IRQ_NONE)
 			if (request_irq(instance->irq, generic_NCR5380_intr, SA_INTERRUPT, "NCR5380", NULL)) {
 				printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
-				instance->irq = IRQ_NONE;
+				instance->irq = SCSI_IRQ_NONE;
 			}
 
-		if (instance->irq == IRQ_NONE) {
+		if (instance->irq == SCSI_IRQ_NONE) {
 			printk(KERN_INFO "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
 			printk(KERN_INFO "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
 		}
 
 		printk(KERN_INFO "scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int) instance->NCR5380_instance_name);
-		if (instance->irq == IRQ_NONE)
+		if (instance->irq == SCSI_IRQ_NONE)
 			printk(" interrupts disabled");
 		else
 			printk(" irq %d", instance->irq);
@@ -492,7 +493,7 @@
 	release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
 #endif
 
-	if (instance->irq != IRQ_NONE)
+	if (instance->irq != SCSI_IRQ_NONE)
 		free_irq(instance->irq, NULL);
 
 	return 0;
@@ -804,7 +805,7 @@
 	PRINTP("NO NCR53C400 driver extensions\n");
 #endif
 	PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name);
-	if (scsi_ptr->irq == IRQ_NONE)
+	if (scsi_ptr->irq == SCSI_IRQ_NONE)
 		PRINTP("no interrupt\n");
 	else
 		PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq);
diff -Nru a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
--- a/drivers/scsi/gdth.c	Thu Mar  6 15:11:01 2003
+++ b/drivers/scsi/gdth.c	Thu Apr 24 05:17:33 2003
@@ -372,11 +372,7 @@
 
 static void gdth_delay(int milliseconds);
 static void gdth_eval_mapping(ulong32 size, int *cyls, int *heads, int *secs);
-#if LINUX_VERSION_CODE >= 0x010346
-static void gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs);
-#else
-static void gdth_interrupt(int irq,struct pt_regs *regs);
-#endif
+static irqreturn_t gdth_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp);
 static int gdth_async_event(int hanum);
 static void gdth_log_event(gdth_evt_data *dvr, char *buffer);
@@ -1925,11 +1921,7 @@
 
     gdth_from_wait = TRUE;
     do {
-#if LINUX_VERSION_CODE >= 0x010346
         gdth_interrupt((int)ha->irq,ha,NULL);
-#else
-        gdth_interrupt((int)ha->irq,NULL);
-#endif
         if (wait_hanum==hanum && wait_index==index) {
             answer_found = TRUE;
             break;
@@ -3362,11 +3354,7 @@
 
 /* SCSI interface functions */
 
-#if LINUX_VERSION_CODE >= 0x010346
-static void gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs)
-#else
-static void gdth_interrupt(int irq,struct pt_regs *regs)
-#endif
+static irqreturn_t gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs)
 {
     register gdth_ha_str *ha;
     gdt6m_dpram_str *dp6m_ptr;
@@ -3383,7 +3371,7 @@
     /* if polling and not from gdth_wait() -> return */
     if (gdth_polling) {
         if (!gdth_from_wait) {
-            return;
+            return IRQ_HANDLED;
         }
     }
 
@@ -3396,7 +3384,7 @@
         /* spurious interrupt */
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return;
+        return IRQ_HANDLED;
     }
 
 #ifdef GDTH_STATISTICS
@@ -3492,7 +3480,7 @@
         TRACE2(("gdth_interrupt() unknown controller type\n"));
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return;
+        return IRQ_HANDLED;
     }
 
     TRACE(("gdth_interrupt() index %d stat %d info %d\n",
@@ -3509,7 +3497,7 @@
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
         gdth_next(hanum);
-        return;
+        return IRQ_HANDLED;
     } 
 
     if (IStatus == SPEZINDEX) {
@@ -3519,7 +3507,7 @@
         gdth_store_event(ha, ES_DRIVER, 4, &ha->dvr);
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return;
+        return IRQ_HANDLED;
     }
     scp     = ha->cmd_tab[IStatus-2].cmnd;
     Service = ha->cmd_tab[IStatus-2].service;
@@ -3532,13 +3520,13 @@
         gdth_store_event(ha, ES_DRIVER, 1, &ha->dvr);
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return;
+        return IRQ_HANDLED;
     }
     if (scp == INTERNAL_CMND) {
         TRACE(("gdth_interrupt() answer to internal command\n"));
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return;
+        return IRQ_HANDLED;
     }
 
     TRACE(("gdth_interrupt() sync. status\n"));
@@ -3563,6 +3551,7 @@
 #endif
     }
     gdth_next(hanum);
+    return IRQ_HANDLED;
 }
 
 static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
diff -Nru a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
--- a/drivers/scsi/ibmmca.c	Sun Mar  2 18:12:49 2003
+++ b/drivers/scsi/ibmmca.c	Thu Apr 24 05:17:33 2003
@@ -477,7 +477,6 @@
 static char ibm_ansi_order = 0;
 #endif
 
-static void interrupt_handler(int, void *, struct pt_regs *);
 static void issue_cmd(int, unsigned long, unsigned char);
 static void internal_done(Scsi_Cmnd * cmd);
 static void check_devices(int, int);
@@ -501,7 +500,8 @@
 static int ldn_access_load(int, int);
 static int ldn_access_total_read_write(int);
 
-static void interrupt_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t interrupt_handler(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	int host_index, ihost_index;
 	unsigned int intr_reg;
@@ -517,7 +517,7 @@
 	/* return if some other device on this IRQ caused the interrupt */
 	if (!hosts[host_index]) {
 		spin_unlock(dev->host_lock);
-		return;
+		return IRQ_NONE;
 	}
 
 	/* the reset-function already did all the job, even ints got
@@ -525,7 +525,7 @@
 	if ((reset_status(host_index) == IM_RESET_NOT_IN_PROGRESS_NO_INT) || (reset_status(host_index) == IM_RESET_FINISHED_OK_NO_INT)) {
 		reset_status(host_index) = IM_RESET_NOT_IN_PROGRESS;
 		spin_unlock(dev->host_lock);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	/*must wait for attention reg not busy, then send EOI to subsystem */
@@ -612,7 +612,7 @@
 		reset_status(ihost_index) = IM_RESET_FINISHED_OK;
 		last_scsi_command(ihost_index)[ldn] = NO_SCSI;
 		spin_unlock(dev->host_lock);
-		return;
+		return IRQ_HANDLED;
 	}
 	/* handling of commands coming from upper level of scsi driver */
 	if (last_scsi_type(ihost_index)[ldn] == IM_IMM_CMD) {
@@ -632,7 +632,7 @@
 			last_scsi_command(ihost_index)[ldn] = NO_SCSI;
 			last_scsi_type(ihost_index)[ldn] = 0;
 			spin_unlock(dev->host_lock);
-			return;
+			return IRQ_HANDLED;
 		} else if (last_scsi_command(ihost_index)[ldn] == IM_ABORT_IMM_CMD) {
 			/* react on SCSI abort command */
 #ifdef IM_DEBUG_PROBE
@@ -652,7 +652,7 @@
 			if (cmd->scsi_done)
 				(cmd->scsi_done) (cmd);	/* should be the internal_done */
 			spin_unlock(dev->host_lock);
-			return;
+			return IRQ_HANDLED;
 		} else {
 			disk_rw_in_progress = 0;
 			PS2_DISK_LED_OFF();
@@ -660,7 +660,7 @@
 			stat_result(ihost_index) = cmd_result;
 			last_scsi_command(ihost_index)[ldn] = NO_SCSI;
 			spin_unlock(dev->host_lock);
-			return;
+			return IRQ_HANDLED;
 		}
 	}
 	last_scsi_command(ihost_index)[ldn] = NO_SCSI;
@@ -671,7 +671,7 @@
 	if (cmd) {
 		if ((cmd->target == TIMEOUT_PUN) && (cmd->device->lun == TIMEOUT_LUN)) {
 			printk("IBM MCA SCSI: Ignoring interrupt from pun=%x, lun=%x.\n", cmd->target, cmd->device->lun);
-			return;
+			return IRQ_HANDLED;
 		}
 	}
 #endif
@@ -679,7 +679,7 @@
 	if (!cmd)
 	{
 		spin_unlock(dev->host_lock);
-		return;
+		return IRQ_HANDLED;
 	}
 
 #ifdef IM_DEBUG_INT
@@ -710,7 +710,7 @@
 	if (cmd->scsi_done)
 		(cmd->scsi_done) (cmd);
 	spin_unlock(dev->host_lock);
-	return;
+	return IRQ_HANDLED;
 }
 
 static void issue_cmd(int host_index, unsigned long cmd_reg, unsigned char attn_reg)
diff -Nru a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
--- a/drivers/scsi/in2000.c	Fri Jan  3 10:58:49 2003
+++ b/drivers/scsi/in2000.c	Thu Apr 24 05:17:33 2003
@@ -832,7 +832,7 @@
  * but it _does_ need to be able to compile and run in an SMP kernel.)
  */
 
-static void in2000_intr(int irqnum, void *dev_id, struct pt_regs *ptregs)
+static irqreturn_t in2000_intr(int irqnum, void *dev_id, struct pt_regs *ptregs)
 {
 	struct Scsi_Host *instance = dev_id;
 	struct IN2000_hostdata *hostdata;
@@ -986,7 +986,7 @@
 
 /* release the SMP spin_lock and restore irq state */
 		spin_unlock_irqrestore(instance->host_lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 
 /* This interrupt was triggered by the WD33c93 chip. The fifo interrupt
@@ -1004,7 +1004,7 @@
 
 /* release the SMP spin_lock and restore irq state */
 		spin_unlock_irqrestore(instance->host_lock, flags);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	DB(DB_INTR, printk("{%02x:%02x-", asr, sr))
@@ -1416,7 +1416,7 @@
 
 /* release the SMP spin_lock and restore irq state */
 			spin_unlock_irqrestore(instance->host_lock, flags);
-			return;
+			return IRQ_HANDLED;
 		}
 		DB(DB_INTR, printk("UNEXP_DISC-%ld", cmd->pid))
 		    hostdata->connected = NULL;
@@ -1589,7 +1589,7 @@
 
 /* release the SMP spin_lock and restore irq state */
 	    spin_unlock_irqrestore(instance->host_lock, flags);
-
+	return IRQ_HANDLED;
 }
 
 
@@ -1910,7 +1910,7 @@
 	unsigned short base;
 	uchar switches;
 	uchar hrev;
-	int flags;
+	unsigned long flags;
 	int val;
 	char buf[32];
 
diff -Nru a/drivers/scsi/ini9100u.c b/drivers/scsi/ini9100u.c
--- a/drivers/scsi/ini9100u.c	Fri Jan  3 10:58:49 2003
+++ b/drivers/scsi/ini9100u.c	Thu Apr 24 05:17:33 2003
@@ -166,14 +166,14 @@
 
 static char *setup_str = (char *) NULL;
 
-static void i91u_intr0(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr1(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr2(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr3(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr4(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr5(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr6(int irq, void *dev_id, struct pt_regs *);
-static void i91u_intr7(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr0(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr1(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr2(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr3(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr4(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr5(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr6(int irq, void *dev_id, struct pt_regs *);
+static irqreturn_t i91u_intr7(int irq, void *dev_id, struct pt_regs *);
 
 static void i91u_panic(char *msg);
 
@@ -697,124 +697,132 @@
 /*
  * Interrupts handler (main routine of the driver)
  */
-static void i91u_intr0(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr0(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[0].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[0]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
-static void i91u_intr1(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr1(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[1].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[1]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
-static void i91u_intr2(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr2(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[2].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[2]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
-static void i91u_intr3(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr3(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[3].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[3]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
-static void i91u_intr4(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr4(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[4].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[4]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
-static void i91u_intr5(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr5(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[5].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[5]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
-
-static void i91u_intr6(int irqno, void *dev_id, struct pt_regs *regs)
+	
+static irqreturn_t i91u_intr6(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[6].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[6]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
-static void i91u_intr7(int irqno, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i91u_intr7(int irqno, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	if (tul_hcs[7].HCS_Intr != irqno)
-		return;
+		return IRQ_NONE;
 
 	spin_lock_irqsave(dev->host_lock, flags);
 
 	tul_isr(&tul_hcs[7]);
 
 	spin_unlock_irqrestore(dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 /* 
diff -Nru a/drivers/scsi/inia100.c b/drivers/scsi/inia100.c
--- a/drivers/scsi/inia100.c	Sun Feb 16 16:18:17 2003
+++ b/drivers/scsi/inia100.c	Thu Apr 24 05:17:33 2003
@@ -108,7 +108,7 @@
 #define NUMBER(arr)     (sizeof(arr) / sizeof(arr[0]))
 static char *setup_str = (char *) NULL;
 
-static void inia100_intr(int, void *, struct pt_regs *);
+static irqreturn_t inia100_intr(int, void *, struct pt_regs *);
 static void inia100_panic(char *msg);
 
 /* ---- EXTERNAL FUNCTIONS ---- */
@@ -659,7 +659,7 @@
 /*
  * Interrupt handler (main routine of the driver)
  */
-static void inia100_intr(int irqno, void *devid, struct pt_regs *regs)
+static irqreturn_t inia100_intr(int irqno, void *devid, struct pt_regs *regs)
 {
 	struct Scsi_Host *host = (struct Scsi_Host *)devid;
 	ORC_HCS *pHcb;
@@ -669,6 +669,7 @@
 	spin_lock_irqsave(host->host_lock, flags);
 	orc_interrupt(pHcb);
 	spin_unlock_irqrestore(host->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 /* 
diff -Nru a/drivers/scsi/ips.c b/drivers/scsi/ips.c
--- a/drivers/scsi/ips.c	Wed Feb 26 19:03:03 2003
+++ b/drivers/scsi/ips.c	Thu Apr 24 05:17:33 2003
@@ -375,7 +375,7 @@
 int ips_eh_reset(Scsi_Cmnd *);
 int ips_queue(Scsi_Cmnd *, void (*) (Scsi_Cmnd *));
 const char * ips_info(struct Scsi_Host *);
-void do_ipsintr(int, void *, struct pt_regs *);
+irqreturn_t do_ipsintr(int, void *, struct pt_regs *);
 static int ips_hainit(ips_ha_t *);
 static int ips_map_status(ips_ha_t *, ips_scb_t *, ips_stat_t *);
 static int ips_send_wait(ips_ha_t *, ips_scb_t *, int, int);
@@ -1264,7 +1264,7 @@
 /*   Wrapper for the interrupt handler                                      */
 /*                                                                          */
 /****************************************************************************/
-void
+irqreturn_t
 do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) {
    ips_ha_t         *ha;
    unsigned long     cpu_flags;
@@ -1274,19 +1274,19 @@
 
    ha = (ips_ha_t *) dev_id;
    if (!ha) 
-      return;
+      return IRQ_NONE;
    host = ips_sh[ha->host_num];
    /* interrupt during initialization */
    if(!host){
       (*ha->func.intr)(ha);
-      return;
+      return IRQ_HANDLED;
    }
 
    IPS_LOCK_SAVE(host->host_lock, cpu_flags);
 
    if (!ha->active) {
       IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags);
-      return;
+      return IRQ_HANDLED;
    }
 
    (*ha->func.intr)(ha);
@@ -1295,6 +1295,7 @@
 
    /* start the next command */
    ips_next(ha, IPS_INTR_ON);
+   return IRQ_HANDLED;
 }
 
 /****************************************************************************/
diff -Nru a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
--- a/drivers/scsi/mac_scsi.c	Sun Dec  1 13:45:41 2002
+++ b/drivers/scsi/mac_scsi.c	Thu Apr 24 05:16:59 2003
@@ -253,16 +253,16 @@
 
     ((struct NCR5380_hostdata *)instance->hostdata)->ctrl = 0;
 
-    if (instance->irq != IRQ_NONE)
+    if (instance->irq != SCSI_IRQ_NONE)
 	if (request_irq(instance->irq, NCR5380_intr, IRQ_FLG_SLOW, 
 		"ncr5380", NCR5380_intr)) {
 	    printk(KERN_WARNING "scsi%d: IRQ%d not free, interrupts disabled\n",
 		   instance->host_no, instance->irq);
-	    instance->irq = IRQ_NONE;
+	    instance->irq = SCSI_IRQ_NONE;
 	}
 
     printk(KERN_INFO "scsi%d: generic 5380 at port %lX irq", instance->host_no, instance->io_port);
-    if (instance->irq == IRQ_NONE)
+    if (instance->irq == SCSI_IRQ_NONE)
 	printk (KERN_INFO "s disabled");
     else
 	printk (KERN_INFO " %d", instance->irq);
@@ -277,7 +277,7 @@
 
 int macscsi_release (struct Scsi_Host *shpnt)
 {
-	if (shpnt->irq != IRQ_NONE)
+	if (shpnt->irq != SCSI_IRQ_NONE)
 		free_irq (shpnt->irq, NCR5380_intr);
 
 	return 0;
diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c	Tue Feb 25 11:05:27 2003
+++ b/drivers/scsi/megaraid.c	Thu Apr 24 05:17:33 2003
@@ -2056,7 +2056,7 @@
 /*--------------------------------------------------------------------
  * Interrupt service routine
  *--------------------------------------------------------------------*/
-static void megaraid_isr (int irq, void *devp, struct pt_regs *regs)
+static irqreturn_t megaraid_isr (int irq, void *devp, struct pt_regs *regs)
 {
 	IO_LOCK_T;
 	mega_host_config * megaCfg;
@@ -2067,11 +2067,13 @@
 	u_char qCnt, qStatus;
 	u_char completed[MAX_FIRMWARE_STATUS];
 	Scsi_Cmnd *SCpnt;
+	int handled = 0;
 
 	megaCfg = (mega_host_config *) devp;
 	mbox = (mega_mailbox *) tmpBox;
 
 	if (megaCfg->host->irq == irq) {
+		handled = 1;
 		if (megaCfg->flag & IN_ISR) {
 			TRACE (("ISR called reentrantly!!\n"));
 			printk ("ISR called reentrantly!!\n");
@@ -2088,14 +2090,14 @@
 			if (dword != 0x10001234) {
 				/* Spurious interrupt */
 				megaCfg->flag &= ~IN_ISR;
-				return;
+				goto out;
 			}
 		} else {
 			byte = READ_PORT (megaCfg->host->io_port, INTR_PORT);
 			if ((byte & VALID_INTR_BYTE) == 0) {
 				/* Spurious interrupt */
 				megaCfg->flag &= ~IN_ISR;
-				return;
+				goto out;
 			}
 			WRITE_PORT (megaCfg->host->io_port, INTR_PORT, byte);
 		}
@@ -2225,7 +2227,8 @@
 		IO_UNLOCK(megaCfg->host);
 
 	}
-
+out:
+	return IRQ_RETVAL(handled);
 }
 
 /*==================================================*/
diff -Nru a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
--- a/drivers/scsi/nsp32.c	Mon Feb 24 10:18:04 2003
+++ b/drivers/scsi/nsp32.c	Thu Apr 24 05:17:33 2003
@@ -26,6 +26,7 @@
 #include <linux/ioport.h>
 #include <linux/major.h>
 #include <linux/blk.h>
+#include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/ctype.h>
@@ -291,8 +292,8 @@
 static int __init init_nsp32(void);
 static void __exit exit_nsp32(void);
 
-static void nsp32_message(char *, int, char *, char *, ...);
-static void nsp32_dmessage(char *, int, int, char *, ...);
+static void nsp32_message(const char *, int, char *, char *, ...);
+static void nsp32_dmessage(const char *, int, int, char *, ...);
 static void nsp32_build_identify(nsp32_hw_data *, Scsi_Cmnd *);
 static void nsp32_build_sdtr(nsp32_hw_data *, unsigned char, unsigned char);
 static void nsp32_build_nop(nsp32_hw_data *);
@@ -318,7 +319,6 @@
 static void nsp32_sack_assert(nsp32_hw_data *);
 static void nsp32_sack_negate(nsp32_hw_data *);
 static void nsp32_do_bus_reset(nsp32_hw_data *);
-static void do_nsp32_isr(int, void *, struct pt_regs *);
 
 static int nsp32_getprom_param(nsp32_hw_data *);
 static int nsp32_getprom_new(nsp32_hw_data *);
@@ -398,7 +398,7 @@
 
 #define NSP32_DEBUG_BUF_LEN		100
 
-static void nsp32_message(char *func, int line, char *type, char *fmt, ...)
+static void nsp32_message(const char *func, int line, char *type, char *fmt, ...)
 {
 	va_list args;
 	char buf[NSP32_DEBUG_BUF_LEN];
@@ -414,7 +414,7 @@
 #endif
 }
 
-static void nsp32_dmessage(char *func, int line, int mask, char *fmt, ...)
+static void nsp32_dmessage(const char *func, int line, int mask, char *fmt, ...)
 {
 	va_list args;
 	char buf[NSP32_DEBUG_BUF_LEN];
@@ -1263,7 +1263,7 @@
 
 
 /* interrupt routine */
-static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	nsp32_hw_data *data = dev_id;
 	unsigned int base = data->BaseAddress;
@@ -1272,6 +1272,7 @@
 	unsigned char busmon, busphase;
 	unsigned long flags;
 	int ret;
+	int handled = 0;
 
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
 	struct Scsi_Host *host = data->Host;
@@ -1291,6 +1292,7 @@
 		nsp32_msg(KERN_INFO, "spurious interrupt: irq other 0x%x", irq_stat);
 		goto out2;
 	}
+	handled = 1;
 	nsp32_write2(base, IRQ_CONTROL, IRQ_CONTROL_ALL_IRQ_MASK);
 
 	busmon = nsp32_read1(base, SCSI_BUS_MONITOR);
@@ -1547,7 +1549,7 @@
 
 	nsp32_dbg(NSP32_DEBUG_INTR, "exit");
 
-	return;
+	return IRQ_RETVAL(handled);
 }
 
 #undef SPRINTF
diff -Nru a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h
--- a/drivers/scsi/nsp32.h	Sat Oct  5 22:23:55 2002
+++ b/drivers/scsi/nsp32.h	Thu Apr 24 05:17:33 2003
@@ -425,5 +425,5 @@
 #define BUSPHASE_STATUS      ( BUSMON_STATUS      & BUSMON_PHASE_MASK )
 #define BUSPHASE_SELECT      ( BUSMON_SEL | BUSMON_IO )
 
-#endif _NSP32_H
+#endif	/* _NSP32_H */
 /* end */
diff -Nru a/drivers/scsi/nsp32_io.h b/drivers/scsi/nsp32_io.h
--- a/drivers/scsi/nsp32_io.h	Sat Oct  5 22:23:58 2002
+++ b/drivers/scsi/nsp32_io.h	Thu Apr 24 05:17:33 2003
@@ -265,5 +265,5 @@
 	nsp32_multi_write4(base, FIFO_DATA_LOW, buf, count);
 }
 
-#endif _NSP32_IO_H
+#endif	/* _NSP32_IO_H */
 /* end */
diff -Nru a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
--- a/drivers/scsi/pas16.c	Mon Nov 25 10:50:45 2002
+++ b/drivers/scsi/pas16.c	Thu Apr 24 05:16:59 2003
@@ -103,11 +103,11 @@
  *   interrupts.  Ie, for a board at the default 0x388 base port,
  *   boot: linux pas16=0x388,255
  *
- *   IRQ_NONE (255) should be specified for no interrupt,
+ *   SCSI_IRQ_NONE (255) should be specified for no interrupt,
  *   IRQ_AUTO (254) to autoprobe for an IRQ line if overridden
  *   on the command line.
  *
- *   (IRQ_AUTO == 254, IRQ_NONE == 255 in NCR5380.h)
+ *   (IRQ_AUTO == 254, SCSI_IRQ_NONE == 255 in NCR5380.h)
  */
  
 #include <linux/module.h>
@@ -451,14 +451,14 @@
 	else 
 	    instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS);
 
-	if (instance->irq != IRQ_NONE) 
+	if (instance->irq != SCSI_IRQ_NONE) 
 	    if (request_irq(instance->irq, pas16_intr, SA_INTERRUPT, "pas16", instance)) {
 		printk("scsi%d : IRQ%d not free, interrupts disabled\n", 
 		    instance->host_no, instance->irq);
-		instance->irq = IRQ_NONE;
+		instance->irq = SCSI_IRQ_NONE;
 	    } 
 
-	if (instance->irq == IRQ_NONE) {
+	if (instance->irq == SCSI_IRQ_NONE) {
 	    printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
 	    printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
 	    /* Disable 5380 interrupts, leave drive params the same */
@@ -472,7 +472,7 @@
 
 	printk("scsi%d : at 0x%04x", instance->host_no, (int) 
 	    instance->io_port);
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 	    printk (" interrupts disabled");
 	else 
 	    printk (" irq %d", instance->irq);
diff -Nru a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c
--- a/drivers/scsi/pci2000.c	Wed Feb 12 14:02:23 2003
+++ b/drivers/scsi/pci2000.c	Thu Apr 24 05:17:33 2003
@@ -262,7 +262,7 @@
  *	Returns:		TRUE if drive is not ready in time.
  *
  ****************************************************************/
-static void Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
 	{
 	struct Scsi_Host   *shost = NULL;	// Pointer to host data block
 	PADAPTER2000		padapter;		// Pointer to adapter control structure
@@ -275,7 +275,7 @@
 	int					bus;
 	int					z;
     unsigned long		flags;
-
+    int handled = 0;
 
 	DEB(printk ("\npci2000 received interrupt "));
 	for ( z = 0; z < NumAdapters;  z++ )										// scan for interrupt to process
@@ -297,6 +297,7 @@
 		goto out;
 		}
 
+    handled = 1;
 	spin_lock_irqsave(shost->host_lock, flags);
 	padapter = HOSTDATA(shost);
 
@@ -391,7 +392,8 @@
 
 irq_return:
     spin_unlock_irqrestore(shost->host_lock, flags);
-out:;
+out:
+    return IRQ_RETVAL(handled);
 }
 /****************************************************************
  *	Name:	Pci2000_QueueCommand
diff -Nru a/drivers/scsi/pci2220i.c b/drivers/scsi/pci2220i.c
--- a/drivers/scsi/pci2220i.c	Tue Feb 18 10:25:13 2003
+++ b/drivers/scsi/pci2220i.c	Thu Apr 24 05:17:33 2003
@@ -1586,7 +1586,7 @@
  *	Returns:		TRUE if drive is not ready in time.
  *
  ****************************************************************/
-static void Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
 	{
 	struct Scsi_Host   *shost = NULL;	// Pointer to host data block
 	PADAPTER2220I		padapter;		// Pointer to adapter control structure
@@ -1600,6 +1600,7 @@
 	int					z;
 	ULONG				zl;
     unsigned long		flags;
+    int handled = 0;
 
 //	DEB (printk ("\npci2220i received interrupt\n"));
 
@@ -1621,6 +1622,7 @@
 		goto out;
 		}
 
+	handled = 1;
 	spin_lock_irqsave(shost->host_lock, flags);
 	padapter = HOSTDATA(shost);
 	pdev = padapter->pdev;
@@ -2025,8 +2027,10 @@
 	OpDone (padapter, zl);
 irq_return:
     spin_unlock_irqrestore(shost->host_lock, flags);
-out:;
-	}
+out:
+	return IRQ_RETVAL(handled);
+}
+
 /****************************************************************
  *	Name:	Pci2220i_QueueCommand
  *
diff -Nru a/drivers/scsi/psi240i.c b/drivers/scsi/psi240i.c
--- a/drivers/scsi/psi240i.c	Wed Nov 20 05:20:10 2002
+++ b/drivers/scsi/psi240i.c	Thu Apr 24 05:17:33 2003
@@ -367,15 +367,18 @@
 	SCpnt->result = DecodeError (shost, status);
 	SCpnt->scsi_done (SCpnt);
 	}
-static void do_Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
-	{
+
+static irqreturn_t do_Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
+{
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
 	
 	spin_lock_irqsave(dev->host_lock, flags);
 	Irq_Handler(irq, dev_id, regs);
 	spin_unlock_irqrestore(dev->host_lock, flags);
-	}
+	return IRQ_HANDLED;
+}
+
 /****************************************************************
  *	Name:	Psi240i_QueueCommand
  *
diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
--- a/drivers/scsi/qla1280.c	Wed Feb 12 14:02:45 2003
+++ b/drivers/scsi/qla1280.c	Sun Apr 20 14:14:29 2003
@@ -1736,11 +1736,12 @@
  * qla1280_intr_handler
  *   Handles the H/W interrupt
  **************************************************************************/
-void
+irqreturn_t
 qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct scsi_qla_host *ha;
 	struct device_reg *reg;
+	int handled = 0;
 	u16 data;
 
 	ENTER_INTR ("qla1280_intr_handler");
@@ -1757,6 +1758,7 @@
 	/* Check for pending interrupts. */
 	if (data & RISC_INT) {
 		qla1280_isr(ha, &ha->done_q_first, &ha->done_q_last);
+		handled = 1;
 	} else {
 		/* spurious interrupts can happen legally */
 		dprintk(1, "scsi(%ld): Spurious interrupt - ignoring\n",
@@ -1772,6 +1774,7 @@
 	WRT_REG_WORD(&reg->ictrl, (ISP_EN_INT | ISP_EN_RISC));
 
 	LEAVE_INTR("qla1280_intr_handler");
+	return IRQ_RETVAL(handled);
 }
 
 /**************************************************************************
diff -Nru a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h
--- a/drivers/scsi/qla1280.h	Tue Dec 10 12:28:34 2002
+++ b/drivers/scsi/qla1280.h	Sun Apr 20 14:14:29 2003
@@ -1316,7 +1316,7 @@
 int qla1280_biosparam(struct scsi_device *, struct block_device *,
 		sector_t, int[]);
 static int qla1280_slave_configure(Scsi_Device *);
-void qla1280_intr_handler(int, void *, struct pt_regs *);
+irqreturn_t qla1280_intr_handler(int, void *, struct pt_regs *);
 void qla1280_setup(char *s, int *dummy);
 
 /*
diff -Nru a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
--- a/drivers/scsi/qlogicfas.c	Thu Feb 27 09:13:04 2003
+++ b/drivers/scsi/qlogicfas.c	Thu Apr 24 05:25:35 2003
@@ -288,7 +288,9 @@
 
 static int ql_wai(void)
 {
-	int i, k;
+	int k;
+	unsigned long i;
+
 	k = 0;
 	i = jiffies + WATCHDOG;
 	while (time_before(jiffies, i) && !qabort && !((k = inb(qbase + 4)) & 0xe0)) {
@@ -359,7 +361,8 @@
 
 static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
 {
-	unsigned int i, j, k;
+	unsigned int i, j;
+	unsigned long k;
 	unsigned int result;	/* ultimate return result */
 	unsigned int status;	/* scsi returned status */
 	unsigned int message;	/* scsi returned message */
@@ -526,7 +529,7 @@
 	(icmd->scsi_done) (icmd);
 }
 
-static void do_ql_ihandl(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_ql_ihandl(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *host = dev_id;
@@ -534,6 +537,7 @@
 	spin_lock_irqsave(host->host_lock, flags);
 	ql_ihandl(irq, dev_id, regs);
 	spin_unlock_irqrestore(host->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 #endif
diff -Nru a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c
--- a/drivers/scsi/qlogicfc.c	Thu Mar 27 09:33:25 2003
+++ b/drivers/scsi/qlogicfc.c	Sun Apr 20 23:55:02 2003
@@ -660,7 +660,7 @@
 static int isp2x00_mbox_command(struct Scsi_Host *, u_short[]);
 static int isp2x00_return_status(Scsi_Cmnd *, struct Status_Entry *);
 static void isp2x00_intr_handler(int, void *, struct pt_regs *);
-static void do_isp2x00_intr_handler(int, void *, struct pt_regs *);
+static irqreturn_t do_isp2x00_intr_handler(int, void *, struct pt_regs *);
 static int isp2x00_make_portdb(struct Scsi_Host *);
 
 #if ISP2x00_FABRIC
@@ -1421,7 +1421,7 @@
 
 #define ASYNC_EVENT_INTERRUPT	0x01
 
-void do_isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t do_isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct Scsi_Host *host = dev_id;
 	unsigned long flags;
@@ -1429,6 +1429,8 @@
 	spin_lock_irqsave(host->host_lock, flags);
 	isp2x00_intr_handler(irq, dev_id, regs);
 	spin_unlock_irqrestore(host->host_lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 void isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
diff -Nru a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c
--- a/drivers/scsi/qlogicisp.c	Wed Feb 12 14:03:35 2003
+++ b/drivers/scsi/qlogicisp.c	Sun Apr 20 23:55:22 2003
@@ -606,7 +606,7 @@
 static int	isp1020_mbox_command(struct Scsi_Host *, u_short []); 
 static int	isp1020_return_status(struct Status_Entry *);
 static void	isp1020_intr_handler(int, void *, struct pt_regs *);
-static void	do_isp1020_intr_handler(int, void *, struct pt_regs *);
+static irqreturn_t do_isp1020_intr_handler(int, void *, struct pt_regs *);
 
 #if USE_NVRAM_DEFAULTS
 static int	isp1020_get_defaults(struct Scsi_Host *);
@@ -965,7 +965,7 @@
 
 #define ASYNC_EVENT_INTERRUPT	0x01
 
-void do_isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t do_isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct Scsi_Host *host = dev_id;
 	unsigned long flags;
@@ -973,6 +973,8 @@
 	spin_lock_irqsave(host->host_lock, flags);
 	isp1020_intr_handler(irq, dev_id, regs);
 	spin_unlock_irqrestore(host->host_lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 void isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
diff -Nru a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
--- a/drivers/scsi/qlogicpti.c	Tue Feb 25 09:57:01 2003
+++ b/drivers/scsi/qlogicpti.c	Sun Apr 20 23:55:42 2003
@@ -644,7 +644,7 @@
 	return 0;
 }
 
-static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs);
 
 static void __init qpti_chain_add(struct qlogicpti *qpti)
 {
@@ -1441,7 +1441,7 @@
 	return done_queue;
 }
 
-static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct qlogicpti *qpti = dev_id;
 	unsigned long flags;
@@ -1463,6 +1463,8 @@
 		spin_unlock(qpti->qhost->host_lock);
 	}
 	local_irq_restore(flags);
+
+	return IRQ_HANDLED;
 }
 
 static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
diff -Nru a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
--- a/drivers/scsi/scsi.c	Mon Apr 14 16:09:21 2003
+++ b/drivers/scsi/scsi.c	Sun Apr 20 16:21:18 2003
@@ -52,6 +52,7 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/completion.h>
+#include <linux/devfs_fs_kernel.h>
 
 #define __KERNEL_SYSCALLS__
 
diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c	Mon Mar 24 04:15:10 2003
+++ b/drivers/scsi/scsi_error.c	Sun Apr 20 09:19:56 2003
@@ -1401,7 +1401,6 @@
 static void scsi_restart_operations(struct Scsi_Host *shost)
 {
 	struct scsi_device *sdev;
-	unsigned long flags;
 
 	/*
 	 * If the door was locked, we need to insert a door lock request
@@ -1430,11 +1429,8 @@
 	 * now that error recovery is done, we will need to ensure that these
 	 * requests are started.
 	 */
-	list_for_each_entry(sdev, &shost->my_devices, siblings) {
-		spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
-		__blk_run_queue(sdev->request_queue);
-		spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
-	}
+	list_for_each_entry(sdev, &shost->my_devices, siblings)
+		blk_run_queue(sdev->request_queue);
 }
 
 /**
diff -Nru a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
--- a/drivers/scsi/scsi_lib.c	Mon Apr 14 16:09:21 2003
+++ b/drivers/scsi/scsi_lib.c	Sun Apr 20 09:19:56 2003
@@ -328,7 +328,7 @@
 
 /*
  * Called for single_lun devices on IO completion. Clear starget_sdev_user,
- * and call __blk_run_queue for all the scsi_devices on the target -
+ * and call blk_run_queue for all the scsi_devices on the target -
  * including current_sdev first.
  *
  * Called with *no* scsi locks held.
@@ -336,7 +336,7 @@
 static void scsi_single_lun_run(struct scsi_device *current_sdev)
 {
 	struct scsi_device *sdev;
-	unsigned long flags, flags2;
+	unsigned long flags;
 
 	spin_lock_irqsave(current_sdev->host->host_lock, flags);
 	WARN_ON(!current_sdev->sdev_target->starget_sdev_user);
@@ -344,14 +344,12 @@
 	spin_unlock_irqrestore(current_sdev->host->host_lock, flags);
 
 	/*
-	 * Call __blk_run_queue for all LUNs on the target, starting with
+	 * Call blk_run_queue for all LUNs on the target, starting with
 	 * current_sdev. We race with others (to set starget_sdev_user),
 	 * but in most cases, we will be first. Ideally, each LU on the
 	 * target would get some limited time or requests on the target.
 	 */
-	spin_lock_irqsave(current_sdev->request_queue->queue_lock, flags2);
-	__blk_run_queue(current_sdev->request_queue);
-	spin_unlock_irqrestore(current_sdev->request_queue->queue_lock, flags2);
+	blk_run_queue(current_sdev->request_queue);
 
 	spin_lock_irqsave(current_sdev->host->host_lock, flags);
 	if (current_sdev->sdev_target->starget_sdev_user) {
@@ -366,11 +364,8 @@
 	spin_unlock_irqrestore(current_sdev->host->host_lock, flags);
 
 	list_for_each_entry(sdev, &current_sdev->same_target_siblings,
-			    same_target_siblings) {
-		spin_lock_irqsave(sdev->request_queue->queue_lock, flags2);
-		__blk_run_queue(sdev->request_queue);
-		spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags2);
-	}
+			    same_target_siblings)
+		blk_run_queue(sdev->request_queue);
 }
 
 /*
@@ -452,7 +447,7 @@
 		  (shost->host_busy >= shost->can_queue))) {
 		/*
 		 * As long as shost is accepting commands and we have
-		 * starved queues, call __blk_run_queue. scsi_request_fn
+		 * starved queues, call blk_run_queue. scsi_request_fn
 		 * drops the queue_lock and can add us back to the
 		 * starved_list.
 		 *
@@ -465,9 +460,7 @@
 		list_del_init(&sdev->starved_entry);
 		spin_unlock_irqrestore(shost->host_lock, flags);
 
-		spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
-		__blk_run_queue(sdev->request_queue);
-		spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
+		blk_run_queue(sdev->request_queue);
 
 		spin_lock_irqsave(shost->host_lock, flags);
 		if (unlikely(!list_empty(&sdev->starved_entry)))
@@ -480,9 +473,7 @@
 	}
 	spin_unlock_irqrestore(shost->host_lock, flags);
 
-	spin_lock_irqsave(q->queue_lock, flags);
-	__blk_run_queue(q);
-	spin_unlock_irqrestore(q->queue_lock, flags);
+	blk_run_queue(q);
 }
 
 /*
diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/scsi/scsi_scan.c	Sat Apr 19 14:18:27 2003
@@ -1733,7 +1733,6 @@
 	if (sdev->attached)
 		return -EINVAL;
 
-	devfs_remove(sdev->devfs_name);
 	scsi_device_unregister(sdev);
 
 	scsi_free_sdev(sdev);
diff -Nru a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
--- a/drivers/scsi/seagate.c	Mon Feb 24 12:16:14 2003
+++ b/drivers/scsi/seagate.c	Thu Apr 24 05:17:33 2003
@@ -333,7 +333,7 @@
 
 static int hostno = -1;
 static void seagate_reconnect_intr (int, void *, struct pt_regs *);
-static void do_seagate_reconnect_intr (int, void *, struct pt_regs *);
+static irqreturn_t do_seagate_reconnect_intr (int, void *, struct pt_regs *);
 
 #ifdef FAST
 static int fast = 1;
@@ -621,7 +621,8 @@
  * asserting SEL.
  */
 
-static void do_seagate_reconnect_intr (int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_seagate_reconnect_intr(int irq, void *dev_id,
+						struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *dev = dev_id;
@@ -629,6 +630,7 @@
 	spin_lock_irqsave (dev->host_lock, flags);
 	seagate_reconnect_intr (irq, dev_id, regs);
 	spin_unlock_irqrestore (dev->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 static void seagate_reconnect_intr (int irq, void *dev_id, struct pt_regs *regs)
diff -Nru a/drivers/scsi/sg.c b/drivers/scsi/sg.c
--- a/drivers/scsi/sg.c	Fri Apr 18 08:57:20 2003
+++ b/drivers/scsi/sg.c	Sun Apr 20 16:21:18 2003
@@ -55,6 +55,7 @@
 #include <linux/vmalloc.h>
 #include <linux/smp_lock.h>
 #include <linux/moduleparam.h>
+#include <linux/devfs_fs_kernel.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c
--- a/drivers/scsi/sr.c	Fri Apr 18 08:58:55 2003
+++ b/drivers/scsi/sr.c	Sat Apr 19 14:18:27 2003
@@ -569,7 +569,8 @@
 	get_capabilities(cd);
 	sr_vendor_init(cd);
 
-	strcpy(disk->devfs_name, sdev->devfs_name);
+	snprintf(disk->devfs_name, sizeof(disk->devfs_name),
+			"%s/cd", sdev->devfs_name);
 	disk->driverfs_dev = &sdev->sdev_driverfs_dev;
 	register_cdrom(&cd->cdi);
 	set_capacity(disk, cd->capacity);
diff -Nru a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
--- a/drivers/scsi/sun3_scsi.c	Wed Mar  5 05:19:23 2003
+++ b/drivers/scsi/sun3_scsi.c	Thu Apr 24 05:16:59 2003
@@ -273,7 +273,7 @@
 #ifndef REAL_DMA
 		printk("scsi%d: IRQ%d not free, interrupts disabled\n",
 		       instance->host_no, instance->irq);
-		instance->irq = IRQ_NONE;
+		instance->irq = SCSI_IRQ_NONE;
 #else
 		printk("scsi%d: IRQ%d not free, bailing out\n",
 		       instance->host_no, instance->irq);
@@ -282,7 +282,7 @@
 	}
 	
 	printk("scsi%d: Sun3 5380 at port %lX irq", instance->host_no, instance->io_port);
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 		printk ("s disabled");
 	else
 		printk (" %d", instance->irq);
@@ -311,7 +311,7 @@
 #ifdef MODULE
 int sun3scsi_release (struct Scsi_Host *shpnt)
 {
-	if (shpnt->irq != IRQ_NONE)
+	if (shpnt->irq != SCSI_IRQ_NONE)
 		free_irq (shpnt->irq, NULL);
 
 	iounmap((void *)sun3_scsi_regp);
diff -Nru a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c
--- a/drivers/scsi/sun3_scsi_vme.c	Fri Feb  7 14:02:17 2003
+++ b/drivers/scsi/sun3_scsi_vme.c	Thu Apr 24 05:16:59 2003
@@ -235,7 +235,7 @@
 #ifndef REAL_DMA
 		printk("scsi%d: IRQ%d not free, interrupts disabled\n",
 		       instance->host_no, instance->irq);
-		instance->irq = IRQ_NONE;
+		instance->irq = SCSI_IRQ_NONE;
 #else
 		printk("scsi%d: IRQ%d not free, bailing out\n",
 		       instance->host_no, instance->irq);
@@ -244,7 +244,7 @@
 	}
 
 	printk("scsi%d: Sun3 5380 VME at port %lX irq", instance->host_no, instance->io_port);
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 		printk ("s disabled");
 	else
 		printk (" %d", instance->irq);
@@ -280,7 +280,7 @@
 #ifdef MODULE
 int sun3scsi_release (struct Scsi_Host *shpnt)
 {
-	if (shpnt->irq != IRQ_NONE)
+	if (shpnt->irq != SCSI_IRQ_NONE)
 		free_irq (shpnt->irq, NULL);
 
 	iounmap(sun3_scsi_regp);
diff -Nru a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
--- a/drivers/scsi/sym53c416.c	Wed Feb 26 19:05:02 2003
+++ b/drivers/scsi/sym53c416.c	Thu Apr 24 05:25:35 2003
@@ -248,7 +248,7 @@
 	unsigned int orig_len = len;
 	unsigned long flags = 0;
 	unsigned int bytes_left;
-	int i;
+	unsigned long i;
 	int timeout = READ_TIMEOUT;
 
 	/* Do transfer */
@@ -290,7 +290,7 @@
 	unsigned int orig_len = len;
 	unsigned long flags = 0;
 	unsigned int bufferfree;
-	unsigned int i;
+	unsigned long i;
 	unsigned int timeout = WRITE_TIMEOUT;
 
 	/* Do transfer */
@@ -327,7 +327,8 @@
 	return orig_len - len;
 }
 
-static void sym53c416_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	struct Scsi_Host *dev = dev_id;
 	int base = 0;
@@ -348,7 +349,7 @@
 	if(!base)
 	{
 		printk(KERN_ERR "sym53c416: No host adapter defined for interrupt %d\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 	/* Now we have the base address and we can start handling the interrupt */
 
@@ -367,7 +368,7 @@
 		spin_lock_irqsave(dev->host_lock, flags);
 		current_command->scsi_done(current_command);
 		spin_unlock_irqrestore(dev->host_lock, flags);
-		return;
+		goto out;
 	}
 	if(int_reg & ILCMD)       /* Illegal Command */
 	{
@@ -377,7 +378,7 @@
 		spin_lock_irqsave(dev->host_lock, flags);
 		current_command->scsi_done(current_command);
 		spin_unlock_irqrestore(dev->host_lock, flags);
-		return;
+		goto out;
 	}
 	if(status_reg & GE)         /* Gross Error */
 	{
@@ -387,7 +388,7 @@
 		spin_lock_irqsave(dev->host_lock, flags);
 		current_command->scsi_done(current_command);
 		spin_unlock_irqrestore(dev->host_lock, flags);
-		return;
+		goto out;
 	}
 	if(status_reg & PE)         /* Parity Error */
 	{
@@ -397,7 +398,7 @@
 		spin_lock_irqsave(dev->host_lock, flags);
 		current_command->scsi_done(current_command);
 		spin_unlock_irqrestore(dev->host_lock, flags);
-		return;
+		goto out;
 	}
 	if(pio_int_reg & (CE | OUE))
 	{
@@ -407,7 +408,7 @@
 		spin_lock_irqsave(dev->host_lock, flags);
 		current_command->scsi_done(current_command);
 		spin_unlock_irqrestore(dev->host_lock, flags);
-		return;
+		goto out;
 	}
 	if(int_reg & DIS)           /* Disconnect */
 	{
@@ -419,7 +420,7 @@
 		spin_lock_irqsave(dev->host_lock, flags);
 		current_command->scsi_done(current_command);
 		spin_unlock_irqrestore(dev->host_lock, flags);
-		return;
+		goto out;
 	}
 	/* Now we handle SCSI phases         */
 
@@ -518,6 +519,8 @@
 			break;
 		}
 	}
+out:
+	return IRQ_HANDLED;
 }
 
 static void sym53c416_init(int base, int scsi_id)
@@ -537,7 +540,8 @@
 
 static int sym53c416_probeirq(int base, int scsi_id)
 {
-	int irq, irqs, i;
+	int irq, irqs;
+	unsigned long i;
 
 	/* Clear interrupt register */
 	inb(base + INT_REG);
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c	Thu Feb 20 04:16:32 2003
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c	Mon Apr 21 10:36:31 2003
@@ -1009,7 +1009,7 @@
 /*
  *  Linux entry point of the interrupt handler.
  */
-static void sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t sym53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
 {
 	unsigned long flags;
 	hcb_p np = (hcb_p) dev_id;
@@ -1029,6 +1029,8 @@
 	SYM_UNLOCK_HCB(np, flags);
 
 	if (DEBUG_FLAGS & DEBUG_TINY) printf_debug ("]\n");
+
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/drivers/scsi/t128.c b/drivers/scsi/t128.c
--- a/drivers/scsi/t128.c	Mon Nov 25 10:44:14 2002
+++ b/drivers/scsi/t128.c	Thu Apr 24 05:16:59 2003
@@ -248,14 +248,14 @@
 	else 
 	    instance->irq = NCR5380_probe_irq(instance, T128_IRQS);
 
-	if (instance->irq != IRQ_NONE) 
+	if (instance->irq != SCSI_IRQ_NONE) 
 	    if (request_irq(instance->irq, t128_intr, SA_INTERRUPT, "t128", instance)) {
 		printk("scsi%d : IRQ%d not free, interrupts disabled\n", 
 		    instance->host_no, instance->irq);
-		instance->irq = IRQ_NONE;
+		instance->irq = SCSI_IRQ_NONE;
 	    } 
 
-	if (instance->irq == IRQ_NONE) {
+	if (instance->irq == SCSI_IRQ_NONE) {
 	    printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
 	    printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
 	}
@@ -265,7 +265,7 @@
 #endif
 
 	printk("scsi%d : at 0x%08lx", instance->host_no, instance->base);
-	if (instance->irq == IRQ_NONE)
+	if (instance->irq == SCSI_IRQ_NONE)
 	    printk (" interrupts disabled");
 	else 
 	    printk (" irq %d", instance->irq);
diff -Nru a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
--- a/drivers/scsi/tmscsim.c	Wed Feb 12 14:04:13 2003
+++ b/drivers/scsi/tmscsim.c	Thu Apr 24 05:16:59 2003
@@ -3045,7 +3045,7 @@
     /* TO DO: We should check for outstanding commands first. */
     dc390_shutdown (host);
 
-    if (host->irq != IRQ_NONE)
+    if (host->irq != SCSI_IRQ_NONE)
     {
 	DEBUG0(printk(KERN_INFO "DC390: Free IRQ %i\n",host->irq);)
 	free_irq (host->irq, pACB);
diff -Nru a/drivers/scsi/tmscsim.h b/drivers/scsi/tmscsim.h
--- a/drivers/scsi/tmscsim.h	Mon Feb  4 23:39:15 2002
+++ b/drivers/scsi/tmscsim.h	Thu Apr 24 05:16:59 2003
@@ -11,7 +11,7 @@
 #include <linux/types.h>
 #include <linux/config.h>
 
-#define IRQ_NONE 255
+#define SCSI_IRQ_NONE 255
 
 #define MAX_ADAPTER_NUM 	4
 #define MAX_SG_LIST_BUF 	16	/* Not used */
diff -Nru a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
--- a/drivers/scsi/u14-34f.c	Fri Feb 21 16:41:14 2003
+++ b/drivers/scsi/u14-34f.c	Thu Apr 24 05:17:33 2003
@@ -604,7 +604,7 @@
 #define H2DEV(x) cpu_to_le32(x)
 #define DEV2H(x) le32_to_cpu(x)
 
-static void do_interrupt_handler(int, void *, struct pt_regs *);
+static irqreturn_t do_interrupt_handler(int, void *, struct pt_regs *);
 static void flush_dev(Scsi_Device *, unsigned long, unsigned int, unsigned int);
 static int do_trace = FALSE;
 static int setup_done = FALSE;
@@ -1890,7 +1890,9 @@
    return;
 }
 
-static void do_interrupt_handler(int irq, void *shap, struct pt_regs *regs) {
+static irqreturn_t do_interrupt_handler(int irq, void *shap,
+					struct pt_regs *regs)
+{
    unsigned int j;
    unsigned long spin_flags;
 
@@ -1900,6 +1902,7 @@
    spin_lock_irqsave(sh[j]->host_lock, spin_flags);
    ihdlr(irq, j);
    spin_unlock_irqrestore(sh[j]->host_lock, spin_flags);
+   return IRQ_HANDLED;
 }
 
 static int u14_34f_release(struct Scsi_Host *shpnt) {
diff -Nru a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
--- a/drivers/scsi/ultrastor.c	Fri Feb 14 11:57:43 2003
+++ b/drivers/scsi/ultrastor.c	Thu Apr 24 05:17:33 2003
@@ -288,7 +288,7 @@
 #endif
 
 static void ultrastor_interrupt(int, void *, struct pt_regs *);
-static void do_ultrastor_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t do_ultrastor_interrupt(int, void *, struct pt_regs *);
 static inline void build_sg_list(struct mscp *, Scsi_Cmnd *SCpnt);
 
 
@@ -1160,7 +1160,8 @@
 #endif
 }
 
-static void do_ultrastor_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id,
+						struct pt_regs *regs)
 {
     unsigned long flags;
     struct Scsi_Host *dev = dev_id;
@@ -1168,6 +1169,7 @@
     spin_lock_irqsave(dev->host_lock, flags);
     ultrastor_interrupt(irq, dev_id, regs);
     spin_unlock_irqrestore(dev->host_lock, flags);
+    return IRQ_HANDLED;
 }
 
 MODULE_LICENSE("GPL");
diff -Nru a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
--- a/drivers/scsi/wd7000.c	Sat Mar 22 22:14:13 2003
+++ b/drivers/scsi/wd7000.c	Thu Apr 24 05:17:33 2003
@@ -1121,7 +1121,8 @@
 	dprintk("wd7000_intr_handle: return from interrupt handler\n");
 }
 
-static void do_wd7000_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_wd7000_intr_handle(int irq, void *dev_id,
+					struct pt_regs *regs)
 {
 	unsigned long flags;
 	struct Scsi_Host *host = dev_id;
@@ -1129,6 +1130,7 @@
 	spin_lock_irqsave(host->host_lock, flags);
 	wd7000_intr_handle(irq, dev_id, regs);
 	spin_unlock_irqrestore(host->host_lock, flags);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/drivers/serial/21285.c b/drivers/serial/21285.c
--- a/drivers/serial/21285.c	Wed Mar 26 06:51:09 2003
+++ b/drivers/serial/21285.c	Thu Apr 24 03:30:40 2003
@@ -414,11 +414,6 @@
 	}
 }
 
-static kdev_t serial21285_console_device(struct console *c)
-{
-	return mk_kdev(SERIAL_21285_MAJOR, SERIAL_21285_MINOR);
-}
-
 static void __init
 serial21285_get_options(struct uart_port *port, int *baud,
 			int *parity, int *bits)
@@ -479,15 +474,17 @@
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
+extern struct uart_driver serial21285_reg;
 #ifdef CONFIG_SERIAL_21285_OLD
 static struct console serial21285_old_cons =
 {
 	.name		= SERIAL_21285_OLD_NAME,
 	.write		= serial21285_console_write,
-	.device		= serial21285_console_device,
+	.device		= uart_console_device,
 	.setup		= serial21285_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= &serial21285_reg,
 };
 #endif
 
@@ -495,10 +492,11 @@
 {
 	.name		= SERIAL_21285_NAME,
 	.write		= serial21285_console_write,
-	.device		= serial21285_console_device,
+	.device		= uart_console_device,
 	.setup		= serial21285_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= &serial21285_reg,
 };
 
 static int __init rs285_console_init(void)
@@ -517,7 +515,7 @@
 static struct uart_driver serial21285_reg = {
 	.owner			= THIS_MODULE,
 	.driver_name		= "ttyFB",
-	.dev_name		= "ttyFB%d",
+	.dev_name		= "ttyFB",
 	.major			= SERIAL_21285_MAJOR,
 	.minor			= SERIAL_21285_MINOR,
 	.nr			= 1,
diff -Nru a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
--- a/drivers/serial/68328serial.c	Sat Apr 12 15:48:42 2003
+++ b/drivers/serial/68328serial.c	Thu Apr 24 03:30:40 2003
@@ -151,20 +151,20 @@
 DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int serial_paranoia_check(struct m68k_serial *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
-		"Warning: bad magic number for serial struct (%d, %d) in %s\n";
+		"Warning: bad magic number for serial struct %s in %s\n";
 	static const char *badinfo =
-		"Warning: null m68k_serial for (%d, %d) in %s\n";
+		"Warning: null m68k_serial for %s in %s\n";
 
 	if (!info) {
-		printk(badinfo, major(device), minor(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, major(device), minor(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -216,7 +216,7 @@
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -246,7 +246,7 @@
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 	
 	save_flags(flags); cli();
@@ -711,7 +711,7 @@
 {
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_set_ldisc"))
+	if (serial_paranoia_check(info, tty->name, "rs_set_ldisc"))
 		return;
 
 	info->is_cons = (tty->termios->c_line == N_TTY);
@@ -725,7 +725,7 @@
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 #ifndef USE_INTS
 	for(;;) {
@@ -774,7 +774,7 @@
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf)
@@ -838,7 +838,7 @@
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 	int	ret;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -850,7 +850,7 @@
 {
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -859,7 +859,7 @@
 {
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	cli();
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -882,7 +882,7 @@
 {
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -895,7 +895,7 @@
 {
 	struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1035,7 +1035,7 @@
 	struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
 	int retval;
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1140,7 +1140,7 @@
 	m68328_uart *uart = &uart_addr[info->line];
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1198,8 +1198,8 @@
 	uart->ustcnt &= ~(USTCNT_RXEN | USTCNT_RX_INTR_MASK);
 
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1233,7 +1233,7 @@
 {
 	struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 	
 	rs_flush_buffer(tty);
@@ -1277,7 +1277,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & S_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & S_CALLOUT_ACTIVE) &&
@@ -1374,14 +1374,14 @@
 	struct m68k_serial	*info;
 	int 			retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	
 	if (line >= NR_PORTS || line < 0) /* we have exactly one */
 		return -ENODEV;
 
 	info = &m68k_soft[line];
 
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 
 	info->count++;
@@ -1401,7 +1401,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & S_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -1662,9 +1662,10 @@
 }
 
 
-static kdev_t m68328_console_device(struct console *c)
+static struct tty_driver *m68328_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 
diff -Nru a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
--- a/drivers/serial/68360serial.c	Thu Apr  3 15:03:46 2003
+++ b/drivers/serial/68360serial.c	Thu Apr 24 03:30:40 2003
@@ -282,7 +282,7 @@
 static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout);
 
 static inline int serial_paranoia_check(ser_info_t *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
@@ -291,11 +291,11 @@
 		"Warning: null async_struct for (%s) in %s\n";
 
 	if (!info) {
-		printk(badinfo, cdevname(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, cdevname(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -339,7 +339,7 @@
  	volatile struct scc_regs *sccp;
  	volatile struct smc_regs *smcp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	local_irq_save(flags);
@@ -364,7 +364,7 @@
 	volatile struct scc_regs *sccp;
 	volatile struct smc_regs *smcp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	local_irq_save(flags);
@@ -1036,7 +1036,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	volatile QUICC_BD	*bdp;
 
-	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_put_char"))
 		return;
 
 	if (!tty)
@@ -1074,7 +1074,7 @@
 		return ret;
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty) 
@@ -1127,7 +1127,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	int	ret;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 
 	if ((info->tx_cur->status & BD_SC_READY) == 0) {
@@ -1147,7 +1147,7 @@
 {
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return 0;
 }
@@ -1156,7 +1156,7 @@
 {
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 
 	/* There is nothing to "flush", whatever we gave the CPM
@@ -1179,7 +1179,7 @@
 
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+	if (serial_paranoia_check(info, tty->name, "rs_send_char"))
 		return;
 
 	bdp = info->tx_cur;
@@ -1218,7 +1218,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1244,7 +1244,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1458,7 +1458,7 @@
 	/* struct async_icount_24 cnow;*/ 	/* kernel counter temps */
 	struct serial_icounter_struct *p_cuser;	/* user space */
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
@@ -1671,7 +1671,7 @@
 	volatile struct smc_regs	*smcp;
 	volatile struct scc_regs	*sccp;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 
 	state = info->state;
@@ -1754,8 +1754,8 @@
 		rs_360_wait_until_sent(tty, info->timeout);
 	}
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1785,7 +1785,7 @@
 	/*int lsr;*/
 	volatile QUICC_BD *bdp;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 #ifdef maybe
@@ -1852,7 +1852,7 @@
 	ser_info_t *info = (ser_info_t *)tty->driver_data;
 	struct serial_state *state = info->state;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	state = info->state;
@@ -1905,7 +1905,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -2041,18 +2041,17 @@
 	ser_info_t	*info;
 	int 		retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS))
 		return -ENODEV;
 	retval = get_async_struct(line, &info);
 	if (retval)
 		return retval;
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->state->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->state->count);
 #endif
 	tty->driver_data = info;
 	info->tty = tty;
@@ -2077,7 +2076,7 @@
 
 	if ((info->state->count == 1) &&
 	    (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->state->normal_termios;
 		else 
 			*tty->termios = info->state->callout_termios;
@@ -2088,7 +2087,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttys%d successful...", info->line);
+	printk("rs_open %s successful...", tty->name);
 #endif
 	return 0;
 }
@@ -2522,9 +2521,10 @@
 }
 #endif
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_struct *serial_console_device(struct console *c, int *index)
 {
-	return MKDEV(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 
diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c
--- a/drivers/serial/8250.c	Sat Mar 15 17:15:06 2003
+++ b/drivers/serial/8250.c	Thu Apr 24 03:30:40 2003
@@ -984,7 +984,7 @@
  * This means we need to loop through all ports. checking that they
  * don't have an interrupt pending.
  */
-static void serial8250_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t serial8250_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct irq_info *i = dev_id;
 	struct list_head *l, *end = NULL;
@@ -1024,6 +1024,8 @@
 	spin_unlock(&i->lock);
 
 	DEBUG_INTR("end.\n");
+	/* FIXME! Was it really ours? */
+	return IRQ_HANDLED;
 }
 
 /*
@@ -1828,7 +1830,7 @@
 	for (i = 0, up = serial8250_ports; i < ARRAY_SIZE(old_serial_port);
 	     i++, up++) {
 		up->port.iobase   = old_serial_port[i].port;
-		up->port.irq      = irq_cannonicalize(old_serial_port[i].irq);
+		up->port.irq      = irq_canonicalize(old_serial_port[i].irq);
 		up->port.uartclk  = old_serial_port[i].baud_base * 16;
 		up->port.flags    = old_serial_port[i].flags |
 				    UPF_RESOURCES;
@@ -1942,11 +1944,6 @@
 	serial_out(up, UART_IER, ier);
 }
 
-static kdev_t serial8250_console_device(struct console *co)
-{
-	return mk_kdev(TTY_MAJOR, 64 + co->index);
-}
-
 static int __init serial8250_console_setup(struct console *co, char *options)
 {
 	struct uart_port *port;
@@ -1975,13 +1972,15 @@
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
+extern struct uart_driver serial8250_reg;
 static struct console serial8250_console = {
 	.name		= "ttyS",
 	.write		= serial8250_console_write,
-	.device		= serial8250_console_device,
+	.device		= uart_console_device,
 	.setup		= serial8250_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= &serial8250_reg,
 };
 
 static int __init serial8250_console_init(void)
@@ -2001,9 +2000,9 @@
 	.owner			= THIS_MODULE,
 	.driver_name		= "serial",
 #ifdef CONFIG_DEVFS_FS
-	.dev_name		= "tts/%d",
+	.dev_name		= "tts/",
 #else
-	.dev_name		= "ttyS%d",
+	.dev_name		= "ttyS",
 #endif
 	.major			= TTY_MAJOR,
 	.minor			= 64,
diff -Nru a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
--- a/drivers/serial/8250_pci.c	Fri Mar 28 02:04:20 2003
+++ b/drivers/serial/8250_pci.c	Mon Apr 21 01:55:47 2003
@@ -23,6 +23,7 @@
 #include <linux/tty.h>
 #include <linux/serial.h>
 #include <linux/serial_core.h>
+#include <linux/8250_pci.h>
 
 #include <asm/bitops.h>
 #include <asm/byteorder.h>
diff -Nru a/drivers/serial/Kconfig b/drivers/serial/Kconfig
--- a/drivers/serial/Kconfig	Tue Mar 18 09:05:10 2003
+++ b/drivers/serial/Kconfig	Sun Apr 20 12:56:51 2003
@@ -97,7 +97,7 @@
 	  Say Y here if you have dumb serial boards other than the four
 	  standard COM 1/2/3/4 ports. This may happen if you have an AST
 	  FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
-	  from <http://www.linuxdoc.org/docs.html#howto>), or other custom
+	  from <http://www.tldp.org/docs.html#howto>), or other custom
 	  serial port hardware which acts similar to standard serial port
 	  hardware. If you only use the standard COM 1/2/3/4 ports, you can
 	  say N here to save some memory. You can also say Y if you have an
diff -Nru a/drivers/serial/amba.c b/drivers/serial/amba.c
--- a/drivers/serial/amba.c	Sat Apr 12 15:48:42 2003
+++ b/drivers/serial/amba.c	Thu Apr 24 03:30:40 2003
@@ -640,11 +640,6 @@
 	UART_PUT_CR(port, old_cr);
 }
 
-static kdev_t ambauart_console_device(struct console *co)
-{
-	return mk_kdev(SERIAL_AMBA_MAJOR, SERIAL_AMBA_MINOR + co->index);
-}
-
 static void __init
 ambauart_console_get_options(struct uart_port *port, int *baud,
 			     int *parity, int *bits)
@@ -696,13 +691,15 @@
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
+extern struct uart_driver amba_reg;
 static struct console amba_console = {
 	.name		= "ttyAM",
 	.write		= ambauart_console_write,
-	.device		= ambauart_console_device,
+	.device		= uart_console_device,
 	.setup		= ambauart_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= &amba_reg,
 };
 
 static int __init ambauart_console_init(void)
@@ -720,7 +717,7 @@
 static struct uart_driver amba_reg = {
 	.owner			= THIS_MODULE,
 	.driver_name		= "ttyAM",
-	.dev_name		= "ttyAM%d",
+	.dev_name		= "ttyAM",
 	.major			= SERIAL_AMBA_MAJOR,
 	.minor			= SERIAL_AMBA_MINOR,
 	.nr			= UART_NR,
diff -Nru a/drivers/serial/anakin.c b/drivers/serial/anakin.c
--- a/drivers/serial/anakin.c	Sat Apr 12 15:48:42 2003
+++ b/drivers/serial/anakin.c	Thu Apr 24 03:30:40 2003
@@ -444,12 +444,6 @@
 	}
 }
 
-static kdev_t
-anakin_console_device(struct console *co)
-{
-	return mk_kdev(SERIAL_ANAKIN_MAJOR, SERIAL_ANAKIN_MINOR + co->index);
-}
-
 /*
  * Read the current UART setup.
  */
@@ -493,10 +487,11 @@
 	return uart_set_options(port, co, baud, parity, bits);
 }
 
+extern struct uart_driver anakin_reg;
 static struct console anakin_console = {
 	.name		= SERIAL_ANAKIN_NAME,
 	.write		= anakin_console_write,
-	.device		= anakin_console_device,
+	.device		= uart_console_device,
 	.setup		= anakin_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
@@ -514,7 +509,7 @@
 #define ANAKIN_CONSOLE		NULL
 #endif
 
-static struct uart_register anakin_reg = {
+static struct uart_driver anakin_reg = {
 	.driver_name		= SERIAL_ANAKIN_NAME,
 	.dev_name		= SERIAL_ANAKIN_NAME,
 	.major			= SERIAL_ANAKIN_MAJOR,
diff -Nru a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
--- a/drivers/serial/clps711x.c	Sat Apr 12 15:48:42 2003
+++ b/drivers/serial/clps711x.c	Thu Apr 24 03:30:40 2003
@@ -503,11 +503,6 @@
 	clps_writel(syscon, SYSCON(port));
 }
 
-static kdev_t clps711xuart_console_device(struct console *co)
-{
-	return mk_kdev(SERIAL_CLPS711X_MAJOR, SERIAL_CLPS711X_MINOR + co->index);
-}
-
 static void __init
 clps711xuart_console_get_options(struct uart_port *port, int *baud,
 				 int *parity, int *bits)
@@ -558,13 +553,15 @@
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
+extern struct uart_driver clps711x_reg;
 static struct console clps711x_console = {
 	.name		= "ttyCL",
 	.write		= clps711xuart_console_write,
-	.device		= clps711xuart_console_device,
+	.device		= uart_console_device,
 	.setup		= clps711xuart_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= &clps711x_reg,
 };
 
 static int __init clps711xuart_console_init(void)
@@ -581,7 +578,7 @@
 
 static struct uart_driver clps711x_reg = {
 	.driver_name		= "ttyCL",
-	.dev_name		= "ttyCL%d",
+	.dev_name		= "ttyCL",
 	.major			= SERIAL_CLPS711X_MAJOR,
 	.minor			= SERIAL_CLPS711X_MINOR,
 	.nr			= UART_NR,
diff -Nru a/drivers/serial/core.c b/drivers/serial/core.c
--- a/drivers/serial/core.c	Wed Apr 16 15:35:04 2003
+++ b/drivers/serial/core.c	Thu Apr 24 03:30:40 2003
@@ -577,8 +577,7 @@
 	struct uart_port *port = state->port;
 	unsigned long flags;
 
-	DPRINTK("uart_flush_buffer(%d) called\n",
-	        minor(tty->device) - tty->driver.minor_start);
+	DPRINTK("uart_flush_buffer(%d) called\n", tty->index);
 
 	spin_lock_irqsave(&port->lock, flags);
 	uart_circ_clear(&state->info->xmit);
@@ -683,7 +682,7 @@
 	if (HIGH_BITS_OFFSET)
 		new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
 
-	new_serial.irq = irq_cannonicalize(new_serial.irq);
+	new_serial.irq = irq_canonicalize(new_serial.irq);
 
 	/*
 	 * This semaphore protects state->count.  It is also
@@ -782,8 +781,12 @@
 		/*
 		 * Claim and map the new regions
 		 */
-		if (port->type != PORT_UNKNOWN)
+		if (port->type != PORT_UNKNOWN) {
 			retval = port->ops->request_port(port);
+		} else {
+			/* Always success - Jean II */
+			retval = 0;
+		}
 
 		/*
 		 * If we fail to request resources for the
@@ -835,7 +838,7 @@
 			 * need to rate-limit; it's CAP_SYS_ADMIN only. */
 			if (port->flags & UPF_SPD_MASK) {
 				printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n",
-				       current->comm, state->info->tty->driver.name, 
+				       current->comm, state->info->tty->driver->name, 
 				       state->port->line);
 			}
 			uart_change_speed(state, NULL);
@@ -1229,8 +1232,8 @@
 		state->count = 1;
 	}
 	if (--state->count < 0) {
-		printk("rs_close: bad serial port count for %s%d: %d\n",
-		       tty->driver.name, port->line, state->count);
+		printk("rs_close: bad serial port count for %s: %d\n",
+		       tty->name, state->count);
 		state->count = 0;
 	}
 	if (state->count)
@@ -1550,20 +1553,20 @@
  */
 static int uart_open(struct tty_struct *tty, struct file *filp)
 {
-	struct uart_driver *drv = (struct uart_driver *)tty->driver.driver_state;
+	struct uart_driver *drv = (struct uart_driver *)tty->driver->driver_state;
 	struct uart_state *state;
-	int retval, line = minor(tty->device) - tty->driver.minor_start;
+	int retval, line = tty->index;
 
 	BUG_ON(!kernel_locked());
 	DPRINTK("uart_open(%d) called\n", line);
 
 	/*
-	 * tty->driver.num won't change, so we won't fail here with
+	 * tty->driver->num won't change, so we won't fail here with
 	 * tty->driver_data set to something non-NULL (and therefore
 	 * we won't get caught by uart_close()).
 	 */
 	retval = -ENODEV;
-	if (line >= tty->driver.num)
+	if (line >= tty->driver->num)
 		goto fail;
 
 	/*
@@ -1957,7 +1960,7 @@
 static inline void
 uart_report_port(struct uart_driver *drv, struct uart_port *port)
 {
-	printk(drv->dev_name, port->line);
+	printk("%s%d", drv->dev_name, port->line);
 	printk(" at ");
 	switch (port->iotype) {
 	case UPIO_PORT:
@@ -2184,13 +2187,21 @@
  */
 void uart_unregister_driver(struct uart_driver *drv)
 {
-	tty_unregister_driver(drv->tty_driver);
-
+	struct tty_driver *p = drv->tty_driver;
+	drv->tty_driver = NULL;
+	tty_unregister_driver(p);
 	kfree(drv->state);
 	kfree(drv->tty_driver->termios);
 	kfree(drv->tty_driver);
 }
 
+struct tty_driver *uart_console_device(struct console *co, int *index)
+{
+	struct uart_driver *p = co->data;
+	*index = co->index;
+	return p->tty_driver;
+}
+
 /**
  *	uart_add_one_port - attach a driver-defined port structure
  *	@drv: pointer to the uart low level driver structure for this port
@@ -2231,7 +2242,7 @@
 	 * Register the port whether it's detected or not.  This allows
 	 * setserial to be used to alter this ports parameters.
 	 */
-	tty_register_device(drv->tty_driver, drv->minor + port->line);
+	tty_register_device(drv->tty_driver, port->line);
 
  out:
 	up(&port_sem);
@@ -2263,7 +2274,7 @@
 	/*
 	 * Remove the devices from devfs
 	 */
-	tty_unregister_device(drv->tty_driver, drv->minor + port->line);
+	tty_unregister_device(drv->tty_driver, port->line);
 
 	uart_unconfigure_port(drv, state);
 	state->port = NULL;
@@ -2410,7 +2421,7 @@
 
 	if (line < 0 || line >= drv->nr) {
 		printk(KERN_ERR "Attempt to unregister ");
-		printk(drv->dev_name, line);
+		printk("%s%d", drv->dev_name, line);
 		printk("\n");
 		return;
 	}
diff -Nru a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
--- a/drivers/serial/mcfserial.c	Sat Apr 12 15:48:42 2003
+++ b/drivers/serial/mcfserial.c	Thu Apr 24 03:30:40 2003
@@ -148,20 +148,20 @@
 
 
 static inline int serial_paranoia_check(struct mcf_serial *info,
-					kdev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
-		"MCFRS(warning): bad magic number for serial struct (%d, %d) in %s\n";
+		"MCFRS(warning): bad magic number for serial struct %s in %s\n";
 	static const char *badinfo =
-		"MCFRS(warning): null mcf_serial for (%d, %d) in %s\n";
+		"MCFRS(warning): null mcf_serial for %s in %s\n";
 
 	if (!info) {
-		printk(badinfo, MAJOR(device), MINOR(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, MAJOR(device), MINOR(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -257,7 +257,7 @@
 	struct mcf_serial	*info = (struct mcf_serial *)tty->driver_data;
 	unsigned long		flags;
 
-	if (serial_paranoia_check(info, tty->device, "mcfrs_stop"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_stop"))
 		return;
 	
 	local_irq_save(flags);
@@ -273,7 +273,7 @@
 	struct mcf_serial	*info = (struct mcf_serial *)tty->driver_data;
 	unsigned long		flags;
 	
-	if (serial_paranoia_check(info, tty->device, "mcfrs_start"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_start"))
 		return;
 
 	local_irq_save(flags);
@@ -712,7 +712,7 @@
 	struct mcf_serial	*info = (struct mcf_serial *)tty->driver_data;
 	unsigned long		flags;
 
-	if (serial_paranoia_check(info, tty->device, "mcfrs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_flush_chars"))
 		return;
 
 	if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -740,7 +740,7 @@
 		__FILE__, __LINE__, tty, from_user, buf, count);
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "mcfrs_write"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf)
@@ -792,7 +792,7 @@
 	struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
 	int	ret;
 				
-	if (serial_paranoia_check(info, tty->device, "mcfrs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -804,7 +804,7 @@
 {
 	struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "mcfrs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -814,7 +814,7 @@
 	struct mcf_serial	*info = (struct mcf_serial *)tty->driver_data;
 	unsigned long		flags;
 				
-	if (serial_paranoia_check(info, tty->device, "mcfrs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_flush_buffer"))
 		return;
 
 	local_irq_save(flags);
@@ -845,7 +845,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "mcfrs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -864,7 +864,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "mcfrs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1002,7 +1002,7 @@
 	int retval, error;
 	int dtr, rts;
 
-	if (serial_paranoia_check(info, tty->device, "mcfrs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1159,7 +1159,7 @@
 	struct mcf_serial	*info = (struct mcf_serial *)tty->driver_data;
 	unsigned long		flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "mcfrs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "mcfrs_close"))
 		return;
 	
 	local_irq_save(flags);
@@ -1229,8 +1229,8 @@
 	} else
 #endif
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1264,7 +1264,7 @@
 {
 	struct mcf_serial * info = (struct mcf_serial *)tty->driver_data;
 	
-	if (serial_paranoia_check(info, tty->device, "mcfrs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_hangup"))
 		return;
 	
 	mcfrs_flush_buffer(tty);
@@ -1308,7 +1308,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ASYNC_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
@@ -1416,15 +1416,14 @@
 	struct mcf_serial	*info;
 	int 			retval, line;
 
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= NR_PORTS))
 		return -ENODEV;
 	info = mcfrs_table + line;
-	if (serial_paranoia_check(info, tty->device, "mcfrs_open"))
+	if (serial_paranoia_check(info, tty->name, "mcfrs_open"))
 		return -ENODEV;
 #ifdef SERIAL_DEBUG_OPEN
-	printk("mcfrs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->count);
+	printk("mcfrs_open %s, count = %d\n", tty->name, info->count);
 #endif
 	info->count++;
 	tty->driver_data = info;
@@ -1447,7 +1446,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -1458,7 +1457,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("mcfrs_open ttyS%d successful...\n", info->line);
+	printk("mcfrs_open %s successful...\n", tty->name);
 #endif
 	return 0;
 }
@@ -1786,9 +1785,10 @@
 }
 
 
-static kdev_t mcfrs_console_device(struct console *c)
+static struct tty_driver *mcfrs_console_device(struct console *c, int *index)
 {
-	return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &mcfrs_serial_driver;
 }
 
 
diff -Nru a/drivers/serial/mux.c b/drivers/serial/mux.c
--- a/drivers/serial/mux.c	Sat Jan 11 08:46:01 2003
+++ b/drivers/serial/mux.c	Mon Apr 21 20:58:42 2003
@@ -456,7 +456,7 @@
 
 		card->drv.owner = THIS_MODULE;
 		card->drv.driver_name = "ttyB";
-		card->drv.dev_name = "ttyB%d";
+		card->drv.dev_name = "ttyB";
 		card->drv.major = MUX_MAJOR;
 		card->drv.minor = port_cnt;
 		card->drv.nr = UART_NR;
diff -Nru a/drivers/serial/nb85e_uart.c b/drivers/serial/nb85e_uart.c
--- a/drivers/serial/nb85e_uart.c	Wed Feb 19 12:19:14 2003
+++ b/drivers/serial/nb85e_uart.c	Thu Apr 24 03:30:40 2003
@@ -272,19 +272,16 @@
 	}
 }
 
-static kdev_t nb85e_uart_cons_device (struct console *c)
-{
-        return mk_kdev (TTY_MAJOR, NB85E_UART_MINOR_BASE + c->index);
-}
-
+extern struct uart_driver nb85e_uart_driver;
 static struct console nb85e_uart_cons =
 {
     .name	= "ttyS",
     .write	= nb85e_uart_cons_write,
-    .device	= nb85e_uart_cons_device,
+    .device	= uart_console_device,
     .flags	= CON_PRINTBUFFER,
     .cflag	= NB85E_UART_INIT_CFLAGS,
     .index	= -1,
+    .data	= &nb85e_uart_driver,
 };
 
 void nb85e_uart_cons_init (unsigned chan)
@@ -528,7 +525,7 @@
 	.owner			= THIS_MODULE,
 	.driver_name		= "nb85e_uart",
 #ifdef CONFIG_DEVFS_FS
-	.dev_name		= "tts/%d",
+	.dev_name		= "tts/",
 #else
 	.dev_name		= "ttyS",
 #endif
diff -Nru a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
--- a/drivers/serial/sa1100.c	Sat Apr 12 15:48:43 2003
+++ b/drivers/serial/sa1100.c	Thu Apr 24 03:30:40 2003
@@ -760,11 +760,6 @@
 	UART_PUT_UTCR3(sport, old_utcr3);
 }
 
-static kdev_t sa1100_console_device(struct console *co)
-{
-	return mk_kdev(SERIAL_SA1100_MAJOR, MINOR_START + co->index);
-}
-
 /*
  * If the port was already initialised (eg, by a boot loader),
  * try to determine the current setup.
@@ -827,13 +822,15 @@
 	return uart_set_options(&sport->port, co, baud, parity, bits, flow);
 }
 
+extern struct uart_driver sa1100_reg;
 static struct console sa1100_console = {
 	.name		= "ttySA",
 	.write		= sa1100_console_write,
-	.device		= sa1100_console_device,
+	.device		= uart_console_device,
 	.setup		= sa1100_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= sa1100_reg,
 };
 
 static int __init sa1100_rs_console_init(void)
@@ -852,7 +849,7 @@
 static struct uart_driver sa1100_reg = {
 	.owner			= THIS_MODULE,
 	.driver_name		= "ttySA",
-	.dev_name		= "ttySA%d",
+	.dev_name		= "ttySA",
 	.major			= SERIAL_SA1100_MAJOR,
 	.minor			= MINOR_START,
 	.nr			= NR_PORTS,
diff -Nru a/drivers/serial/serial98.c b/drivers/serial/serial98.c
--- a/drivers/serial/serial98.c	Thu Mar 20 10:43:51 2003
+++ b/drivers/serial/serial98.c	Thu Apr 24 03:30:40 2003
@@ -136,16 +136,17 @@
 #ifdef CONFIG_SERIAL98_CONSOLE
 static void
 serial98_console_write(struct console *co, const char *s, unsigned int count);
-static kdev_t serial98_console_device(struct console *co);
 static int __init serial98_console_setup(struct console *co, char *options);
 
+extern struct uart_driver serial98_reg;
 static struct console serial98_console = {
 	.name		= "ttyS",
 	.write		= serial98_console_write,
-	.device		= serial98_console_device,
+	.device		= uart_console_device,
 	.setup		= serial98_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
+	.data		= &serial98_reg,
 };
 
 #define SERIAL98_CONSOLE	&serial98_console
@@ -156,7 +157,7 @@
 static struct uart_driver serial98_reg = {
 	.owner			= THIS_MODULE,
 	.driver_name		= "serial98",
-	.dev_name		= "ttyS%d",
+	.dev_name		= "ttyS",
 	.major			= TTY_MAJOR,
 	.minor			= 64,
 	.nr			= SERIAL98_NR,
@@ -992,11 +993,6 @@
 
 	/* restore modem status interrupt */
 	outb(ier2, IER2_8251F);
-}
-
-static kdev_t serial98_console_device(struct console *co)
-{
-	return mk_kdev(TTY_MAJOR, 64 + co->index);
 }
 
 static int __init serial98_console_setup(struct console *co, char *options)
diff -Nru a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
--- a/drivers/serial/sunsab.c	Mon Jan 13 23:08:13 2003
+++ b/drivers/serial/sunsab.c	Thu Apr 24 03:30:40 2003
@@ -290,7 +290,7 @@
 	wake_up_interruptible(&up->port.info->delta_msr_wait);
 }
 
-static void sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct uart_sunsab_port *up = dev_id;
 	union sab82532_irq_status status;
@@ -339,6 +339,8 @@
 	}
 
 	spin_unlock_irqrestore(&up->port.lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 /* port->lock is not held.  */
@@ -826,9 +828,9 @@
 	.owner			= THIS_MODULE,
 	.driver_name		= "serial",
 #ifdef CONFIG_DEVFS_FS
-	.dev_name		= "tts/%d",
+	.dev_name		= "tts/",
 #else
-	.dev_name		= "ttyS%d",
+	.dev_name		= "ttyS",
 #endif
 	.major			= TTY_MAJOR,
 };
@@ -861,11 +863,6 @@
 	sunsab_tec_wait(up);
 }
 
-static kdev_t sunsab_console_device(struct console *con)
-{
-	return mk_kdev(sunsab_reg.major, sunsab_reg.minor + con->index);
-}
-
 static int sunsab_console_setup(struct console *con, char *options)
 {
 	struct uart_sunsab_port *up = &sunsab_ports[con->index];
@@ -926,10 +923,11 @@
 static struct console sunsab_console = {
 	.name	=	"ttyS",
 	.write	=	sunsab_console_write,
-	.device	=	sunsab_console_device,
+	.device	=	uart_console_device,
 	.setup	=	sunsab_console_setup,
 	.flags	=	CON_PRINTBUFFER,
 	.index	=	-1,
+	.data	=	&sunsab_reg,
 };
 
 static void __init sunsab_console_init(void)
diff -Nru a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
--- a/drivers/serial/sunsu.c	Sun Mar  2 18:12:49 2003
+++ b/drivers/serial/sunsu.c	Thu Apr 24 03:30:40 2003
@@ -458,7 +458,7 @@
 	wake_up_interruptible(&up->port.info->delta_msr_wait);
 }
 
-static void sunsu_serial_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct uart_sunsu_port *up = dev_id;
 	unsigned long flags;
@@ -476,6 +476,8 @@
 	} while (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT));
 
 	spin_unlock_irqrestore(&up->port.lock, flags);
+
+	return IRQ_HANDLED;
 }
 
 /* Separate interrupt handling path for keyboard/mouse ports.  */
@@ -548,7 +550,7 @@
 	} while (serial_in(up, UART_LSR) & UART_LSR_DR);
 }
 
-static void sunsu_kbd_ms_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sunsu_kbd_ms_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct uart_sunsu_port *up = dev_id;
 
@@ -559,6 +561,8 @@
 			receive_kbd_ms_chars(up, regs,
 					     (status & UART_LSR_BI) != 0);
 	}
+
+	return IRQ_HANDLED;
 }
 
 static unsigned int sunsu_tx_empty(struct uart_port *port)
@@ -1282,9 +1286,9 @@
 	.owner			= THIS_MODULE,
 	.driver_name		= "serial",
 #ifdef CONFIG_DEVFS_FS
-	.dev_name		= "tts/%d",
+	.dev_name		= "tts/",
 #else
-	.dev_name		= "ttyS%d",
+	.dev_name		= "ttyS",
 #endif
 	.major			= TTY_MAJOR,
 };
@@ -1418,11 +1422,6 @@
 	serial_out(up, UART_IER, ier);
 }
 
-static kdev_t sunsu_console_device(struct console *co)
-{
-	return mk_kdev(sunsu_reg.major, sunsu_reg.minor + co->index);
-}
-
 /*
  *	Setup initial baud/bits/parity. We do two things here:
  *	- construct a cflag setting for the first su_open()
@@ -1463,10 +1462,11 @@
 static struct console sunsu_cons = {
 	.name	=	"ttyS",
 	.write	=	sunsu_console_write,
-	.device	=	sunsu_console_device,
+	.device	=	uart_console_device,
 	.setup	=	sunsu_console_setup,
 	.flags	=	CON_PRINTBUFFER,
 	.index	=	-1,
+	.data	=	&sunsu_reg,
 };
 
 /*
diff -Nru a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
--- a/drivers/serial/sunzilog.c	Tue Feb 25 09:45:15 2003
+++ b/drivers/serial/sunzilog.c	Thu Apr 24 03:30:40 2003
@@ -539,7 +539,7 @@
 	ZS_WSYNC(channel);
 }
 
-static void sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct uart_sunzilog_port *up = dev_id;
 
@@ -587,6 +587,8 @@
 
 		up = up->next;
 	}
+
+	return IRQ_HANDLED;
 }
 
 /* A convenient way to quickly get R0 status.  The caller must _not_ hold the
@@ -1029,9 +1031,9 @@
 	.owner		=	THIS_MODULE,
 	.driver_name	=	"ttyS",
 #ifdef CONFIG_DEVFS_FS
-	.dev_name	=	"tts/%d",
+	.dev_name	=	"tts/",
 #else
-	.dev_name	=	"ttyS%d",
+	.dev_name	=	"ttyS",
 #endif
 	.major		=	TTY_MAJOR,
 };
@@ -1350,11 +1352,6 @@
 	spin_unlock_irqrestore(&up->port.lock, flags);
 }
 
-static kdev_t sunzilog_console_device(struct console *con)
-{
-	return mk_kdev(sunzilog_reg.major, sunzilog_reg.minor + con->index);
-}
-
 static int __init sunzilog_console_setup(struct console *con, char *options)
 {
 	struct uart_sunzilog_port *up = &sunzilog_port_table[con->index];
@@ -1400,10 +1397,11 @@
 static struct console sunzilog_console = {
 	.name	=	"ttyS",
 	.write	=	sunzilog_console_write,
-	.device	=	sunzilog_console_device,
+	.device	=	uart_console_device,
 	.setup	=	sunzilog_console_setup,
 	.flags	=	CON_PRINTBUFFER,
 	.index	=	-1,
+	.data   =	&sunzilog_reg,
 };
 
 static int __init sunzilog_console_init(void)
diff -Nru a/drivers/serial/uart00.c b/drivers/serial/uart00.c
--- a/drivers/serial/uart00.c	Sat Apr 12 15:48:43 2003
+++ b/drivers/serial/uart00.c	Thu Apr 24 03:30:40 2003
@@ -576,11 +576,6 @@
 #endif
 }
 
-static kdev_t uart00_console_device(struct console *co)
-{
-	return mk_kdev(SERIAL_UART00_MAJOR, SERIAL_UART00_MINOR + co->index);
-}
-
 static void __init
 uart00_console_get_options(struct uart_port *port, int *baud,
 			   int *parity, int *bits)
@@ -636,13 +631,15 @@
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
+extern struct uart_driver uart00_reg;
 static struct console uart00_console = {
 	.name		= SERIAL_UART00_NAME,
 	.write		= uart00_console_write,
-	.device		= uart00_console_device,
+	.device		= uart_console_device,
 	.setup		= uart00_console_setup,
 	.flags		= CON_PRINTBUFFER,
 	.index		= 0,
+	.data		= &uart00_reg;
 };
 
 static int __init uart00_console_init(void)
diff -Nru a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c
--- a/drivers/sgi/char/sgiserial.c	Fri Feb 14 15:27:26 2003
+++ b/drivers/sgi/char/sgiserial.c	Thu Apr 24 03:30:40 2003
@@ -143,20 +143,20 @@
 static DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int serial_paranoia_check(struct sgi_serial *info,
-					dev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic = KERN_WARNING
-		"Warning: bad magic number for serial struct (%d, %d) in %s\n";
+		"Warning: bad magic number for serial struct %s in %s\n";
 	static const char *badinfo = KERN_WARNING
-		"Warning: null sgi_serial for (%d, %d) in %s\n";
+		"Warning: null sgi_serial for %s in %s\n";
 
 	if (!info) {
-		printk(badinfo, MAJOR(device), MINOR(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, MAJOR(device), MINOR(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -293,7 +293,7 @@
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 	save_flags(flags); cli();
@@ -310,7 +310,7 @@
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1003,7 +1003,7 @@
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf)
@@ -1076,7 +1076,7 @@
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 	int	ret;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -1088,7 +1088,7 @@
 {
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -1097,7 +1097,7 @@
 {
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	cli();
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1113,7 +1113,7 @@
 	struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1167,7 +1167,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty))
@@ -1191,7 +1191,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1377,7 +1377,7 @@
 	struct sgi_serial * info = (struct sgi_serial *) tty->driver_data;
 	int retval;
 
-	if (serial_paranoia_check(info, tty->device, "zs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "zs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1473,7 +1473,7 @@
 	struct sgi_serial * info = (struct sgi_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1539,8 +1539,8 @@
 	ZS_CLEARFIFO(info->zs_channel);
 
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1574,7 +1574,7 @@
 {
 	struct sgi_serial * info = (struct sgi_serial *)tty->driver_data;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 	
 	rs_flush_buffer(tty);
@@ -1618,7 +1618,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ZILOG_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ZILOG_CALLOUT_ACTIVE) &&
@@ -1725,7 +1725,7 @@
 	struct sgi_serial	*info;
 	int 			retval, line;
 
-	line = MINOR(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	/* The zilog lines for the mouse/keyboard must be
 	 * opened using their respective drivers.
 	 */
@@ -1735,11 +1735,10 @@
 	/* Is the kgdb running over this line? */
 	if (info->kgdb_channel)
 		return -ENODEV;
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->count);
 #endif
 	info->count++;
 	tty->driver_data = info;
@@ -1762,7 +1761,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -1781,7 +1780,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttys%d successful...\n", info->line);
+	printk("rs_open %s successful...\n", tty->name);
 #endif
 	return 0;
 }
@@ -2110,9 +2109,10 @@
 	rs_fair_output();
 }
 
-static kdev_t zs_console_device(struct console *con)
+static struct tty_driver *zs_console_device(struct console *con, int *index)
 {
-	return MKDEV(TTY_MAJOR, 64 + con->index);
+	*index = con->index;
+	return &serial_driver;
 }
 
 
diff -Nru a/drivers/tc/zs.c b/drivers/tc/zs.c
--- a/drivers/tc/zs.c	Sun Dec 29 23:18:11 2002
+++ b/drivers/tc/zs.c	Thu Apr 24 03:30:40 2003
@@ -235,20 +235,20 @@
 static DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int serial_paranoia_check(struct dec_serial *info,
-					dev_t device, const char *routine)
+					char *name, const char *routine)
 {
 #ifdef SERIAL_PARANOIA_CHECK
 	static const char *badmagic =
-		"Warning: bad magic number for serial struct (%d, %d) in %s\n";
+		"Warning: bad magic number for serial struct %s in %s\n";
 	static const char *badinfo =
-		"Warning: null mac_serial for (%d, %d) in %s\n";
+		"Warning: null mac_serial for %s in %s\n";
 
 	if (!info) {
-		printk(badinfo, MAJOR(device), MINOR(device), routine);
+		printk(badinfo, name, routine);
 		return 1;
 	}
 	if (info->magic != SERIAL_MAGIC) {
-		printk(badmagic, MAJOR(device), MINOR(device), routine);
+		printk(badmagic, name, routine);
 		return 1;
 	}
 #endif
@@ -631,7 +631,7 @@
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_stop"))
+	if (serial_paranoia_check(info, tty->name, "rs_stop"))
 		return;
 	
 #if 1
@@ -649,7 +649,7 @@
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 	unsigned long flags;
 	
-	if (serial_paranoia_check(info, tty->device, "rs_start"))
+	if (serial_paranoia_check(info, tty->name, "rs_start"))
 		return;
 	
 	save_flags(flags); cli();
@@ -928,7 +928,7 @@
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
 		return;
 
 	if (info->xmit_cnt <= 0 || tty->stopped || info->tx_stopped ||
@@ -948,7 +948,7 @@
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_write"))
+	if (serial_paranoia_check(info, tty->name, "rs_write"))
 		return 0;
 
 	if (!tty || !info->xmit_buf)
@@ -991,7 +991,7 @@
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 	int	ret;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+	if (serial_paranoia_check(info, tty->name, "rs_write_room"))
 		return 0;
 	ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
 	if (ret < 0)
@@ -1003,7 +1003,7 @@
 {
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 			
-	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
 		return 0;
 	return info->xmit_cnt;
 }
@@ -1012,7 +1012,7 @@
 {
 	struct dec_serial *info = (struct dec_serial *)tty->driver_data;
 				
-	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+	if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
 		return;
 	cli();
 	info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1043,7 +1043,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+	if (serial_paranoia_check(info, tty->name, "rs_throttle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1071,7 +1071,7 @@
 	       tty->ldisc.chars_in_buffer(tty));
 #endif
 
-	if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+	if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
 		return;
 	
 	if (I_IXOFF(tty)) {
@@ -1251,7 +1251,7 @@
 	struct dec_serial *info = (struct dec_serial *) tty->driver_data;
 	unsigned long flags;
 
-	if (serial_paranoia_check(info, tty->device, "rs_break"))
+	if (serial_paranoia_check(info, tty->name, "rs_break"))
 		return;
 	if (!info->port)
 		return;
@@ -1274,7 +1274,7 @@
 	if (info->hook)
 		return -ENODEV;
 
-	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
 
 	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1356,7 +1356,7 @@
 	struct dec_serial * info = (struct dec_serial *)tty->driver_data;
 	unsigned long flags;
 
-	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+	if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
 		return;
 	
 	save_flags(flags); cli();
@@ -1424,8 +1424,8 @@
 	}
 
 	shutdown(info);
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
@@ -1452,7 +1452,7 @@
 	struct dec_serial *info = (struct dec_serial *) tty->driver_data;
 	unsigned long orig_jiffies, char_time;
 
-	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+	if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
 		return;
 
 	orig_jiffies = jiffies;
@@ -1485,7 +1485,7 @@
 {
 	struct dec_serial * info = (struct dec_serial *)tty->driver_data;
 
-	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+	if (serial_paranoia_check(info, tty->name, "rs_hangup"))
 		return;
 
 	rs_flush_buffer(tty);
@@ -1527,7 +1527,7 @@
 	 * If this is a callout device, then just make sure the normal
 	 * device isn't being used.
 	 */
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		if (info->flags & ZILOG_NORMAL_ACTIVE)
 			return -EBUSY;
 		if ((info->flags & ZILOG_CALLOUT_ACTIVE) &&
@@ -1639,7 +1639,7 @@
 	struct dec_serial	*info;
 	int 			retval, line;
 
-	line = MINOR(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= zs_channels_found))
 		return -ENODEV;
 	info = zs_soft + line;
@@ -1647,11 +1647,10 @@
 	if (info->hook)
 		return -ENODEV;
 
-	if (serial_paranoia_check(info, tty->device, "rs_open"))
+	if (serial_paranoia_check(info, tty->name, "rs_open"))
 		return -ENODEV;
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
-	       info->count);
+	printk("rs_open %s, count = %d\n", tty->name, info->count);
 #endif
 
 	info->count++;
@@ -1690,7 +1689,7 @@
 	}
 
 	if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) {
-		if (tty->driver.subtype == SERIAL_TYPE_NORMAL)
+		if (tty->driver->subtype == SERIAL_TYPE_NORMAL)
 			*tty->termios = info->normal_termios;
 		else 
 			*tty->termios = info->callout_termios;
@@ -1708,7 +1707,7 @@
 	info->pgrp = current->pgrp;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("rs_open ttyS%02d successful...", info->line);
+	printk("rs_open %s successful...", tty->name);
 #endif
 /* tty->low_latency = 1; */
 	return 0;
@@ -1874,7 +1873,7 @@
 	memset(&serial_driver, 0, sizeof(struct tty_driver));
 	serial_driver.magic = TTY_DRIVER_MAGIC;
 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
-	serial_driver.name = "tts/%d";
+	serial_driver.name = "tts/";
 #else
 	serial_driver.name = "ttyS";
 #endif
@@ -1916,7 +1915,7 @@
 	 */
 	callout_driver = serial_driver;
 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
-	callout_driver.name = "cua/%d";
+	callout_driver.name = "cua/";
 #else
 	callout_driver.name = "cua";
 #endif
@@ -1971,10 +1970,8 @@
 		printk("ttyS%02d at 0x%08x (irq = %d)", info->line, 
 		       info->port, info->irq);
 		printk(" is a Z85C30 SCC\n");
-		tty_register_device(&serial_driver,
-				   serial_driver.minor_start + info->line);
-		tty_register_device(&callout_driver,
-				   callout_driver.minor_start + info->line);
+		tty_register_device(&serial_driver, info->line);
+		tty_register_device(&callout_driver, info->line);
 
 	}
 
@@ -2124,9 +2121,10 @@
 	}
 }
 
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
 {
-	return MKDEV(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return &serial_driver;
 }
 
 /*
diff -Nru a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c
--- a/drivers/usb/class/audio.c	Tue Apr  8 16:28:30 2003
+++ b/drivers/usb/class/audio.c	Thu Apr 24 03:35:29 2003
@@ -185,7 +185,6 @@
 #include <linux/soundcard.h>
 #include <linux/list.h>
 #include <linux/vmalloc.h>
-#include <linux/wrapper.h>
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/bitops.h>
@@ -450,7 +449,7 @@
 	for(nr = 0; nr < NRSGBUF; nr++) {
 		if (!(p = db->sgbuf[nr]))
 			continue;
-		mem_map_unreserve(virt_to_page(p));
+		ClearPageReserved(virt_to_page(p));
 		free_page((unsigned long)p);
 		db->sgbuf[nr] = NULL;
 	}
@@ -492,7 +491,7 @@
 			if (!p)
 				return -ENOMEM;
 			db->sgbuf[nr] = p;
-			mem_map_reserve(virt_to_page(p));
+			SetPageReserved(virt_to_page(p));
 		}
 		memset(db->sgbuf[nr], AFMT_ISUNSIGNED(db->format) ? 0x80 : 0, PAGE_SIZE);
 		if ((nr << PAGE_SHIFT) >= db->dmasize)
diff -Nru a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c
--- a/drivers/usb/class/bluetty.c	Thu Mar 13 10:36:02 2003
+++ b/drivers/usb/class/bluetty.c	Mon Apr 21 20:58:42 2003
@@ -276,9 +276,9 @@
 }
 
 
-static inline struct usb_bluetooth *get_bluetooth_by_minor (int minor)
+static inline struct usb_bluetooth *get_bluetooth_by_index (int index)
 {
-	return bluetooth_table[minor];
+	return bluetooth_table[index];
 }
 
 
@@ -357,7 +357,7 @@
 	tty->driver_data = NULL;
 
 	/* get the bluetooth object associated with this tty pointer */
-	bluetooth = get_bluetooth_by_minor (minor(tty->device));
+	bluetooth = get_bluetooth_by_index (tty->index);
 
 	if (bluetooth_paranoia_check (bluetooth, __FUNCTION__)) {
 		return -ENODEV;
@@ -1298,7 +1298,7 @@
 	.magic =		TTY_DRIVER_MAGIC,
 	.owner =		THIS_MODULE,
 	.driver_name =		"usb-bluetooth",
-	.name =			"usb/ttub/%d",
+	.name =			"usb/ttub/",
 	.major =		BLUETOOTH_TTY_MAJOR,
 	.minor_start =		0,
 	.num =			BLUETOOTH_TTY_MINORS,
diff -Nru a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
--- a/drivers/usb/class/cdc-acm.c	Mon Mar 24 05:50:18 2003
+++ b/drivers/usb/class/cdc-acm.c	Thu Apr 24 16:01:58 2003
@@ -313,7 +313,7 @@
 
 static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 {
-	struct acm *acm = acm_table[minor(tty->device)];
+	struct acm *acm = acm_table[tty->index];
 
 	if (!acm || !acm->dev) return -EINVAL;
 
@@ -432,43 +432,47 @@
 		dbg("send break failed");
 }
 
-static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
+static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file)
 {
 	struct acm *acm = tty->driver_data;
-	unsigned int mask, newctrl;
 
-	if (!ACM_READY(acm)) return -EINVAL;
+	if (!ACM_READY(acm))
+		return -EINVAL;
+
+	return (acm->ctrlout & ACM_CTRL_DTR ? TIOCM_DTR : 0) |
+	       (acm->ctrlout & ACM_CTRL_RTS ? TIOCM_RTS : 0) |
+	       (acm->ctrlin  & ACM_CTRL_DSR ? TIOCM_DSR : 0) |
+	       (acm->ctrlin  & ACM_CTRL_RI  ? TIOCM_RI  : 0) |
+	       (acm->ctrlin  & ACM_CTRL_DCD ? TIOCM_CD  : 0) |
+	       TIOCM_CTS;
+}
 
-	switch (cmd) {
+static int acm_tty_tiocmset(struct tty_struct *tty, struct file *file,
+			    unsigned int set, unsigned int clear)
+{
+	struct acm *acm = tty->driver_data;
+	unsigned int newctrl;
 
-		case TIOCMGET:
+	if (!ACM_READY(acm))
+		return -EINVAL;
 
-			return put_user((acm->ctrlout & ACM_CTRL_DTR ? TIOCM_DTR : 0) |
-				(acm->ctrlout & ACM_CTRL_RTS ? TIOCM_RTS : 0) |
-				(acm->ctrlin  & ACM_CTRL_DSR ? TIOCM_DSR : 0) |
-				(acm->ctrlin  & ACM_CTRL_RI  ? TIOCM_RI  : 0) |
-				(acm->ctrlin  & ACM_CTRL_DCD ? TIOCM_CD  : 0) |
-				 TIOCM_CTS, (unsigned long *) arg);
-
-		case TIOCMSET:
-		case TIOCMBIS:
-		case TIOCMBIC:
-
-			if (get_user(mask, (unsigned long *) arg))
-				return -EFAULT;
-
-			newctrl = acm->ctrlout;
-			mask = (mask & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (mask & TIOCM_RTS ? ACM_CTRL_RTS : 0);
-
-			switch (cmd) {
-				case TIOCMSET: newctrl  =  mask; break;
-				case TIOCMBIS: newctrl |=  mask; break;
-				case TIOCMBIC: newctrl &= ~mask; break;
-			}
+	newctrl = acm->ctrlout;
+	set = (set & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (set & TIOCM_RTS ? ACM_CTRL_RTS : 0);
+	clear = (clear & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (clear & TIOCM_RTS ? ACM_CTRL_RTS : 0);
 
-			if (acm->ctrlout == newctrl) return 0;
-			return acm_set_control(acm, acm->ctrlout = newctrl);
-	}
+	newctrl = (newctrl & ~clear) | set;
+
+	if (acm->ctrlout == newctrl)
+		return 0;
+	return acm_set_control(acm, acm->ctrlout = newctrl);
+}
+
+static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg)
+{
+	struct acm *acm = tty->driver_data;
+
+	if (!ACM_READY(acm))
+		return -EINVAL;
 
 	return -ENOIOCTLCMD;
 }
@@ -727,7 +731,7 @@
 	.magic =		TTY_DRIVER_MAGIC,
 	.owner =		THIS_MODULE,
 	.driver_name =		"acm",
-	.name =			"usb/acm/%d",
+	.name =			"usb/acm/",
 	.major =		ACM_TTY_MAJOR,
 	.minor_start =		0,
 	.num =			ACM_TTY_MINORS,
@@ -750,7 +754,9 @@
 	.unthrottle =		acm_tty_unthrottle,
 	.chars_in_buffer =	acm_tty_chars_in_buffer,
 	.break_ctl =		acm_tty_break_ctl,
-	.set_termios =		acm_tty_set_termios
+	.set_termios =		acm_tty_set_termios,
+	.tiocmget =		acm_tty_tiocmget,
+	.tiocmset =		acm_tty_tiocmset,
 };
 
 /*
diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c
--- a/drivers/usb/class/usb-midi.c	Sat Mar 29 19:46:59 2003
+++ b/drivers/usb/class/usb-midi.c	Thu Apr 24 03:35:31 2003
@@ -33,7 +33,6 @@
 #include <linux/sched.h>
 #include <linux/list.h>
 #include <linux/slab.h>
-#include <linux/wrapper.h>
 #include <linux/usb.h>
 #include <linux/poll.h>
 #include <linux/sound.h>
@@ -820,7 +819,7 @@
 	struct list_head      *devs, *mdevs;
 	struct usb_midi_state *s;
 	struct usb_mididev    *m;
-	int flags;
+	unsigned long flags;
 	int succeed = 0;
 
 #if 0
diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
--- a/drivers/usb/class/usblp.c	Sat Mar 22 09:02:37 2003
+++ b/drivers/usb/class/usblp.c	Sat Apr 19 02:08:38 2003
@@ -130,7 +130,6 @@
 
 struct usblp {
 	struct usb_device 	*dev;			/* USB device */
-	devfs_handle_t		devfs;			/* devfs device */
 	struct semaphore	sem;			/* locks this struct, especially "dev" */
 	char			*writebuf;		/* write transfer_buffer */
 	char			*readbuf;		/* read transfer_buffer */
@@ -163,7 +162,6 @@
 
 	dbg("usblp=0x%p", usblp);
 	dbg("dev=0x%p", usblp->dev);
-	dbg("devfs=0x%p", usblp->devfs);
 	dbg("buf=0x%p", usblp->buf);
 	dbg("readcount=%d", usblp->readcount);
 	dbg("ifnum=%d", usblp->ifnum);
@@ -382,7 +380,7 @@
 
 static void usblp_cleanup (struct usblp *usblp)
 {
-	devfs_unregister (usblp->devfs);
+	devfs_remove ("usb/lp%d", usblp->minor);
 	usb_deregister_dev (1, usblp->minor);
 	info("usblp%d: removed", usblp->minor);
 
@@ -908,8 +906,7 @@
 
 	/* If we have devfs, create with perms=660. */
 	sprintf(name, "usb/lp%d", usblp->minor);
-	usblp->devfs = devfs_register(NULL, name,
-				      DEVFS_FL_DEFAULT, USB_MAJOR,
+	devfs_register(NULL, name, 0, USB_MAJOR,
 				      usblp->minor,
 				      S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP |
 				      S_IWGRP, &usblp_fops, NULL);
diff -Nru a/drivers/usb/core/file.c b/drivers/usb/core/file.c
--- a/drivers/usb/core/file.c	Sat Mar 22 09:02:37 2003
+++ b/drivers/usb/core/file.c	Fri Apr 18 11:15:45 2003
@@ -28,8 +28,6 @@
 #endif
 #include <linux/usb.h>
 
-static devfs_handle_t usb_devfs_handle;	/* /dev/usb dir. */
-
 #define MAX_USB_MINORS	256
 static struct file_operations *usb_minors[MAX_USB_MINORS];
 static spinlock_t minor_lock = SPIN_LOCK_UNLOCKED;
@@ -75,14 +73,13 @@
 		return -EBUSY;
 	}
 
-	usb_devfs_handle = devfs_mk_dir("usb");
-
+	devfs_mk_dir("usb");
 	return 0;
 }
 
 void usb_major_cleanup(void)
 {
-	devfs_unregister(usb_devfs_handle);
+	devfs_remove("usb");
 	unregister_chrdev(USB_MAJOR, "usb");
 }
 
diff -Nru a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
--- a/drivers/usb/core/hcd-pci.c	Tue Jan  7 06:49:31 2003
+++ b/drivers/usb/core/hcd-pci.c	Mon Apr 21 07:45:46 2003
@@ -17,11 +17,6 @@
  */
 
 #include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <asm/io.h>
-#include <asm/irq.h>
 
 #ifdef CONFIG_USB_DEBUG
 	#define DEBUG
@@ -29,6 +24,11 @@
 	#undef DEBUG
 #endif
 
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/irq.h>
 #include <linux/usb.h>
 #include "hcd.h"
 
@@ -214,7 +214,7 @@
 	hub = hcd->self.root_hub;
 	hcd->state = USB_STATE_QUIESCING;
 
-	dev_dbg (*hcd->controller, "roothub graceful disconnect\n");
+	dev_dbg (hcd->controller, "roothub graceful disconnect\n");
 	usb_disconnect (&hub);
 
 	hcd->driver->stop (hcd);
@@ -326,7 +326,7 @@
 
 	retval = -EBUSY;
 	if (hcd->state != USB_STATE_SUSPENDED) {
-		dev_dbg (*hcd->controller, "can't resume, not suspended!\n");
+		dev_dbg (hcd->controller, "can't resume, not suspended!\n");
 		goto done;
 	}
 	hcd->state = USB_STATE_RESUMING;
@@ -336,7 +336,7 @@
 
 	retval = hcd->driver->resume (hcd);
 	if (!HCD_IS_RUNNING (hcd->state)) {
-		dev_dbg (*hcd->controller, "resume fail, retval %d\n", retval);
+		dev_dbg (hcd->controller, "resume fail, retval %d\n", retval);
 		usb_hc_died (hcd);
 // FIXME:  recover, reset etc.
 	} else {
diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
--- a/drivers/usb/core/hcd.c	Mon Apr 14 14:01:44 2003
+++ b/drivers/usb/core/hcd.c	Mon Apr 21 13:41:12 2003
@@ -961,8 +961,8 @@
 	spin_lock_irqsave (&hcd_data_lock, flags);
 	list_del_init (&urb->urb_list);
 	dev = urb->dev;
-	usb_put_dev (dev);
 	spin_unlock_irqrestore (&hcd_data_lock, flags);
+	usb_put_dev (dev);
 }
 
 
@@ -1436,17 +1436,18 @@
  * to handle interrupts.  The PCI glue layer does so automatically; only
  * bus glue for non-PCI system busses will need to use this.
  */
-void usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r)
+irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r)
 {
 	struct usb_hcd		*hcd = __hcd;
 	int			start = hcd->state;
 
 	if (unlikely (hcd->state == USB_STATE_HALT))	/* irq sharing? */
-		return;
+		return IRQ_NONE;
 
 	hcd->driver->irq (hcd, r);
 	if (hcd->state != start && hcd->state == USB_STATE_HALT)
 		usb_hc_died (hcd);
+	return IRQ_HANDLED;
 }
 EXPORT_SYMBOL (usb_hcd_irq);
 
diff -Nru a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
--- a/drivers/usb/core/hcd.h	Mon Apr 14 13:59:07 2003
+++ b/drivers/usb/core/hcd.h	Sun Apr 20 14:14:29 2003
@@ -239,7 +239,7 @@
 
 /* generic bus glue, needed for host controllers that don't use PCI */
 extern struct usb_operations usb_hcd_operations;
-extern void usb_hcd_irq (int irq, void *__hcd, struct pt_regs *r);
+extern irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs *r);
 extern void usb_hc_died (struct usb_hcd *hcd);
 
 /* -------------------------------------------------------------------------- */
diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c	Thu Apr 17 07:40:50 2003
+++ b/drivers/usb/core/usb.c	Mon Apr 21 09:54:44 2003
@@ -791,14 +791,22 @@
 void usb_disconnect(struct usb_device **pdev)
 {
 	struct usb_device	*dev = *pdev;
-	struct usb_bus		*bus = dev->bus;
-	struct usb_operations	*ops = bus->op;
+	struct usb_bus		*bus;
+	struct usb_operations	*ops;
 	int			i;
 
 	might_sleep ();
 
-	if (!dev)
+	if (!dev) {
+		pr_debug ("%s nodev\n", __FUNCTION__);
 		return;
+	}
+	bus = dev->bus;
+	if (!bus) {
+		pr_debug ("%s nobus\n", __FUNCTION__);
+		return;
+	}
+	ops = bus->op;
 
 	*pdev = NULL;
 
diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c
--- a/drivers/usb/image/scanner.c	Sat Apr 12 04:48:13 2003
+++ b/drivers/usb/image/scanner.c	Fri Apr 18 11:54:05 2003
@@ -397,6 +397,7 @@
  */
 
 
+#include <linux/devfs_fs_kernel.h>
 #include <asm/byteorder.h>
 
 /* 
@@ -843,7 +844,7 @@
 	kfree(scn->obuf);
 
 	dbg("%s: De-allocating minor:%d", __FUNCTION__, scn->scn_minor);
-	devfs_unregister(scn->devfs);
+	devfs_remove("usb/scanner%d", scn->scn_minor - SCN_BASE_MNR);
 	usb_deregister_dev(1, scn->scn_minor);
 	usb_free_urb(scn->scn_irq);
 	usb_put_dev(scn->scn_dev);
@@ -1105,13 +1106,11 @@
 
 	sprintf(name, "usb/scanner%d", scn->scn_minor - SCN_BASE_MNR);
 	
-	scn->devfs = devfs_register(NULL, name,
+	devfs_register(NULL, name,
 				    DEVFS_FL_DEFAULT, USB_MAJOR,
 				    scn->scn_minor,
 				    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP |
 				    S_IWGRP | S_IROTH | S_IWOTH, &usb_scanner_fops, NULL);
-	if (scn->devfs == NULL)
-		dbg("scanner%d: device node registration failed", scn_minor);
 
 	info ("USB scanner device (0x%04x/0x%04x) now attached to %s",
 	      dev->descriptor.idVendor, dev->descriptor.idProduct, name);
diff -Nru a/drivers/usb/image/scanner.h b/drivers/usb/image/scanner.h
--- a/drivers/usb/image/scanner.h	Sat Mar 22 09:02:37 2003
+++ b/drivers/usb/image/scanner.h	Fri Apr 18 11:53:22 2003
@@ -40,7 +40,6 @@
 #include <linux/ioctl.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
-#include <linux/devfs_fs_kernel.h>
 
 // #define DEBUG
 
@@ -336,7 +335,6 @@
 
 struct scn_usb_data {
 	struct usb_device *scn_dev;
-	devfs_handle_t devfs;	/* devfs device */
 	struct urb *scn_irq;
 	unsigned int ifnum;	/* Interface number of the USB device */
 	int scn_minor;		/* Scanner minor - used in disconnect() */
diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.c	Sat Mar 22 09:04:18 2003
+++ b/drivers/usb/input/hiddev.c	Thu Apr 24 13:24:53 2003
@@ -35,6 +35,7 @@
 #include <linux/usb.h>
 #include "hid.h"
 #include <linux/hiddev.h>
+#include <linux/devfs_fs_kernel.h>
 
 #ifdef CONFIG_USB_DYNAMIC_MINORS
 #define HIDDEV_MINOR_BASE	0
@@ -50,7 +51,6 @@
 	int open;
 	int minor;
 	wait_queue_head_t wait;
-	devfs_handle_t devfs;
 	struct hid_device *hid;
 	struct hiddev_list *list;
 };
@@ -66,7 +66,6 @@
 };
 
 static struct hiddev *hiddev_table[HIDDEV_MINORS];
-static devfs_handle_t hiddev_devfs_handle;
 
 /* forward reference to make our lives easier */
 extern struct usb_driver hiddev_driver;
@@ -229,7 +228,7 @@
  */
 static void hiddev_cleanup(struct hiddev *hiddev)
 {
-	devfs_unregister(hiddev->devfs);
+	devfs_remove("usb/hid/hiddev%d", hiddev->minor);
 	usb_deregister_dev(1, hiddev->minor);
 	hiddev_table[hiddev->minor] = NULL;
 	kfree(hiddev);
@@ -716,8 +715,8 @@
 	hiddev->exist = 1;
 
 	sprintf(devfs_name, "usb/hid/hiddev%d", minor);
-	hiddev->devfs = devfs_register(NULL, devfs_name,
-		DEVFS_FL_DEFAULT, USB_MAJOR, minor + HIDDEV_MINOR_BASE,
+	devfs_register(NULL, devfs_name, 0,
+		USB_MAJOR, minor + HIDDEV_MINOR_BASE,
 		S_IFCHR | S_IRUGO | S_IWUSR, &hiddev_fops, NULL);
 	hid->minor = minor;
 	hid->hiddev = hiddev;
@@ -774,7 +773,7 @@
 
 int __init hiddev_init(void)
 {
-	hiddev_devfs_handle = devfs_mk_dir("usb/hid");
+	devfs_mk_dir("usb/hid");
 	usb_register(&hiddev_driver);
 	return 0;
 }
diff -Nru a/drivers/usb/media/ibmcam.c b/drivers/usb/media/ibmcam.c
--- a/drivers/usb/media/ibmcam.c	Fri Dec 27 05:20:06 2002
+++ b/drivers/usb/media/ibmcam.c	Thu Apr 24 03:35:33 2003
@@ -28,7 +28,6 @@
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/wrapper.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
diff -Nru a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c
--- a/drivers/usb/media/ov511.c	Tue Mar 25 15:16:15 2003
+++ b/drivers/usb/media/ov511.c	Thu Apr 24 03:35:37 2003
@@ -47,7 +47,6 @@
 #include <asm/io.h>
 #include <asm/semaphore.h>
 #include <asm/processor.h>
-#include <linux/wrapper.h>
 #include <linux/mm.h>
 
 #if defined (__i386__)
@@ -357,7 +356,7 @@
 	memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 	adr = (unsigned long) mem;
 	while (size > 0) {
-		mem_map_reserve(vmalloc_to_page((void *)adr));
+		SetPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
@@ -375,7 +374,7 @@
 
 	adr = (unsigned long) mem;
 	while ((long) size > 0) {
-		mem_map_unreserve(vmalloc_to_page((void *)adr));
+		ClearPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
diff -Nru a/drivers/usb/media/pwc-if.c b/drivers/usb/media/pwc-if.c
--- a/drivers/usb/media/pwc-if.c	Thu Mar 13 10:36:02 2003
+++ b/drivers/usb/media/pwc-if.c	Thu Apr 24 03:35:40 2003
@@ -55,7 +55,6 @@
 #include <linux/poll.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <linux/wrapper.h>
 #include <asm/io.h>
 
 #include "pwc.h"
@@ -211,7 +210,7 @@
 	        adr=(unsigned long) mem;
 		while (size > 0) 
                 {
-			mem_map_reserve(vmalloc_to_page((void *)adr));
+			SetPageReserved(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
@@ -228,7 +227,7 @@
 	        adr=(unsigned long) mem;
 		while ((long) size > 0) 
                 {
-			mem_map_unreserve(vmalloc_to_page((void *)adr));
+			ClearPageReserved(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
diff -Nru a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c
--- a/drivers/usb/media/se401.c	Thu Mar 13 10:36:02 2003
+++ b/drivers/usb/media/se401.c	Thu Apr 24 03:35:42 2003
@@ -38,7 +38,6 @@
 #include <linux/usb.h>
 #include <asm/io.h>
 #include <asm/semaphore.h>
-#include <linux/wrapper.h>
 #include <linux/mm.h>
 
 #include "se401.h"
@@ -99,7 +98,7 @@
 	memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 	adr = (unsigned long) mem;
 	while (size > 0) {
-		mem_map_reserve(vmalloc_to_page((void *)adr));
+		SetPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
@@ -116,7 +115,7 @@
 
 	adr = (unsigned long) mem;
 	while ((long) size > 0) {
-		mem_map_unreserve(vmalloc_to_page((void *)adr));
+		ClearPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
diff -Nru a/drivers/usb/media/stv680.c b/drivers/usb/media/stv680.c
--- a/drivers/usb/media/stv680.c	Tue Mar 25 15:16:15 2003
+++ b/drivers/usb/media/stv680.c	Thu Apr 24 03:35:44 2003
@@ -66,7 +66,6 @@
 #include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/pagemap.h>
-#include <linux/wrapper.h>
 #include <linux/smp_lock.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
@@ -151,7 +150,7 @@
 	memset (mem, 0, size);	/* Clear the ram out, no junk to the user */
 	adr = (unsigned long) mem;
 	while (size > 0) {
-		mem_map_reserve(vmalloc_to_page((void *)adr));
+		SetPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
@@ -167,7 +166,7 @@
 
 	adr = (unsigned long) mem;
 	while ((long) size > 0) {
-		mem_map_unreserve(vmalloc_to_page((void *)adr));
+		ClearPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
diff -Nru a/drivers/usb/media/ultracam.c b/drivers/usb/media/ultracam.c
--- a/drivers/usb/media/ultracam.c	Fri Dec 27 05:20:06 2002
+++ b/drivers/usb/media/ultracam.c	Thu Apr 24 03:35:46 2003
@@ -7,7 +7,6 @@
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/wrapper.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
diff -Nru a/drivers/usb/media/usbvideo.c b/drivers/usb/media/usbvideo.c
--- a/drivers/usb/media/usbvideo.c	Thu Feb  6 06:49:36 2003
+++ b/drivers/usb/media/usbvideo.c	Thu Apr 24 03:35:48 2003
@@ -22,7 +22,6 @@
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
 #include <linux/vmalloc.h>
-#include <linux/wrapper.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
@@ -103,7 +102,7 @@
 	memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 	adr = (unsigned long) mem;
 	while (size > 0) {
-		mem_map_reserve(vmalloc_to_page((void *)adr));
+		SetPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
@@ -120,7 +119,7 @@
 
 	adr = (unsigned long) mem;
 	while ((long) size > 0) {
-		mem_map_unreserve(vmalloc_to_page((void *)adr));
+		ClearPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
diff -Nru a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c
--- a/drivers/usb/media/vicam.c	Thu Mar 13 10:36:02 2003
+++ b/drivers/usb/media/vicam.c	Thu Apr 24 03:35:50 2003
@@ -32,7 +32,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/wrapper.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/videodev.h>
@@ -379,7 +378,7 @@
 	memset(mem, 0, size); /* Clear the ram out, no junk to the user */
 	adr = (unsigned long) mem;
 	while (size > 0) {
-		mem_map_reserve(vmalloc_to_page((void *)adr));
+		SetPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
@@ -396,7 +395,7 @@
 
 	adr = (unsigned long) mem;
 	while ((long) size > 0) {
-		mem_map_unreserve(vmalloc_to_page((void *)adr));
+		ClearPageReserved(vmalloc_to_page((void *)adr));
 		adr += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}
diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
--- a/drivers/usb/misc/auerswald.c	Sat Mar 22 09:02:37 2003
+++ b/drivers/usb/misc/auerswald.c	Fri Apr 18 11:50:24 2003
@@ -242,7 +242,6 @@
 	struct semaphore 	mutex;         	    /* protection in user context */
 	char 			name[20];	    /* name of the /dev/usb entry */
 	unsigned int		dtindex;	    /* index in the device table */
-	devfs_handle_t 		devfs;	 	    /* devfs device node */
 	struct usb_device *	usbdev;      	    /* USB device handle */
 	int			open_count;	    /* count the number of open character channels */
         char 			dev_desc[AUSI_DLEN];/* for storing a textual description */
@@ -1972,7 +1971,7 @@
 	up (&dev_table_mutex);
 
 	/* initialize the devfs node for this device and register it */
-	cp->devfs = devfs_register(NULL, cp->name, 0, USB_MAJOR,
+	devfs_register(NULL, cp->name, 0, USB_MAJOR,
 				    AUER_MINOR_BASE + dtindex,
 				    S_IFCHR | S_IRUGO | S_IWUGO,
 				    &auerswald_fops, NULL);
@@ -2092,7 +2091,7 @@
 
 	/* remove our devfs node */
 	/* Nobody can see this device any more */
-	devfs_unregister (cp->devfs);
+	devfs_remove(cp->name);
 
 	/* give back our USB minor number */
 	usb_deregister_dev (1, cp->dtindex);
diff -Nru a/drivers/usb/misc/brlvger.c b/drivers/usb/misc/brlvger.c
--- a/drivers/usb/misc/brlvger.c	Sat Mar 22 09:02:37 2003
+++ b/drivers/usb/misc/brlvger.c	Fri Apr 18 11:52:06 2003
@@ -156,7 +156,6 @@
 	struct usb_device   *dev; /* USB device handle */
 	struct usb_endpoint_descriptor *in_interrupt;
 	struct urb *intr_urb;
-	devfs_handle_t devfs;
 
 	int subminor; /* which minor dev #? */
 
@@ -374,16 +373,11 @@
 	dbg("Display length: %d", priv->plength);
 
 	sprintf(devfs_name, "usb/brlvger%d", priv->subminor);
-	priv->devfs = devfs_register(NULL, devfs_name,
+	devfs_register(NULL, devfs_name,
 				     DEVFS_FL_DEFAULT, USB_MAJOR,
 				     BRLVGER_MINOR+priv->subminor,
 				     S_IFCHR |S_IRUSR|S_IWUSR |S_IRGRP|S_IWGRP,
 				     &brlvger_fops, NULL);
-	if (!priv->devfs) {
-#ifdef CONFIG_DEVFS_FS
-		err("devfs node registration failed");
-#endif
-	}
 
 	display_table[i] = priv;
 
@@ -420,7 +414,7 @@
 	if(priv){
 		info("Display %d disconnecting", priv->subminor);
 
-		devfs_unregister(priv->devfs);
+		devfs_remove("usb/brlvger%d", priv->subminor);
 		usb_deregister_dev(1, priv->subminor);
 
 		down(&disconnect_sem);
diff -Nru a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
--- a/drivers/usb/misc/rio500.c	Sat Mar 22 09:02:37 2003
+++ b/drivers/usb/misc/rio500.c	Fri Apr 18 11:51:05 2003
@@ -65,7 +65,6 @@
 
 struct rio_usb_data {
         struct usb_device *rio_dev;     /* init: probe_rio */
-        devfs_handle_t devfs;           /* devfs device */
         unsigned int ifnum;             /* Interface number of the USB device */
         int isopen;                     /* nz if open */
         int present;                    /* Device is present on the bus */
@@ -476,13 +475,11 @@
 	}
 	dbg("probe_rio: ibuf address:%p", rio->ibuf);
 
-	rio->devfs = devfs_register(NULL, "usb/rio500",
+	devfs_register(NULL, "usb/rio500",
 				    DEVFS_FL_DEFAULT, USB_MAJOR,
 				    RIO_MINOR,
 				    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP |
 				    S_IWGRP, &usb_rio_fops, NULL);
-	if (rio->devfs == NULL)
-		dbg("probe_rio: device node registration failed");
 
 	init_MUTEX(&(rio->lock));
 
@@ -496,7 +493,7 @@
 
 	usb_set_intfdata (intf, NULL);
 	if (rio) {
-		devfs_unregister(rio->devfs);
+		devfs_remove("usb/rio500");
 		usb_deregister_dev(1, rio->minor);
 
 		down(&(rio->lock));
diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c
--- a/drivers/usb/misc/speedtch.c	Sat Apr 12 04:35:57 2003
+++ b/drivers/usb/misc/speedtch.c	Wed Apr 23 09:51:29 2003
@@ -20,7 +20,19 @@
  ******************************************************************************/
 
 /*
- *  Written by Johan Verrept (Johan.Verrept@advalvas.be)
+ *  Written by Johan Verrept, maintained by Duncan Sands (duncan.sands@wanadoo.fr)
+ *
+ *  1.6:	- No longer opens a connection if the firmware is not loaded
+ *  		- Added support for the speedtouch 330
+ *  		- Removed the limit on the number of devices
+ *  		- Module now autoloads on device plugin
+ *  		- Merged relevant parts of sarlib
+ *  		- Replaced the kernel thread with a tasklet
+ *  		- New packet transmission code
+ *  		- Changed proc file contents
+ *  		- Fixed all known SMP races
+ *  		- Many fixes and cleanups
+ *  		- Various fixes by Oliver Neukum (oliver@neukum.name)
  *
  *  1.5A:	- Version for inclusion in 2.5 series kernel
  *		- Modifications by Richard Purdie (rpurdie@rpsys.net)
@@ -28,6 +40,7 @@
  *		udsl_usb_send_data_context->urb to a pointer and adding code
  *		to alloc and free it
  *		- remove_wait_queue() added to udsl_atm_processqueue_thread()
+ *		- Duncan Sands (duncan.sands@wanadoo.fr) is the new maintainer
  *
  *  1.5:	- fixed memory leak when atmsar_decode_aal5 returned NULL.
  *		(reported by stephen.robinson@zen.co.uk)
@@ -77,9 +90,9 @@
 #define PACKETDEBUG(arg...)
 #endif
 
-#define DRIVER_AUTHOR	"Johan Verrept, Johan.Verrept@advalvas.be"
-#define DRIVER_DESC	"Driver for the Alcatel SpeedTouch USB ADSL modem"
-#define DRIVER_VERSION	"1.5A"
+#define DRIVER_AUTHOR	"Johan Verrept, Duncan Sands <duncan.sands@wanadoo.fr>"
+#define DRIVER_DESC	"Alcatel SpeedTouch USB driver"
+#define DRIVER_VERSION	"1.6"
 
 #define SPEEDTOUCH_VENDORID		0x06b9
 #define SPEEDTOUCH_PRODUCTID		0x4061
@@ -393,11 +406,12 @@
 **  encode  **
 *************/
 
+static const unsigned char zeros[ATM_CELL_PAYLOAD];
+
 static void udsl_groom_skb (struct atm_vcc *vcc, struct sk_buff *skb)
 {
 	struct udsl_control *ctrl = UDSL_SKB (skb);
-	unsigned int i, zero_padding;
-	unsigned char zero = 0;
+	unsigned int zero_padding;
 	u32 crc;
 
 	ctrl->atm_data.vcc = vcc;
@@ -423,8 +437,7 @@
 	ctrl->aal5_trailer [3] = skb->len;
 
 	crc = crc32_be (~0, skb->data, skb->len);
-	for (i = 0; i < zero_padding; i++)
-		crc = crc32_be (crc, &zero, 1);
+	crc = crc32_be (crc, zeros, zero_padding);
 	crc = crc32_be (crc, ctrl->aal5_trailer, 4);
 	crc = ~crc;
 
@@ -566,8 +579,7 @@
 						atmsar_vcc->vcc->push (atmsar_vcc->vcc, new);
 					} else {
 						dbg
-						    ("dropping incoming packet : rx_inuse = %d, vcc->sk->rcvbuf = %d, skb->true_size = %d",
-						     atomic_read (&atmsar_vcc->vcc->rx_inuse),
+						    ("dropping incoming packet : vcc->sk->rcvbuf = %d, skb->true_size = %d",
 						     atmsar_vcc->vcc->sk->rcvbuf, new->truesize);
 						dev_kfree_skb (new);
 					}
diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
--- a/drivers/usb/net/kaweth.c	Thu Feb  6 12:06:21 2003
+++ b/drivers/usb/net/kaweth.c	Mon Apr 21 01:26:37 2003
@@ -744,7 +744,7 @@
 		}
 	}
 
-	private_header = __skb_push(skb, 2);
+	private_header = (u16 *)__skb_push(skb, 2);
 	*private_header = cpu_to_le16(skb->len-2);
 	kaweth->tx_skb = skb;
 
diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c	Wed Apr  2 02:24:08 2003
+++ b/drivers/usb/net/usbnet.c	Mon Apr 21 01:37:16 2003
@@ -314,8 +314,12 @@
 			: (in_interrupt () ? "in_interrupt" : "can sleep"))
 
 #ifdef DEBUG
-#define devdbg(usbnet, fmt, arg...) \
-	printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net.name, ## arg)
+#define devdbg(usbnet, fmt, arg...)				\
+	do {							\
+		printk(KERN_DEBUG "%s:", (usbnet)->net.name);	\
+		printk(fmt, ## arg);				\
+		printk("\n");					\
+	} while (0)
 #else
 #define devdbg(usbnet, fmt, arg...) do {} while(0)
 #endif
diff -Nru a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
--- a/drivers/usb/serial/belkin_sa.c	Thu Mar 13 10:36:02 2003
+++ b/drivers/usb/serial/belkin_sa.c	Wed Apr 23 10:33:12 2003
@@ -101,6 +101,8 @@
 static void belkin_sa_set_termios	(struct usb_serial_port *port, struct termios * old);
 static int  belkin_sa_ioctl		(struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
 static void belkin_sa_break_ctl		(struct usb_serial_port *port, int break_state );
+static int  belkin_sa_tiocmget		(struct usb_serial_port *port, struct file *file);
+static int  belkin_sa_tiocmset		(struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
 
 
 static struct usb_device_id id_table_combined [] = {
@@ -138,6 +140,8 @@
 	.ioctl =		belkin_sa_ioctl,
 	.set_termios =		belkin_sa_set_termios,
 	.break_ctl =		belkin_sa_break_ctl,
+	.tiocmget =		belkin_sa_tiocmget,
+	.tiocmset =		belkin_sa_tiocmset,
 	.attach =		belkin_sa_startup,
 	.shutdown =		belkin_sa_shutdown,
 };
@@ -502,65 +506,77 @@
 }
 
 
-static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+static int belkin_sa_tiocmget (struct usb_serial_port *port, struct file *file)
+{
+	struct belkin_sa_private *priv = usb_get_serial_port_data(port);
+	unsigned long control_state;
+	unsigned long flags;
+	
+	dbg("%s", __FUNCTION__);
+
+	spin_lock_irqsave(&priv->lock, flags);
+	control_state = priv->control_state;
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return control_state;
+}
+
+
+static int belkin_sa_tiocmset (struct usb_serial_port *port, struct file *file,
+			       unsigned int set, unsigned int clear)
 {
 	struct usb_serial *serial = port->serial;
-	__u16 urb_value; /* Will hold the new flags */
 	struct belkin_sa_private *priv = usb_get_serial_port_data(port);
-	int ret = 0;
-	int mask;
 	unsigned long control_state;
 	unsigned long flags;
+	int retval;
+	int rts = 0;
+	int dtr = 0;
 	
+	dbg("%s", __FUNCTION__);
+
 	spin_lock_irqsave(&priv->lock, flags);
 	control_state = priv->control_state;
+
+	if (set & TIOCM_RTS) {
+		control_state |= TIOCM_RTS;
+		rts = 1;
+	}
+	if (set & TIOCM_DTR) {
+		control_state |= TIOCM_DTR;
+		dtr = 1;
+	}
+	if (clear & TIOCM_RTS) {
+		control_state &= ~TIOCM_RTS;
+		rts = 0;
+	}
+	if (clear & TIOCM_DTR) {
+		control_state &= ~TIOCM_DTR;
+		dtr = 0;
+	}
+
+	priv->control_state = control_state;
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	/* Based on code from acm.c and others */
-	switch (cmd) {
-	case TIOCMGET:
-		return put_user(control_state, (unsigned long *) arg);
-		break;
+	retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
+	if (retval < 0) {
+		err("Set RTS error %d", retval);
+		goto exit;
+	}
 
-	case TIOCMSET: /* Turns on and off the lines as specified by the mask */
-	case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
-	case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */
-		if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-
-		if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) {
-			/* RTS needs set */
-			urb_value = ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) || (cmd == TIOCMBIS) ? 1 : 0;
-			if (urb_value)
-				control_state |= TIOCM_RTS;
-			else
-				control_state &= ~TIOCM_RTS;
-
-			if ((ret = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, urb_value)) < 0) {
-				err("Set RTS error %d", ret);
-				goto cmerror;
-			}
-		}
+	retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
+	if (retval < 0) {
+		err("Set DTR error %d", retval);
+		goto exit;
+	}
+exit:
+	return retval;
+}
 
-		if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) {
-			/* DTR needs set */
-			urb_value = ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) || (cmd == TIOCMBIS) ? 1 : 0;
-			if (urb_value)
-				control_state |= TIOCM_DTR;
-			else
-				control_state &= ~TIOCM_DTR;
-			if ((ret = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, urb_value)) < 0) {
-				err("Set DTR error %d", ret);
-				goto cmerror;
-			}
-		}
-cmerror:
-		spin_lock_irqsave(&priv->lock, flags);
-		priv->control_state = control_state;
-		spin_unlock_irqrestore(&priv->lock, flags);
-		return ret;
-		break;
-					
+
+static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+{
+	switch (cmd) {
 	case TIOCMIWAIT:
 		/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
 		/* TODO */
diff -Nru a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
--- a/drivers/usb/serial/digi_acceleport.c	Fri Jan 10 01:41:57 2003
+++ b/drivers/usb/serial/digi_acceleport.c	Thu Apr 24 16:01:58 2003
@@ -460,6 +460,9 @@
 static void digi_break_ctl( struct usb_serial_port *port, int break_state );
 static int digi_ioctl( struct usb_serial_port *port, struct file *file,
 	unsigned int cmd, unsigned long arg );
+static int digi_tiocmget( struct usb_serial_port *port, struct file *file );
+static int digi_tiocmset( struct usb_serial_port *port, struct file *file,
+	unsigned int set, unsigned int clear );
 static int digi_write( struct usb_serial_port *port, int from_user,
 	const unsigned char *buf, int count );
 static void digi_write_bulk_callback( struct urb *urb, struct pt_regs *regs );
@@ -526,6 +529,8 @@
 	.ioctl =			digi_ioctl,
 	.set_termios =			digi_set_termios,
 	.break_ctl =			digi_break_ctl,
+	.tiocmget =			digi_tiocmget,
+	.tiocmset =			digi_tiocmset,
 	.attach =			digi_startup,
 	.shutdown =			digi_shutdown,
 };
@@ -551,6 +556,8 @@
 	.ioctl =			digi_ioctl,
 	.set_termios =			digi_set_termios,
 	.break_ctl =			digi_break_ctl,
+	.tiocmget =			digi_tiocmget,
+	.tiocmset =			digi_tiocmset,
 	.attach =			digi_startup,
 	.shutdown =			digi_shutdown,
 };
@@ -1211,39 +1218,46 @@
 }
 
 
-static int digi_ioctl( struct usb_serial_port *port, struct file *file,
-	unsigned int cmd, unsigned long arg )
+static int digi_tiocmget( struct usb_serial_port *port, struct file *file )
 {
+	struct digi_port *priv = usb_get_serial_port_data(port);
+	unsigned int val;
+	unsigned long flags;
+
+	dbg("%s: TOP: port=%d", __FUNCTION__, priv->dp_port_num);
+
+	spin_lock_irqsave( &priv->dp_port_lock, flags );
+	val = priv->dp_modem_signals;
+	spin_unlock_irqrestore( &priv->dp_port_lock, flags );
+	return val;
+}
 
+
+static int digi_tiocmset( struct usb_serial_port *port, struct file *file,
+	unsigned int set, unsigned int clear )
+{
 	struct digi_port *priv = usb_get_serial_port_data(port);
 	unsigned int val;
-	unsigned long flags = 0;
+	unsigned long flags;
 
+	dbg("%s: TOP: port=%d", __FUNCTION__, priv->dp_port_num);
 
-dbg( "digi_ioctl: TOP: port=%d, cmd=0x%x", priv->dp_port_num, cmd );
+	spin_lock_irqsave( &priv->dp_port_lock, flags );
+	val = (priv->dp_modem_signals & ~clear) | set;
+	spin_unlock_irqrestore( &priv->dp_port_lock, flags );
+	return digi_set_modem_signals( port, val, 1 );
+}
 
-	switch (cmd) {
 
-	case TIOCMGET:
-		spin_lock_irqsave( &priv->dp_port_lock, flags );
-		val = priv->dp_modem_signals;
-		spin_unlock_irqrestore( &priv->dp_port_lock, flags );
-		if( copy_to_user((unsigned int *)arg, &val, sizeof(int)) )
-			return( -EFAULT );
-		return( 0 );
+static int digi_ioctl( struct usb_serial_port *port, struct file *file,
+	unsigned int cmd, unsigned long arg )
+{
 
-	case TIOCMSET:
-	case TIOCMBIS:
-	case TIOCMBIC:
-		if( copy_from_user(&val, (unsigned int *)arg, sizeof(int)) )
-			return( -EFAULT );
-		spin_lock_irqsave( &priv->dp_port_lock, flags );
-		if( cmd == TIOCMBIS )
-			val = priv->dp_modem_signals | val;
-		else if( cmd == TIOCMBIC )
-			val = priv->dp_modem_signals & ~val;
-		spin_unlock_irqrestore( &priv->dp_port_lock, flags );
-		return( digi_set_modem_signals( port, val, 1 ) );
+	struct digi_port *priv = usb_get_serial_port_data(port);
+
+dbg( "digi_ioctl: TOP: port=%d, cmd=0x%x", priv->dp_port_num, cmd );
+
+	switch (cmd) {
 
 	case TIOCMIWAIT:
 		/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
@@ -1565,8 +1579,8 @@
 	}
 
 	/* flush driver and line discipline buffers */
-	if( tty->driver.flush_buffer )
-		tty->driver.flush_buffer( tty );
+	if( tty->driver->flush_buffer )
+		tty->driver->flush_buffer( tty );
 	if( tty->ldisc.flush_buffer )
 		tty->ldisc.flush_buffer( tty );
 
diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c	Tue Feb  4 05:48:08 2003
+++ b/drivers/usb/serial/ftdi_sio.c	Wed Apr 23 10:33:21 2003
@@ -175,6 +175,8 @@
 static void ftdi_sio_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
 static void ftdi_sio_read_bulk_callback	(struct urb *urb, struct pt_regs *regs);
 static void ftdi_sio_set_termios	(struct usb_serial_port *port, struct termios * old);
+static int  ftdi_sio_tiocmget		(struct usb_serial_port *port, struct file *file);
+static int  ftdi_sio_tiocmset		(struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
 static int  ftdi_sio_ioctl		(struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
 static void ftdi_sio_break_ctl		(struct usb_serial_port *port, int break_state );
 
@@ -198,6 +200,8 @@
 	.ioctl =		ftdi_sio_ioctl,
 	.set_termios =		ftdi_sio_set_termios,
 	.break_ctl =		ftdi_sio_break_ctl,
+	.tiocmget =		ftdi_sio_tiocmget,
+	.tiocmset =		ftdi_sio_tiocmset,
 	.attach =		ftdi_sio_startup,
         .shutdown =             ftdi_sio_shutdown,
 };
@@ -219,6 +223,8 @@
 	.ioctl =		ftdi_sio_ioctl,
 	.set_termios =		ftdi_sio_set_termios,
 	.break_ctl =		ftdi_sio_break_ctl,
+	.tiocmget =		ftdi_sio_tiocmget,
+	.tiocmset =		ftdi_sio_tiocmset,
 	.attach =		ftdi_8U232AM_startup,
         .shutdown =             ftdi_sio_shutdown,
 };
@@ -823,125 +829,100 @@
 	return;
 } /* ftdi_sio_set_termios */
 
-static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+static int ftdi_sio_tiocmget (struct usb_serial_port *port, struct file *file)
 {
 	struct usb_serial *serial = port->serial;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
-	__u16 urb_value=0; /* Will hold the new flags */
-	char buf[2];
-	int  ret, mask;
+	char *buf = NULL;
+	int ret = -EINVAL;
+	int size;
 	
-	dbg("%s cmd 0x%04x", __FUNCTION__, cmd);
+	dbg("%s", __FUNCTION__);
 
-	/* Based on code from acm.c and others */
-	switch (cmd) {
+	buf = kmalloc(2, GFP_KERNEL);
+	if (!buf)
+		goto exit;
 
-	case TIOCMGET:
-		dbg("%s TIOCMGET", __FUNCTION__);
-		if (priv->ftdi_type == sio){
-			/* Request the status from the device */
-			if ((ret = usb_control_msg(serial->dev, 
-						   usb_rcvctrlpipe(serial->dev, 0),
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
-						   0, 0, 
-						   buf, 1, WDR_TIMEOUT)) < 0 ) {
-				err("%s Could not get modem status of device - err: %d", __FUNCTION__,
-				    ret);
-				return(ret);
-			}
-		} else {
-			/* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same 
-			   format as the data returned from the in point */
-			if ((ret = usb_control_msg(serial->dev, 
-						   usb_rcvctrlpipe(serial->dev, 0),
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
-						   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
-						   0, 0, 
-						   buf, 2, WDR_TIMEOUT)) < 0 ) {
-				err("%s Could not get modem status of device - err: %d", __FUNCTION__,
-				    ret);
-				return(ret);
-			}
-		}
+	if (priv->ftdi_type == sio) {
+		size = 1;
+	} else {
+		/* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same 
+		   format as the data returned from the in point */
+		size = 2;
+	}
+	ret = usb_control_msg(serial->dev,
+			      usb_rcvctrlpipe(serial->dev, 0),
+			      FTDI_SIO_GET_MODEM_STATUS_REQUEST,
+			      FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
+			      0, 0, buf, size, WDR_TIMEOUT);
+	if (ret < 0) {
+		err("%s Could not get modem status of device - err: %d",
+		    __FUNCTION__, ret);
+		goto exit;
+	}
+
+	ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
+		(buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
+		(buf[0]  & FTDI_SIO_RI_MASK  ? TIOCM_RI  : 0) |
+		(buf[0]  & FTDI_SIO_RLSD_MASK ? TIOCM_CD  : 0);
+
+exit:
+	kfree(buf);
+	return ret;
+}
 
-		return put_user((buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
-				(buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
-				(buf[0]  & FTDI_SIO_RI_MASK  ? TIOCM_RI  : 0) |
-				(buf[0]  & FTDI_SIO_RLSD_MASK ? TIOCM_CD  : 0),
-				(unsigned long *) arg);
-		break;
-
-	case TIOCMSET: /* Turns on and off the lines as specified by the mask */
-		dbg("%s TIOCMSET", __FUNCTION__);
-		if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-		urb_value = ((mask & TIOCM_DTR) ? HIGH : LOW);
-		if (set_dtr(serial->dev, usb_sndctrlpipe(serial->dev, 0),urb_value) < 0){
-			err("Error from DTR set urb (TIOCMSET)");
-		}
-		urb_value = ((mask & TIOCM_RTS) ? HIGH : LOW);
-		if (set_rts(serial->dev, usb_sndctrlpipe(serial->dev, 0),urb_value) < 0){
-			err("Error from RTS set urb (TIOCMSET)");
-		}	
-		break;
-					
-	case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
-		dbg("%s TIOCMBIS", __FUNCTION__);
- 	        if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-  	        if (mask & TIOCM_DTR){
-			if ((ret = set_dtr(serial->dev, 
-					   usb_sndctrlpipe(serial->dev, 0),
-					   HIGH)) < 0) {
-				err("Urb to set DTR failed");
-				return(ret);
-			}
-		}
-		if (mask & TIOCM_RTS) {
-			if ((ret = set_rts(serial->dev, 
-					   usb_sndctrlpipe(serial->dev, 0),
-					   HIGH)) < 0){
-				err("Urb to set RTS failed");
-				return(ret);
-			}
-		}
-					break;
+static int ftdi_sio_tiocmset (struct usb_serial_port *port, struct file *file,
+			      unsigned int set, unsigned int clear)
+{
+	struct usb_serial *serial = port->serial;
+	int ret = 0;
+	
+	dbg("%s", __FUNCTION__);
 
-	case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */
-		dbg("%s TIOCMBIC", __FUNCTION__);
- 	        if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-  	        if (mask & TIOCM_DTR){
-			if ((ret = set_dtr(serial->dev, 
-					   usb_sndctrlpipe(serial->dev, 0),
-					   LOW)) < 0){
-				err("Urb to unset DTR failed");
-				return(ret);
-			}
-		}	
-		if (mask & TIOCM_RTS) {
-			if ((ret = set_rts(serial->dev, 
-					   usb_sndctrlpipe(serial->dev, 0),
-					   LOW)) < 0){
-				err("Urb to unset RTS failed");
-				return(ret);
-			}
+	if (set & TIOCM_RTS)
+		if ((ret = set_rts(serial->dev, 
+				   usb_sndctrlpipe(serial->dev, 0),
+				   HIGH)) < 0) {
+			err("Urb to set RTS failed");
+			goto exit;
+		}
+
+	if (set & TIOCM_DTR)
+		if ((ret = set_dtr(serial->dev, 
+				   usb_sndctrlpipe(serial->dev, 0),
+				   HIGH)) < 0) {
+			err("Urb to set DTR failed");
+			goto exit;
+		}
+
+	if (clear & TIOCM_RTS)
+		if ((ret = set_rts(serial->dev, 
+				   usb_sndctrlpipe(serial->dev, 0),
+				   LOW)) < 0) {
+			err("Urb to unset RTS failed");
+			goto exit;
+		}
+
+	if (clear & TIOCM_DTR)
+		if ((ret = set_dtr(serial->dev, 
+				   usb_sndctrlpipe(serial->dev, 0),
+				   LOW)) < 0) {
+			err("Urb to unset DTR failed");
+			goto exit;
 		}
-		break;
 
-		/*
-		 * I had originally implemented TCSET{A,S}{,F,W} and
-		 * TCGET{A,S} here separately, however when testing I
-		 * found that the higher layers actually do the termios
-		 * conversions themselves and pass the call onto
-		 * ftdi_sio_set_termios. 
-		 *
-		 */
+exit:
+	return ret;
+}
 
+static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+{
+	dbg("%s cmd 0x%04x", __FUNCTION__, cmd);
+
+	switch (cmd) {
 	default:
 	  /* This is not an error - turns out the higher layers will do 
-	   *  some ioctls itself (see comment above)
+	   *  some ioctls itself
  	   */
 		dbg("%s arg not supported - it was 0x%04x", __FUNCTION__,cmd);
 		return(-ENOIOCTLCMD);
diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
--- a/drivers/usb/serial/io_edgeport.c	Mon Apr 14 14:23:42 2003
+++ b/drivers/usb/serial/io_edgeport.c	Wed Apr 23 10:33:29 2003
@@ -455,6 +455,8 @@
 static void edge_set_termios		(struct usb_serial_port *port, struct termios *old_termios);
 static int  edge_ioctl			(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg);
 static void edge_break			(struct usb_serial_port *port, int break_state);
+static int  edge_tiocmget		(struct usb_serial_port *port, struct file *file);
+static int  edge_tiocmset		(struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
 static int  edge_startup		(struct usb_serial *serial);
 static void edge_shutdown		(struct usb_serial *serial);
 
@@ -1762,42 +1764,27 @@
 	return -ENOIOCTLCMD;
 }
 
-static int set_modem_info(struct edgeport_port *edge_port, unsigned int cmd, unsigned int *value)
+static int edge_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear)
 {
-	unsigned int mcr = edge_port->shadowMCR;
-	unsigned int arg;
-
-	if (copy_from_user(&arg, value, sizeof(int)))
-		return -EFAULT;
-
-	switch (cmd) {
-		case TIOCMBIS:
-			if (arg & TIOCM_RTS)
-				mcr |= MCR_RTS;
-			if (arg & TIOCM_DTR)
-				mcr |= MCR_RTS;
-			if (arg & TIOCM_LOOP)
-				mcr |= MCR_LOOPBACK;
-			break;
+        struct edgeport_port *edge_port = usb_get_serial_port_data(port);
+	unsigned int mcr;
 
-		case TIOCMBIC:
-			if (arg & TIOCM_RTS)
-				mcr &= ~MCR_RTS;
-			if (arg & TIOCM_DTR)
-				mcr &= ~MCR_RTS;
-			if (arg & TIOCM_LOOP)
-				mcr &= ~MCR_LOOPBACK;
-			break;
+	dbg("%s - port %d", __FUNCTION__, port->number);
 
-		case TIOCMSET:
-			/* turn off the RTS and DTR and LOOPBACK 
-			 * and then only turn on what was asked to */
-			mcr &=  ~(MCR_RTS | MCR_DTR | MCR_LOOPBACK);
-			mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0);
-			mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0);
-			mcr |= ((arg & TIOCM_LOOP) ? MCR_LOOPBACK : 0);
-			break;
-	}
+	mcr = edge_port->shadowMCR;
+	if (set & TIOCM_RTS)
+		mcr |= MCR_RTS;
+	if (set & TIOCM_DTR)
+		mcr |= MCR_DTR;
+	if (set & TIOCM_LOOP)
+		mcr |= MCR_LOOPBACK;
+
+	if (clear & TIOCM_RTS)
+		mcr &= ~MCR_RTS;
+	if (clear & TIOCM_DTR)
+		mcr &= ~MCR_DTR;
+	if (clear & TIOCM_LOOP)
+		mcr &= ~MCR_LOOPBACK;
 
 	edge_port->shadowMCR = mcr;
 
@@ -1806,12 +1793,17 @@
 	return 0;
 }
 
-static int get_modem_info(struct edgeport_port *edge_port, unsigned int *value)
+static int edge_tiocmget(struct usb_serial_port *port, struct file *file)
 {
+        struct edgeport_port *edge_port = usb_get_serial_port_data(port);
 	unsigned int result = 0;
-	unsigned int msr = edge_port->shadowMSR;
-	unsigned int mcr = edge_port->shadowMCR;
+	unsigned int msr;
+	unsigned int mcr;
+
+	dbg("%s - port %d", __FUNCTION__, port->number);
 
+	msr = edge_port->shadowMSR;
+	mcr = edge_port->shadowMCR;
 	result = ((mcr & MCR_DTR)	? TIOCM_DTR: 0)	  /* 0x002 */
 		  | ((mcr & MCR_RTS)	? TIOCM_RTS: 0)   /* 0x004 */
 		  | ((msr & MSR_CTS)	? TIOCM_CTS: 0)   /* 0x020 */
@@ -1822,13 +1814,9 @@
 
 	dbg("%s -- %x", __FUNCTION__, result);
 
-	if (copy_to_user(value, &result, sizeof(int)))
-		return -EFAULT;
-	return 0;
+	return result;
 }
 
-
-
 static int get_serial_info(struct edgeport_port *edge_port, struct serial_struct * retinfo)
 {
 	struct serial_struct tmp;
@@ -1884,16 +1872,6 @@
 			dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__,  port->number);
 			return get_lsr_info(edge_port, (unsigned int *) arg);
 			return 0;
-
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__,  port->number);
-			return set_modem_info(edge_port, cmd, (unsigned int *) arg);
-
-		case TIOCMGET:  
-			dbg("%s (%d) TIOCMGET", __FUNCTION__,  port->number);
-			return get_modem_info(edge_port, (unsigned int *) arg);
 
 		case TIOCGSERIAL:
 			dbg("%s (%d) TIOCGSERIAL", __FUNCTION__,  port->number);
diff -Nru a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h
--- a/drivers/usb/serial/io_tables.h	Mon Dec 16 10:13:18 2002
+++ b/drivers/usb/serial/io_tables.h	Wed Apr 23 10:33:29 2003
@@ -114,6 +114,8 @@
 	.shutdown		= edge_shutdown,
 	.ioctl			= edge_ioctl,
 	.set_termios		= edge_set_termios,
+	.tiocmget		= edge_tiocmget,
+	.tiocmset		= edge_tiocmset,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
@@ -137,6 +139,8 @@
 	.shutdown		= edge_shutdown,
 	.ioctl			= edge_ioctl,
 	.set_termios		= edge_set_termios,
+	.tiocmget		= edge_tiocmget,
+	.tiocmset		= edge_tiocmset,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
@@ -160,6 +164,8 @@
 	.shutdown		= edge_shutdown,
 	.ioctl			= edge_ioctl,
 	.set_termios		= edge_set_termios,
+	.tiocmget		= edge_tiocmget,
+	.tiocmset		= edge_tiocmset,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
@@ -183,6 +189,8 @@
 	.shutdown		= edge_shutdown,
 	.ioctl			= edge_ioctl,
 	.set_termios		= edge_set_termios,
+	.tiocmget		= edge_tiocmget,
+	.tiocmset		= edge_tiocmset,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
diff -Nru a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
--- a/drivers/usb/serial/io_ti.c	Fri Mar 14 04:03:18 2003
+++ b/drivers/usb/serial/io_ti.c	Wed Apr 23 10:33:34 2003
@@ -2403,42 +2403,27 @@
 	return;
 }
 
-static int set_modem_info (struct edgeport_port *edge_port, unsigned int cmd, unsigned int *value)
+static int edge_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear)
 {
-	unsigned int mcr = edge_port->shadow_mcr;
-	unsigned int arg;
+        struct edgeport_port *edge_port = usb_get_serial_port_data(port);
+	unsigned int mcr;
 
-	if (copy_from_user(&arg, value, sizeof(int)))
-		return -EFAULT;
-
-	switch (cmd) {
-		case TIOCMBIS:
-			if (arg & TIOCM_RTS)
-				mcr |= MCR_RTS;
-			if (arg & TIOCM_DTR)
-				mcr |= MCR_RTS;
-			if (arg & TIOCM_LOOP)
-				mcr |= MCR_LOOPBACK;
-			break;
+	dbg("%s - port %d", __FUNCTION__, port->number);
 
-		case TIOCMBIC:
-			if (arg & TIOCM_RTS)
-				mcr &= ~MCR_RTS;
-			if (arg & TIOCM_DTR)
-				mcr &= ~MCR_RTS;
-			if (arg & TIOCM_LOOP)
-				mcr &= ~MCR_LOOPBACK;
-			break;
-
-		case TIOCMSET:
-			/* turn off the RTS and DTR and LOOPBACK 
-			 * and then only turn on what was asked to */
-			mcr &=  ~(MCR_RTS | MCR_DTR | MCR_LOOPBACK);
-			mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0);
-			mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0);
-			mcr |= ((arg & TIOCM_LOOP) ? MCR_LOOPBACK : 0);
-			break;
-	}
+	mcr = edge_port->shadow_mcr;
+	if (set & TIOCM_RTS)
+		mcr |= MCR_RTS;
+	if (set & TIOCM_DTR)
+		mcr |= MCR_DTR;
+	if (set & TIOCM_LOOP)
+		mcr |= MCR_LOOPBACK;
+
+	if (clear & TIOCM_RTS)
+		mcr &= ~MCR_RTS;
+	if (clear & TIOCM_DTR)
+		mcr &= ~MCR_DTR;
+	if (clear & TIOCM_LOOP)
+		mcr &= ~MCR_LOOPBACK;
 
 	edge_port->shadow_mcr = mcr;
 
@@ -2447,12 +2432,17 @@
 	return 0;
 }
 
-static int get_modem_info (struct edgeport_port *edge_port, unsigned int *value)
+static int edge_tiocmget(struct usb_serial_port *port, struct file *file)
 {
+        struct edgeport_port *edge_port = usb_get_serial_port_data(port);
 	unsigned int result = 0;
-	unsigned int msr = edge_port->shadow_msr;
-	unsigned int mcr = edge_port->shadow_mcr;
+	unsigned int msr;
+	unsigned int mcr;
 
+	dbg("%s - port %d", __FUNCTION__, port->number);
+
+	msr = edge_port->shadow_msr;
+	mcr = edge_port->shadow_mcr;
 	result = ((mcr & MCR_DTR)	? TIOCM_DTR: 0)	  /* 0x002 */
 		  | ((mcr & MCR_RTS)	? TIOCM_RTS: 0)   /* 0x004 */
 		  | ((msr & MSR_CTS)	? TIOCM_CTS: 0)   /* 0x020 */
@@ -2463,9 +2453,7 @@
 
 	dbg("%s -- %x", __FUNCTION__, result);
 
-	if (copy_to_user(value, &result, sizeof(int)))
-		return -EFAULT;
-	return 0;
+	return result;
 }
 
 static int get_serial_info (struct edgeport_port *edge_port, struct serial_struct * retinfo)
@@ -2515,18 +2503,6 @@
 //			return get_lsr_info(edge_port, (unsigned int *) arg);
 			break;
 
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			dbg("%s - (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number);
-			return set_modem_info(edge_port, cmd, (unsigned int *) arg);
-			break;
-
-		case TIOCMGET:  
-			dbg("%s - (%d) TIOCMGET", __FUNCTION__, port->number);
-			return get_modem_info(edge_port, (unsigned int *) arg);
-			break;
-
 		case TIOCGSERIAL:
 			dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number);
 			return get_serial_info(edge_port, (struct serial_struct *) arg);
@@ -2665,6 +2641,8 @@
 	.shutdown		= edge_shutdown,
 	.ioctl			= edge_ioctl,
 	.set_termios		= edge_set_termios,
+	.tiocmget		= edge_tiocmget,
+	.tiocmset		= edge_tiocmset,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
@@ -2688,6 +2666,8 @@
 	.shutdown		= edge_shutdown,
 	.ioctl			= edge_ioctl,
 	.set_termios		= edge_set_termios,
+	.tiocmget		= edge_tiocmget,
+	.tiocmset		= edge_tiocmset,
 	.write			= edge_write,
 	.write_room		= edge_write_room,
 	.chars_in_buffer	= edge_chars_in_buffer,
diff -Nru a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
--- a/drivers/usb/serial/keyspan.c	Mon Apr 14 15:12:19 2003
+++ b/drivers/usb/serial/keyspan.c	Wed Apr 23 10:33:39 2003
@@ -282,48 +282,46 @@
 	keyspan_send_setup(port, 0);
 }
 
-static int keyspan_ioctl(struct usb_serial_port *port, struct file *file,
-			     unsigned int cmd, unsigned long arg)
+static int keyspan_tiocmget(struct usb_serial_port *port, struct file *file)
 {
-	unsigned int			value, set;
+	unsigned int			value;
 	struct keyspan_port_private 	*p_priv;
 
 	p_priv = usb_get_serial_port_data(port);
 	
-	switch (cmd) {
-	case TIOCMGET:
-		value = ((p_priv->rts_state) ? TIOCM_RTS : 0) |
-			((p_priv->dtr_state) ? TIOCM_DTR : 0) |
-			((p_priv->cts_state) ? TIOCM_CTS : 0) |
-			((p_priv->dsr_state) ? TIOCM_DSR : 0) |
-			((p_priv->dcd_state) ? TIOCM_CAR : 0) |
-			((p_priv->ri_state) ? TIOCM_RNG : 0); 
-
-		if (put_user(value, (unsigned int *) arg))
-			return -EFAULT;
-		return 0;
+	value = ((p_priv->rts_state) ? TIOCM_RTS : 0) |
+		((p_priv->dtr_state) ? TIOCM_DTR : 0) |
+		((p_priv->cts_state) ? TIOCM_CTS : 0) |
+		((p_priv->dsr_state) ? TIOCM_DSR : 0) |
+		((p_priv->dcd_state) ? TIOCM_CAR : 0) |
+		((p_priv->ri_state) ? TIOCM_RNG : 0); 
+
+	return value;
+}
+
+static int keyspan_tiocmset(struct usb_serial_port *port, struct file *file,
+			    unsigned int set, unsigned int clear)
+{
+	struct keyspan_port_private 	*p_priv;
+
+	p_priv = usb_get_serial_port_data(port);
 	
-	case TIOCMSET:
-		if (get_user(value, (unsigned int *) arg))
-			return -EFAULT;
-		p_priv->rts_state = ((value & TIOCM_RTS) ? 1 : 0);
-		p_priv->dtr_state = ((value & TIOCM_DTR) ? 1 : 0);
-		keyspan_send_setup(port, 0);
-		return 0;
-
-	case TIOCMBIS:
-	case TIOCMBIC:
-		if (get_user(value, (unsigned int *) arg))
-			return -EFAULT;
-		set = (cmd == TIOCMBIS);
-		if (value & TIOCM_RTS)
-			p_priv->rts_state = set;
-		if (value & TIOCM_DTR)
-			p_priv->dtr_state = set;
-		keyspan_send_setup(port, 0);
-		return 0;
-	}
+	if (set & TIOCM_RTS)
+		p_priv->rts_state = 1;
+	if (set & TIOCM_DTR)
+		p_priv->dtr_state = 1;
+
+	if (clear & TIOCM_RTS)
+		p_priv->rts_state = 0;
+	if (clear & TIOCM_DTR)
+		p_priv->dtr_state = 0;
+	keyspan_send_setup(port, 0);
+	return 0;
+}
 
+static int keyspan_ioctl(struct usb_serial_port *port, struct file *file,
+			     unsigned int cmd, unsigned long arg)
+{
 	return -ENOIOCTLCMD;
 }
 
diff -Nru a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
--- a/drivers/usb/serial/keyspan.h	Tue Apr  1 22:58:43 2003
+++ b/drivers/usb/serial/keyspan.h	Wed Apr 23 10:33:39 2003
@@ -63,6 +63,11 @@
 					 struct termios *old);
 static void keyspan_break_ctl		(struct usb_serial_port *port,
 					 int break_state);
+static int  keyspan_tiocmget		(struct usb_serial_port *port,
+					 struct file *file);
+static int  keyspan_tiocmset		(struct usb_serial_port *port,
+					 struct file *file, unsigned int set,
+					 unsigned int clear);
 static int  keyspan_fake_startup	(struct usb_serial *serial);
 
 static int  keyspan_usa19_calc_baud	(u32 baud_rate, u32 baudclk, 
@@ -551,6 +556,8 @@
 	.ioctl			= keyspan_ioctl,
 	.set_termios		= keyspan_set_termios,
 	.break_ctl		= keyspan_break_ctl,
+	.tiocmget		= keyspan_tiocmget,
+	.tiocmset		= keyspan_tiocmset,
 	.attach			= keyspan_startup,
 	.shutdown		= keyspan_shutdown,
 };
@@ -574,6 +581,8 @@
 	.ioctl			= keyspan_ioctl,
 	.set_termios		= keyspan_set_termios,
 	.break_ctl		= keyspan_break_ctl,
+	.tiocmget		= keyspan_tiocmget,
+	.tiocmset		= keyspan_tiocmset,
 	.attach			= keyspan_startup,
 	.shutdown		= keyspan_shutdown,
 };
@@ -597,6 +606,8 @@
 	.ioctl			= keyspan_ioctl,
 	.set_termios		= keyspan_set_termios,
 	.break_ctl		= keyspan_break_ctl,
+	.tiocmget		= keyspan_tiocmget,
+	.tiocmset		= keyspan_tiocmset,
 	.attach			= keyspan_startup,
 	.shutdown		= keyspan_shutdown,
 };
diff -Nru a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
--- a/drivers/usb/serial/keyspan_pda.c	Thu Dec 26 09:37:14 2002
+++ b/drivers/usb/serial/keyspan_pda.c	Wed Apr 23 10:33:43 2003
@@ -457,62 +457,54 @@
 	return rc;
 }
 
+static int keyspan_pda_tiocmget(struct usb_serial_port *port, struct file *file)
+{
+	struct usb_serial *serial = port->serial;
+	int rc;
+	unsigned char status;
+	int value;
 
-static int keyspan_pda_ioctl(struct usb_serial_port *port, struct file *file,
-			     unsigned int cmd, unsigned long arg)
+	rc = keyspan_pda_get_modem_info(serial, &status);
+	if (rc < 0)
+		return rc;
+	value =
+		((status & (1<<7)) ? TIOCM_DTR : 0) |
+		((status & (1<<6)) ? TIOCM_CAR : 0) |
+		((status & (1<<5)) ? TIOCM_RNG : 0) |
+		((status & (1<<4)) ? TIOCM_DSR : 0) |
+		((status & (1<<3)) ? TIOCM_CTS : 0) |
+		((status & (1<<2)) ? TIOCM_RTS : 0);
+	return value;
+}
+
+static int keyspan_pda_tiocmset(struct usb_serial_port *port, struct file *file,
+				unsigned int set, unsigned int clear)
 {
 	struct usb_serial *serial = port->serial;
 	int rc;
-	unsigned int value;
-	unsigned char status, mask;
+	unsigned char status;
 
+	rc = keyspan_pda_get_modem_info(serial, &status);
+	if (rc < 0)
+		return rc;
+
+	if (set & TIOCM_RTS)
+		status |= (1<<2);
+	if (set & TIOCM_DTR)
+		status |= (1<<7);
+
+	if (clear & TIOCM_RTS)
+		status &= ~(1<<2);
+	if (clear & TIOCM_DTR)
+		status &= ~(1<<7);
+	rc = keyspan_pda_set_modem_info(serial, status);
+	return rc;
+}
+
+static int keyspan_pda_ioctl(struct usb_serial_port *port, struct file *file,
+			     unsigned int cmd, unsigned long arg)
+{
 	switch (cmd) {
-	case TIOCMGET: /* get modem pins state */
-		rc = keyspan_pda_get_modem_info(serial, &status);
-		if (rc < 0)
-			return rc;
-		value =
-			((status & (1<<7)) ? TIOCM_DTR : 0) |
-			((status & (1<<6)) ? TIOCM_CAR : 0) |
-			((status & (1<<5)) ? TIOCM_RNG : 0) |
-			((status & (1<<4)) ? TIOCM_DSR : 0) |
-			((status & (1<<3)) ? TIOCM_CTS : 0) |
-			((status & (1<<2)) ? TIOCM_RTS : 0);
-		if (copy_to_user((unsigned int *)arg, &value, sizeof(int)))
-			return -EFAULT;
-		return 0;
-	case TIOCMSET: /* set a state as returned by MGET */
-		if (copy_from_user(&value, (unsigned int *)arg, sizeof(int)))
-			return -EFAULT;
-		status =
-			((value & TIOCM_DTR) ? (1<<7) : 0) |
-			((value & TIOCM_CAR) ? (1<<6) : 0) |
-			((value & TIOCM_RNG) ? (1<<5) : 0) |
-			((value & TIOCM_DSR) ? (1<<4) : 0) |
-			((value & TIOCM_CTS) ? (1<<3) : 0) |
-			((value & TIOCM_RTS) ? (1<<2) : 0);
-		rc = keyspan_pda_set_modem_info(serial, status);
-		if (rc < 0)
-			return rc;
-		return 0;
-	case TIOCMBIS: /* set bits in bitmask <arg> */
-	case TIOCMBIC: /* clear bits from bitmask <arg> */
-		if (copy_from_user(&value, (unsigned int *)arg, sizeof(int)))
-			return -EFAULT;
-		rc = keyspan_pda_get_modem_info(serial, &status);
-		if (rc < 0)
-			return rc;
-		mask =
-			((value & TIOCM_RTS) ? (1<<2) : 0) |
-			((value & TIOCM_DTR) ? (1<<7) : 0);
-		if (cmd == TIOCMBIS)
-			status |= mask;
-		else
-			status &= ~mask;
-		rc = keyspan_pda_set_modem_info(serial, status);
-		if (rc < 0)
-			return rc;
-		return 0;
 	case TIOCMIWAIT:
 		/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
 		/* TODO */
@@ -874,6 +866,8 @@
 	.ioctl =		keyspan_pda_ioctl,
 	.set_termios =		keyspan_pda_set_termios,
 	.break_ctl =		keyspan_pda_break_ctl,
+	.tiocmget =		keyspan_pda_tiocmget,
+	.tiocmset =		keyspan_pda_tiocmset,
 	.attach =		keyspan_pda_startup,
 	.shutdown =		keyspan_pda_shutdown,
 };
diff -Nru a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
--- a/drivers/usb/serial/kl5kusb105.c	Mon Apr 14 03:10:10 2003
+++ b/drivers/usb/serial/kl5kusb105.c	Wed Apr 23 10:33:48 2003
@@ -105,6 +105,11 @@
 static void klsi_105_break_ctl	         (struct usb_serial_port *port,
 					  int break_state );
  */
+static int  klsi_105_tiocmget	         (struct usb_serial_port *port,
+					  struct file *file);
+static int  klsi_105_tiocmset	         (struct usb_serial_port *port,
+					  struct file *file, unsigned int set,
+					  unsigned int clear);
 
 /*
  * All of the device info needed for the KLSI converters.
@@ -143,6 +148,8 @@
 	.ioctl =	     klsi_105_ioctl,
 	.set_termios =	     klsi_105_set_termios,
 	/*.break_ctl =	     klsi_105_break_ctl,*/
+	.tiocmget =          klsi_105_tiocmget,
+	.tiocmset =          klsi_105_tiocmset,
 	.attach =	     klsi_105_startup,
 	.shutdown =	     klsi_105_shutdown,
 	.throttle =	     klsi_105_throttle,
@@ -879,68 +886,67 @@
 } /* mct_u232_break_ctl */
 #endif
 
-static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
-			   unsigned int cmd, unsigned long arg)
+static int klsi_105_tiocmget (struct usb_serial_port *port, struct file *file)
 {
 	struct usb_serial *serial = port->serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
-	int mask;
 	unsigned long flags;
+	int rc;
+	unsigned long line_state;
+	dbg("%s - request, just guessing", __FUNCTION__);
+
+	rc = klsi_105_get_line_state(serial, &line_state);
+	if (rc < 0) {
+		err("Reading line control failed (error = %d)", rc);
+		/* better return value? EAGAIN? */
+		return rc;
+	}
+
+	spin_lock_irqsave (&priv->lock, flags);
+	priv->line_state = line_state;
+	spin_unlock_irqrestore (&priv->lock, flags);
+	dbg("%s - read line state 0x%lx", __FUNCTION__, line_state);
+	return (int)line_state;
+}
+
+static int klsi_105_tiocmset (struct usb_serial_port *port, struct file *file,
+			      unsigned int set, unsigned int clear)
+{
+	int retval = -EINVAL;
+	
+	dbg("%s", __FUNCTION__);
+
+/* if this ever gets implemented, it should be done something like this:
+	struct usb_serial *serial = port->serial;
+	struct klsi_105_private *priv = usb_get_serial_port_data(port);
+	unsigned long flags;
+	int control;
+
+	spin_lock_irqsave (&priv->lock, flags);
+	if (set & TIOCM_RTS)
+		priv->control_state |= TIOCM_RTS;
+	if (set & TIOCM_DTR)
+		priv->control_state |= TIOCM_DTR;
+	if (clear & TIOCM_RTS)
+		priv->control_state &= ~TIOCM_RTS;
+	if (clear & TIOCM_DTR)
+		priv->control_state &= ~TIOCM_DTR;
+	control = priv->control_state;
+	spin_unlock_irqrestore (&priv->lock, flags);
+	retval = mct_u232_set_modem_ctrl(serial, control);
+*/
+	return retval;
+}
+					
+static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
+			   unsigned int cmd, unsigned long arg)
+{
+	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	
 	dbg("%scmd=0x%x", __FUNCTION__, cmd);
 
 	/* Based on code from acm.c and others */
 	switch (cmd) {
-	case TIOCMGET: {
-		int rc;
-		unsigned long line_state;
-		dbg("%s - TIOCMGET request, just guessing", __FUNCTION__);
-
-		rc = klsi_105_get_line_state(serial, &line_state);
-		if (rc < 0) {
-			err("Reading line control failed (error = %d)", rc);
-			/* better return value? EAGAIN? */
-			return -ENOIOCTLCMD;
-		}
-		spin_lock_irqsave (&priv->lock, flags);
-		priv->line_state = line_state;
-		spin_unlock_irqrestore (&priv->lock, flags);
-		dbg("%s - read line state 0x%lx", __FUNCTION__, line_state);
-		return put_user(line_state, (unsigned long *) arg); 
-	       };
-
-	case TIOCMSET: /* Turns on and off the lines as specified by the mask */
-	case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
-	case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */
-		if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-
-		if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) {
-			/* RTS needs set */
-			if( ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) ||
-			    (cmd == TIOCMBIS) )
-				dbg("%s - set RTS not handled", __FUNCTION__);
-				/* priv->control_state |=  TIOCM_RTS; */
-			else
-				dbg("%s - clear RTS not handled", __FUNCTION__);
-				/* priv->control_state &= ~TIOCM_RTS; */
-		}
-
-		if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) {
-			/* DTR needs set */
-			if( ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) ||
-			    (cmd == TIOCMBIS) )
-				dbg("%s - set DTR not handled", __FUNCTION__);
-			/*	priv->control_state |=  TIOCM_DTR; */
-			else
-				dbg("%s - clear DTR not handled", __FUNCTION__);
-				/* priv->control_state &= ~TIOCM_DTR; */
-		}
-		/*
-		mct_u232_set_modem_ctrl(serial, priv->control_state);
-		*/
-		break;
-					
 	case TIOCMIWAIT:
 		/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
 		/* TODO */
diff -Nru a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
--- a/drivers/usb/serial/kobil_sct.c	Mon Apr 14 03:10:37 2003
+++ b/drivers/usb/serial/kobil_sct.c	Wed Apr 23 10:33:52 2003
@@ -81,6 +81,9 @@
 static int  kobil_write_room(struct usb_serial_port *port);
 static int  kobil_ioctl(struct usb_serial_port *port, struct file *file,
 			unsigned int cmd, unsigned long arg);
+static int  kobil_tiocmget(struct usb_serial_port *port, struct file *file);
+static int  kobil_tiocmset(struct usb_serial_port *port, struct file *file,
+			   unsigned int set, unsigned int clear);
 static void kobil_read_int_callback( struct urb *urb, struct pt_regs *regs );
 static void kobil_write_callback( struct urb *purb, struct pt_regs *regs );
 
@@ -106,6 +109,8 @@
 	.attach =		kobil_startup,
 	.shutdown =		kobil_shutdown,
 	.ioctl =		kobil_ioctl,
+	.tiocmget =		kobil_tiocmget,
+	.tiocmset =		kobil_tiocmset,
 	.open =			kobil_open,
 	.close =		kobil_close,
 	.write =		kobil_write,
@@ -490,11 +495,120 @@
 }
 
 
+static int kobil_tiocmget(struct usb_serial_port *port, struct file *file)
+{
+	struct kobil_private * priv;
+	int result;
+	unsigned char *transfer_buffer;
+	int transfer_buffer_length = 8;
+
+	priv = usb_get_serial_port_data(port);
+	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) {
+		// This device doesn't support ioctl calls
+		return -EINVAL;
+	}
+
+	// allocate memory for transfer buffer
+	transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL);  
+	if (!transfer_buffer) {
+		return -ENOMEM;
+	}
+	memset(transfer_buffer, 0, transfer_buffer_length);
+
+	result = usb_control_msg( port->serial->dev, 
+				  usb_rcvctrlpipe(port->serial->dev, 0 ), 
+				  SUSBCRequest_GetStatusLineState,
+				  USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
+				  0,
+				  0,
+				  transfer_buffer,
+				  transfer_buffer_length,
+				  KOBIL_TIMEOUT);
+
+	dbg("%s - port %d Send get_status_line_state URB returns: %i. Statusline: %02x", 
+	    __FUNCTION__, port->number, result, transfer_buffer[0]);
+
+	if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0) {
+		priv->line_state |= TIOCM_DSR;
+	} else {
+		priv->line_state &= ~TIOCM_DSR; 
+	}
+
+	kfree(transfer_buffer);
+	return priv->line_state;
+}
+
+static int  kobil_tiocmset(struct usb_serial_port *port, struct file *file,
+			   unsigned int set, unsigned int clear)
+{
+	struct kobil_private * priv;
+	int result;
+	int dtr = 0;
+	int rts = 0;
+	unsigned char *transfer_buffer;
+	int transfer_buffer_length = 8;
+
+	priv = usb_get_serial_port_data(port);
+	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) {
+		// This device doesn't support ioctl calls
+		return -EINVAL;
+	}
+
+	// allocate memory for transfer buffer
+	transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL);
+	if (! transfer_buffer) {
+		return -ENOMEM;
+	}
+	memset(transfer_buffer, 0, transfer_buffer_length);
+
+	if (set & TIOCM_RTS)
+		rts = 1;
+	if (set & TIOCM_DTR)
+		dtr = 1;
+	if (clear & TIOCM_RTS)
+		rts = 0;
+	if (clear & TIOCM_DTR)
+		dtr = 0;
+
+	if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) {
+		if (dtr != 0)
+			dbg("%s - port %d Setting DTR", __FUNCTION__, port->number);
+		else
+			dbg("%s - port %d Clearing DTR", __FUNCTION__, port->number);
+		result = usb_control_msg( port->serial->dev, 
+					  usb_rcvctrlpipe(port->serial->dev, 0 ), 
+					  SUSBCRequest_SetStatusLinesOrQueues,
+					  USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
+					  ((dtr != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR),
+					  0,
+					  transfer_buffer,
+					  0,
+					  KOBIL_TIMEOUT);
+	} else {
+		if (rts != 0)
+			dbg("%s - port %d Setting RTS", __FUNCTION__, port->number);
+		else
+			dbg("%s - port %d Clearing RTS", __FUNCTION__, port->number);
+		result = usb_control_msg( port->serial->dev, 
+					  usb_rcvctrlpipe(port->serial->dev, 0 ), 
+					  SUSBCRequest_SetStatusLinesOrQueues,
+					  USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
+					  ((rts != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS),
+					  0,
+					  transfer_buffer,
+					  0,
+					  KOBIL_TIMEOUT);
+	}
+	dbg("%s - port %d Send set_status_line URB returns: %i", __FUNCTION__, port->number, result);
+	kfree(transfer_buffer);
+	return (result < 0) ? result : 0;
+}
+
+
 static int  kobil_ioctl(struct usb_serial_port *port, struct file *file,
 			unsigned int cmd, unsigned long arg)
 {
 	struct kobil_private * priv;
-	int mask;
 	int result;
 	unsigned short urb_val = 0;
 	unsigned char *transfer_buffer;
@@ -605,90 +719,8 @@
 		kfree(transfer_buffer);
 		return ((result < 0) ? -EFAULT : 0);
 
-	case TIOCMGET: // 0x5415
-		// allocate memory for transfer buffer
-		transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL);  
-		if (! transfer_buffer) {
-			return -ENOBUFS;
-		} else {
-			memset(transfer_buffer, 0, transfer_buffer_length);
-		}
-
-		result = usb_control_msg( port->serial->dev, 
-					  usb_rcvctrlpipe(port->serial->dev, 0 ), 
-					  SUSBCRequest_GetStatusLineState,
-					  USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
-					  0,
-					  0,
-					  transfer_buffer,
-					  transfer_buffer_length,
-					  KOBIL_TIMEOUT
-			);
-
-		dbg("%s - port %d Send get_status_line_state (TIOCMGET) URB returns: %i. Statusline: %02x", 
-		    __FUNCTION__, port->number, result, transfer_buffer[0]);
-
-		if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0) {
-			priv->line_state |= TIOCM_DSR;
-		} else {
-			priv->line_state &= ~TIOCM_DSR; 
-		}
-
-		kfree(transfer_buffer);
-		return put_user(priv->line_state, (unsigned long *) arg);
-
-	case TIOCMSET: // 0x5418
-		if (get_user(mask, (unsigned long *) arg)){
-			return -EFAULT;
-		}
-		// allocate memory for transfer buffer
-		transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL);
-		if (! transfer_buffer) {
-			return -ENOBUFS;
-		} else {
-			memset(transfer_buffer, 0, transfer_buffer_length);
-		}
-
-		if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) {
-			if ((mask & TIOCM_DTR) != 0){
-				dbg("%s - port %d Setting DTR", __FUNCTION__, port->number);
-			} else {
-				dbg("%s - port %d Clearing DTR", __FUNCTION__, port->number);
-			} 
-			result = usb_control_msg( port->serial->dev, 
-						  usb_rcvctrlpipe(port->serial->dev, 0 ), 
-						  SUSBCRequest_SetStatusLinesOrQueues,
-						  USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
-						  ( ((mask & TIOCM_DTR) != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR),
-						  0,
-						  transfer_buffer,
-						  0,
-						  KOBIL_TIMEOUT
-				);
-			
-		} else {
-			if ((mask & TIOCM_RTS) != 0){
-				dbg("%s - port %d Setting RTS", __FUNCTION__, port->number);
-			} else {
-				dbg("%s - port %d Clearing RTS", __FUNCTION__, port->number);
-			}
-			result = usb_control_msg( port->serial->dev, 
-						  usb_rcvctrlpipe(port->serial->dev, 0 ), 
-						  SUSBCRequest_SetStatusLinesOrQueues,
-						  USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
-						  (((mask & TIOCM_RTS) != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS),
-						  0,
-						  transfer_buffer,
-						  0,
-						  KOBIL_TIMEOUT
-				);
-		}
-		dbg("%s - port %d Send set_status_line (TIOCMSET) URB returns: %i", __FUNCTION__, port->number, result);
-
-		kfree(transfer_buffer);
-		return ((result < 0) ? -EFAULT : 0);
 	}
-	return 0;
+	return -ENOIOCTLCMD;
 }
 
 
diff -Nru a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
--- a/drivers/usb/serial/mct_u232.c	Tue Feb 25 03:11:43 2003
+++ b/drivers/usb/serial/mct_u232.c	Wed Apr 23 10:33:56 2003
@@ -125,7 +125,11 @@
 					  unsigned long arg);
 static void mct_u232_break_ctl	         (struct usb_serial_port *port,
 					  int break_state );
-
+static int  mct_u232_tiocmget		 (struct usb_serial_port *port,
+					  struct file *file);
+static int  mct_u232_tiocmset		 (struct usb_serial_port *port,
+					  struct file *file, unsigned int set,
+					  unsigned int clear);
 /*
  * All of the device info needed for the MCT USB-RS232 converter.
  */
@@ -165,6 +169,8 @@
 	.ioctl =	     mct_u232_ioctl,
 	.set_termios =	     mct_u232_set_termios,
 	.break_ctl =	     mct_u232_break_ctl,
+	.tiocmget =	     mct_u232_tiocmget,
+	.tiocmset =	     mct_u232_tiocmset,
 	.attach =	     mct_u232_startup,
 	.shutdown =	     mct_u232_shutdown,
 };
@@ -773,57 +779,55 @@
 } /* mct_u232_break_ctl */
 
 
-static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
-			   unsigned int cmd, unsigned long arg)
+static int mct_u232_tiocmget (struct usb_serial_port *port, struct file *file)
+{
+	struct mct_u232_private *priv = usb_get_serial_port_data(port);
+	unsigned long control_state;
+	unsigned long flags;
+	
+	dbg("%s", __FUNCTION__);
+
+	spin_lock_irqsave(&priv->lock, flags);
+	control_state = priv->control_state;
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return control_state;
+}
+
+static int mct_u232_tiocmset (struct usb_serial_port *port, struct file *file,
+			      unsigned int set, unsigned int clear)
 {
 	struct usb_serial *serial = port->serial;
 	struct mct_u232_private *priv = usb_get_serial_port_data(port);
-	int mask;
 	unsigned long control_state;
 	unsigned long flags;
 	
-	dbg("%scmd=0x%x", __FUNCTION__, cmd);
+	dbg("%s", __FUNCTION__);
 
 	spin_lock_irqsave(&priv->lock, flags);
 	control_state = priv->control_state;
+
+	if (set & TIOCM_RTS)
+		control_state |= TIOCM_RTS;
+	if (set & TIOCM_DTR)
+		control_state |= TIOCM_DTR;
+	if (clear & TIOCM_RTS)
+		control_state &= ~TIOCM_RTS;
+	if (clear & TIOCM_DTR)
+		control_state &= ~TIOCM_DTR;
+
+	priv->control_state = control_state;
 	spin_unlock_irqrestore(&priv->lock, flags);
+	return mct_u232_set_modem_ctrl(serial, control_state);
+}
+
+static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file,
+			   unsigned int cmd, unsigned long arg)
+{
+	dbg("%scmd=0x%x", __FUNCTION__, cmd);
 
 	/* Based on code from acm.c and others */
 	switch (cmd) {
-	case TIOCMGET:
-		return put_user(control_state, (unsigned long *) arg);
-		break;
-
-	case TIOCMSET: /* Turns on and off the lines as specified by the mask */
-	case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
-	case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */
-		if (get_user(mask, (unsigned long *) arg))
-			return -EFAULT;
-
-		if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) {
-			/* RTS needs set */
-			if( ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) ||
-			    (cmd == TIOCMBIS) )
-				control_state |=  TIOCM_RTS;
-			else
-				control_state &= ~TIOCM_RTS;
-		}
-
-		if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) {
-			/* DTR needs set */
-			if( ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) ||
-			    (cmd == TIOCMBIS) )
-				control_state |=  TIOCM_DTR;
-			else
-				control_state &= ~TIOCM_DTR;
-		}
-		mct_u232_set_modem_ctrl(serial, control_state);
-
-		spin_lock_irqsave(&priv->lock, flags);
-		priv->control_state = control_state;
-		spin_unlock_irqrestore(&priv->lock, flags);
-		break;
-					
 	case TIOCMIWAIT:
 		/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
 		/* TODO */
diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c	Fri Mar 14 06:58:12 2003
+++ b/drivers/usb/serial/pl2303.c	Thu Apr 24 07:53:32 2003
@@ -1,7 +1,8 @@
 /*
  * Prolific PL2303 USB to serial adaptor driver
  *
- * Copyright (C) 2001-2002 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2001-2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2003 IBM Corp.
  *
  * Original driver for 2.2.x by anonymous
  *
@@ -111,6 +112,16 @@
 #define VENDOR_READ_REQUEST_TYPE	0xc0
 #define VENDOR_READ_REQUEST		0x01
 
+#define UART_STATE			0x08
+#define UART_DCD			0x01
+#define UART_DSR			0x02
+#define UART_BREAK_ERROR		0x04
+#define UART_RING			0x08
+#define UART_FRAME_ERROR		0x10
+#define UART_PARITY_ERROR		0x20
+#define UART_OVERRUN_ERROR		0x40
+#define UART_CTS			0x80
+
 /* function prototypes for a PL2303 serial converter */
 static int pl2303_open (struct usb_serial_port *port, struct file *filp);
 static void pl2303_close (struct usb_serial_port *port, struct file *filp);
@@ -124,6 +135,9 @@
 static int pl2303_write (struct usb_serial_port *port, int from_user,
 			 const unsigned char *buf, int count);
 static void pl2303_break_ctl(struct usb_serial_port *port,int break_state);
+static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file);
+static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file,
+			    unsigned int set, unsigned int clear);
 static int pl2303_startup (struct usb_serial *serial);
 static void pl2303_shutdown (struct usb_serial *serial);
 
@@ -143,6 +157,8 @@
 	.ioctl =		pl2303_ioctl,
 	.break_ctl =		pl2303_break_ctl,
 	.set_termios =		pl2303_set_termios,
+	.tiocmget =		pl2303_tiocmget,
+	.tiocmset =		pl2303_tiocmset,
 	.read_bulk_callback =	pl2303_read_bulk_callback,
 	.read_int_callback =	pl2303_read_int_callback,
 	.write_bulk_callback =	pl2303_write_bulk_callback,
@@ -153,6 +169,7 @@
 struct pl2303_private {
 	spinlock_t lock;
 	u8 line_control;
+	u8 line_status;
 	u8 termios_initialized;
 };
 
@@ -222,6 +239,7 @@
 {
 	struct usb_serial *serial = port->serial;
 	struct pl2303_private *priv = usb_get_serial_port_data(port);
+	unsigned long flags;
 	unsigned int cflag;
 	unsigned char *buf;
 	int baud;
@@ -234,13 +252,13 @@
 		return;
 	}
 
-	spin_lock(&priv->lock);
+	spin_lock_irqsave(&priv->lock, flags);
 	if (!priv->termios_initialized) {
 		*(port->tty->termios) = tty_std_termios;
 		port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
 		priv->termios_initialized = 1;
 	}
-	spin_unlock(&priv->lock);
+	spin_unlock_irqrestore(&priv->lock, flags);
 
 	cflag = port->tty->termios->c_cflag;
 	/* check that they really want us to change something */
@@ -350,13 +368,13 @@
 	if (cflag && CBAUD) {
 		u8 control;
 
-		spin_lock (&priv->lock);
+		spin_lock_irqsave(&priv->lock, flags);
 		if ((cflag && CBAUD) == B0)
 			priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);
 		else
 			priv->line_control |= (CONTROL_DTR | CONTROL_RTS);
 		control = priv->line_control;
-		spin_unlock (&priv->lock);
+		spin_unlock_irqrestore(&priv->lock, flags);
 		set_control_lines (serial->dev, control);
 	}
 	
@@ -445,6 +463,7 @@
 {
 	struct usb_serial *serial;
 	struct pl2303_private *priv;
+	unsigned long flags;
 	unsigned int c_cflag;
 	int result;
 
@@ -481,72 +500,56 @@
 		if (c_cflag & HUPCL) {
 			/* drop DTR and RTS */
 			priv = usb_get_serial_port_data(port);
-			spin_lock (&priv->lock);
+			spin_lock_irqsave(&priv->lock, flags);
 			priv->line_control = 0;
-			spin_unlock (&priv->lock);
+			spin_unlock_irqrestore (&priv->lock, flags);
 			set_control_lines (port->serial->dev, 0);
 		}
 	}
 
 }
 
-static int set_modem_info (struct usb_serial_port *port, unsigned int cmd, unsigned int *value)
+static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file,
+			    unsigned int set, unsigned int clear)
 {
 	struct pl2303_private *priv = usb_get_serial_port_data(port);
-	unsigned int arg;
+	unsigned long flags;
 	u8 control;
 
-	if (copy_from_user(&arg, value, sizeof(int)))
-		return -EFAULT;
-
-	spin_lock (&priv->lock);
-	switch (cmd) {
-		case TIOCMBIS:
-			if (arg & TIOCM_RTS)
-				priv->line_control |= CONTROL_RTS;
-			if (arg & TIOCM_DTR)
-				priv->line_control |= CONTROL_DTR;
-			break;
-
-		case TIOCMBIC:
-			if (arg & TIOCM_RTS)
-				priv->line_control &= ~CONTROL_RTS;
-			if (arg & TIOCM_DTR)
-				priv->line_control &= ~CONTROL_DTR;
-			break;
-
-		case TIOCMSET:
-			/* turn off RTS and DTR and then only turn
-			   on what was asked to */
-			priv->line_control &= ~(CONTROL_RTS | CONTROL_DTR);
-			priv->line_control |= ((arg & TIOCM_RTS) ? CONTROL_RTS : 0);
-			priv->line_control |= ((arg & TIOCM_DTR) ? CONTROL_DTR : 0);
-			break;
-	}
+	spin_lock_irqsave (&priv->lock, flags);
+	if (set & TIOCM_RTS)
+		priv->line_control |= CONTROL_RTS;
+	if (set & TIOCM_DTR)
+		priv->line_control |= CONTROL_DTR;
+	if (clear & TIOCM_RTS)
+		priv->line_control &= ~CONTROL_RTS;
+	if (clear & TIOCM_DTR)
+		priv->line_control &= ~CONTROL_DTR;
 	control = priv->line_control;
-	spin_unlock (&priv->lock);
+	spin_unlock_irqrestore (&priv->lock, flags);
 
 	return set_control_lines (port->serial->dev, control);
 }
 
-static int get_modem_info (struct usb_serial_port *port, unsigned int *value)
+static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file)
 {
 	struct pl2303_private *priv = usb_get_serial_port_data(port);
+	unsigned long flags;
 	unsigned int mcr;
 	unsigned int result;
 
-	spin_lock (&priv->lock);
+	dbg("%s (%d)", __FUNCTION__, port->number);
+
+	spin_lock_irqsave (&priv->lock, flags);
 	mcr = priv->line_control;
-	spin_unlock (&priv->lock);
+	spin_unlock_irqrestore (&priv->lock, flags);
 
 	result = ((mcr & CONTROL_DTR)		? TIOCM_DTR : 0)
 		  | ((mcr & CONTROL_RTS)	? TIOCM_RTS : 0);
 
 	dbg("%s - result = %x", __FUNCTION__, result);
 
-	if (copy_to_user(value, &result, sizeof(int)))
-		return -EFAULT;
-	return 0;
+	return result;
 }
 
 static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg)
@@ -554,17 +557,6 @@
 	dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd);
 
 	switch (cmd) {
-		
-		case TIOCMGET:
-			dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number);
-			return get_modem_info (port, (unsigned int *)arg);
-
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__,  port->number);
-			return set_modem_info(port, cmd, (unsigned int *) arg);
-
 		default:
 			dbg("%s not supported = 0x%04x", __FUNCTION__, cmd);
 			break;
@@ -573,7 +565,6 @@
 	return -ENOIOCTLCMD;
 }
 
-
 static void pl2303_break_ctl (struct usb_serial_port *port, int break_state)
 {
 	struct usb_serial *serial = port->serial;
@@ -613,9 +604,13 @@
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
 	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-	//unsigned char *data = urb->transfer_buffer;
+	struct pl2303_private *priv = usb_get_serial_port_data(port);
+	unsigned char *data = urb->transfer_buffer;
+	unsigned long flags;
 	int status;
 
+	dbg("%s (%d)", __FUNCTION__, port->number);
+
 	switch (urb->status) {
 	case 0:
 		/* success */
@@ -637,8 +632,14 @@
 
 	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 
-	//FIXME need to update state of terminal lines variable
+	if (urb->actual_length > UART_STATE)
+		goto exit;
 
+	/* Save off the uart status for others to look at */
+	spin_lock_irqsave(&priv->lock, flags);
+	priv->line_status = data[UART_STATE];
+	spin_unlock_irqrestore(&priv->lock, flags);
+		
 exit:
 	status = usb_submit_urb (urb, GFP_ATOMIC);
 	if (status)
@@ -651,10 +652,14 @@
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
 	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
+	struct pl2303_private *priv = usb_get_serial_port_data(port);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
+	unsigned long flags;
 	int i;
 	int result;
+	u8 status;
+	char tty_flag;
 
 	if (port_paranoia_check (port, __FUNCTION__))
 		return;
@@ -688,13 +693,34 @@
 
 	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
 
+	/* get tty_flag from status */
+	tty_flag = TTY_NORMAL;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	status = priv->line_status;
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	/* break takes precedence over parity, */
+	/* which takes precedence over framing errors */
+	if (status & UART_BREAK_ERROR )
+		tty_flag = TTY_BREAK;
+	else if (status & UART_PARITY_ERROR)
+		tty_flag = TTY_PARITY;
+	else if (status & UART_FRAME_ERROR)
+		tty_flag = TTY_FRAME;
+	dbg("%s - tty_flag = %d", __FUNCTION__, tty_flag);
+
 	tty = port->tty;
 	if (tty && urb->actual_length) {
+		/* overrun is special, not associated with a char */
+		if (status & UART_OVERRUN_ERROR)
+			tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+
 		for (i = 0; i < urb->actual_length; ++i) {
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
 				tty_flip_buffer_push(tty);
 			}
-			tty_insert_flip_char (tty, data[i], 0);
+			tty_insert_flip_char (tty, data[i], tty_flag);
 		}
 		tty_flip_buffer_push (tty);
 	}
diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c	Mon Apr  7 13:40:45 2003
+++ b/drivers/usb/serial/usb-serial.c	Thu Apr 24 16:01:59 2003
@@ -389,9 +389,9 @@
 static LIST_HEAD(usb_serial_driver_list);
 
 
-struct usb_serial *usb_serial_get_by_minor (unsigned int minor)
+struct usb_serial *usb_serial_get_by_index(unsigned index)
 {
-	struct usb_serial *serial = serial_table[minor];
+	struct usb_serial *serial = serial_table[index];
 
 	if (serial)
 		kobject_get (&serial->kobj);
@@ -462,13 +462,13 @@
 	tty->driver_data = NULL;
 
 	/* get the serial object associated with this tty pointer */
-	serial = usb_serial_get_by_minor (minor(tty->device));
+	serial = usb_serial_get_by_index(tty->index);
 
 	if (serial_paranoia_check (serial, __FUNCTION__))
 		return -ENODEV;
 
 	/* set up our port structure making the tty driver remember our port object, and us it */
-	portNumber = minor(tty->device) - serial->minor;
+	portNumber = tty->index - serial->minor;
 	port = &serial->port[portNumber];
 	tty->driver_data = port;
 
@@ -753,7 +753,7 @@
 	dbg("%s", __FUNCTION__);
 	length += sprintf (page, "usbserinfo:1.0 driver:%s\n", DRIVER_VERSION);
 	for (i = 0; i < SERIAL_TTY_MINORS && length < PAGE_SIZE; ++i) {
-		serial = usb_serial_get_by_minor(i);
+		serial = usb_serial_get_by_index(i);
 		if (serial == NULL)
 			continue;
 
@@ -785,6 +785,51 @@
 	return ((count < begin+length-off) ? count : begin+length-off);
 }
 
+static int serial_tiocmget (struct tty_struct *tty, struct file *file)
+{
+	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
+	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
+
+	if (!serial)
+		goto exit;
+
+	dbg("%s - port %d", __FUNCTION__, port->number);
+
+	if (!port->open_count) {
+		dbg("%s - port not open", __FUNCTION__);
+		goto exit;
+	}
+
+	if (serial->type->tiocmget)
+		return serial->type->tiocmget(port, file);
+
+exit:
+	return -EINVAL;
+}
+
+static int serial_tiocmset (struct tty_struct *tty, struct file *file,
+			    unsigned int set, unsigned int clear)
+{
+	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
+	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
+
+	if (!serial)
+		goto exit;
+
+	dbg("%s - port %d", __FUNCTION__, port->number);
+
+	if (!port->open_count) {
+		dbg("%s - port not open", __FUNCTION__);
+		goto exit;
+	}
+
+	if (serial->type->tiocmset)
+		return serial->type->tiocmset(port, file, set, clear);
+
+exit:
+	return -EINVAL;
+}
+
 void usb_serial_port_softint(void *private)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)private;
@@ -1261,7 +1306,7 @@
 #ifndef CONFIG_DEVFS_FS
 	.name =			"ttyUSB",
 #else
-	.name =			"usb/tts/%d",
+	.name =			"usb/tts/",
 #endif
 	.major =		SERIAL_TTY_MAJOR,
 	.minor_start =		0,
@@ -1286,6 +1331,8 @@
 	.break_ctl =		serial_break,
 	.chars_in_buffer =	serial_chars_in_buffer,
 	.read_proc =		serial_read_proc,
+	.tiocmget =		serial_tiocmget,
+	.tiocmset =		serial_tiocmset,
 };
 
 
diff -Nru a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
--- a/drivers/usb/serial/usb-serial.h	Thu Mar 13 10:36:02 2003
+++ b/drivers/usb/serial/usb-serial.h	Wed Apr 23 10:33:08 2003
@@ -251,6 +251,8 @@
 	int  (*chars_in_buffer)	(struct usb_serial_port *port);
 	void (*throttle)	(struct usb_serial_port *port);
 	void (*unthrottle)	(struct usb_serial_port *port);
+	int  (*tiocmget)	(struct usb_serial_port *port, struct file *file);
+	int  (*tiocmset)	(struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
 
 	void (*read_int_callback)(struct urb *urb, struct pt_regs *regs);
 	void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs);
diff -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
--- a/drivers/usb/serial/whiteheat.c	Thu Mar 20 05:42:23 2003
+++ b/drivers/usb/serial/whiteheat.c	Thu Apr 24 16:01:59 2003
@@ -146,6 +146,8 @@
 static int  whiteheat_write_room	(struct usb_serial_port *port);
 static int  whiteheat_ioctl		(struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
 static void whiteheat_set_termios	(struct usb_serial_port *port, struct termios * old);
+static int  whiteheat_tiocmget		(struct usb_serial_port *port, struct file *file);
+static int  whiteheat_tiocmset		(struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
 static void whiteheat_break_ctl		(struct usb_serial_port *port, int break_state);
 static int  whiteheat_chars_in_buffer	(struct usb_serial_port *port);
 static void whiteheat_throttle		(struct usb_serial_port *port);
@@ -184,6 +186,8 @@
 	.ioctl =		whiteheat_ioctl,
 	.set_termios =		whiteheat_set_termios,
 	.break_ctl =		whiteheat_break_ctl,
+	.tiocmget =		whiteheat_tiocmget,
+	.tiocmset =		whiteheat_tiocmset,
 	.chars_in_buffer =	whiteheat_chars_in_buffer,
 	.throttle =		whiteheat_throttle,
 	.unthrottle =		whiteheat_unthrottle,
@@ -646,8 +650,8 @@
 	}
 */
 
-	if (port->tty->driver.flush_buffer)
-		port->tty->driver.flush_buffer(port->tty);
+	if (port->tty->driver->flush_buffer)
+		port->tty->driver->flush_buffer(port->tty);
 	if (port->tty->ldisc.flush_buffer)
 		port->tty->ldisc.flush_buffer(port->tty);
 
@@ -767,73 +771,53 @@
 }
 
 
-static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+static int whiteheat_tiocmget (struct usb_serial_port *port, struct file *file)
 {
 	struct whiteheat_private *info = usb_get_serial_port_data(port);
 	unsigned int modem_signals = 0;
-	struct serial_struct serstruct;
-
-	dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
 
-	switch (cmd) {
-		case TIOCMGET:
-			firm_get_dtr_rts(port);
-			if (info->mcr & UART_MCR_DTR)
-				modem_signals |= TIOCM_DTR;
-			if (info->mcr & UART_MCR_RTS)
-				modem_signals |= TIOCM_RTS;
-			
-			if (copy_to_user((unsigned int *)arg, &modem_signals, sizeof(unsigned int)))
-				return -EFAULT;
-
-			break;
-
-		case TIOCMSET:
-			if (copy_from_user(&modem_signals, (unsigned int *)arg, sizeof(unsigned int)))
-				return -EFAULT;
-
-			if (modem_signals & TIOCM_DTR)
-				info->mcr |= UART_MCR_DTR;
-			else
-				info->mcr &= ~UART_MCR_DTR;
-			if (modem_signals & TIOCM_RTS)
-				info->mcr |= UART_MCR_RTS;
-			else
-				info->mcr &= ~UART_MCR_RTS;
+	dbg("%s - port %d", __FUNCTION__, port->number);
 
-			firm_set_dtr(port, info->mcr & UART_MCR_DTR);
-			firm_set_rts(port, info->mcr & UART_MCR_RTS);
+	firm_get_dtr_rts(port);
+	if (info->mcr & UART_MCR_DTR)
+		modem_signals |= TIOCM_DTR;
+	if (info->mcr & UART_MCR_RTS)
+		modem_signals |= TIOCM_RTS;
 
-			break;
+	return modem_signals;
+}
 
-		case TIOCMBIS:
-			if (copy_from_user(&modem_signals, (unsigned int *)arg, sizeof(unsigned int)))
-				return -EFAULT;
 
-			if (modem_signals & TIOCM_DTR)
-				info->mcr |= UART_MCR_DTR;
-			if (modem_signals & TIOCM_RTS)
-				info->mcr |= UART_MCR_RTS;
+static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file,
+			       unsigned int set, unsigned int clear)
+{
+	struct whiteheat_private *info = usb_get_serial_port_data(port);
 
-			firm_set_dtr(port, info->mcr & UART_MCR_DTR);
-			firm_set_rts(port, info->mcr & UART_MCR_RTS);
+	dbg("%s - port %d", __FUNCTION__, port->number);
 
-			break;
+	if (set & TIOCM_RTS)
+		info->mcr |= UART_MCR_RTS;
+	if (set & TIOCM_DTR)
+		info->mcr |= UART_MCR_DTR;
+
+	if (clear & TIOCM_RTS)
+		info->mcr &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR)
+		info->mcr &= ~UART_MCR_DTR;
 
-		case TIOCMBIC:
-			if (copy_from_user(&modem_signals, (unsigned int *)arg, sizeof(unsigned int)))
-				return -EFAULT;
+	firm_set_dtr(port, info->mcr & UART_MCR_DTR);
+	firm_set_rts(port, info->mcr & UART_MCR_RTS);
+	return 0;
+}
 
-			if (modem_signals & TIOCM_DTR)
-				info->mcr &= ~UART_MCR_DTR;
-			if (modem_signals & TIOCM_RTS)
-				info->mcr &= ~UART_MCR_RTS;
 
-			firm_set_dtr(port, info->mcr & UART_MCR_DTR);
-			firm_set_rts(port, info->mcr & UART_MCR_RTS);
+static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
+{
+	struct serial_struct serstruct;
 
-			break;
+	dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
 
+	switch (cmd) {
 		case TIOCGSERIAL:
 			memset(&serstruct, 0, sizeof(serstruct));
 			serstruct.type = PORT_16654;
@@ -864,10 +848,10 @@
 			break;
 
 		default:
-			return -ENOIOCTLCMD;
+			break;
 	}
 
-	return 0;
+	return -ENOIOCTLCMD;
 }
 
 
diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
--- a/drivers/usb/usb-skeleton.c	Mon Mar 24 13:03:56 2003
+++ b/drivers/usb/usb-skeleton.c	Fri Apr 18 11:49:59 2003
@@ -98,7 +98,6 @@
 struct usb_skel {
 	struct usb_device *	udev;			/* save off the usb device pointer */
 	struct usb_interface *	interface;		/* the interface for this device */
-	devfs_handle_t		devfs;			/* devfs device node */
 	unsigned char		minor;			/* the starting minor number for this device */
 	unsigned char		num_ports;		/* the number of ports this device has */
 	char			num_interrupt_in;	/* number of interrupt in endpoints we have */
@@ -610,7 +609,7 @@
 	/* initialize the devfs node for this device and register it */
 	sprintf(name, "usb/skel%d", dev->minor);
 
-	dev->devfs = devfs_register(NULL, name,
+	devfs = devfs_register(NULL, name,
 				     DEVFS_FL_DEFAULT, USB_MAJOR,
 				     dev->minor,
 				     S_IFCHR | S_IRUSR | S_IWUSR |
@@ -674,7 +673,7 @@
 	minor = dev->minor;
 
 	/* remove our devfs node */
-	devfs_unregister (dev->devfs);
+	devfs_remove("usb/skel%d", dev->minor);
 
 	/* give back our dynamic minor */
 	usb_deregister_dev (1, minor);
diff -Nru a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c
--- a/drivers/video/S3triofb.c	Thu Oct 31 12:05:41 2002
+++ b/drivers/video/S3triofb.c	Thu Apr 24 03:30:41 2003
@@ -520,7 +520,6 @@
 
     strcpy(fb_info.modename, "Trio64 ");
     strncat(fb_info.modename, dp->full_name, sizeof(fb_info.modename));
-    fb_info.node = NODEV;
     fb_info.currcon = -1;
     fb_info.fbops = &s3trio_ops;
     fb_info.screen_base = s3trio_base;	
@@ -542,7 +541,7 @@
 	return;
 
     printk("fb%d: S3 Trio frame buffer device on %s\n",
-	   minor(fb_info.node), dp->full_name);
+	   fb_info.node, dp->full_name);
 }
 
 
diff -Nru a/drivers/video/acornfb.c b/drivers/video/acornfb.c
--- a/drivers/video/acornfb.c	Sat Jan 18 11:54:34 2003
+++ b/drivers/video/acornfb.c	Thu Apr 24 03:30:41 2003
@@ -979,7 +979,6 @@
 		return;
 	first = 0;
 
-	fb_info.node		= NODEV;
 	fb_info.fbops		= &acornfb_ops;
 	fb_info.flags		= FBINFO_FLAG_DEFAULT;
 
diff -Nru a/drivers/video/amifb.c b/drivers/video/amifb.c
--- a/drivers/video/amifb.c	Fri Mar 21 14:13:56 2003
+++ b/drivers/video/amifb.c	Thu Apr 24 03:30:41 2003
@@ -1143,7 +1143,7 @@
 	 */
 
 static int flash_cursor(void);
-static void amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp);
+static irqreturn_t amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp);
 static u_long chipalloc(u_long size);
 static void chipfree(void);
 
@@ -2385,7 +2385,6 @@
 	    fb_info.monspecs.vfmax = 90;
 	}
 
-	fb_info.node = NODEV;
 	fb_info.fbops = &amifb_ops;
 	fb_info.par = &currentpar;
 	fb_info.flags = FBINFO_FLAG_DEFAULT;
@@ -2453,7 +2452,7 @@
 	}
 
 	printk("fb%d: %s frame buffer device, using %dK of video memory\n",
-	       minor(fb_info.node), fb_info.fix.id, fb_info.fix.smem_len>>10);
+	       fb_info.node, fb_info.fix.id, fb_info.fix.smem_len>>10);
 
 	return 0;
 
@@ -2504,7 +2503,7 @@
 	 * VBlank Display Interrupt
 	 */
 
-static void amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp)
+static irqreturn_t amifb_interrupt(int irq, void *dev_id, struct pt_regs *fp)
 {
 	if (do_vmode_pan || do_vmode_full)
 		ami_update_display();
@@ -2534,6 +2533,7 @@
 		ami_reinit_copper();
 		do_vmode_full = 0;
 	}
+	return IRQ_HANDLED;
 }
 
 /* --------------------------- Hardware routines --------------------------- */
diff -Nru a/drivers/video/anakinfb.c b/drivers/video/anakinfb.c
--- a/drivers/video/anakinfb.c	Fri Nov 22 13:46:58 2002
+++ b/drivers/video/anakinfb.c	Thu Apr 24 03:30:41 2003
@@ -73,7 +73,6 @@
 {
 	memset(&fb_info, 0, sizeof(struct fb_info));
 
-	fb_info.node = NODEV;
 	fb_info.flags = FBINFO_FLAG_DEFAULT;
 	fb_info.fbops = &anakinfb_ops;
 	fb_info.var = anakinfb_var;
diff -Nru a/drivers/video/atafb.c b/drivers/video/atafb.c
--- a/drivers/video/atafb.c	Tue Nov 19 12:03:56 2002
+++ b/drivers/video/atafb.c	Thu Apr 24 03:30:41 2003
@@ -1522,7 +1522,7 @@
 }
 
 
-static void falcon_vbl_switcher( int irq, void *dummy, struct pt_regs *fp )
+static irqreturn_t falcon_vbl_switcher( int irq, void *dummy, struct pt_regs *fp )
 {
 	struct falcon_hw *hw = &f_new_mode;
 
@@ -1579,6 +1579,7 @@
 		videl.xoffset = current_par.hw.falcon.xoffset;
 		shifter_f030.off_next = current_par.hw.falcon.line_offset;
 	}
+	return IRQ_HANDLED;
 }
 
 
@@ -2792,7 +2793,6 @@
 
 	strcpy(fb_info.modename, "Atari Builtin ");
 	fb_info.changevar = NULL;
-	fb_info.node = NODEV;
 	fb_info.fbops = &atafb_ops;
 	fb_info.disp = &disp;
 	fb_info.currcon = -1;
@@ -2816,7 +2816,7 @@
 	   printk("   virtual %dx%d\n",
 			  disp.var.xres_virtual, disp.var.yres_virtual);
 	printk("fb%d: %s frame buffer device, using %dK of video memory\n",
-	       minor(fb_info.node), fb_info.modename, screen_len>>10);
+	       fb_info.node, fb_info.modename, screen_len>>10);
 
 	/* TODO: This driver cannot be unloaded yet */
 	MOD_INC_USE_COUNT;
diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
--- a/drivers/video/aty/aty128fb.c	Tue Mar 25 07:10:05 2003
+++ b/drivers/video/aty/aty128fb.c	Thu Apr 24 03:30:41 2003
@@ -1534,7 +1534,6 @@
 	par->chip_gen = ent->driver_data;
 
 	/* fill in info */
-	info->node  = NODEV;
 	info->fbops = &aty128fb_ops;
 	info->flags = FBINFO_FLAG_DEFAULT;
 
@@ -1635,7 +1634,7 @@
 #endif
 
 	printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
-	       minor(info->node), info->fix.id, video_card);
+	       info->node, info->fix.id, video_card);
 
 	return 1;	/* success! */
 }
diff -Nru a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
--- a/drivers/video/aty/atyfb_base.c	Tue Feb 25 10:31:27 2003
+++ b/drivers/video/aty/atyfb_base.c	Thu Apr 24 03:30:41 2003
@@ -1747,7 +1747,6 @@
 	fb_memset((void *) info->screen_base, 0,
 		  info->fix.smem_len);
 
-	info->node = NODEV;
 	info->fbops = &atyfb_ops;
 	info->pseudo_palette = pseudo_palette;
 	info->flags = FBINFO_FLAG_DEFAULT;
@@ -1861,7 +1860,7 @@
 	fb_list = info;
 
 	printk("fb%d: %s frame buffer device on %s\n",
-	       minor(info->node), info->fix.id, name);
+	       info->node, info->fix.id, name);
 	return 1;
 }
 
diff -Nru a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c
--- a/drivers/video/aty/mach64_gx.c	Sun Feb  9 15:55:58 2003
+++ b/drivers/video/aty/mach64_gx.c	Sat Apr 19 23:22:36 2003
@@ -119,7 +119,7 @@
 }
 
 static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per,
-			      u32 bpp, u32 width, union aty_pll *pll)
+			      u8 bpp, union aty_pll *pll)
 {
 	/*
 	 *  FIXME: use real calculations instead of using fixed values from the old
@@ -338,7 +338,7 @@
      */
 
 static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per,
-				u32 bpp, u32 width, union aty_pll *pll)
+				u8 bpp, union aty_pll *pll)
 {
 	u32 MHz100;		/* in 0.01 MHz */
 	u32 program_bits;
@@ -494,7 +494,7 @@
      */
 
 static int aty_var_to_pll_1703(const struct fb_info *info, u32 vclk_per,
-			       u32 bpp, u32 width, union aty_pll *pll)
+			       u32 vclk_per, u8 bpp, union aty_pll *pll)
 {
 	u32 mhz100;		/* in 0.01 MHz */
 	u32 program_bits;
@@ -610,7 +610,7 @@
      */
 
 static int aty_var_to_pll_8398(const struct fb_info *info, u32 vclk_per,
-			       u32 bpp, u32 width, union aty_pll *pll)
+			       u32 vclk_per, u8 bpp, union aty_pll *pll)
 {
 	u32 tempA, tempB, fOut, longMHz100, diff, preDiff;
 
@@ -734,7 +734,7 @@
      */
 
 static int aty_var_to_pll_408(const struct fb_info *info, u32 vclk_per,
-			      u32 bpp, u32 width, union aty_pll *pll)
+			      u8 bpp, union aty_pll *pll)
 {
 	u32 mhz100;		/* in 0.01 MHz */
 	u32 program_bits;
diff -Nru a/drivers/video/bw2.c b/drivers/video/bw2.c
--- a/drivers/video/bw2.c	Tue Mar  4 09:55:26 2003
+++ b/drivers/video/bw2.c	Thu Apr 24 03:30:41 2003
@@ -346,7 +346,6 @@
 
 	all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres);
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &bw2_ops;
 #if defined(CONFIG_SPARC32)
diff -Nru a/drivers/video/cg14.c b/drivers/video/cg14.c
--- a/drivers/video/cg14.c	Tue Mar  4 09:55:26 2003
+++ b/drivers/video/cg14.c	Thu Apr 24 03:30:41 2003
@@ -473,7 +473,6 @@
 	all->par.mode = MDI_8_PIX;
 	all->par.ramsize = (is_8mb ? 0x800000 : 0x400000);
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &cg14_ops;
 	all->info.currcon = -1;
diff -Nru a/drivers/video/cg3.c b/drivers/video/cg3.c
--- a/drivers/video/cg3.c	Tue Mar  4 09:55:26 2003
+++ b/drivers/video/cg3.c	Thu Apr 24 03:30:41 2003
@@ -395,7 +395,6 @@
 		sbus_ioremap(&sdev->resource[0], CG3_REGS_OFFSET,
 			     sizeof(struct cg3_regs), "cg3 regs");
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &cg3_ops;
 #ifdef CONFIG_SPARC32
diff -Nru a/drivers/video/cg6.c b/drivers/video/cg6.c
--- a/drivers/video/cg6.c	Sun Mar 23 00:28:04 2003
+++ b/drivers/video/cg6.c	Thu Apr 24 03:30:41 2003
@@ -680,7 +680,6 @@
 		sbus_ioremap(&sdev->resource[0], CG6_FHC_OFFSET,
 			     sizeof(u32), "cgsix fhc");
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &cg6_ops;
 #ifdef CONFIG_SPARC32
diff -Nru a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
--- a/drivers/video/chipsfb.c	Sat Dec 21 13:15:36 2002
+++ b/drivers/video/chipsfb.c	Thu Apr 24 03:30:41 2003
@@ -361,7 +361,6 @@
 
 	p->var = chipsfb_var;
 
-	p->node = NODEV;
 	p->fbops = &chipsfb_ops;
 	p->flags = FBINFO_FLAG_DEFAULT;
 
@@ -373,7 +372,7 @@
 	}
 
 	printk(KERN_INFO "fb%d: Chips 65550 frame buffer (%dK RAM detected)\n",
-		minor(p->node), p->fix.smem_len / 1024);
+		p->node, p->fix.smem_len / 1024);
 
 	chips_hw_init();
 }
diff -Nru a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
--- a/drivers/video/cirrusfb.c	Tue Mar  4 05:33:23 2003
+++ b/drivers/video/cirrusfb.c	Thu Apr 24 03:30:41 2003
@@ -2781,7 +2781,6 @@
 		 sizeof (fb_info->gen.info.modename));
 	fb_info->gen.info.modename [sizeof (fb_info->gen.info.modename) - 1] = 0;
 
-	fb_info->gen.info.node = NODEV;
 	fb_info->gen.info.fbops = &clgenfb_ops;
 	fb_info->gen.info.disp = &disp;
 	fb_info->gen.info.currcon = -1;
diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	Thu Apr 10 08:47:57 2003
+++ b/drivers/video/console/fbcon.c	Mon Apr 21 01:18:58 2003
@@ -138,7 +138,6 @@
 #define DEFAULT_CURSOR_BLINK_RATE	(20)
 
 static int vbl_cursor_cnt;
-static int cursor_blink_rate;
 
 #define divides(a, b)	((!(a) || (b)%(a)) ? 0 : 1)
 
@@ -185,7 +184,7 @@
  */
 static int vbl_detected;
 
-static void fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
+static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
 {
 	vbl_detected++;
 }
@@ -202,7 +201,9 @@
 	info->fbops->fb_cursor(info, &info->cursor);
 }
 
-static void fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp)
+#if (defined(__arm__) && defined(IRQ_VSYNCPULSE)) || defined(CONFIG_ATARI) || defined(CONFIG_MAC)
+static int cursor_blink_rate;
+static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp)
 {
 	struct fb_info *info = dev_id;
 
@@ -210,7 +211,9 @@
 		schedule_work(&info->queue);	
 		vbl_cursor_cnt = cursor_blink_rate; 
 	}
+	return IRQ_HANDLED;
 }
+#endif
 	
 static void cursor_timer_handler(unsigned long dev_addr);
 
@@ -527,8 +530,9 @@
 	struct fb_info *info;
 	struct vc_data *vc;
 	static int done = 0;
-	int irqres = 1;
+	int irqres;
 
+	irqres = 1;
 	/*
 	 *  If num_registered_fb is zero, this is a call for the dummy part.
 	 *  The frame buffer devices weren't initialized yet.
diff -Nru a/drivers/video/controlfb.c b/drivers/video/controlfb.c
--- a/drivers/video/controlfb.c	Tue Mar 25 07:10:05 2003
+++ b/drivers/video/controlfb.c	Thu Apr 24 03:30:41 2003
@@ -483,7 +483,7 @@
 	if (register_framebuffer(&p->info) < 0)
 		return -ENXIO;
 	
-	printk(KERN_INFO "fb%d: control display adapter\n", minor(p->info.node));	
+	printk(KERN_INFO "fb%d: control display adapter\n", p->info.node);	
 
 	return 0;
 }
@@ -1008,7 +1008,6 @@
 {
 	/* Fill fb_info */
 	info->par = &p->par;
-	info->node = NODEV;
 	info->fbops = &controlfb_ops;
 	info->pseudo_palette = p->pseudo_palette;
         info->flags = FBINFO_FLAG_DEFAULT;
diff -Nru a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
--- a/drivers/video/cyber2000fb.c	Wed Mar 26 06:55:17 2003
+++ b/drivers/video/cyber2000fb.c	Thu Apr 24 03:30:41 2003
@@ -1281,7 +1281,6 @@
 
 	cfb->fb.fbops		= &cyber2000fb_ops;
 	cfb->fb.flags		= FBINFO_FLAG_DEFAULT;
-	cfb->fb.node		= NODEV;
 	cfb->fb.pseudo_palette	= (void *)(cfb + 1);
 
 	fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0);
diff -Nru a/drivers/video/cyberfb.c b/drivers/video/cyberfb.c
--- a/drivers/video/cyberfb.c	Thu Oct 31 12:05:47 2002
+++ b/drivers/video/cyberfb.c	Thu Apr 24 03:30:41 2003
@@ -1033,7 +1033,6 @@
 
 	    strcpy(fb_info.modename, cyberfb_name);
 	    fb_info.changevar = NULL;
-	    fb_info.node = NODEV;
 	    fb_info.fbops = &cyberfb_ops;
 	    fb_info.screen_base = (unsigned char *)CyberMem;
 	    fb_info.disp = &disp;
@@ -1063,7 +1062,7 @@
 	    }
 
 	    printk("fb%d: %s frame buffer device, using %ldK of video memory\n",
-		   minor(fb_info.node), fb_info.modename, CyberSize>>10);
+		   fb_info.node, fb_info.modename, CyberSize>>10);
 
 	    /* TODO: This driver cannot be unloaded yet */
 	    MOD_INC_USE_COUNT;
diff -Nru a/drivers/video/dnfb.c b/drivers/video/dnfb.c
--- a/drivers/video/dnfb.c	Fri Mar 21 14:13:56 2003
+++ b/drivers/video/dnfb.c	Thu Apr 24 03:30:41 2003
@@ -229,7 +229,6 @@
 {
 	int err;
 
-	fb_info.node = NODEV;
 	fb_info.fbops = &dn_fb_ops;
 	fb_info.fix = dnfb_fix;
 	fb_info.var = dnfb_var;
diff -Nru a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
--- a/drivers/video/epson1355fb.c	Thu Oct 31 12:05:48 2002
+++ b/drivers/video/epson1355fb.c	Thu Apr 24 03:30:41 2003
@@ -500,7 +500,6 @@
 	fb_info.gen.fbhw->detect();
 	strcpy(fb_info.gen.info.modename, "SED1355");
 	fb_info.gen.info.changevar = NULL;
-	fb_info.gen.info.node = NODEV;
 	fb_info.gen.info.fbops = &e1355fb_ops;
 	fb_info.gen.info.screen_base = (void *)E1355_FB_BASE;
 	fb_info.gen.currcon = -1;
@@ -517,7 +516,7 @@
 		do_install_cmap(0, &fb_info.gen);
 	if (register_framebuffer(&fb_info.gen.info) < 0)
 		return -EINVAL;
-	printk(KERN_INFO "fb%d: %s frame buffer device\n", minor(fb_info.gen.info.node),
+	printk(KERN_INFO "fb%d: %s frame buffer device\n", fb_info.gen.info.node,
 	       fb_info.gen.info.modename);
 
 	return 0;
diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c	Sat Apr 12 17:33:14 2003
+++ b/drivers/video/fbmem.c	Thu Apr 24 03:30:41 2003
@@ -25,6 +25,7 @@
 #include <linux/mman.h>
 #include <linux/tty.h>
 #include <linux/init.h>
+#include <linux/linux_logo.h>
 #include <linux/proc_fs.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
@@ -655,7 +656,7 @@
 	}
 
 	/* Return if no suitable logo was found */
-	fb_logo.logo = find_logo(info->var.bits_per_pixel);
+	fb_logo.logo = fb_find_logo(info->var.bits_per_pixel);
 	
 	if (!fb_logo.logo || fb_logo.logo->height > info->var.yres) {
 		fb_logo.logo = NULL;
@@ -752,7 +753,7 @@
 	for (fi = registered_fb; fi < &registered_fb[FB_MAX] && len < 4000; fi++)
 		if (*fi)
 			clen += sprintf(buf + clen, "%d %s\n",
-				        minor((*fi)->node),
+				        (*fi)->node,
 				        (*fi)->fix.id);
 	*start = buf + offset;
 	if (clen > offset)
@@ -1222,7 +1223,7 @@
 	for (i = 0 ; i < FB_MAX; i++)
 		if (!registered_fb[i])
 			break;
-	fb_info->node = mk_kdev(FB_MAJOR, i);
+	fb_info->node = i;
 	
 	if (fb_info->pixmap.addr == NULL) {
 		fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL);
@@ -1264,7 +1265,7 @@
 {
 	int i;
 
-	i = minor(fb_info->node);
+	i = fb_info->node;
 	if (!registered_fb[i])
 		return -EINVAL;
 	devfs_remove("fb/%d", i);
diff -Nru a/drivers/video/ffb.c b/drivers/video/ffb.c
--- a/drivers/video/ffb.c	Sun Mar 23 00:28:04 2003
+++ b/drivers/video/ffb.c	Thu Apr 24 03:30:41 2003
@@ -895,7 +895,6 @@
 	all->par.prom_node = node;
 	all->par.prom_parent_node = parent;
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &ffb_ops;
 	all->info.screen_base = (char *) all->par.physbase + FFB_DFB24_POFF;
diff -Nru a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
--- a/drivers/video/fm2fb.c	Tue Feb 18 10:38:27 2003
+++ b/drivers/video/fm2fb.c	Thu Apr 24 03:30:41 2003
@@ -259,7 +259,6 @@
 		if (fm2fb_mode == -1)
 			fm2fb_mode = FM2FB_MODE_PAL;
 
-		fb_info.node = NODEV;
 		fb_info.fbops = &fm2fb_ops;
 		fb_info.var = fb_var_modes[fm2fb_mode];
 		fb_info.screen_base = (char *)fb_fix.smem_start;
@@ -273,7 +272,7 @@
 		if (register_framebuffer(&fb_info) < 0)
 			return -EINVAL;
 
-		printk("fb%d: %s frame buffer device\n", minor(fb_info.node), fb_fix.id);
+		printk("fb%d: %s frame buffer device\n", fb_info.node, fb_fix.id);
 		return 0;
 	}
 	return -ENXIO;
diff -Nru a/drivers/video/g364fb.c b/drivers/video/g364fb.c
--- a/drivers/video/g364fb.c	Tue Nov 26 16:03:45 2002
+++ b/drivers/video/g364fb.c	Thu Apr 24 03:30:41 2003
@@ -237,7 +237,6 @@
 	fb_fix.smem_len = (1 << (mem * 2)) * 512 * 1024;
 	fb_var.yres_virtual = fb_fix.smem_len / fb_var.xres;
 
-	fb_info.node = NODEV;
 	fb_info.fbops = &g364fb_ops;
 	fb_info.screen_base = (char *) G364_MEM_BASE;	/* virtual kernel address */
 	fb_info.var = fb_var;
diff -Nru a/drivers/video/hgafb.c b/drivers/video/hgafb.c
--- a/drivers/video/hgafb.c	Mon Mar  3 19:41:18 2003
+++ b/drivers/video/hgafb.c	Thu Apr 24 03:30:41 2003
@@ -549,7 +549,6 @@
 	hga_fix.smem_start = VGA_MAP_MEM(hga_vram_base);
 	hga_fix.smem_len = hga_vram_len;
 
-	fb_info.node = NODEV;
 	fb_info.flags = FBINFO_FLAG_DEFAULT;
 	fb_info.var = hga_default_var;
 	fb_info.fix = hga_fix;
@@ -565,7 +564,7 @@
                 return -EINVAL;
 
         printk(KERN_INFO "fb%d: %s frame buffer device\n",
-               minor(fb_info.node), fb_info.fix.id);
+               fb_info.node, fb_info.fix.id);
 	return 0;
 }
 
diff -Nru a/drivers/video/hitfb.c b/drivers/video/hitfb.c
--- a/drivers/video/hitfb.c	Wed Mar  5 09:22:33 2003
+++ b/drivers/video/hitfb.c	Thu Apr 24 03:30:41 2003
@@ -153,7 +153,6 @@
 	}
 	hitfb_var.yres = ldvntr+1;
 
-	fb_info.node		= NODEV;
 	fb_info.fbops 		= &hitfb_ops;
 	fb_info.var 		= hitfb_var;
 	fb_info.fix 		= hitfb_fix;
@@ -169,7 +168,7 @@
 		return -EINVAL;
     
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
-			minor(fb_info.node), fb_info.fix.id);
+			fb_info.node, fb_info.fix.id);
 	return 0;
 }
 
diff -Nru a/drivers/video/hpfb.c b/drivers/video/hpfb.c
--- a/drivers/video/hpfb.c	Mon Mar  3 19:41:18 2003
+++ b/drivers/video/hpfb.c	Thu Apr 24 03:30:41 2003
@@ -150,7 +150,6 @@
 	/*
 	 *	Let there be consoles..
 	 */
-	fb_info.node  = NODEV;
 	fb_info.fbops = &hpfb_ops;
 	fb_info.flags = FBINFO_FLAG_DEFAULT;
 	fb_info.var   = hpfb_defined;
diff -Nru a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
--- a/drivers/video/i810/i810_main.c	Thu Apr 10 08:47:57 2003
+++ b/drivers/video/i810/i810_main.c	Thu Apr 24 03:30:41 2003
@@ -1828,7 +1828,6 @@
 	i810_init_device(par);        
 
 	info->screen_base = par->fb.virtual;
-	info->node = NODEV;
 	info->fbops = &par->i810fb_ops;
 	info->pseudo_palette = par->pseudo_palette;
 	info->flags = FBINFO_FLAG_DEFAULT;
@@ -1861,7 +1860,7 @@
       	       "I810FB: Video RAM   : %dK\n" 
 	       "I810FB: Monitor     : H: %d-%d KHz V: %d-%d Hz\n"
 	       "I810FB: Mode        : %dx%d-%dbpp@%dHz\n",
-	       minor(info->node),
+	       info->node,
 	       i810_pci_list[entry->driver_data],
 	       VERSION_MAJOR, VERSION_MINOR, VERSION_TEENIE, BRANCH_VERSION,
 	       (int) par->fb.size>>10, info->monspecs.hfmin/1000,
diff -Nru a/drivers/video/igafb.c b/drivers/video/igafb.c
--- a/drivers/video/igafb.c	Mon Dec  9 17:38:23 2002
+++ b/drivers/video/igafb.c	Thu Apr 24 03:30:41 2003
@@ -356,7 +356,6 @@
         else 
                 video_cmap_len = 256;
 
-	info->node  = NODEV;
 	info->fbops = &igafb_ops;
 	info->flags = FBINFO_FLAG_DEFAULT;
 
@@ -366,7 +365,7 @@
 		return 0;
 
 	printk("fb%d: %s frame buffer device at 0x%08lx [%dMB VRAM]\n",
-	       minor(info->node), info->fix.id, 
+	       info->node, info->fix.id, 
 	       par->frame_buffer_phys, info->fix.smem_len >> 20);
 
 	iga_blank_border(par); 
diff -Nru a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
--- a/drivers/video/imsttfb.c	Sat Apr 12 17:33:15 2003
+++ b/drivers/video/imsttfb.c	Thu Apr 24 03:30:41 2003
@@ -1440,7 +1440,6 @@
 
 	info->var.pixclock = 1000000 / getclkMHz(par);
 
-	info->node = NODEV;
 	info->fbops = &imsttfb_ops;
 	info->flags = FBINFO_FLAG_DEFAULT;
 
@@ -1453,7 +1452,7 @@
 
 	tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8;
 	printk("fb%u: %s frame buffer; %uMB vram; chip version %u\n",
-		minor(info->node), info->fix.id, info->fix.smem_len >> 20, tmp);
+		info->node, info->fix.id, info->fix.smem_len >> 20, tmp);
 }
 
 static int __devinit
diff -Nru a/drivers/video/leo.c b/drivers/video/leo.c
--- a/drivers/video/leo.c	Fri Mar  7 18:42:32 2003
+++ b/drivers/video/leo.c	Thu Apr 24 03:30:41 2003
@@ -510,7 +510,6 @@
 		sbus_ioremap(&sdev->resource[0], LEO_OFF_LX_CURSOR,
 			     sizeof(struct leo_cursor), "leolx cursor");
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &leo_ops;
 	all->info.currcon = -1;
diff -Nru a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
--- a/drivers/video/logo/logo.c	Thu Apr 10 07:16:31 2003
+++ b/drivers/video/logo/logo.c	Sun Apr 20 02:43:30 2003
@@ -33,7 +33,7 @@
 extern const struct linux_logo logo_superh_clut224;
 
 
-const struct linux_logo * __init find_logo(int depth)
+const struct linux_logo *fb_find_logo(int depth)
 {
 	const struct linux_logo *logo = 0;
 
diff -Nru a/drivers/video/macfb.c b/drivers/video/macfb.c
--- a/drivers/video/macfb.c	Tue Feb 25 09:45:20 2003
+++ b/drivers/video/macfb.c	Thu Apr 24 03:30:41 2003
@@ -943,7 +943,6 @@
 			break;
 		}
 
-	fb_info.node		= NODEV;
 	fb_info.fbops		= &macfb_ops;
 	fb_info.var		= macfb_defined;
 	fb_info.fix		= macfb_fix;
@@ -956,7 +955,7 @@
 		return;
 
 	printk("fb%d: %s frame buffer device\n",
-	       minor(fb_info.node), fb_info.fix.id);
+	       fb_info.node, fb_info.fix.id);
 }
 
 MODULE_LICENSE("GPL");
diff -Nru a/drivers/video/matrox/i2c-matroxfb.c b/drivers/video/matrox/i2c-matroxfb.c
--- a/drivers/video/matrox/i2c-matroxfb.c	Sun Mar 23 00:05:21 2003
+++ b/drivers/video/matrox/i2c-matroxfb.c	Thu Apr 24 03:30:41 2003
@@ -112,7 +112,7 @@
 	b->mask.clock = clock;
 	b->adapter = matrox_i2c_adapter_template;
 	snprintf(b->adapter.dev.name, DEVICE_NAME_SIZE, name,
-		minor(minfo->fbcon.node));
+		minfo->fbcon.node);
 	b->adapter.data = b;
 	b->adapter.algo_data = &b->bac;
 	b->bac = matrox_i2c_algo_template;
diff -Nru a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
--- a/drivers/video/matrox/matroxfb_base.c	Thu Oct 31 12:05:53 2002
+++ b/drivers/video/matrox/matroxfb_base.c	Thu Apr 24 03:30:41 2003
@@ -1752,7 +1752,6 @@
 
 	strcpy(ACCESS_FBINFO(fbcon.modename), "MATROX VGA");
 	ACCESS_FBINFO(fbcon.changevar) = NULL;
-	ACCESS_FBINFO(fbcon.node) = NODEV;
 	ACCESS_FBINFO(fbcon.fbops) = &matroxfb_ops;
 	ACCESS_FBINFO(fbcon.disp) = d;
 	ACCESS_FBINFO(fbcon.switch_con) = &matroxfb_switch;
@@ -1872,12 +1871,12 @@
 		goto failVideoIO;
 	}
 	printk("fb%d: %s frame buffer device\n",
-	       minor(ACCESS_FBINFO(fbcon.node)), ACCESS_FBINFO(fbcon.modename));
+	       ACCESS_FBINFO(fbcon.node), ACCESS_FBINFO(fbcon.modename));
 	if (ACCESS_FBINFO(fbcon.currcon) < 0) {
 		/* there is no console on this fb... but we have to initialize hardware
 		 * until someone tells me what is proper thing to do */
 		printk(KERN_INFO "fb%d: initializing hardware\n",
-			minor(ACCESS_FBINFO(fbcon.node)));
+			ACCESS_FBINFO(fbcon.node));
 		matroxfb_set_var(&vesafb_defined, -1, &ACCESS_FBINFO(fbcon));
 	}
 	return 0;
diff -Nru a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
--- a/drivers/video/matrox/matroxfb_crtc2.c	Thu Oct 31 12:05:54 2002
+++ b/drivers/video/matrox/matroxfb_crtc2.c	Thu Apr 24 03:30:41 2003
@@ -747,7 +747,6 @@
 
 	strcpy(m2info->fbcon.modename, "MATROX CRTC2");
 	m2info->fbcon.changevar = NULL;
-	m2info->fbcon.node = NODEV;
 	m2info->fbcon.fbops = &matroxfb_dh_ops;
 	m2info->fbcon.disp = d;
 	m2info->fbcon.switch_con = &matroxfb_dh_switch;
@@ -816,7 +815,7 @@
 		return -1;
 	}
 	printk(KERN_INFO "matroxfb_crtc2: secondary head of fb%u was registered as fb%u\n",
-		minor(ACCESS_FBINFO(fbcon.node)), minor(m2info->fbcon.node));
+		ACCESS_FBINFO(fbcon.node), m2info->fbcon.node);
 	m2info->fbcon_registered = 1;
 	return 0;
 #undef minfo
@@ -839,7 +838,7 @@
 			printk(KERN_ERR "matroxfb_crtc2: Expect kernel crash after module unload.\n");
 			return;
 		}
-		id = minor(m2info->fbcon.node);
+		id = m2info->fbcon.node;
 		unregister_framebuffer(&m2info->fbcon);
 		kfree(m2info->fbcon.disp);
 		/* return memory back to primary head */
diff -Nru a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c
--- a/drivers/video/maxinefb.c	Thu Feb 13 18:50:30 2003
+++ b/drivers/video/maxinefb.c	Thu Apr 24 03:30:41 2003
@@ -155,7 +155,6 @@
 		 */
 	}
 
-	fb_info.node = NODEV;
 	fb_info.fbops = &maxinefb_ops;
 	fb_info.screen_base = (char *) maxinefb_fix.smem_start;
 	fb_info.var = maxinefb_defined;
diff -Nru a/drivers/video/neofb.c b/drivers/video/neofb.c
--- a/drivers/video/neofb.c	Mon Mar  3 19:41:18 2003
+++ b/drivers/video/neofb.c	Thu Apr 24 03:30:41 2003
@@ -2021,7 +2021,7 @@
 		goto failed;
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
-	       minor(info->node), info->fix.id);
+	       info->node, info->fix.id);
 
 	/*
 	 * Our driver data
diff -Nru a/drivers/video/offb.c b/drivers/video/offb.c
--- a/drivers/video/offb.c	Thu Dec 12 11:36:54 2002
+++ b/drivers/video/offb.c	Thu Apr 24 03:30:41 2003
@@ -523,7 +523,6 @@
 	var->sync = 0;
 	var->vmode = FB_VMODE_NONINTERLACED;
 
-	info->node = NODEV;
 	info->fbops = &offb_ops;
 	info->screen_base = ioremap(address, fix->smem_len);
 	info->par = par;
@@ -539,7 +538,7 @@
 	}
 
 	printk(KERN_INFO "fb%d: Open Firmware frame buffer device on %s\n",
-	       minor(info->node), full_name);
+	       info->node, full_name);
 }
 
 MODULE_LICENSE("GPL");
diff -Nru a/drivers/video/p9100.c b/drivers/video/p9100.c
--- a/drivers/video/p9100.c	Tue Mar  4 09:55:26 2003
+++ b/drivers/video/p9100.c	Thu Apr 24 03:30:41 2003
@@ -298,7 +298,6 @@
 		sbus_ioremap(&sdev->resource[0], 0,
 			     sizeof(struct p9100_regs), "p9100 regs");
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &p9100_ops;
 #ifdef CONFIG_SPARC32
diff -Nru a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
--- a/drivers/video/platinumfb.c	Tue Mar 25 07:10:05 2003
+++ b/drivers/video/platinumfb.c	Thu Apr 24 03:30:41 2003
@@ -327,7 +327,6 @@
 {
 	/* Fill fb_info */
 	info->par = &p->par;
-	info->node = NODEV;
 	info->fbops = &platinumfb_ops;
 	info->pseudo_palette = p->pseudo_palette;
         info->flags = FBINFO_FLAG_DEFAULT;
@@ -409,7 +408,7 @@
 		return 0;
 
 	printk(KERN_INFO "fb%d: platinum frame buffer device\n",
-	       minor(p->info.node));
+	       p->info.node);
 
 	return 1;
 }
diff -Nru a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
--- a/drivers/video/pm2fb.c	Wed Apr  2 11:59:15 2003
+++ b/drivers/video/pm2fb.c	Thu Apr 24 03:30:41 2003
@@ -2269,7 +2269,6 @@
 	fb_info.gen.parsize=sizeof(struct pm2fb_par);
 	fb_info.gen.fbhw=&pm2fb_hwswitch;
 	strcpy(fb_info.gen.info.modename, permedia2_name);
-	fb_info.gen.info.node = NODEV;
 	fb_info.gen.info.flags=FBINFO_FLAG_DEFAULT;
 	fb_info.gen.info.fbops=&pm2fb_ops;
 	fb_info.gen.info.disp=&fb_info.disp;
@@ -2288,7 +2287,7 @@
 		return -EINVAL;
 	}
 	printk(KERN_INFO "fb%d: %s (%s), using %uK of video memory.\n",
-				minor(fb_info.gen.info.node),
+				fb_info.gen.info.node,
 				board_table[fb_info.board].name,
 				permedia2_name,
 				(u32 )(fb_info.regions.fb_size>>10));
diff -Nru a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
--- a/drivers/video/pm3fb.c	Wed Feb 19 16:35:24 2003
+++ b/drivers/video/pm3fb.c	Thu Apr 24 03:30:41 2003
@@ -1602,7 +1602,6 @@
 	disp[l_fb_info->board_num].scrollmode = 0;	/* SCROLL_YNOMOVE; *//* 0 means "let fbcon choose" */
 	l_fb_info->gen.parsize = sizeof(struct pm3fb_par);
 	l_fb_info->gen.info.changevar = NULL;
-	l_fb_info->gen.info.node = B_FREE;
 	l_fb_info->gen.info.fbops = &pm3fb_ops;
 	l_fb_info->gen.info.disp = &(disp[l_fb_info->board_num]);
 	if (fontn[l_fb_info->board_num][0])
@@ -1646,7 +1645,7 @@
 	pm3fb_write_mode(l_fb_info);
 	
 	printk("fb%d: %s, using %uK of video memory (%s)\n",
-	       minor(l_fb_info->gen.info.node),
+	       l_fb_info->gen.info.node,
 	       permedia3_name, (u32) (l_fb_info->fb_size >> 10),
 	       cardbase[l_fb_info->board_type].cardname);
 }
diff -Nru a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
--- a/drivers/video/pmag-ba-fb.c	Thu Feb 13 18:50:30 2003
+++ b/drivers/video/pmag-ba-fb.c	Thu Apr 24 03:30:41 2003
@@ -138,7 +138,6 @@
 	/*
 	 *      Let there be consoles..
 	 */
-	info->node = NODEV;
 	info->fbops = &pmagbafb_ops;
 	info->var = pmagbafb_defined;
 	info->fix = pmagbafb_fix; 
diff -Nru a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
--- a/drivers/video/pmagb-b-fb.c	Thu Feb 13 18:50:30 2003
+++ b/drivers/video/pmagb-b-fb.c	Thu Apr 24 03:30:41 2003
@@ -141,7 +141,6 @@
 	/*
 	 *      Let there be consoles..
 	 */
-	info->node = NODEV;
 	info->fbops = &pmagbbfb_ops;
 	info->var = pmagbbfb_defined;
 	info->fix = pmagbbfb_fix;
diff -Nru a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
--- a/drivers/video/pvr2fb.c	Tue Feb 25 10:47:18 2003
+++ b/drivers/video/pvr2fb.c	Thu Apr 24 03:30:41 2003
@@ -246,7 +246,7 @@
 static void pvr2_update_display(void);
 static void pvr2_init_display(void);
 static void pvr2_do_blank(void);
-static void pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp);
+static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp);
 static int pvr2_init_cable(void);
 static int pvr2_get_param(const struct pvr2_params *p, const char *s,
                             int val, int size);
@@ -939,7 +939,7 @@
 	is_blanked = do_blank > 0 ? do_blank : 0;
 }
 
-static void pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp)
+static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id, struct pt_regs *fp)
 {
 	if (do_vmode_pan || do_vmode_full)
 		pvr2_update_display();
@@ -958,6 +958,7 @@
 	if (do_vmode_full) {
 		do_vmode_full = 0;
 	}
+	return IRQ_HANDLED;
 }
 
 /*
@@ -1020,7 +1021,6 @@
 	
 	strcpy(fb_info.modename, pvr2fb_name);
 	fb_info.changevar = NULL;
-	fb_info.node = NODEV;
 	fb_info.fbops = &pvr2fb_ops;
 	fb_info.screen_base = (char *) videomemory;
 	fb_info.disp = &disp;
@@ -1059,10 +1059,10 @@
 	modememused = get_line_length(var.xres_virtual, var.bits_per_pixel);
 	modememused *= var.yres_virtual;
 	printk("fb%d: %s frame buffer device, using %ldk/%ldk of video memory\n",
-	       minor(fb_info.node), fb_info.modename, modememused>>10,
+	       fb_info.node, fb_info.modename, modememused>>10,
 	       videomemorysize>>10);
 	printk("fb%d: Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n", 
-	       minor(fb_info.node), var.xres, var.yres, var.bits_per_pixel, 
+	       fb_info.node, var.xres, var.yres, var.bits_per_pixel, 
 	       get_line_length(var.xres, var.bits_per_pixel),
 	       (char *)pvr2_get_param(cables, NULL, cable_type, 3),
 	       (char *)pvr2_get_param(outputs, NULL, video_output, 3));
diff -Nru a/drivers/video/q40fb.c b/drivers/video/q40fb.c
--- a/drivers/video/q40fb.c	Mon Feb 24 13:47:01 2003
+++ b/drivers/video/q40fb.c	Thu Apr 24 03:30:41 2003
@@ -105,7 +105,6 @@
 	
 	fb_info.var = q40fb_var;
 	fb_info.fix = q40fb_fix;
-	fb_info.node = NODEV;
 	fb_info.fbops = &q40fb_ops;
 	fb_info.flags = FBINFO_FLAG_DEFAULT;  /* not as module for now */
 	fb_info.pseudo_palette = pseudo_palette;	
@@ -121,7 +120,7 @@
 	}
 
         printk(KERN_INFO "fb%d: Q40 frame buffer alive and kicking !\n",
-	       minor(fb_info.node));
+	       fb_info.node);
 	return 0;
 }
 
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
--- a/drivers/video/radeonfb.c	Thu Apr 10 14:07:43 2003
+++ b/drivers/video/radeonfb.c	Thu Apr 24 03:30:41 2003
@@ -2237,7 +2237,6 @@
 	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
-        info->node = NODEV;
         info->flags = FBINFO_FLAG_DEFAULT;
         info->fbops = &radeonfb_ops;
         info->display_fg = NULL;
diff -Nru a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c
--- a/drivers/video/retz3fb.c	Wed Apr  2 11:59:15 2003
+++ b/drivers/video/retz3fb.c	Thu Apr 24 03:30:41 2003
@@ -1403,7 +1403,6 @@
 
 		strcpy(fb_info->modename, retz3fb_name);
 		fb_info->changevar = NULL;
-		fb_info->node = NODEV;
 		fb_info->fbops = &retz3fb_ops;
 		fb_info->screen_base = zinfo->fbmem;
 		fb_info->disp = &zinfo->disp;
@@ -1430,7 +1429,7 @@
 			return -EINVAL;
 
 		printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of "
-		       "video memory\n", minor(fb_info->node),
+		       "video memory\n", fb_info->node,
 		       fb_info->modename, zinfo->fbsize>>10);
 
 		/* FIXME: This driver cannot be unloaded yet */
diff -Nru a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
--- a/drivers/video/riva/fbdev.c	Fri Apr 11 23:09:19 2003
+++ b/drivers/video/riva/fbdev.c	Thu Apr 24 03:30:41 2003
@@ -1581,7 +1581,6 @@
 	struct riva_par *par = (struct riva_par *) info->par;
 	unsigned int cmap_len;
 
-	info->node = NODEV;
 	info->flags = FBINFO_FLAG_DEFAULT;
 	info->var = rivafb_default_var;
 	info->fix = rivafb_fix;
diff -Nru a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
--- a/drivers/video/sa1100fb.c	Thu Mar  6 08:48:29 2003
+++ b/drivers/video/sa1100fb.c	Thu Apr 24 03:30:41 2003
@@ -1395,7 +1395,7 @@
 /*
  *  sa1100fb_handle_irq: Handle 'LCD DONE' interrupts.
  */
-static void sa1100fb_handle_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sa1100fb_handle_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sa1100fb_info *fbi = dev_id;
 	unsigned int lcsr = LCSR;
@@ -1406,6 +1406,7 @@
 	}
 
 	LCSR = lcsr;
+	return IRQ_HANDLED;
 }
 
 /*
@@ -1700,7 +1701,6 @@
 
 	fbi->fb.fbops		= &sa1100fb_ops;
 	fbi->fb.flags		= FBINFO_FLAG_DEFAULT;
-	fbi->fb.node		= NODEV;
 	fbi->fb.monspecs	= monspecs;
 	fbi->fb.currcon		= -1;
 	fbi->fb.pseudo_palette	= (fbi + 1);
diff -Nru a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
--- a/drivers/video/sgivwfb.c	Mon Mar 31 08:11:01 2003
+++ b/drivers/video/sgivwfb.c	Thu Apr 24 03:30:41 2003
@@ -773,7 +773,6 @@
 	sgivwfb_fix.ywrapstep = ywrap;
 	sgivwfb_fix.ypanstep = ypan;
 
-	fb_info.node = NODEV;
 	fb_info.fix = sgivwfb_fix;
 
 	switch (flatpanel_id) {
@@ -807,7 +806,7 @@
 	}
 
 	printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n",      
-		minor(fb_info.node), sgivwfb_mem_size >> 10, sgivwfb_mem_phys);
+		fb_info.node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys);
 	return 0;
 
 fail_register_framebuffer:
diff -Nru a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
--- a/drivers/video/sis/sis_main.c	Fri Mar  7 11:19:02 2003
+++ b/drivers/video/sis/sis_main.c	Thu Apr 24 03:30:41 2003
@@ -4524,7 +4524,6 @@
 #endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)		/* ---- 2.5 series init ---- */
-		sis_fb_info.node = NODEV;
 		sis_fb_info.flags = FBINFO_FLAG_DEFAULT;
 		sis_fb_info.var = default_var;
 		sis_fb_info.fix = sisfb_fix;
@@ -4571,7 +4570,7 @@
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 		printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%02d\n",
-	       		minor(sis_fb_info.node), myid, VER_MAJOR, VER_MINOR, VER_LEVEL);			     
+	       		sis_fb_info.node, myid, VER_MAJOR, VER_MINOR, VER_LEVEL);			     
 #endif
 
 	}	/* TW: if mode = "none" */
diff -Nru a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
--- a/drivers/video/skeletonfb.c	Fri Feb  7 14:44:36 2003
+++ b/drivers/video/skeletonfb.c	Thu Apr 24 03:30:41 2003
@@ -536,7 +536,6 @@
      * space via ioremap. Consult ioport.h. 
      */
     info.screen_base = framebuffer_virtual_memory;	
-    info.node = NODEV;
     info.fbops = &xxxfb_ops;
     info.fix = xxxfb_fix;
     info.pseudo_palette = pseudo_palette;
@@ -566,7 +565,7 @@
 	
     if (register_framebuffer(&info) < 0)
 	return -EINVAL;
-    printk(KERN_INFO "fb%d: %s frame buffer device\n", minor(info.node),
+    printk(KERN_INFO "fb%d: %s frame buffer device\n", info.node,
 	   info.fix.id);
     return 0;
 }
diff -Nru a/drivers/video/sstfb.c b/drivers/video/sstfb.c
--- a/drivers/video/sstfb.c	Mon Mar  3 19:41:18 2003
+++ b/drivers/video/sstfb.c	Thu Apr 24 03:30:41 2003
@@ -1474,7 +1474,6 @@
 	f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
 	f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
-	info->node	= NODEV;
 	info->flags	= FBINFO_FLAG_DEFAULT;
 	info->fbops	= &sstfb_ops;
 	info->currcon	= -1;
@@ -1520,7 +1519,7 @@
 		sstfb_drawdebugimage(info);
 
 	printk(KERN_INFO "fb%d: %s frame buffer device at 0x%p\n",
-	       minor(info->node), fix->id, info->screen_base);
+	       info->node, fix->id, info->screen_base);
 
 	return 0;
 
diff -Nru a/drivers/video/stifb.c b/drivers/video/stifb.c
--- a/drivers/video/stifb.c	Tue Jan  7 16:45:15 2003
+++ b/drivers/video/stifb.c	Thu Apr 24 03:30:41 2003
@@ -1277,7 +1277,6 @@
 	var->bits_per_pixel = bpp;
 
 	strcpy(fix->id, "stifb");
-	info->node = NODEV;
 	info->fbops = &stifb_ops;
 	info->screen_base = (void*) REGION_BASE(fb,1);
 	info->flags = FBINFO_FLAG_DEFAULT;
@@ -1306,7 +1305,7 @@
 
 	printk(KERN_INFO 
 	    "fb%d: %s %dx%d-%d frame buffer device, id: %04x, mmio: 0x%04lx\n",
-		minor(fb->info.node), 
+		fb->info.node, 
 		fix->id,
 		var->xres, 
 		var->yres,
diff -Nru a/drivers/video/sun3fb.c b/drivers/video/sun3fb.c
--- a/drivers/video/sun3fb.c	Thu Oct 31 12:05:55 2002
+++ b/drivers/video/sun3fb.c	Thu Apr 24 03:30:41 2003
@@ -569,7 +569,6 @@
 	fix->type = FB_TYPE_PACKED_PIXELS;
 	fix->visual = FB_VISUAL_PSEUDOCOLOR;
 	
-	fb->info.node = NODEV;
 	fb->info.fbops = &sun3fb_ops;
 	fb->info.disp = disp;
 	fb->info.currcon = -1;
@@ -646,7 +645,7 @@
 		kfree(fb);
 		return -EINVAL;
 	}
-	printk("fb%d: %s\n", minor(fb->info.node), p);
+	printk("fb%d: %s\n", fb->info.node, p);
 
 	return 0;
 }
diff -Nru a/drivers/video/tcx.c b/drivers/video/tcx.c
--- a/drivers/video/tcx.c	Tue Mar  4 09:55:26 2003
+++ b/drivers/video/tcx.c	Thu Apr 24 03:30:41 2003
@@ -374,7 +374,6 @@
 		all->par.mmap_map[i].poff = sdev->reg_addrs[j].phys_addr;
 	}
 
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &tcx_ops;
 #ifdef CONFIG_SPARC32
diff -Nru a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
--- a/drivers/video/tdfxfb.c	Tue Mar 25 17:25:37 2003
+++ b/drivers/video/tdfxfb.c	Thu Apr 24 03:30:41 2003
@@ -1218,7 +1218,6 @@
 	tdfx_fix.ypanstep	= nopan ? 0 : 1;
 	tdfx_fix.ywrapstep	= nowrap ? 0 : 1;
    
-	info->node		= NODEV;
 	info->fbops		= &tdfxfb_ops;
 	info->fix		= tdfx_fix; 	
 	info->par		= default_par;
diff -Nru a/drivers/video/tgafb.c b/drivers/video/tgafb.c
--- a/drivers/video/tgafb.c	Tue Mar 25 17:25:37 2003
+++ b/drivers/video/tgafb.c	Thu Apr 24 03:30:41 2003
@@ -1425,7 +1425,6 @@
 	pci_read_config_byte(pdev, PCI_REVISION_ID, &all->par.tga_chip_rev);
 
 	/* Setup framebuffer.  */
-	all->info.node = NODEV;
 	all->info.flags = FBINFO_FLAG_DEFAULT;
 	all->info.fbops = &tgafb_ops;
 	all->info.screen_base = (char *) all->par.tga_fb_base;
@@ -1465,7 +1464,7 @@
 	       pdev->bus->number, PCI_SLOT(pdev->devfn),
 	       PCI_FUNC(pdev->devfn));
 	printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n",
-	       minor(all->info.node), all->info.fix.id, bar0_start);
+	       all->info.node, all->info.fix.id, bar0_start);
 
 	return 0;
 
diff -Nru a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
--- a/drivers/video/tridentfb.c	Wed Apr  2 11:59:16 2003
+++ b/drivers/video/tridentfb.c	Thu Apr 24 03:30:41 2003
@@ -1140,7 +1140,6 @@
 		nativex = get_nativex();
 
 	fb_info.fix = tridentfb_fix;
-	fb_info.node = NODEV;
 	fb_info.fbops = &tridentfb_ops;
 
 
@@ -1161,7 +1160,7 @@
 		return -EINVAL;
 	}
 	output("fb%d: %s frame buffer device %dx%d-%dbpp\n",
-	   minor(fb_info.node), fb_info.fix.id,default_var.xres,
+	   fb_info.node, fb_info.fix.id,default_var.xres,
 	   default_var.yres,default_var.bits_per_pixel);
 	return 0;
 }
diff -Nru a/drivers/video/tx3912fb.c b/drivers/video/tx3912fb.c
--- a/drivers/video/tx3912fb.c	Fri Nov 22 13:47:00 2002
+++ b/drivers/video/tx3912fb.c	Thu Apr 24 03:30:41 2003
@@ -292,7 +292,6 @@
 	if ((tx3912fb_fix.line_length * tx3912fb_var.yres_virtual) > tx3912fb_fix.smem_len)
 		return -ENOMEM;
 
-	fb_info.node = NODEV;
 	fb_info.fbops = &tx3912fb_ops;
 	fb_info.var = tx3912fb_var;
 	fb_info.fix = tx3912fb_fix;
@@ -309,7 +308,7 @@
 		return -1;
 
 	printk(KERN_INFO "fb%d: TX3912 frame buffer using %uKB.\n",
-	       minor(fb_info.node), (u_int) (fb_info.fix.smem_len >> 10));
+	       fb_info.node, (u_int) (fb_info.fix.smem_len >> 10));
 	return 0;
 }
 
diff -Nru a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c
--- a/drivers/video/valkyriefb.c	Wed Nov 13 16:08:15 2002
+++ b/drivers/video/valkyriefb.c	Thu Apr 24 03:30:41 2003
@@ -447,7 +447,7 @@
 		return;
 	}
 	
-	printk(KERN_INFO "fb%d: valkyrie frame buffer device\n", GET_FB_IDX(p->info.node));	
+	printk(KERN_INFO "fb%d: valkyrie frame buffer device\n", p->info.node);	
 }
 
 static void valkyrie_set_par(const struct fb_par_valkyrie *par,
@@ -715,7 +715,6 @@
 static void __init valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p)
 {
 	strcpy(info->modename, p->fix.id);
-	info->node = NODEV;
 	info->fbops = &valkyriefb_ops;
 	info->screen_base = (char *) p->frame_buffer + 0x1000;
 	info->disp = &p->disp;
diff -Nru a/drivers/video/vesafb.c b/drivers/video/vesafb.c
--- a/drivers/video/vesafb.c	Thu Apr 10 11:17:40 2003
+++ b/drivers/video/vesafb.c	Thu Apr 24 03:30:41 2003
@@ -359,7 +359,6 @@
 		}
 	}
 	
-	fb_info.node = NODEV;
 	fb_info.fbops = &vesafb_ops;
 	fb_info.var = vesafb_defined;
 	fb_info.fix = vesafb_fix;
@@ -372,7 +371,7 @@
 		return -EINVAL;
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
-	       minor(fb_info.node), fb_info.fix.id);
+	       fb_info.node, fb_info.fix.id);
 	return 0;
 }
 
diff -Nru a/drivers/video/vfb.c b/drivers/video/vfb.c
--- a/drivers/video/vfb.c	Mon Mar 31 15:55:38 2003
+++ b/drivers/video/vfb.c	Thu Apr 24 03:30:41 2003
@@ -426,7 +426,6 @@
 	memset(videomemory, 0, videomemorysize);
 
 	fb_info.screen_base = videomemory;
-	fb_info.node = NODEV;
 	fb_info.fbops = &vfb_ops;
 
 	retval = fb_find_mode(&fb_info.var, &fb_info, NULL,
@@ -447,7 +446,7 @@
 
 	printk(KERN_INFO
 	       "fb%d: Virtual frame buffer device, using %ldK of video memory\n",
-	       minor(fb_info.node), videomemorysize >> 10);
+	       fb_info.node, videomemorysize >> 10);
 	return 0;
 }
 
diff -Nru a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
--- a/drivers/video/vga16fb.c	Wed Mar 26 16:34:39 2003
+++ b/drivers/video/vga16fb.c	Thu Apr 24 03:30:41 2003
@@ -1364,7 +1364,6 @@
 	vga16fb_defined.blue.length  = i;	
 
 	/* name should not depend on EGA/VGA */
-	vga16fb.node = NODEV;
 	vga16fb.fbops = &vga16fb_ops;
 	vga16fb.var = vga16fb_defined;
 	vga16fb.fix = vga16fb_fix;
@@ -1385,7 +1384,7 @@
 	}
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
-	       minor(vga16fb.node), vga16fb.fix.id);
+	       vga16fb.node, vga16fb.fix.id);
 
 	return 0;
 }
diff -Nru a/drivers/video/virgefb.c b/drivers/video/virgefb.c
--- a/drivers/video/virgefb.c	Sun Mar  2 18:12:49 2003
+++ b/drivers/video/virgefb.c	Thu Apr 24 03:30:41 2003
@@ -1783,7 +1783,6 @@
 	fbhw = &virgefb_hw_switch;
 	strcpy(fb_info.modename, virgefb_name);
 	fb_info.changevar = NULL;
-	fb_info.node = NODEV;
 	fb_info.fbops = &virgefb_ops;
 	fb_info.disp = &disp;
 	fb_info.currcon = -1;
@@ -1806,7 +1805,7 @@
 	}
 
 	printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of video memory\n",
-	       minor(fb_info.node), fb_info.modename, v_ram_size>>10);
+	       fb_info.node, fb_info.modename, v_ram_size>>10);
 
 	/* TODO: This driver cannot be unloaded yet */
 
diff -Nru a/fs/Kconfig b/fs/Kconfig
--- a/fs/Kconfig	Fri Mar 21 10:23:06 2003
+++ b/fs/Kconfig	Sun Apr 20 12:56:52 2003
@@ -26,7 +26,7 @@
 	  by about 44 KB.
 
 	  The Ext2fs-Undeletion mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, gives information about
+	  <http://www.tldp.org/docs.html#howto>, gives information about
 	  how to retrieve deleted files on ext2fs file systems.
 
 	  To change the behavior of ext2 file systems, you can use the tune2fs
@@ -386,7 +386,7 @@
 	  in order to use quota support (you can download sources from
 	  <http://www.sf.net/projects/linuxquota/>). For further details, read
 	  the Quota mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. Probably the quota
+	  <http://www.tldp.org/docs.html#howto>. Probably the quota
 	  support is only useful for multi user systems. If unsure, say N.
 
 config QFMT_V1
@@ -469,7 +469,7 @@
 	  driver.  If you have a CD-ROM drive and want to do more with it than
 	  just listen to audio CDs and watch its LEDs, say Y (and read
 	  <file:Documentation/filesystems/isofs.txt> and the CD-ROM-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>), thereby
+	  available from <http://www.tldp.org/docs.html#howto>), thereby
 	  enlarging your kernel by about 27 KB; otherwise say N.
 
 	  If you want to compile this as a module ( = code which can be
@@ -576,7 +576,7 @@
 	  they are compressed; to access compressed MSDOS partitions under
 	  Linux, you can either use the DOS emulator DOSEMU, described in the
 	  DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, or try dmsdosfs in
+	  <http://www.tldp.org/docs.html#howto>, or try dmsdosfs in
 	  <ftp://ibiblio.org/pub/Linux/system/filesystems/dosfs/>. If you
 	  intend to use dosemu with a non-compressed MSDOS partition, say Y
 	  here) and MSDOS floppies. This means that file access becomes
@@ -1233,7 +1233,7 @@
 	  programs nfsd and mountd (but does not need to have NFS file system
 	  support enabled in its kernel). NFS is explained in the Network
 	  Administrator's Guide, available from
-	  <http://www.linuxdoc.org/docs.html#guide>, on its man page: "man
+	  <http://www.tldp.org/docs.html#guide>, on its man page: "man
 	  nfs", and in the NFS-HOWTO.
 
 	  A superior but less widely used alternative to NFS is provided by
@@ -1298,7 +1298,7 @@
 	  as well.
 
 	  Please read the NFS-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  The NFS server is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
@@ -1398,7 +1398,7 @@
 	  works only if the Windows machines use TCP/IP as the underlying
 	  transport protocol, and not NetBEUI.  For details, read
 	  <file:Documentation/filesystems/smbfs.txt> and the SMB-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>.
+	  available from <http://www.tldp.org/docs.html#howto>.
 
 	  Note: if you just want your box to act as an SMB *server* and make
 	  files and printing services available to Windows clients (which need
@@ -1475,7 +1475,7 @@
 	  to mount NetWare file server volumes and to access them just like
 	  any other Unix directory.  For details, please read the file
 	  <file:Documentation/filesystems/ncpfs.txt> in the kernel source and
-	  the IPX-HOWTO from <http://www.linuxdoc.org/docs.html#howto>.
+	  the IPX-HOWTO from <http://www.tldp.org/docs.html#howto>.
 
 	  You do not have to say Y here if you want your Linux box to act as a
 	  file *server* for Novell NetWare clients.
diff -Nru a/fs/aio.c b/fs/aio.c
--- a/fs/aio.c	Sat Mar 22 09:10:34 2003
+++ b/fs/aio.c	Sat Apr 19 23:22:38 2003
@@ -148,7 +148,7 @@
 
 	dprintk("mmap address: 0x%08lx\n", info->mmap_base);
 	info->nr_pages = get_user_pages(current, ctx->mm,
-					info->mmap_base, info->mmap_size, 
+					info->mmap_base, nr_pages, 
 					1, 0, info->ring_pages, NULL);
 	up_write(&ctx->mm->mmap_sem);
 
diff -Nru a/fs/bio.c b/fs/bio.c
--- a/fs/bio.c	Sun Mar 23 01:40:11 2003
+++ b/fs/bio.c	Thu Apr 24 03:23:09 2003
@@ -434,19 +434,9 @@
 	return len;
 }
 
-/**
- *	bio_map_user	-	map user address into bio
- *	@bdev: destination block device
- *	@uaddr: start of user address
- *	@len: length in bytes
- *	@write_to_vm: bool indicating writing to pages or not
- *
- *	Map the user space address into a bio suitable for io to a block
- *	device. Caller should check the size of the returned bio, we might
- *	not have mapped the entire range specified.
- */
-struct bio *bio_map_user(struct block_device *bdev, unsigned long uaddr,
-			 unsigned int len, int write_to_vm)
+static struct bio *__bio_map_user(struct block_device *bdev,
+				  unsigned long uaddr, unsigned int len,
+				  int write_to_vm)
 {
 	unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	unsigned long start = uaddr >> PAGE_SHIFT;
@@ -510,8 +500,11 @@
 	kfree(pages);
 
 	/*
-	 * check if the mapped pages need bouncing for an isa host.
+	 * set data direction, and check if mapped pages need bouncing
 	 */
+	if (!write_to_vm)
+		bio->bi_rw |= (1 << BIO_RW);
+
 	blk_queue_bounce(q, &bio);
 	return bio;
 out:
@@ -521,17 +514,42 @@
 }
 
 /**
- *	bio_unmap_user	-	unmap a bio
- *	@bio:		the bio being unmapped
- *	@write_to_vm:	bool indicating whether pages were written to
- *
- *	Unmap a bio previously mapped by bio_map_user(). The @write_to_vm
- *	must be the same as passed into bio_map_user(). Must be called with
- *	a process context.
+ *	bio_map_user	-	map user address into bio
+ *	@bdev: destination block device
+ *	@uaddr: start of user address
+ *	@len: length in bytes
+ *	@write_to_vm: bool indicating writing to pages or not
  *
- *	bio_unmap_user() may sleep.
+ *	Map the user space address into a bio suitable for io to a block
+ *	device.
  */
-void bio_unmap_user(struct bio *bio, int write_to_vm)
+struct bio *bio_map_user(struct block_device *bdev, unsigned long uaddr,
+			 unsigned int len, int write_to_vm)
+{
+	struct bio *bio;
+
+	bio = __bio_map_user(bdev, uaddr, len, write_to_vm);
+
+	if (bio) {
+		if (bio->bi_size < len) {
+			bio_endio(bio, bio->bi_size, 0);
+			bio_unmap_user(bio, 0);
+			return NULL;
+		}
+
+		/*
+		 * subtle -- if __bio_map_user() ended up bouncing a bio,
+		 * it would normally disappear when its bi_end_io is run.
+		 * however, we need it for the unmap, so grab an extra
+		 * reference to it
+		 */
+		bio_get(bio);
+	}
+
+	return bio;
+}
+
+static void __bio_unmap_user(struct bio *bio, int write_to_vm)
 {
 	struct bio_vec *bvec;
 	int i;
@@ -558,6 +576,23 @@
 		page_cache_release(bvec->bv_page);
 	}
 
+	bio_put(bio);
+}
+
+/**
+ *	bio_unmap_user	-	unmap a bio
+ *	@bio:		the bio being unmapped
+ *	@write_to_vm:	bool indicating whether pages were written to
+ *
+ *	Unmap a bio previously mapped by bio_map_user(). The @write_to_vm
+ *	must be the same as passed into bio_map_user(). Must be called with
+ *	a process context.
+ *
+ *	bio_unmap_user() may sleep.
+ */
+void bio_unmap_user(struct bio *bio, int write_to_vm)
+{
+	__bio_unmap_user(bio, write_to_vm);
 	bio_put(bio);
 }
 
diff -Nru a/fs/block_dev.c b/fs/block_dev.c
--- a/fs/block_dev.c	Mon Mar 24 10:17:16 2003
+++ b/fs/block_dev.c	Thu Apr 24 03:30:41 2003
@@ -449,14 +449,13 @@
 {
 	struct gendisk *disk = bdev->bd_disk;
 	struct block_device_operations * bdops = disk->fops;
-	kdev_t dev = to_kdev_t(bdev->bd_dev);
 
 	if (!bdops->media_changed)
 		return 0;
 	if (!bdops->media_changed(bdev->bd_disk))
 		return 0;
 
-	if (invalidate_device(dev, 0))
+	if (__invalidate_device(bdev, 0))
 		printk("VFS: busy inodes on changed media.\n");
 
 	if (bdops->revalidate_disk)
@@ -466,36 +465,6 @@
 	return 1;
 }
 
-int full_check_disk_change(struct block_device *bdev)
-{
-	int res = 0;
-	if (bdev->bd_contains != bdev)
-		BUG();
-	down(&bdev->bd_sem);
-	if (check_disk_change(bdev) && bdev->bd_invalidated) {
-		rescan_partitions(bdev->bd_disk, bdev);
-		res = 1;
-	}
-	up(&bdev->bd_sem);
-	return res;
-}
-
-/*
- * Will die as soon as two remaining callers get converted.
- */
-int __check_disk_change(dev_t dev)
-{
-	struct block_device *bdev = bdget(dev);
-	int res;
-	if (!bdev)
-		return 0;
-	if (blkdev_get(bdev, FMODE_READ, 0, BDEV_RAW) < 0)
-		return 0;
-	res = full_check_disk_change(bdev);
-	blkdev_put(bdev, BDEV_RAW);
-	return res;
-}
-
 static void bd_set_size(struct block_device *bdev, loff_t size)
 {
 	unsigned bsize = bdev_hardsect_size(bdev);
@@ -559,10 +528,10 @@
 			bdev->bd_contains = whole;
 			down(&whole->bd_sem);
 			whole->bd_part_count++;
-			p = disk->part + part - 1;
+			p = disk->part[part - 1];
 			bdev->bd_inode->i_data.backing_dev_info =
 			   whole->bd_inode->i_data.backing_dev_info;
-			if (!(disk->flags & GENHD_FL_UP) || !p->nr_sects) {
+			if (!(disk->flags & GENHD_FL_UP) || !p || !p->nr_sects) {
 				whole->bd_part_count--;
 				up(&whole->bd_sem);
 				ret = -ENXIO;
diff -Nru a/fs/buffer.c b/fs/buffer.c
--- a/fs/buffer.c	Sat Apr 12 16:21:06 2003
+++ b/fs/buffer.c	Thu Apr 24 03:30:41 2003
@@ -447,15 +447,6 @@
 	invalidate_inode_pages(bdev->bd_inode->i_mapping);
 }
 
-void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers)
-{
-	struct block_device *bdev = bdget(kdev_t_to_nr(dev));
-	if (bdev) {
-		invalidate_bdev(bdev, destroy_dirty_buffers);
-		bdput(bdev);
-	}
-}
-
 /*
  * Kick pdflush then try to free up some ZONE_NORMAL memory.
  */
@@ -776,6 +767,85 @@
 EXPORT_SYMBOL(mark_buffer_dirty_inode);
 
 /*
+ * Add a page to the dirty page list.
+ *
+ * It is a sad fact of life that this function is called from several places
+ * deeply under spinlocking.  It may not sleep.
+ *
+ * If the page has buffers, the uptodate buffers are set dirty, to preserve
+ * dirty-state coherency between the page and the buffers.  It the page does
+ * not have buffers then when they are later attached they will all be set
+ * dirty.
+ *
+ * The buffers are dirtied before the page is dirtied.  There's a small race
+ * window in which a writepage caller may see the page cleanness but not the
+ * buffer dirtiness.  That's fine.  If this code were to set the page dirty
+ * before the buffers, a concurrent writepage caller could clear the page dirty
+ * bit, see a bunch of clean buffers and we'd end up with dirty buffers/clean
+ * page on the dirty page list.
+ *
+ * There is also a small window where the page is dirty, and not on dirty_pages.
+ * Also a possibility that by the time the page is added to dirty_pages, it has
+ * been set clean.  The page lists are somewhat approximate in this regard.
+ * It's better to have clean pages accidentally attached to dirty_pages than to
+ * leave dirty pages attached to clean_pages.
+ *
+ * We use private_lock to lock against try_to_free_buffers while using the
+ * page's buffer list.  Also use this to protect against clean buffers being
+ * added to the page after it was set dirty.
+ *
+ * FIXME: may need to call ->reservepage here as well.  That's rather up to the
+ * address_space though.
+ *
+ * For now, we treat swapper_space specially.  It doesn't use the normal
+ * block a_ops.
+ */
+int __set_page_dirty_buffers(struct page *page)
+{
+	struct address_space * const mapping = page->mapping;
+	int ret = 0;
+
+	if (mapping == NULL) {
+		SetPageDirty(page);
+		goto out;
+	}
+
+	if (!PageUptodate(page))
+		buffer_error();
+
+	spin_lock(&mapping->private_lock);
+	if (page_has_buffers(page)) {
+		struct buffer_head *head = page_buffers(page);
+		struct buffer_head *bh = head;
+
+		do {
+			if (buffer_uptodate(bh))
+				set_buffer_dirty(bh);
+			else
+				buffer_error();
+			bh = bh->b_this_page;
+		} while (bh != head);
+	}
+	spin_unlock(&mapping->private_lock);
+
+	if (!TestSetPageDirty(page)) {
+		spin_lock(&mapping->page_lock);
+		if (page->mapping) {	/* Race with truncate? */
+			if (!mapping->backing_dev_info->memory_backed)
+				inc_page_state(nr_dirty);
+			list_del(&page->list);
+			list_add(&page->list, &mapping->dirty_pages);
+		}
+		spin_unlock(&mapping->page_lock);
+		__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
+	}
+	
+out:
+	return ret;
+}
+EXPORT_SYMBOL(__set_page_dirty_buffers);
+
+/*
  * Write out and wait upon a list of buffers.
  *
  * We have conflicting pressures: we want to make sure that all
@@ -916,7 +986,7 @@
 	head = NULL;
 	offset = PAGE_SIZE;
 	while ((offset -= size) >= 0) {
-		bh = alloc_buffer_head();
+		bh = alloc_buffer_head(GFP_NOFS);
 		if (!bh)
 			goto no_grow;
 
@@ -2267,7 +2337,7 @@
 		if (buffer_uptodate(&map_bh))
 			continue;	/* reiserfs does this */
 		if (block_start < from || block_end > to) {
-			struct buffer_head *bh = alloc_buffer_head();
+			struct buffer_head *bh = alloc_buffer_head(GFP_NOFS);
 
 			if (!bh) {
 				ret = -ENOMEM;
@@ -2826,9 +2896,9 @@
 	buffer_heads_over_limit = (tot > max_buffer_heads);
 }
 	
-struct buffer_head *alloc_buffer_head(void)
+struct buffer_head *alloc_buffer_head(int gfp_flags)
 {
-	struct buffer_head *ret = kmem_cache_alloc(bh_cachep, GFP_NOFS);
+	struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags);
 	if (ret) {
 		preempt_disable();
 		__get_cpu_var(bh_accounting).nr++;
diff -Nru a/fs/dcache.c b/fs/dcache.c
--- a/fs/dcache.c	Wed Apr  9 11:44:15 2003
+++ b/fs/dcache.c	Sat Apr 19 23:22:23 2003
@@ -155,12 +155,11 @@
  	if (d_unhashed(dentry))
 		goto kill_it;
   	if (list_empty(&dentry->d_lru)) {
-  		dentry->d_vfs_flags &= ~DCACHE_REFERENCED;
+  		dentry->d_vfs_flags |= DCACHE_REFERENCED;
   		list_add(&dentry->d_lru, &dentry_unused);
   		dentry_stat.nr_unused++;
   	}
  	spin_unlock(&dentry->d_lock);
-	dentry->d_vfs_flags |= DCACHE_REFERENCED;
 	spin_unlock(&dcache_lock);
 	return;
 
@@ -250,7 +249,6 @@
 static inline struct dentry * __dget_locked(struct dentry *dentry)
 {
 	atomic_inc(&dentry->d_count);
-	dentry->d_vfs_flags |= DCACHE_REFERENCED;
 	if (atomic_read(&dentry->d_count) == 1) {
 		dentry_stat.nr_unused--;
 		list_del_init(&dentry->d_lru);
@@ -379,17 +377,16 @@
 		dentry = list_entry(tmp, struct dentry, d_lru);
 
  		spin_lock(&dentry->d_lock);
+		/* leave inuse dentries */
+ 		if (atomic_read(&dentry->d_count)) {
+ 			spin_unlock(&dentry->d_lock);
+			continue;
+		}
 		/* If the dentry was recently referenced, don't free it. */
 		if (dentry->d_vfs_flags & DCACHE_REFERENCED) {
 			dentry->d_vfs_flags &= ~DCACHE_REFERENCED;
-
-			/* don't add non zero d_count dentries 
-			 * back to d_lru list
-			 */
- 			if (!atomic_read(&dentry->d_count)) {
- 				list_add(&dentry->d_lru, &dentry_unused);
- 				dentry_stat.nr_unused++;
- 			}
+ 			list_add(&dentry->d_lru, &dentry_unused);
+ 			dentry_stat.nr_unused++;
  			spin_unlock(&dentry->d_lock);
 			continue;
 		}
@@ -538,13 +535,18 @@
 		struct list_head *tmp = next;
 		struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
 		next = tmp->next;
-		list_del_init(&dentry->d_lru);
 
-		/* don't add non zero d_count dentries 
-		 * back to d_lru list
+		if (!list_empty(&dentry->d_lru)) {
+			dentry_stat.nr_unused--;
+			list_del_init(&dentry->d_lru);
+		}
+		/* 
+		 * move only zero ref count dentries to the end 
+		 * of the unused list for prune_dcache
 		 */
 		if (!atomic_read(&dentry->d_count)) {
 			list_add(&dentry->d_lru, dentry_unused.prev);
+			dentry_stat.nr_unused++;
 			found++;
 		}
 		/*
@@ -609,13 +611,18 @@
 		spin_lock(&dcache_lock);
 		hlist_for_each(lp, head) {
 			struct dentry *this = hlist_entry(lp, struct dentry, d_hash);
-			list_del(&this->d_lru);
+			if (!list_empty(&this->d_lru)) {
+				dentry_stat.nr_unused--;
+				list_del(&this->d_lru);
+			}
 
-			/* don't add non zero d_count dentries 
-			 * back to d_lru list
+			/* 
+			 * move only zero ref count dentries to the end 
+			 * of the unused list for prune_dcache
 			 */
 			if (!atomic_read(&this->d_count)) {
 				list_add_tail(&this->d_lru, &dentry_unused);
+				dentry_stat.nr_unused++;
 				found++;
 			}
 		}
@@ -1017,7 +1024,6 @@
 		if (likely(move_count == dentry->d_move_count)) {
 			if (!d_unhashed(dentry)) {
 				atomic_inc(&dentry->d_count);
-				dentry->d_vfs_flags |= DCACHE_REFERENCED;
 				found = dentry;
 			}
 		}
diff -Nru a/fs/devfs/base.c b/fs/devfs/base.c
--- a/fs/devfs/base.c	Fri Apr 18 08:59:17 2003
+++ b/fs/devfs/base.c	Sun Apr 20 16:54:18 2003
@@ -763,7 +763,6 @@
 
 struct bdev_type
 {
-    struct block_device_operations *ops;
     dev_t dev;
 };
 
@@ -1442,7 +1441,6 @@
  *		this to whatever you like, and change it once the file is opened (the next
  *		file opened will not see this change).
  *
- *	Returns a handle which may later be used in a call to devfs_unregister().
  *	On failure %NULL is returned.
  */
 
@@ -1457,6 +1455,8 @@
 
     /* we don't accept any flags anymore.  prototype will change soon. */
     WARN_ON(flags);
+    WARN_ON(dir);
+    WARN_ON(!S_ISCHR(mode));
 
     if (name == NULL)
     {
@@ -1491,7 +1491,6 @@
     } else if (S_ISBLK (mode)) {
 	de->u.bdev.dev = dev;
 	de->u.cdev.autogen = devnum != 0;
-	de->u.bdev.ops = ops;
     } else {
 	PRINTK ("(%s): illegal mode: %x\n", name, mode);
 	devfs_put (de);
@@ -1517,6 +1516,52 @@
 }   /*  End Function devfs_register  */
 
 
+int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
+{
+	struct devfs_entry *dir = NULL, *de;
+	char buf[64];
+	va_list args;
+	int error, n;
+
+	if (!S_ISBLK(mode)) {
+		printk(KERN_WARNING "%s: invalide mode (%u) for %s\n",
+				__FUNCTION__, mode, buf);
+		return -EINVAL;
+	}
+
+	va_start(args, fmt);
+	n = vsnprintf(buf, 64, fmt, args);
+	if (n >= 64 || !buf[0]) {
+		printk(KERN_WARNING "%s: invalid format string\n",
+				__FUNCTION__);
+		return -EINVAL;
+	}
+
+	de = _devfs_prepare_leaf(&dir, buf, mode);
+	if (!de) {
+		printk(KERN_WARNING "%s: could not prepare leaf for %s\n",
+				__FUNCTION__, buf);
+		return -ENOMEM;		/* could be more accurate... */
+	}
+
+	de->u.bdev.dev = dev;
+
+	error = _devfs_append_entry(dir, de, NULL);
+	if (error) {
+		printk(KERN_WARNING "%s: could not append to parent for %s\n",
+				__FUNCTION__, buf);
+		goto out;
+	}
+
+	devfsd_notify(de, DEVFSD_NOTIFY_REGISTERED);
+ out:
+	devfs_put(dir);
+	return error;
+}
+
+EXPORT_SYMBOL(devfs_mk_bdev);
+
+
 /**
  *	_devfs_unhook - Unhook a device entry from its parents list
  *	@de: The entry to unhook.
@@ -1578,24 +1623,6 @@
     }
 }   /*  End Function _devfs_unregister  */
 
-
-/**
- *	devfs_unregister - Unregister a device entry.
- *	@de: A handle previously created by devfs_register() or returned from
- *		devfs_get_handle(). If this is %NULL the routine does nothing.
- */
-
-void devfs_unregister (devfs_handle_t de)
-{
-    VERIFY_ENTRY (de);
-    if ( (de == NULL) || (de->parent == NULL) ) return;
-    DPRINTK (DEBUG_UNREGISTER, "(%s): de: %p  refcount: %d\n",
-	     de->name, de, atomic_read (&de->refcount) );
-    write_lock (&de->parent->u.dir.lock);
-    _devfs_unregister (de->parent, de);
-    devfs_put (de);
-}   /*  End Function devfs_unregister  */
-
 static int devfs_do_symlink (devfs_handle_t dir, const char *name,
 			     const char *link, devfs_handle_t *handle)
 {
@@ -1678,45 +1705,42 @@
  *	Use of this function is optional. The devfs_register() function
  *	will automatically create intermediate directories as needed. This function
  *	is provided for efficiency reasons, as it provides a handle to a directory.
- *	Returns a handle which may later be used in a call to devfs_unregister().
  *	On failure %NULL is returned.
  */
 
-devfs_handle_t devfs_mk_dir(const char *fmt, ...)
+int devfs_mk_dir(const char *fmt, ...)
 {
 	struct devfs_entry *dir = NULL, *de = NULL, *old;
 	char buf[64];
 	va_list args;
-	int n;
+	int error, n;
 
 	va_start(args, fmt);
 	n = vsnprintf(buf, 64, fmt, args);
 	if (n >= 64 || !buf[0]) {
 		printk(KERN_WARNING "%s: invalid argument.", __FUNCTION__);
-		return NULL;
+		return -EINVAL;
 	}
 
 	de = _devfs_prepare_leaf(&dir, buf, MODE_DIR);
 	if (!de) {
 		PRINTK("(%s): could not prepare leaf\n", buf);
-		return NULL;
+		return -EINVAL;
 	}
 
-	de->info = NULL;
-	if (_devfs_append_entry(dir, de, &old)) {
+	error = _devfs_append_entry(dir, de, &old);
+	if (error) {
 		PRINTK("(%s): could not append to dir: %p \"%s\"\n",
 				buf, dir, dir->name);
 		devfs_put(old);
 		goto out_put;
 	}
 	
-	DPRINTK(DEBUG_REGISTER, "(%s): de: %p dir: %p \"%s\"\n",
-			buf, de, dir, dir->name);
 	devfsd_notify(de, DEVFSD_NOTIFY_REGISTERED);
 
  out_put:
 	devfs_put(dir);
-	return de;
+	return error;
 }
 
 
@@ -1730,7 +1754,10 @@
 	n = vsnprintf(buf, 64, fmt, args);
 	if (n < 64 && buf[0]) {
 		devfs_handle_t de = _devfs_find_entry(NULL, buf, 0);
-		devfs_unregister(de);
+
+		write_lock(&de->parent->u.dir.lock);
+		_devfs_unregister(de->parent, de);
+		devfs_put(de);
 		devfs_put(de);
 	}
 }
@@ -1863,7 +1890,6 @@
 
 EXPORT_SYMBOL(devfs_put);
 EXPORT_SYMBOL(devfs_register);
-EXPORT_SYMBOL(devfs_unregister);
 EXPORT_SYMBOL(devfs_mk_symlink);
 EXPORT_SYMBOL(devfs_mk_dir);
 EXPORT_SYMBOL(devfs_remove);
diff -Nru a/fs/devfs/util.c b/fs/devfs/util.c
--- a/fs/devfs/util.c	Fri Apr 18 08:58:55 2003
+++ b/fs/devfs/util.c	Sat Apr 19 14:26:30 2003
@@ -74,8 +74,6 @@
 #include <asm/bitops.h>
 #include "internal.h"
 
-#define PRINTK(format, args...) \
-   {printk (KERN_ERR "%s" format, __FUNCTION__ , ## args);}
 
 int devfs_register_tape(const char *name)
 {
@@ -255,162 +253,4 @@
 		}
 	}
 	up(&device_list_mutex);
-}
-
-struct unique_numspace
-{
-    spinlock_t init_lock;
-    unsigned char sem_initialised;
-    unsigned int num_free;          /*  Num free in bits       */
-    unsigned int length;            /*  Array length in bytes  */
-    unsigned long *bits;
-    struct semaphore semaphore;
-};
-
-#define UNIQUE_NUMBERSPACE_INITIALISER {SPIN_LOCK_UNLOCKED, 0, 0, 0, NULL}
-
-
-/**
- *	devfs_alloc_unique_number - Allocate a unique (positive) number.
- *	@space: The number space to allocate from.
- *
- *	Returns the allocated unique number, else a negative error code.
- *	This routine is thread safe and may block.
- */
-
-int devfs_alloc_unique_number (struct unique_numspace *space)
-{
-    int number;
-    unsigned int length;
-
-    /*  Get around stupid lack of semaphore initialiser  */
-    spin_lock (&space->init_lock);
-    if (!space->sem_initialised)
-    {
-	sema_init (&space->semaphore, 1);
-	space->sem_initialised = 1;
-    }
-    spin_unlock (&space->init_lock);
-    down (&space->semaphore);
-    if (space->num_free < 1)
-    {
-	void *bits;
-
-	if (space->length < 16) length = 16;
-	else length = space->length << 1;
-	if ( ( bits = vmalloc (length) ) == NULL )
-	{
-	    up (&space->semaphore);
-	    return -ENOMEM;
-	}
-	if (space->bits != NULL)
-	{
-	    memcpy (bits, space->bits, space->length);
-	    vfree (space->bits);
-	}
-	space->num_free = (length - space->length) << 3;
-	space->bits = bits;
-	memset (bits + space->length, 0, length - space->length);
-	space->length = length;
-    }
-    number = find_first_zero_bit (space->bits, space->length << 3);
-    --space->num_free;
-    __set_bit (number, space->bits);
-    up (&space->semaphore);
-    return number;
-}   /*  End Function devfs_alloc_unique_number  */
-EXPORT_SYMBOL(devfs_alloc_unique_number);
-
-
-/**
- *	devfs_dealloc_unique_number - Deallocate a unique (positive) number.
- *	@space: The number space to deallocate from.
- *	@number: The number to deallocate.
- *
- *	This routine is thread safe and may block.
- */
-
-void devfs_dealloc_unique_number (struct unique_numspace *space, int number)
-{
-    int was_set;
-
-    if (number < 0) return;
-    down (&space->semaphore);
-    was_set = __test_and_clear_bit (number, space->bits);
-    if (was_set) ++space->num_free;
-    up (&space->semaphore);
-    if (!was_set) PRINTK ("(): number %d was already free\n", number);
-}   /*  End Function devfs_dealloc_unique_number  */
-EXPORT_SYMBOL(devfs_dealloc_unique_number);
-
-static struct unique_numspace disc_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
-static struct unique_numspace cdrom_numspace = UNIQUE_NUMBERSPACE_INITIALISER;
-
-void devfs_create_partitions(struct gendisk *disk)
-{
-	char dirname[64], diskname[64], symlink[16];
-
-	if (!disk->devfs_name)
-		sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name,
-				disk->first_minor >> disk->minor_shift);
-
-	devfs_mk_dir(disk->devfs_name);
-	disk->number = devfs_alloc_unique_number(&disc_numspace);
-
-	sprintf(diskname, "%s/disc", disk->devfs_name);
-	devfs_register(NULL, diskname, 0,
-			disk->major, disk->first_minor,
-			S_IFBLK | S_IRUSR | S_IWUSR,
-			disk->fops, NULL);
-
-	sprintf(symlink, "discs/disc%d", disk->number);
-	sprintf(dirname, "../%s", disk->devfs_name);
-	devfs_mk_symlink(symlink, dirname);
-
-}
-
-void devfs_create_cdrom(struct gendisk *disk)
-{
-	char dirname[64], cdname[64], symlink[16];
-
-	if (!disk->devfs_name)
-		strcat(disk->devfs_name, disk->disk_name);
-
-	devfs_mk_dir(disk->devfs_name);
-	disk->number = devfs_alloc_unique_number(&cdrom_numspace);
-
-	sprintf(cdname, "%s/cd", disk->devfs_name);
-	devfs_register(NULL, cdname, 0,
-			disk->major, disk->first_minor,
-			S_IFBLK | S_IRUGO | S_IWUGO,
-			disk->fops, NULL);
-
-	sprintf(symlink, "cdroms/cdrom%d", disk->number);
-	sprintf(dirname, "../%s", disk->devfs_name);
-	devfs_mk_symlink(symlink, dirname);
-}
-
-void devfs_register_partition(struct gendisk *dev, int part)
-{
-	char devname[64];
-
-	sprintf(devname, "%s/part%d", dev->devfs_name, part);
-	devfs_register(NULL, devname, 0,
-			dev->major, dev->first_minor + part,
-			S_IFBLK | S_IRUSR | S_IWUSR,
-			dev->fops, NULL);
-}
-
-void devfs_remove_partitions(struct gendisk *disk)
-{
-	devfs_remove("discs/disc%d", disk->number);
-	devfs_remove(disk->devfs_name);
-	devfs_dealloc_unique_number(&disc_numspace, disk->number);
-}
-
-void devfs_remove_cdrom(struct gendisk *disk)
-{
-	devfs_remove("cdroms/cdrom%d", disk->number);
-	devfs_remove(disk->devfs_name);
-	devfs_dealloc_unique_number(&cdrom_numspace, disk->number);
 }
diff -Nru a/fs/dquot.c b/fs/dquot.c
--- a/fs/dquot.c	Sat Apr 12 00:30:08 2003
+++ b/fs/dquot.c	Sat Apr 19 23:22:37 2003
@@ -345,50 +345,6 @@
 	return 0;
 }
 
-static struct super_block *get_super_to_sync(int type)
-{
-	struct list_head *head;
-	int cnt, dirty;
-
-restart:
-	spin_lock(&sb_lock);
-	list_for_each(head, &super_blocks) {
-		struct super_block *sb = list_entry(head, struct super_block, s_list);
-
-		for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++)
-			if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt)
-			    && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt]))
-				dirty = 1;
-		if (!dirty)
-			continue;
-		sb->s_count++;
-		spin_unlock(&sb_lock);
-		down_read(&sb->s_umount);
-		if (!sb->s_root) {
-			drop_super(sb);
-			goto restart;
-		}
-		return sb;
-	}
-	spin_unlock(&sb_lock);
-	return NULL;
-}
-
-void sync_dquots(struct super_block *sb, int type)
-{
-	if (sb) {
-		if (sb->s_qcop->quota_sync)
-			sb->s_qcop->quota_sync(sb, type);
-	}
-	else {
-		while ((sb = get_super_to_sync(type))) {
-			if (sb->s_qcop->quota_sync)
-				sb->s_qcop->quota_sync(sb, type);
-			drop_super(sb);
-		}
-	}
-}
-
 /* Free unused dquots from cache */
 static void prune_dqcache(int count)
 {
diff -Nru a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
--- a/fs/exportfs/expfs.c	Wed Apr  2 22:51:32 2003
+++ b/fs/exportfs/expfs.c	Sat Apr 19 23:22:23 2003
@@ -91,7 +91,6 @@
 			if (dentry != result &&
 			    acceptable(context, dentry)) {
 				dput(result);
-				dentry->d_vfs_flags |= DCACHE_REFERENCED;
 				return dentry;
 			}
 			spin_lock(&dcache_lock);
@@ -271,7 +270,6 @@
 		if (dentry != result &&
 		    acceptable(context, dentry)) {
 			dput(result);
-			dentry->d_vfs_flags |= DCACHE_REFERENCED;
 			return dentry;
 		}
 		spin_lock(&dcache_lock);
@@ -434,7 +432,6 @@
 		iput(inode);
 		return ERR_PTR(-ENOMEM);
 	}
-	result->d_vfs_flags |= DCACHE_REFERENCED;
 	return result;
 }
 
diff -Nru a/fs/fat/inode.c b/fs/fat/inode.c
--- a/fs/fat/inode.c	Wed Apr  2 22:51:32 2003
+++ b/fs/fat/inode.c	Sat Apr 19 23:22:23 2003
@@ -608,7 +608,6 @@
 		return ERR_PTR(-ENOMEM);
 	}
 	result->d_op = sb->s_root->d_op;
-	result->d_vfs_flags |= DCACHE_REFERENCED;
 	return result;
 }
 
diff -Nru a/fs/inode.c b/fs/inode.c
--- a/fs/inode.c	Tue Apr  8 03:16:30 2003
+++ b/fs/inode.c	Thu Apr 24 03:30:41 2003
@@ -340,15 +340,11 @@
 	return busy;
 }
  
-int invalidate_device(kdev_t dev, int do_sync)
+int __invalidate_device(struct block_device *bdev, int do_sync)
 {
 	struct super_block *sb;
-	struct block_device *bdev = bdget(kdev_t_to_nr(dev));
 	int res;
 
-	if (!bdev)
-		return 0;
-
 	if (do_sync)
 		fsync_bdev(bdev);
 
@@ -366,6 +362,15 @@
 		drop_super(sb);
 	}
 	invalidate_bdev(bdev, 0);
+	return res;
+}
+
+int invalidate_device(kdev_t dev, int do_sync)
+{
+	int res = 0;
+	struct block_device *bdev = bdget(kdev_t_to_nr(dev));
+	if (bdev)
+		res = __invalidate_device(bdev, do_sync);
 	bdput(bdev);
 	return res;
 }
diff -Nru a/fs/jbd/journal.c b/fs/jbd/journal.c
--- a/fs/jbd/journal.c	Wed Apr  2 22:51:44 2003
+++ b/fs/jbd/journal.c	Sat Apr 19 23:22:40 2003
@@ -457,14 +457,8 @@
 	/*
 	 * Right, time to make up the new buffer_head.
 	 */
-	do {
-		new_bh = alloc_buffer_head();
-		if (!new_bh) {
-			printk (KERN_NOTICE "%s: ENOMEM at alloc_buffer_head, "
-				"trying again.\n", __FUNCTION__);
-			yield();
-		}
-	} while (!new_bh);
+	new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
+
 	/* keep subsequent assertions sane */
 	new_bh->b_state = 0;
 	init_buffer(new_bh, NULL, NULL);
@@ -1613,28 +1607,7 @@
  */
 void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry)
 {
-	void *p;
-	static unsigned long last_warning;
-	
-	while (1) {
-		p = kmalloc(size, flags);
-		if (p)
-			return p;
-		if (!retry)
-			return NULL;
-		/* Log every retry for debugging.  Also log them to the
-		 * syslog, but do rate-limiting on the non-debugging
-		 * messages. */
-		jbd_debug(1, "ENOMEM in %s, retrying.\n", where);
-
-		if (time_after(jiffies, last_warning + 5*HZ)) {
-			printk(KERN_NOTICE
-			       "ENOMEM in %s, retrying.\n", where);
-			last_warning = jiffies;
-		}
-		
-		yield();
-	}
+	return kmalloc(size, flags | (retry ? __GFP_NOFAIL : 0));	
 }
 
 /*
diff -Nru a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
--- a/fs/jfs/jfs_txnmgr.c	Mon Mar 24 13:52:21 2003
+++ b/fs/jfs/jfs_txnmgr.c	Thu Apr 17 13:10:50 2003
@@ -1240,8 +1240,21 @@
 	 * Ensure that inode isn't reused before
 	 * lazy commit thread finishes processing
 	 */
-	if (tblk->xflag & (COMMIT_CREATE | COMMIT_DELETE))
+	if (tblk->xflag & (COMMIT_CREATE | COMMIT_DELETE)) {
 		atomic_inc(&tblk->ip->i_count);
+		/*
+		 * Avoid a rare deadlock
+		 *
+		 * If the inode is locked, we may be blocked in
+		 * jfs_commit_inode.  If so, we don't want the
+		 * lazy_commit thread doing the last iput() on the inode
+		 * since that may block on the locked inode.  Instead,
+		 * commit the transaction synchronously, so the last iput
+		 * will be done by the calling thread (or later)
+		 */
+		if (tblk->ip->i_state & I_LOCK)
+			tblk->xflag &= ~COMMIT_LAZY;
+	}
 
 	ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
 	       ((tblk->ip->i_nlink == 0) &&
diff -Nru a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
--- a/fs/nfs/nfs4proc.c	Mon Apr  7 15:47:19 2003
+++ b/fs/nfs/nfs4proc.c	Wed Apr 23 03:11:43 2003
@@ -572,10 +572,10 @@
 	u32                     f_bmres[2];
 	u32                     d_bmres[2];
 	struct nfs_fattr        d_attr = {
-		.valid          0,
+		.valid          = 0,
 	};
 	struct nfs_fattr        f_attr = {
-		.valid          0,
+		.valid          = 0,
 	};
 	struct nfs4_getattr     f_getattr = {
 		.gt_bmval       = nfs4_fattr_bitmap,
diff -Nru a/fs/partitions/Makefile b/fs/partitions/Makefile
--- a/fs/partitions/Makefile	Thu Mar  6 15:43:48 2003
+++ b/fs/partitions/Makefile	Sat Apr 19 14:18:27 2003
@@ -4,6 +4,7 @@
 
 obj-y := check.o
 
+obj-$(CONFIG_DEVFS_FS) += devfs.o
 obj-$(CONFIG_ACORN_PARTITION) += acorn.o
 obj-$(CONFIG_AMIGA_PARTITION) += amiga.o
 obj-$(CONFIG_ATARI_PARTITION) += atari.o
diff -Nru a/fs/partitions/check.c b/fs/partitions/check.c
--- a/fs/partitions/check.c	Fri Apr 18 08:58:55 2003
+++ b/fs/partitions/check.c	Sun Apr 20 14:52:10 2003
@@ -19,8 +19,10 @@
 #include <linux/blk.h>
 #include <linux/kmod.h>
 #include <linux/ctype.h>
+#include <linux/devfs_fs_kernel.h>
 
 #include "check.h"
+#include "devfs.h"
 
 #include "acorn.h"
 #include "amiga.h"
@@ -94,25 +96,24 @@
 
 char *disk_name(struct gendisk *hd, int part, char *buf)
 {
-	if (!part) {
 #ifdef CONFIG_DEVFS_FS
-		if (hd->devfs_name)
-			sprintf(buf, "%s/%s", hd->devfs_name,
-				(hd->flags & GENHD_FL_CD) ? "cd" : "disc");
-		else
-#endif
-			sprintf(buf, "%s", hd->disk_name);
-	} else {
-#ifdef CONFIG_DEVFS_FS
-		if (hd->devfs_name)
+	if (hd->devfs_name[0] != '\0') {
+		if (part)
 			sprintf(buf, "%s/part%d", hd->devfs_name, part);
+		else if (hd->minors != 1)
+			sprintf(buf, "%s/disc", hd->devfs_name);
 		else
-#endif
-		if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
-			sprintf(buf, "%sp%d", hd->disk_name, part);
-		else
-			sprintf(buf, "%s%d", hd->disk_name, part);
+			sprintf(buf, "%s", hd->devfs_name);
+		return buf;
 	}
+#endif
+
+	if (!part)
+		sprintf(buf, "%s", hd->disk_name);
+	else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
+		sprintf(buf, "%sp%d", hd->disk_name, part);
+	else
+		sprintf(buf, "%s%d", hd->disk_name, part);
 
 	return buf;
 }
@@ -128,7 +129,7 @@
 		return NULL;
 
 #ifdef CONFIG_DEVFS_FS
-	if (hd->devfs_name) {
+	if (hd->devfs_name[0] != '\0') {
 		printk(KERN_INFO " /dev/%s:", hd->devfs_name);
 		sprintf(state->name, "p");
 	}
@@ -182,7 +183,7 @@
 static ssize_t part_dev_read(struct hd_struct * p, char *page)
 {
 	struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj);
-	int part = p - disk->part + 1;
+	int part = p->partno;
 	dev_t base = MKDEV(disk->major, disk->first_minor); 
 	return sprintf(page, "%04x\n", (unsigned)(base + part));
 }
@@ -234,7 +235,9 @@
 
 void delete_partition(struct gendisk *disk, int part)
 {
-	struct hd_struct *p = disk->part + part - 1;
+	struct hd_struct *p = disk->part[part-1];
+	if (!p)
+		return;
 	if (!p->nr_sects)
 		return;
 	p->start_sect = 0;
@@ -242,15 +245,28 @@
 	p->reads = p->writes = p->read_sectors = p->write_sectors = 0;
 	devfs_remove("%s/part%d", disk->devfs_name, part);
 	kobject_unregister(&p->kobj);
+	disk->part[part-1] = NULL;
+	kfree(p);
 }
 
 void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len)
 {
-	struct hd_struct *p = disk->part + part - 1;
+	struct hd_struct *p;
 
+	p = kmalloc(sizeof(*p), GFP_KERNEL);
+	if (!p)
+		return;
+	
+	memset(p, 0, sizeof(*p));
 	p->start_sect = start;
 	p->nr_sects = len;
-	devfs_register_partition(disk, part);
+	p->partno = part;
+	disk->part[part-1] = p;
+
+	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor + part),
+			S_IFBLK|S_IRUSR|S_IWUSR,
+			"%s/part%d", disk->devfs_name, part);
+
 	snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part);
 	p->kobj.parent = &disk->kobj;
 	p->kobj.ktype = &ktype_part;
@@ -284,12 +300,12 @@
 		return;
 	disk_sysfs_symlinks(disk);
 
-	if (disk->flags & GENHD_FL_CD)
-		devfs_create_cdrom(disk);
-
 	/* No minors to use for partitions */
-	if (disk->minors == 1)
+	if (disk->minors == 1) {
+		if (disk->devfs_name[0] != '\0')
+			devfs_add_disk(disk);
 		return;
+	}
 
 	/* No such device (e.g., media were just removed) */
 	if (!get_capacity(disk))
@@ -299,7 +315,7 @@
 	if (blkdev_get(bdev, FMODE_READ, 0, BDEV_RAW) < 0)
 		return;
 	state = check_partition(disk, bdev);
-	devfs_create_partitions(disk);
+	devfs_add_partitioned(disk);
 	if (state) {
 		for (j = 1; j < state->limit; j++) {
 			sector_t size = state->parts[j].size;
@@ -392,10 +408,9 @@
 	unlink_gendisk(disk);
 	disk_stat_set_all(disk, 0);
 	disk->stamp = disk->stamp_idle = 0;
-	if (disk->flags & GENHD_FL_CD)
-		devfs_remove_cdrom(disk);
-	else
-		devfs_remove_partitions(disk);
+
+	devfs_remove_disk(disk);
+
 	if (disk->driverfs_dev) {
 		sysfs_remove_link(&disk->kobj, "device");
 		sysfs_remove_link(&disk->driverfs_dev->kobj, "block");
diff -Nru a/fs/partitions/check.h b/fs/partitions/check.h
--- a/fs/partitions/check.h	Tue Oct  8 11:36:39 2002
+++ b/fs/partitions/check.h	Sat Apr 19 23:22:17 2003
@@ -29,3 +29,8 @@
 }
 
 extern int warn_no_part;
+
+extern void parse_bsd(struct parsed_partitions *state,
+			struct block_device *bdev, u32 offset, u32 size,
+			int origin, char *flavour, int max_partitions);
+
diff -Nru a/fs/partitions/devfs.c b/fs/partitions/devfs.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/partitions/devfs.c	Mon Apr 21 10:20:54 2003
@@ -0,0 +1,130 @@
+/*
+ * This tries to keep block devices away from devfs as much as possible.
+ */
+#include <linux/fs.h>
+#include <linux/devfs_fs_kernel.h>
+#include <linux/vmalloc.h>
+#include <linux/genhd.h>
+#include <asm/bitops.h>
+#include <asm/semaphore.h>
+
+
+struct unique_numspace {
+	u32		  num_free;          /*  Num free in bits       */
+	u32		  length;            /*  Array length in bytes  */
+	unsigned long	  *bits;
+	struct semaphore  mutex;
+};
+
+static DECLARE_MUTEX(numspace_mutex);
+
+static int expand_numspace(struct unique_numspace *s)
+{
+	u32 length;
+	void *bits;
+
+	if (s->length < 16)
+		length = 16;
+	else
+		length = s->length << 1;
+
+	bits = vmalloc(length);
+	if (!bits)
+		return -ENOMEM;
+	if (s->bits) {
+		memcpy(bits, s->bits, s->length);
+		vfree(s->bits);
+	}
+		
+	s->num_free = (length - s->length) << 3;
+	s->bits = bits;
+	memset(bits + s->length, 0, length - s->length);
+	s->length = length;
+
+	return 0;
+}
+
+static int alloc_unique_number(struct unique_numspace *s)
+{
+	int rval = 0;
+
+	down(&numspace_mutex);
+	if (s->num_free < 1)
+		rval = expand_numspace(s);
+	if (!rval) {
+		rval = find_first_zero_bit(s->bits, s->length << 3);
+		--s->num_free;
+		__set_bit(rval, s->bits);
+	}
+	up(&numspace_mutex);
+
+	return rval;
+}
+
+static void dealloc_unique_number(struct unique_numspace *s, int number)
+{
+	int old_val;
+
+	if (number >= 0) {
+		down(&numspace_mutex);
+		old_val = __test_and_clear_bit(number, s->bits);
+		if (old_val)
+			++s->num_free;
+		up(&numspace_mutex);
+	}
+}
+
+static struct unique_numspace disc_numspace;
+static struct unique_numspace cdrom_numspace;
+
+void devfs_add_partitioned(struct gendisk *disk)
+{
+	char dirname[64], symlink[16];
+
+	devfs_mk_dir(disk->devfs_name);
+	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
+			S_IFBLK|S_IRUSR|S_IWUSR,
+			"%s/disc", disk->devfs_name);
+
+	disk->number = alloc_unique_number(&disc_numspace);
+
+	sprintf(symlink, "discs/disc%d", disk->number);
+	sprintf(dirname, "../%s", disk->devfs_name);
+	devfs_mk_symlink(symlink, dirname);
+
+}
+
+void devfs_add_disk(struct gendisk *disk)
+{
+	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
+			(disk->flags & GENHD_FL_CD) ?
+				S_IFBLK|S_IRUGO|S_IWUGO :
+				S_IFBLK|S_IRUSR|S_IWUSR,
+			"%s", disk->devfs_name);
+
+	if (disk->flags & GENHD_FL_CD) {
+		char dirname[64], symlink[16];
+
+		disk->number = alloc_unique_number(&cdrom_numspace);
+
+		sprintf(symlink, "cdroms/cdrom%d", disk->number);
+		sprintf(dirname, "../%s", disk->devfs_name);
+		devfs_mk_symlink(symlink, dirname);
+	}
+}
+
+void devfs_remove_disk(struct gendisk *disk)
+{
+	if (disk->minors != 1) {
+		devfs_remove("discs/disc%d", disk->number);
+		dealloc_unique_number(&disc_numspace, disk->number);
+		devfs_remove("%s/disc", disk->devfs_name);
+	}
+	if (disk->flags & GENHD_FL_CD) {
+		devfs_remove("cdroms/cdrom%d", disk->number);
+		dealloc_unique_number(&cdrom_numspace, disk->number);
+	}
+	devfs_remove(disk->devfs_name);
+}
+
+
diff -Nru a/fs/partitions/devfs.h b/fs/partitions/devfs.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/fs/partitions/devfs.h	Sat Apr 19 13:56:14 2003
@@ -0,0 +1,10 @@
+
+#ifdef CONFIG_DEVFS_FS
+void devfs_add_disk(struct gendisk *dev);
+void devfs_add_partitioned(struct gendisk *dev);
+void devfs_remove_disk(struct gendisk *dev);
+#else
+# define devfs_add_disk(disk)			do { } while (0)
+# define devfs_add_partitioned(disk)		do { } while (0)
+# define devfs_remove_disk(disk)		do { } while (0)
+#endif
diff -Nru a/fs/partitions/mac.c b/fs/partitions/mac.c
--- a/fs/partitions/mac.c	Sat Jul 20 11:03:57 2002
+++ b/fs/partitions/mac.c	Thu Apr 24 03:30:41 2003
@@ -12,7 +12,7 @@
 #include "mac.h"
 
 #ifdef CONFIG_ALL_PPC
-extern void note_bootable_part(kdev_t dev, int part, int goodness);
+extern void note_bootable_part(dev_t dev, int part, int goodness);
 #endif
 
 /*
@@ -121,8 +121,7 @@
 	}
 #ifdef CONFIG_ALL_PPC
 	if (found_root_goodness)
-		note_bootable_part(to_kdev_t(bdev->bd_dev),
-					found_root, found_root_goodness);
+		note_bootable_part(bdev->bd_dev, found_root, found_root_goodness);
 #endif
 
 	put_dev_sector(sect);
diff -Nru a/fs/partitions/msdos.c b/fs/partitions/msdos.c
--- a/fs/partitions/msdos.c	Thu Feb 13 10:15:06 2003
+++ b/fs/partitions/msdos.c	Sat Apr 19 23:22:17 2003
@@ -214,12 +214,12 @@
 #endif
 }
 
-#ifdef CONFIG_BSD_DISKLABEL
+#if defined(CONFIG_BSD_DISKLABEL) || defined(CONFIG_NEC98_PARTITION)
 /* 
  * Create devices for BSD partitions listed in a disklabel, under a
  * dos-like partition. See parse_extended() for more information.
  */
-static void
+void
 parse_bsd(struct parsed_partitions *state, struct block_device *bdev,
 		u32 offset, u32 size, int origin, char *flavour,
 		int max_partitions)
diff -Nru a/fs/partitions/nec98.c b/fs/partitions/nec98.c
--- a/fs/partitions/nec98.c	Thu Mar  6 15:43:48 2003
+++ b/fs/partitions/nec98.c	Sat Apr 19 23:22:17 2003
@@ -66,13 +66,6 @@
 	return valid;
 }
 
-#ifdef CONFIG_BSD_DISKLABEL
-extern void parse_bsd(struct parsed_partitions *state,
-			struct block_device *bdev,
-			u32 offset, u32 size, int origin, char *flavour,
-			int max_partitions);
-#endif
-
 int nec98_partition(struct parsed_partitions *state, struct block_device *bdev)
 {
 	unsigned int nr;
diff -Nru a/fs/proc/array.c b/fs/proc/array.c
--- a/fs/proc/array.c	Mon Feb 24 23:13:09 2003
+++ b/fs/proc/array.c	Mon Apr 21 20:58:43 2003
@@ -303,7 +303,7 @@
 		atomic_inc(&mm->mm_users);
 	if (task->tty) {
 		tty_pgrp = task->tty->pgrp;
-		tty_nr = kdev_t_to_nr(task->tty->device);
+		tty_nr = task->tty->device;
 	}
 	task_unlock(task);
 	if (mm) {
diff -Nru a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
--- a/fs/proc/proc_misc.c	Tue Apr  8 07:50:00 2003
+++ b/fs/proc/proc_misc.c	Wed Apr 23 03:12:19 2003
@@ -333,6 +333,18 @@
 	.release	= seq_release,
 };
 
+extern struct seq_operations diskstats_op;
+static int diskstats_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &diskstats_op);
+}
+static struct file_operations proc_diskstats_operations = {
+	.open		= diskstats_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
 #ifdef CONFIG_MODULES
 extern struct seq_operations modules_op;
 static int modules_open(struct inode *inode, struct file *file)
@@ -644,6 +656,7 @@
 	create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations);
 	create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
 	create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations);
+	create_seq_entry("diskstats", 0, &proc_diskstats_operations);
 #ifdef CONFIG_MODULES
 	create_seq_entry("modules", 0, &proc_modules_operations);
 #endif
diff -Nru a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
--- a/fs/proc/proc_tty.c	Fri Oct 11 17:46:21 2002
+++ b/fs/proc/proc_tty.c	Mon Apr 21 20:58:43 2003
@@ -12,13 +12,12 @@
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/tty.h>
+#include <linux/seq_file.h>
 #include <asm/bitops.h>
 
 extern struct tty_ldisc ldiscs[];
 
 
-static int tty_drivers_read_proc(char *page, char **start, off_t off,
-				 int count, int *eof, void *data);
 static int tty_ldiscs_read_proc(char *page, char **start, off_t off,
 				int count, int *eof, void *data);
 
@@ -30,72 +29,129 @@
 /*
  * This is the handler for /proc/tty/drivers
  */
-static int tty_drivers_read_proc(char *page, char **start, off_t off,
-				 int count, int *eof, void *data)
+static void show_tty_range(struct seq_file *m, struct tty_driver *p,
+	dev_t from, int num)
 {
-	int	len = 0;
-	off_t	begin = 0;
-	struct tty_driver *p;
-	char	range[20], deftype[20];
-	char	*type;
-
-	list_for_each_entry(p, &tty_drivers, tty_drivers) {
-		if (p->num > 1)
-			sprintf(range, "%d-%d", p->minor_start,
-				p->minor_start + p->num - 1);
+	seq_printf(m, "%-20s ", p->driver_name ? p->driver_name : "unknown");
+	seq_printf(m, "/dev/%-8s ", p->name);
+	if (p->num > 1) {
+		char	range[20];
+		sprintf(range, "%d-%d", MINOR(from),
+			MINOR(from) + num - 1);
+		seq_printf(m, "%3d %7s ", MAJOR(from), range);
+	} else {
+		seq_printf(m, "%3d %7d ", MAJOR(from), MINOR(from));
+	}
+	switch (p->type) {
+	case TTY_DRIVER_TYPE_SYSTEM:
+		seq_printf(m, "system");
+		if (p->subtype == SYSTEM_TYPE_TTY)
+			seq_printf(m, ":/dev/tty");
+		else if (p->subtype == SYSTEM_TYPE_SYSCONS)
+			seq_printf(m, ":console");
+		else if (p->subtype == SYSTEM_TYPE_CONSOLE)
+			seq_printf(m, ":vtmaster");
+		break;
+	case TTY_DRIVER_TYPE_CONSOLE:
+		seq_printf(m, "console");
+		break;
+	case TTY_DRIVER_TYPE_SERIAL:
+		seq_printf(m, "serial");
+		if (p->subtype == 2)
+			seq_printf(m, ":callout");
+		break;
+	case TTY_DRIVER_TYPE_PTY:
+		if (p->subtype == PTY_TYPE_MASTER)
+			seq_printf(m, "pty:master");
+		else if (p->subtype == PTY_TYPE_SLAVE)
+			seq_printf(m, "pty:slave");
 		else
-			sprintf(range, "%d", p->minor_start);
-		switch (p->type) {
-		case TTY_DRIVER_TYPE_SYSTEM:
-			if (p->subtype == SYSTEM_TYPE_TTY)
-				type = "system:/dev/tty";
-			else if (p->subtype == SYSTEM_TYPE_SYSCONS)
-				type = "system:console";
-			else if (p->subtype == SYSTEM_TYPE_CONSOLE)
-				type = "system:vtmaster";
-			else
-				type = "system";
-			break;
-		case TTY_DRIVER_TYPE_CONSOLE:
-			type = "console";
-			break;
-		case TTY_DRIVER_TYPE_SERIAL:
-			if (p->subtype == 2)
-				type = "serial:callout";
-			else
-				type = "serial";
-			break;
-		case TTY_DRIVER_TYPE_PTY:
-			if (p->subtype == PTY_TYPE_MASTER)
-				type = "pty:master";
-			else if (p->subtype == PTY_TYPE_SLAVE)
-				type = "pty:slave";
-			else
-				type = "pty";
-			break;
-		default:
-			sprintf(deftype, "type:%d.%d", p->type, p->subtype);
-			type = deftype;
-			break;
-		}
-		len += sprintf(page+len, "%-20s /dev/%-8s %3d %7s %s\n",
-			       p->driver_name ? p->driver_name : "unknown",
-			       p->name, p->major, range, type);
-		if (len+begin > off+count)
-			break;
-		if (len+begin < off) {
-			begin += len;
-			len = 0;
-		}
+			seq_printf(m, "pty");
+		break;
+	default:
+		seq_printf(m, "type:%d.%d", p->type, p->subtype);
 	}
-	if (!p)
-		*eof = 1;
-	if (off >= len+begin)
-		return 0;
-	*start = page + (off-begin);
-	return ((count < begin+len-off) ? count : begin+len-off);
+	seq_putc(m, '\n');
 }
 
+static int show_tty_driver(struct seq_file *m, void *v)
+{
+	struct tty_driver *p = v;
+	dev_t from = MKDEV(p->major, p->minor_start);
+	dev_t to = from + p->num;
+
+	if (&p->tty_drivers == tty_drivers.next) {
+		/* pseudo-drivers first */
+		seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty", "tty");
+		seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 0);
+		seq_printf(m, "system:/dev/tty\n");
+		seq_printf(m, "%-20s /dev/%-8s ", "/dev/console", "console");
+		seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 1);
+		seq_printf(m, "system:console\n");
+#ifdef CONFIG_UNIX98_PTYS
+		seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx");
+		seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2);
+		seq_printf(m, "system\n");
+#endif
+#ifdef CONFIG_VT
+		seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0");
+		seq_printf(m, "%3d %7d ", TTY_MAJOR, 0);
+		seq_printf(m, "system:vtmaster\n");
+#endif
+	}
+
+	while (MAJOR(from) < MAJOR(to)) {
+		dev_t next = MKDEV(MAJOR(from)+1, 0);
+		show_tty_range(m, p, from, next - from);
+		from = next;
+	}
+	if (from != to)
+		show_tty_range(m, p, from, to - from);
+	return 0;
+}
+
+/* iterator */
+static void *t_start(struct seq_file *m, loff_t *pos)
+{
+	struct list_head *p;
+	loff_t l = *pos;
+	list_for_each(p, &tty_drivers)
+		if (!l--)
+			return list_entry(p, struct tty_driver, tty_drivers);
+	return NULL;
+}
+
+static void *t_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	struct list_head *p = ((struct tty_driver *)v)->tty_drivers.next;
+	(*pos)++;
+	return p==&tty_drivers ? NULL :
+			list_entry(p, struct tty_driver, tty_drivers);
+}
+
+static void t_stop(struct seq_file *m, void *v)
+{
+}
+
+static struct seq_operations tty_drivers_op = {
+	.start	= t_start,
+	.next	= t_next,
+	.stop	= t_stop,
+	.show	= show_tty_driver
+};
+
+static int tty_drivers_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &tty_drivers_op);
+}
+
+static struct file_operations proc_tty_drivers_operations = {
+	.open		= tty_drivers_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
 /*
  * This is the handler for /proc/tty/ldiscs
  */
@@ -170,11 +226,14 @@
  */
 void __init proc_tty_init(void)
 {
+	struct proc_dir_entry *entry;
 	if (!proc_mkdir("tty", 0))
 		return;
 	proc_tty_ldisc = proc_mkdir("tty/ldisc", 0);
 	proc_tty_driver = proc_mkdir("tty/driver", 0);
 
 	create_proc_read_entry("tty/ldiscs", 0, 0, tty_ldiscs_read_proc,NULL);
-	create_proc_read_entry("tty/drivers", 0, 0, tty_drivers_read_proc,NULL);
+	entry = create_proc_entry("tty/drivers", 0, NULL);
+	if (entry)
+		entry->proc_fops = &proc_tty_drivers_operations;
 }
diff -Nru a/fs/quota.c b/fs/quota.c
--- a/fs/quota.c	Sat Mar 22 12:36:49 2003
+++ b/fs/quota.c	Sat Apr 19 23:22:37 2003
@@ -19,8 +19,10 @@
 {
 	if (type >= MAXQUOTAS)
 		return -EINVAL;
+	if (!sb && cmd != Q_SYNC)
+		return -ENODEV;
 	/* Is operation supported? */
-	if (!sb->s_qcop)
+	if (sb && !sb->s_qcop)
 		return -ENOSYS;
 
 	switch (cmd) {
@@ -51,7 +53,7 @@
 				return -ENOSYS;
 			break;
 		case Q_SYNC:
-			if (!sb->s_qcop->quota_sync)
+			if (sb && !sb->s_qcop->quota_sync)
 				return -ENOSYS;
 			break;
 		case Q_XQUOTAON:
@@ -102,6 +104,50 @@
 	return security_quotactl (cmd, type, id, sb);
 }
 
+static struct super_block *get_super_to_sync(int type)
+{
+	struct list_head *head;
+	int cnt, dirty;
+
+restart:
+	spin_lock(&sb_lock);
+	list_for_each(head, &super_blocks) {
+		struct super_block *sb = list_entry(head, struct super_block, s_list);
+
+		for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++)
+			if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt)
+			    && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt]))
+				dirty = 1;
+		if (!dirty)
+			continue;
+		sb->s_count++;
+		spin_unlock(&sb_lock);
+		down_read(&sb->s_umount);
+		if (!sb->s_root) {
+			drop_super(sb);
+			goto restart;
+		}
+		return sb;
+	}
+	spin_unlock(&sb_lock);
+	return NULL;
+}
+
+void sync_dquots(struct super_block *sb, int type)
+{
+	if (sb) {
+		if (sb->s_qcop->quota_sync)
+			sb->s_qcop->quota_sync(sb, type);
+	}
+	else {
+		while ((sb = get_super_to_sync(type))) {
+			if (sb->s_qcop->quota_sync)
+				sb->s_qcop->quota_sync(sb, type);
+			drop_super(sb);
+		}
+	}
+}
+
 /* Copy parameters and call proper function */
 static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, caddr_t addr)
 {
@@ -167,7 +213,8 @@
 			return sb->s_qcop->set_dqblk(sb, type, id, &idq);
 		}
 		case Q_SYNC:
-			return sb->s_qcop->quota_sync(sb, type);
+			sync_dquots(sb, type);
+			return 0;
 
 		case Q_XQUOTAON:
 		case Q_XQUOTAOFF:
@@ -222,27 +269,30 @@
 	struct super_block *sb = NULL;
 	struct block_device *bdev;
 	char *tmp;
-	int ret = -ENODEV;
+	int ret;
 
 	cmds = cmd >> SUBCMDSHIFT;
 	type = cmd & SUBCMDMASK;
 
-	tmp = getname(special);
-	if (IS_ERR(tmp))
-		return PTR_ERR(tmp);
-	bdev = lookup_bdev(tmp);
-	putname(tmp);
-	if (IS_ERR(bdev))
-		return PTR_ERR(bdev);
-	sb = get_super(bdev);
-	bdput(bdev);
+	if (cmds != Q_SYNC || special) {
+		tmp = getname(special);
+		if (IS_ERR(tmp))
+			return PTR_ERR(tmp);
+		bdev = lookup_bdev(tmp);
+		putname(tmp);
+		if (IS_ERR(bdev))
+			return PTR_ERR(bdev);
+		sb = get_super(bdev);
+		bdput(bdev);
+		if (!sb)
+			return -ENODEV;
+	}
 
-	if (sb) {
-		ret = check_quotactl_valid(sb, type, cmds, id);
-		if (ret >= 0)
-			ret = do_quotactl(sb, type, cmds, id, addr);
+	ret = check_quotactl_valid(sb, type, cmds, id);
+	if (ret >= 0)
+		ret = do_quotactl(sb, type, cmds, id, addr);
+	if (sb)
 		drop_super(sb);
-	}
 
 	return ret;
 }
diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
--- a/fs/reiserfs/inode.c	Wed Apr  2 22:51:32 2003
+++ b/fs/reiserfs/inode.c	Sat Apr 19 23:22:23 2003
@@ -1260,7 +1260,6 @@
 	    iput(inode);
 	    return ERR_PTR(-ENOMEM);
     }
-    result->d_vfs_flags |= DCACHE_REFERENCED;
     return result;
 }
 
diff -Nru a/fs/smbfs/proc.c b/fs/smbfs/proc.c
--- a/fs/smbfs/proc.c	Wed Apr  2 22:51:32 2003
+++ b/fs/smbfs/proc.c	Sat Apr 19 23:22:56 2003
@@ -2085,7 +2085,6 @@
 void smb_decode_unix_basic(struct smb_fattr *fattr, char *p)
 {
 	/* FIXME: verify nls support. all is sent as utf8? */
-	__u64 devmajor, devminor;
 
 	fattr->f_unix = 1;
 	fattr->f_mode = 0;
@@ -2112,9 +2111,10 @@
 	fattr->f_mode |= smb_filetype_to_mode(WVAL(p, 56));
 
 	if (S_ISBLK(fattr->f_mode) || S_ISCHR(fattr->f_mode)) {
-		devmajor = LVAL(p, 60);
-		devminor = LVAL(p, 68);
-		fattr->f_rdev = ((devmajor & 0xFF) << 8) | (devminor & 0xFF);
+		__u64 major = LVAL(p, 60);
+		__u64 minor = LVAL(p, 68);
+
+		fattr->f_rdev = MKDEV(major & 0xffffffff, minor & 0xffffffff);
 	}
 	fattr->f_mode |= LVAL(p, 84);
 }
@@ -3008,7 +3008,7 @@
  */
 int
 smb_proc_setattr_unix(struct dentry *d, struct iattr *attr,
-		      int major, int minor)
+		      unsigned int major, unsigned int minor)
 {
 	struct smb_sb_info *server = server_from_dentry(d);
 	u64 nttime;
diff -Nru a/fs/smbfs/proto.h b/fs/smbfs/proto.h
--- a/fs/smbfs/proto.h	Tue Dec 31 17:21:17 2002
+++ b/fs/smbfs/proto.h	Sat Apr 19 23:22:56 2003
@@ -27,7 +27,7 @@
 extern void smb_decode_unix_basic(struct smb_fattr *fattr, char *p);
 extern int smb_proc_getattr(struct dentry *dir, struct smb_fattr *fattr);
 extern int smb_proc_setattr(struct dentry *dir, struct smb_fattr *fattr);
-extern int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, int major, int minor);
+extern int smb_proc_setattr_unix(struct dentry *d, struct iattr *attr, unsigned int major, unsigned int minor);
 extern int smb_proc_settime(struct dentry *dentry, struct smb_fattr *fattr);
 extern int smb_proc_dskattr(struct super_block *sb, struct statfs *attr);
 extern int smb_proc_read_link(struct smb_sb_info *server, struct dentry *d, char *buffer, int len);
diff -Nru a/fs/xfs/linux/xfs_super.c b/fs/xfs/linux/xfs_super.c
--- a/fs/xfs/linux/xfs_super.c	Mon Apr  7 12:05:43 2003
+++ b/fs/xfs/linux/xfs_super.c	Sat Apr 19 23:22:23 2003
@@ -741,7 +741,6 @@
 		iput(inode);
 		return ERR_PTR(-ENOMEM);
 	}
-	result->d_vfs_flags |= DCACHE_REFERENCED;
 	return result;
 }
 
diff -Nru a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c
--- a/fs/xfs/pagebuf/page_buf.c	Wed Mar 26 10:29:29 2003
+++ b/fs/xfs/pagebuf/page_buf.c	Sat Apr 19 23:22:50 2003
@@ -554,7 +554,8 @@
 		} else if (flags & PBF_MAPPED) {
 			if (as_list_len > 64)
 				purge_addresses();
-			pb->pb_addr = vmap(pb->pb_pages, page_count);
+			pb->pb_addr = vmap(pb->pb_pages, page_count,
+					VM_MAP, PAGE_KERNEL);
 			if (pb->pb_addr == NULL)
 				return -ENOMEM;
 			pb->pb_addr += pb->pb_offset;
diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h
--- a/include/acpi/acconfig.h	Fri Mar 28 14:10:26 2003
+++ b/include/acpi/acconfig.h	Fri Apr 18 16:27:55 2003
@@ -47,7 +47,7 @@
 
 /******************************************************************************
  *
- * Compile-time options
+ * Configuration options
  *
  *****************************************************************************/
 
@@ -62,21 +62,9 @@
  *
  */
 
-
-/******************************************************************************
- *
- * Subsystem Constants
- *
- *****************************************************************************/
-
-
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030328
-
-/* Version of ACPI supported */
-
-#define ACPI_CA_SUPPORT_LEVEL           2
+#define ACPI_CA_VERSION                 0x20030418
 
 /* Maximum objects in the various object caches */
 
@@ -86,6 +74,23 @@
 #define ACPI_MAX_OBJECT_CACHE_DEPTH     64          /* Interpreter operand objects */
 #define ACPI_MAX_WALK_CACHE_DEPTH       4           /* Objects for parse tree walks */
 
+/*
+ * Should the subystem abort the loading of an ACPI table if the
+ * table checksum is incorrect?
+ */
+#define ACPI_CHECKSUM_ABORT             FALSE
+
+
+/******************************************************************************
+ *
+ * Subsystem Constants
+ *
+ *****************************************************************************/
+
+/* Version of ACPI supported */
+
+#define ACPI_CA_SUPPORT_LEVEL           2
+
 /* String size constants */
 
 #define ACPI_MAX_STRING_LENGTH          512
@@ -106,20 +111,6 @@
 
 /******************************************************************************
  *
- * Configuration of subsystem behavior
- *
- *****************************************************************************/
-
-
-/*
- * Should the subystem abort the loading of an ACPI table if the
- * table checksum is incorrect?
- */
-#define ACPI_CHECKSUM_ABORT             FALSE
-
-
-/******************************************************************************
- *
  * ACPI Specification constants (Do not change unless the specification changes)
  *
  *****************************************************************************/
@@ -195,7 +186,6 @@
  * ACPI AML Debugger
  *
  *****************************************************************************/
-
 
 #define ACPI_DEBUGGER_MAX_ARGS          8  /* Must be max method args + 1 */
 
diff -Nru a/include/acpi/acinterp.h b/include/acpi/acinterp.h
--- a/include/acpi/acinterp.h	Tue Feb 18 15:32:34 2003
+++ b/include/acpi/acinterp.h	Fri Apr 18 16:27:55 2003
@@ -164,15 +164,17 @@
 acpi_ex_get_buffer_datum(
 	acpi_integer                    *datum,
 	void                            *buffer,
+	u32                             buffer_length,
 	u32                             byte_granularity,
-	u32                             offset);
+	u32                             buffer_offset);
 
 void
 acpi_ex_set_buffer_datum (
 	acpi_integer                    merged_datum,
 	void                            *buffer,
+	u32                             buffer_length,
 	u32                             byte_granularity,
-	u32                             offset);
+	u32                             buffer_offset);
 
 acpi_status
 acpi_ex_read_data_from_field (
diff -Nru a/include/acpi/aclocal.h b/include/acpi/aclocal.h
--- a/include/acpi/aclocal.h	Fri Mar 28 14:10:26 2003
+++ b/include/acpi/aclocal.h	Fri Apr 18 16:27:55 2003
@@ -196,7 +196,7 @@
 
 
 	union acpi_operand_object           *object;        /* Pointer to attached ACPI object (optional) */
-	struct acpi_namespace_node          *child;         /* first child */
+	struct acpi_namespace_node          *child;         /* First child */
 	struct acpi_namespace_node          *peer;          /* Next peer*/
 	u16                                 reference_count; /* Current count of references and children */
 	u8                                  flags;
@@ -476,10 +476,10 @@
 struct acpi_pscope_state
 {
 	ACPI_STATE_COMMON
-	union acpi_parse_object             *op;                    /* current op being parsed */
-	u8                                  *arg_end;               /* current argument end */
-	u8                                  *pkg_end;               /* current package end */
-	u32                                 arg_list;               /* next argument to parse */
+	union acpi_parse_object             *op;                    /* Current op being parsed */
+	u8                                  *arg_end;               /* Current argument end */
+	u8                                  *pkg_end;               /* Current package end */
+	u32                                 arg_list;               /* Next argument to parse */
 	u32                                 arg_count;              /* Number of fixed arguments */
 };
 
@@ -585,11 +585,8 @@
 
 union acpi_parse_value
 {
-	acpi_integer                        integer;        /* integer constant (Up to 64 bits) */
+	acpi_integer                        integer;        /* Integer constant (Up to 64 bits) */
 	struct uint64_struct                integer64;      /* Structure overlay for 2 32-bit Dwords */
-	u32                                 integer32;      /* integer constant, 32 bits only */
-	u16                                 integer16;      /* integer constant, 16 bits only */
-	u8                                  integer8;       /* integer constant, 8 bits only */
 	u32                                 size;           /* bytelist or field size */
 	char                                *string;        /* NULL terminated string */
 	u8                                  *buffer;        /* buffer or string */
@@ -602,15 +599,15 @@
 	u8                                  data_type;      /* To differentiate various internal objs */\
 	u8                                  flags;          /* Type of Op */\
 	u16                                 aml_opcode;     /* AML opcode */\
-	u32                                 aml_offset;     /* offset of declaration in AML */\
-	union acpi_parse_object             *parent;        /* parent op */\
-	union acpi_parse_object             *next;          /* next op */\
+	u32                                 aml_offset;     /* Offset of declaration in AML */\
+	union acpi_parse_object             *parent;        /* Parent op */\
+	union acpi_parse_object             *next;          /* Next op */\
 	ACPI_DISASM_ONLY_MEMBERS (\
 	u8                                  disasm_flags;   /* Used during AML disassembly */\
 	u8                                  disasm_opcode;  /* Subtype used for disassembly */\
-	char                                aml_op_name[16]) /* op name (debug only) */\
+	char                                aml_op_name[16]) /* Op name (debug only) */\
 			   /* NON-DEBUG members below: */\
-	struct acpi_namespace_node          *node;          /* for use by interpreter */\
+	struct acpi_namespace_node          *node;          /* For use by interpreter */\
 	union acpi_parse_value              value;          /* Value or args associated with the opcode */\
 
 
@@ -691,14 +688,14 @@
 struct acpi_parse_state
 {
 	u32                                 aml_size;
-	u8                                  *aml_start;     /* first AML byte */
-	u8                                  *aml;           /* next AML byte */
+	u8                                  *aml_start;     /* First AML byte */
+	u8                                  *aml;           /* Next AML byte */
 	u8                                  *aml_end;       /* (last + 1) AML byte */
-	u8                                  *pkg_start;     /* current package begin */
-	u8                                  *pkg_end;       /* current package end */
-	union acpi_parse_object             *start_op;      /* root of parse tree */
+	u8                                  *pkg_start;     /* Current package begin */
+	u8                                  *pkg_end;       /* Current package end */
+	union acpi_parse_object             *start_op;      /* Root of parse tree */
 	struct acpi_namespace_node          *start_node;
-	union acpi_generic_state            *scope;         /* current scope */
+	union acpi_generic_state            *scope;         /* Current scope */
 	union acpi_parse_object             *start_scope;
 };
 
diff -Nru a/include/acpi/acmacros.h b/include/acpi/acmacros.h
--- a/include/acpi/acmacros.h	Tue Feb 18 15:32:34 2003
+++ b/include/acpi/acmacros.h	Fri Apr 18 16:27:55 2003
@@ -116,7 +116,7 @@
 #define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **)(void *)(p))
 
 #if ACPI_MACHINE_WIDTH == 16
-#define ACPI_STORE_POINTER(d,s)         ACPI_MOVE_UNALIGNED32_TO_32(d,s)
+#define ACPI_STORE_POINTER(d,s)         ACPI_MOVE_32_TO_32(d,s)
 #define ACPI_PHYSADDR_TO_PTR(i)         (void *)(i)
 #define ACPI_PTR_TO_PHYSADDR(i)         (u32) (char *)(i)
 #else
@@ -130,41 +130,169 @@
  * Otherwise, we have to move one byte at a time.
  */
 
-#ifdef _HW_ALIGNMENT_SUPPORT
+#ifdef ACPI_BIG_ENDIAN
+/*
+ * Macros for big-endian machines
+ */
+
+/* This macro sets a buffer index, starting from the end of the buffer */
+
+#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) ((buf_len) - (((buf_offset)+1) * (byte_gran)))
+
+/* These macros reverse the bytes during the move, converting little-endian to big endian */
+
+	 /* Big Endian      <==        Little Endian */
+	 /*  Hi...Lo                     Lo...Hi     */
+/* 16-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_16_TO_16(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[1];\
+			  ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[0];}
+
+#define ACPI_MOVE_16_TO_32(d,s)         {(*(u32 *)(void *)(d))=0;\
+					  ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
+					  ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
+
+#define ACPI_MOVE_16_TO_64(d,s)         {(*(u64 *)(void *)(d))=0;\
+							   ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\
+							   ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];}
+
+/* 32-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+
+#define ACPI_MOVE_32_TO_32(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\
+									  ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\
+									  ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
+									  ((  u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
+
+#define ACPI_MOVE_32_TO_64(d,s)         {(*(u64 *)(void *)(d))=0;\
+										   ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[3];\
+										   ((u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[2];\
+										   ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\
+										   ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];}
+
+/* 64-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+
+#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
+
+#define ACPI_MOVE_64_TO_64(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\
+										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\
+										 ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[5];\
+										 ((  u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[4];\
+										 ((  u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[3];\
+										 ((  u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[2];\
+										 ((  u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\
+										 ((  u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];}
+#else
+/*
+ * Macros for little-endian machines
+ */
+
+/* This macro sets a buffer index, starting from the beginning of the buffer */
+
+#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset)
+
+#ifdef ACPI_MISALIGNED_TRANSFERS
+
+/* The hardware supports unaligned transfers, just do the little-endian move */
+
+#if ACPI_MACHINE_WIDTH == 16
+
+/* No 64-bit integers */
+/* 16-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_16_TO_16(d,s)         *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
+#define ACPI_MOVE_16_TO_32(d,s)         *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
+#define ACPI_MOVE_16_TO_64(d,s)         ACPI_MOVE_16_TO_32(d,s)
+
+/* 32-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+#define ACPI_MOVE_32_TO_32(d,s)         *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
+#define ACPI_MOVE_32_TO_64(d,s)         ACPI_MOVE_32_TO_32(d,s)
+
+/* 64-bit source, 16/32/64 destination */
 
-/* The hardware supports unaligned transfers, just do the move */
+#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
+#define ACPI_MOVE_64_TO_64(d,s)         ACPI_MOVE_32_TO_32(d,s)
 
-#define ACPI_MOVE_UNALIGNED16_TO_16(d,s)    *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
-#define ACPI_MOVE_UNALIGNED32_TO_32(d,s)    *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
-#define ACPI_MOVE_UNALIGNED16_TO_32(d,s)    *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
-#define ACPI_MOVE_UNALIGNED64_TO_64(d,s)    *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
+#else
+/* 16-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_16_TO_16(d,s)         *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
+#define ACPI_MOVE_16_TO_32(d,s)         *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
+#define ACPI_MOVE_16_TO_64(d,s)         *(u64 *)(void *)(d) = *(u16 *)(void *)(s)
+
+/* 32-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+#define ACPI_MOVE_32_TO_32(d,s)         *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
+#define ACPI_MOVE_32_TO_64(d,s)         *(u64 *)(void *)(d) = *(u32 *)(void *)(s)
+
+/* 64-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
+#define ACPI_MOVE_64_TO_64(d,s)         *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
+#endif
 
 #else
 /*
  * The hardware does not support unaligned transfers.  We must move the
  * data one byte at a time.  These macros work whether the source or
- * the destination (or both) is/are unaligned.
+ * the destination (or both) is/are unaligned.  (Little-endian move)
  */
 
-#define ACPI_MOVE_UNALIGNED16_TO_16(d,s)    {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
-	  ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];}
+/* 16-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_16_TO_16(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
+										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];}
+
+#define ACPI_MOVE_16_TO_32(d,s)         {(*(u32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d,s);}
+#define ACPI_MOVE_16_TO_64(d,s)         {(*(u64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d,s);}
+
+/* 32-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+
+#define ACPI_MOVE_32_TO_32(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
+										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
+										 ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\
+										 ((  u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];}
+
+#define ACPI_MOVE_32_TO_64(d,s)         {(*(u64 *)(void *)(d)) = 0; ACPI_MOVE_32_TO_32(d,s);}
+
+/* 64-bit source, 16/32/64 destination */
+
+#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
+#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
+#define ACPI_MOVE_64_TO_64(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
+										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
+										 ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\
+										 ((  u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];\
+										 ((  u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[4];\
+										 ((  u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[5];\
+										 ((  u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[6];\
+										 ((  u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[7];}
+#endif
+#endif
+
+/* Macros based on machine integer width */
+
+#if ACPI_MACHINE_WIDTH == 16
+#define ACPI_MOVE_SIZE_TO_16(d,s)       ACPI_MOVE_16_TO_16(d,s)
 
-#define ACPI_MOVE_UNALIGNED32_TO_32(d,s)    {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
-			   ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
-			   ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\
-			   ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];}
-
-#define ACPI_MOVE_UNALIGNED16_TO_32(d,s)    {(*(u32*)(void *)(d)) = 0; ACPI_MOVE_UNALIGNED16_TO_16(d,s);}
-
-#define ACPI_MOVE_UNALIGNED64_TO_64(d,s)    {((u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
-					 ((u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
-					 ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\
-					 ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];\
-					 ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[4];\
-					 ((u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[5];\
-					 ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[6];\
-					 ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[7];}
+#elif ACPI_MACHINE_WIDTH == 32
+#define ACPI_MOVE_SIZE_TO_16(d,s)       ACPI_MOVE_32_TO_16(d,s)
 
+#elif ACPI_MACHINE_WIDTH == 64
+#define ACPI_MOVE_SIZE_TO_16(d,s)       ACPI_MOVE_64_TO_16(d,s)
+
+#else
+#error unknown ACPI_MACHINE_WIDTH
 #endif
 
 
@@ -232,21 +360,6 @@
 
 #if ACPI_MACHINE_WIDTH != 16
 
-#define ACPI_PCI_DEVICE_MASK            (u64) 0x0000FFFF00000000
-#define ACPI_PCI_FUNCTION_MASK          (u64) 0x00000000FFFF0000
-#define ACPI_PCI_REGISTER_MASK          (u64) 0x000000000000FFFF
-
-/*
- * Obsolete
- */
-
-/*
-#define ACPI_PCI_FUNCTION(a)            (u16) ((((u64)((u64)(a) & ACPI_PCI_FUNCTION_MASK)) >> 16))
-#define ACPI_PCI_DEVICE(a)              (u16) ((((u64)((u64)(a) & ACPI_PCI_DEVICE_MASK)) >> 32))
-#define ACPI_PCI_REGISTER(a)            (u16) (((u64)((u64)(a) & ACPI_PCI_REGISTER_MASK)))
-*/
-
-
 #define ACPI_PCI_DEVICE(a)              (u16) ((ACPI_HIDWORD ((a))) & 0x0000FFFF)
 #define ACPI_PCI_FUNCTION(a)            (u16) ((ACPI_LODWORD ((a))) >> 16)
 #define ACPI_PCI_REGISTER(a)            (u16) ((ACPI_LODWORD ((a))) & 0x0000FFFF)
@@ -337,10 +450,10 @@
  * 5) Expand address to 64 bits
  */
 #define ASL_BUILD_GAS_FROM_ENTRY(a,b,c,d)   do {a.address_space_id = (u8) d;\
-							  a.register_bit_width = (u8) ACPI_MUL_8 (b);\
-							  a.register_bit_offset = 0;\
-							  a.reserved = 0;\
-							  ACPI_STORE_ADDRESS (a.address,(acpi_physical_address) c);} while (0)
+												a.register_bit_width = (u8) ACPI_MUL_8 (b);\
+												a.register_bit_offset = 0;\
+												a.reserved = 0;\
+												ACPI_STORE_ADDRESS (a.address,(acpi_physical_address) c);} while (0)
 
 /* ACPI V1.0 entries -- address space is always I/O */
 
@@ -351,7 +464,7 @@
  * Reporting macros that are never compiled out
  */
 
-#define ACPI_PARAM_LIST(pl)                  pl
+#define ACPI_PARAM_LIST(pl)                 pl
 
 /*
  * Error reporting.  These versions add callers module and line#.  Since
@@ -362,9 +475,9 @@
 #ifdef ACPI_DEBUG_OUTPUT
 
 #define ACPI_REPORT_INFO(fp)                {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
-									   acpi_os_printf ACPI_PARAM_LIST(fp);}
+												acpi_os_printf ACPI_PARAM_LIST(fp);}
 #define ACPI_REPORT_ERROR(fp)               {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \
-											 acpi_os_printf ACPI_PARAM_LIST(fp);}
+												acpi_os_printf ACPI_PARAM_LIST(fp);}
 #define ACPI_REPORT_WARNING(fp)             {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \
 												acpi_os_printf ACPI_PARAM_LIST(fp);}
 #define ACPI_REPORT_NSERROR(s,e)            acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e);
@@ -408,21 +521,21 @@
  * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
  */
 
-#define ACPI_FUNCTION_NAME(a)           struct acpi_debug_print_info _dbg;     \
-										_dbg.component_id = _COMPONENT; \
-										_dbg.proc_name   = a;           \
-										_dbg.module_name = _THIS_MODULE;
-
-#define ACPI_FUNCTION_TRACE(a)          ACPI_FUNCTION_NAME(a)\
-											acpi_ut_trace(__LINE__,&_dbg)
-#define ACPI_FUNCTION_TRACE_PTR(a,b)    ACPI_FUNCTION_NAME(a)\
-											acpi_ut_trace_ptr(__LINE__,&_dbg,(void *)b)
-#define ACPI_FUNCTION_TRACE_U32(a,b)    ACPI_FUNCTION_NAME(a)\
-											acpi_ut_trace_u32(__LINE__,&_dbg,(u32)b)
-#define ACPI_FUNCTION_TRACE_STR(a,b)    ACPI_FUNCTION_NAME(a)\
-											acpi_ut_trace_str(__LINE__,&_dbg,(char *)b)
+#define ACPI_FUNCTION_NAME(a)               struct acpi_debug_print_info _dbg; \
+												_dbg.component_id = _COMPONENT; \
+												_dbg.proc_name   = a; \
+												_dbg.module_name = _THIS_MODULE;
+
+#define ACPI_FUNCTION_TRACE(a)              ACPI_FUNCTION_NAME(a) \
+												acpi_ut_trace(__LINE__,&_dbg)
+#define ACPI_FUNCTION_TRACE_PTR(a,b)        ACPI_FUNCTION_NAME(a) \
+												acpi_ut_trace_ptr(__LINE__,&_dbg,(void *)b)
+#define ACPI_FUNCTION_TRACE_U32(a,b)        ACPI_FUNCTION_NAME(a) \
+												acpi_ut_trace_u32(__LINE__,&_dbg,(u32)b)
+#define ACPI_FUNCTION_TRACE_STR(a,b)        ACPI_FUNCTION_NAME(a) \
+												acpi_ut_trace_str(__LINE__,&_dbg,(char *)b)
 
-#define ACPI_FUNCTION_ENTRY()           acpi_ut_track_stack_ptr()
+#define ACPI_FUNCTION_ENTRY()               acpi_ut_track_stack_ptr()
 
 /*
  * Function exit tracing.
diff -Nru a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
--- a/include/acpi/acpiosxf.h	Fri Mar 28 14:10:26 2003
+++ b/include/acpi/acpiosxf.h	Fri Apr 18 16:27:55 2003
@@ -229,13 +229,13 @@
 acpi_status
 acpi_os_read_port (
 	acpi_io_address                 address,
-	void                            *value,
+	u32                             *value,
 	u32                             width);
 
 acpi_status
 acpi_os_write_port (
 	acpi_io_address                 address,
-	acpi_integer                    value,
+	u32                             value,
 	u32                             width);
 
 
@@ -246,13 +246,13 @@
 acpi_status
 acpi_os_read_memory (
 	acpi_physical_address           address,
-	void                            *value,
+	u32                             *value,
 	u32                             width);
 
 acpi_status
 acpi_os_write_memory (
 	acpi_physical_address           address,
-	acpi_integer                    value,
+	u32                             value,
 	u32                             width);
 
 
diff -Nru a/include/acpi/actbl.h b/include/acpi/actbl.h
--- a/include/acpi/actbl.h	Tue Feb 18 15:32:35 2003
+++ b/include/acpi/actbl.h	Fri Apr 18 16:27:55 2003
@@ -181,7 +181,15 @@
 	u32                             critical_level;
 };
 
-
+struct hpet_description_table
+{
+	struct acpi_table_header        header;
+	u32                             hardware_id;
+	u32                             base_address[3];
+	u8                              hpet_number;
+	u16                             clock_tick;
+	u8                              attributes;
+};
 #pragma pack()
 
 
diff -Nru a/include/acpi/actypes.h b/include/acpi/actypes.h
--- a/include/acpi/actypes.h	Fri Mar 28 14:10:26 2003
+++ b/include/acpi/actypes.h	Fri Apr 18 16:27:55 2003
@@ -154,7 +154,7 @@
 typedef u16                                     acpi_size;
 
 #define ALIGNED_ADDRESS_BOUNDARY        0x00000002
-#define _HW_ALIGNMENT_SUPPORT
+#define ACPI_MISALIGNED_TRANSFERS
 #define ACPI_USE_NATIVE_DIVIDE                          /* No 64-bit integers, ok to use native divide */
 #define ACPI_MAX_PTR                    ACPI_UINT16_MAX
 #define ACPI_SIZE_MAX                   ACPI_UINT16_MAX
@@ -192,7 +192,7 @@
 typedef u32                                     acpi_size;
 
 #define ALIGNED_ADDRESS_BOUNDARY        0x00000004
-#define _HW_ALIGNMENT_SUPPORT
+#define ACPI_MISALIGNED_TRANSFERS
 #define ACPI_MAX_PTR                    ACPI_UINT32_MAX
 #define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
 
@@ -1194,7 +1194,7 @@
 
 #define ACPI_NEXT_RESOURCE(res)             (struct acpi_resource *)((u8 *) res + res->length)
 
-#ifdef _HW_ALIGNMENT_SUPPORT
+#ifdef ACPI_MISALIGNED_TRANSFERS
 #define ACPI_ALIGN_RESOURCE_SIZE(length)    (length)
 #else
 #define ACPI_ALIGN_RESOURCE_SIZE(length)    ACPI_ROUND_UP_TO_NATIVE_WORD(length)
diff -Nru a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
--- a/include/asm-alpha/irq.h	Tue Apr 15 10:58:12 2003
+++ b/include/asm-alpha/irq.h	Wed Apr 23 00:49:34 2003
@@ -64,7 +64,7 @@
 # define NR_IRQS	16
 #endif
 
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	/*
 	 * XXX is this true for all Alpha's?  The old serial driver
diff -Nru a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
--- a/include/asm-alpha/pgalloc.h	Mon Dec 30 07:03:59 2002
+++ b/include/asm-alpha/pgalloc.h	Sat Apr 19 23:22:43 2003
@@ -40,7 +40,7 @@
 static inline pmd_t *
 pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL);
+	pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (ret)
 		clear_page(ret);
 	return ret;
diff -Nru a/include/asm-arm/arch-adifcc/time.h b/include/asm-arm/arch-adifcc/time.h
--- a/include/asm-arm/arch-adifcc/time.h	Tue Feb  5 16:06:21 2002
+++ b/include/asm-arm/arch-adifcc/time.h	Mon Apr 21 15:43:41 2003
@@ -4,6 +4,6 @@
  */
 
 /*
- * No on board timer, implemenation @ arch/arm/kernel/xscale-time.c
+ * No on board timer, implementation @ arch/arm/kernel/xscale-time.c
  */
 
diff -Nru a/include/asm-arm/arch-arc/irqs.h b/include/asm-arm/arch-arc/irqs.h
--- a/include/asm-arm/arch-arc/irqs.h	Mon Feb  4 23:37:24 2002
+++ b/include/asm-arm/arch-arc/irqs.h	Wed Apr 23 00:49:34 2003
@@ -57,4 +57,4 @@
  */
 #define FIQ_START		64
 
-#define irq_cannonicalize(i)	(i)
+#define irq_canonicalize(i)	(i)
diff -Nru a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h
--- a/include/asm-arm/arch-clps711x/memory.h	Wed Nov 20 16:04:02 2002
+++ b/include/asm-arm/arch-clps711x/memory.h	Mon Apr 21 15:43:41 2003
@@ -95,7 +95,7 @@
  * Because of the wide memory address space between physical RAM banks on the 
  * SA1100, it's much more convenient to use Linux's NUMA support to implement
  * our memory map representation.  Assuming all memory nodes have equal access 
- * characteristics, we then have generic discontigous memory support.
+ * characteristics, we then have generic discontiguous memory support.
  *
  * Of course, all this isn't mandatory for SA1100 implementations with only
  * one used memory bank.  For those, simply undefine CONFIG_DISCONTIGMEM.
diff -Nru a/include/asm-arm/arch-ebsa285/irqs.h b/include/asm-arm/arch-ebsa285/irqs.h
--- a/include/asm-arm/arch-ebsa285/irqs.h	Tue Feb  5 09:39:51 2002
+++ b/include/asm-arm/arch-ebsa285/irqs.h	Wed Apr 23 00:49:34 2003
@@ -95,4 +95,4 @@
 #define AUX_IRQ		(machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
 #define IRQ_FLOPPYDISK	IRQ_ISA_FLOPPY
 
-#define irq_cannonicalize(_i)	(((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
+#define irq_canonicalize(_i)	(((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
diff -Nru a/include/asm-arm/arch-epxa10db/ether00.h b/include/asm-arm/arch-epxa10db/ether00.h
--- a/include/asm-arm/arch-epxa10db/ether00.h	Tue Feb  5 16:06:21 2002
+++ b/include/asm-arm/arch-epxa10db/ether00.h	Mon Apr 21 15:43:41 2003
@@ -55,7 +55,7 @@
 #define ETHER_ARC_SIZE         (21)
 
 /*
-*	Regsiter definitions and masks
+*	Register definitions and masks
 */
 #define ETHER_DMA_CTL(base)							(ETHER00_TYPE (base + 0x100))
 #define ETHER_DMA_CTL_DMBURST_OFST				(2)
diff -Nru a/include/asm-arm/arch-epxa10db/pld_conf00.h b/include/asm-arm/arch-epxa10db/pld_conf00.h
--- a/include/asm-arm/arch-epxa10db/pld_conf00.h	Tue Feb  5 12:29:49 2002
+++ b/include/asm-arm/arch-epxa10db/pld_conf00.h	Mon Apr 21 15:43:41 2003
@@ -8,7 +8,7 @@
 /*
  *  
  *  This file contains the register definitions for the Excalibur
- *  Interrupnt controller INT_CTRL00.
+ *  Interrupt controller INT_CTRL00.
  *
  *  Copyright (C) 2001 Altera Corporation
  *
diff -Nru a/include/asm-arm/arch-integrator/bits.h b/include/asm-arm/arch-integrator/bits.h
--- a/include/asm-arm/arch-integrator/bits.h	Tue Feb  5 10:02:16 2002
+++ b/include/asm-arm/arch-integrator/bits.h	Mon Apr 21 15:43:41 2003
@@ -16,7 +16,7 @@
 /* DO NOT EDIT!! - this file automatically generated
  *                 from .s file by awk -f s2h.awk
  */
-/*  Bit field defintions
+/*  Bit field definitions
  *  Copyright (C) ARM Limited 1998. All rights reserved.
  */
 
diff -Nru a/include/asm-arm/arch-iop3xx/iop310.h b/include/asm-arm/arch-iop3xx/iop310.h
--- a/include/asm-arm/arch-iop3xx/iop310.h	Tue Apr  1 03:15:31 2003
+++ b/include/asm-arm/arch-iop3xx/iop310.h	Mon Apr 21 15:43:42 2003
@@ -1,7 +1,7 @@
 /*
  * linux/include/asm/arch-iop3xx/iop310.h
  *
- * Intel IOP310 Compainion Chip definitions
+ * Intel IOP310 Companion Chip definitions
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff -Nru a/include/asm-arm/arch-iop3xx/iop321.h b/include/asm-arm/arch-iop3xx/iop321.h
--- a/include/asm-arm/arch-iop3xx/iop321.h	Tue Apr 15 08:12:47 2003
+++ b/include/asm-arm/arch-iop3xx/iop321.h	Mon Apr 21 04:16:16 2003
@@ -17,12 +17,10 @@
 /*
  * IOP321 I/O and Mem space regions for PCI autoconfiguration
  */
-#define	IOP321_PCI_LOWER_IO		0x90000000
-#define	IOP321_PCI_UPPER_IO		0x9000ffff
-#define IOP321_PCI_LOWER_MEM		0x80000000
-#define IOP321_PCI_UPPER_MEM		0x83ffffff
-
-#define IOP321_PCI_WINDOW_SIZE		64 * 0x100000
+#define	IOP321_PCI_IO_BASE		0x90000000
+#define	IOP321_PCI_IO_SIZE		0x00010000
+#define IOP321_PCI_MEM_BASE		0x40000000
+#define IOP321_PCI_MEM_SIZE		0x40000000
 
 /*
  * IOP321 chipset registers
diff -Nru a/include/asm-arm/arch-nexuspci/irqs.h b/include/asm-arm/arch-nexuspci/irqs.h
--- a/include/asm-arm/arch-nexuspci/irqs.h	Tue Feb  5 09:39:51 2002
+++ b/include/asm-arm/arch-nexuspci/irqs.h	Wed Apr 23 00:49:34 2003
@@ -31,4 +31,4 @@
 /* timer is part of the DUART */
 #define IRQ_TIMER		IRQ_DUART
 
-#define irq_cannonicalize(i)	(i)
+#define irq_canonicalize(i)	(i)
diff -Nru a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
--- a/include/asm-arm/arch-pxa/pxa-regs.h	Mon Feb 17 07:29:52 2003
+++ b/include/asm-arm/arch-pxa/pxa-regs.h	Mon Apr 21 15:43:42 2003
@@ -690,9 +690,9 @@
 #define ICSR0		__REG(0x40800014)  /* ICP Status Register 0 */
 #define ICSR1		__REG(0x40800018)  /* ICP Status Register 1 */
 
-#define ICCR0_AME       (1 << 7)           /* Adress match enable */
+#define ICCR0_AME       (1 << 7)           /* Address match enable */
 #define ICCR0_TIE       (1 << 6)           /* Transmit FIFO interrupt enable */
-#define ICCR0_RIE       (1 << 5)           /* Recieve FIFO interrupt enable */
+#define ICCR0_RIE       (1 << 5)           /* Receive FIFO interrupt enable */
 #define ICCR0_RXE       (1 << 4)           /* Receive enable */
 #define ICCR0_TXE       (1 << 3)           /* Transmit enable */
 #define ICCR0_TUS       (1 << 2)           /* Transmit FIFO underrun select */
diff -Nru a/include/asm-arm/arch-sa1100/graphicsclient.h b/include/asm-arm/arch-sa1100/graphicsclient.h
--- a/include/asm-arm/arch-sa1100/graphicsclient.h	Tue Feb 19 15:02:20 2002
+++ b/include/asm-arm/arch-sa1100/graphicsclient.h	Mon Apr 21 15:43:42 2003
@@ -63,7 +63,7 @@
 #define _ADS_UARTC		0x10140000	/* UART C */
 #define _ADS_UARTD		0x10160000	/* UART D */
 
-/* UART controll lines GPIOs */
+/* UART control lines GPIOs */
 #define GPIO_GC_UART0_RTS       GPIO_GPIO15
 #define GPIO_GC_UART1_RTS	    GPIO_GPIO17
 #define GPIO_GC_UART2_RTS	    GPIO_GPIO19
@@ -71,7 +71,7 @@
 #define GPIO_GC_UART1_CTS       GPIO_GPIO16
 #define GPIO_GC_UART2_CTS       GPIO_GPIO17
 
-/* UART controll lines IRQs */
+/* UART control lines IRQs */
 #define IRQ_GC_UART0_CTS       IRQ_GPIO14
 #define IRQ_GC_UART1_CTS       IRQ_GPIO16
 #define IRQ_GC_UART2_CTS       IRQ_GPIO17
diff -Nru a/include/asm-arm/arch-sa1100/h3600_gpio.h b/include/asm-arm/arch-sa1100/h3600_gpio.h
--- a/include/asm-arm/arch-sa1100/h3600_gpio.h	Tue Feb  5 16:06:21 2002
+++ b/include/asm-arm/arch-sa1100/h3600_gpio.h	Mon Apr 21 15:43:42 2003
@@ -480,7 +480,7 @@
 #define _H3800_ASIC1_GPIO_State         0x40    /* R   See masks below  (default 0)         */
 #define _H3800_ASIC1_GPIO_Reset         0x42    /* R/W See masks below  (default 0x04)      */
 #define _H3800_ASIC1_GPIO_SleepMask     0x44    /* R/W 0:don't mask, 1:mask trigger in sleep mode  */
-#define _H3800_ASIC1_GPIO_SleepDir      0x46    /* R/W direction 0:input, 1:ouput in sleep mode    */
+#define _H3800_ASIC1_GPIO_SleepDir      0x46    /* R/W direction 0:input, 1:output in sleep mode    */
 #define _H3800_ASIC1_GPIO_SleepOut      0x48    /* R/W level 0:low, 1:high in sleep mode           */
 #define _H3800_ASIC1_GPIO_Status        0x4A    /* R   Pin status                                  */
 #define _H3800_ASIC1_GPIO_BattFaultDir  0x4C    /* R/W direction 0:input, 1:output in batt_fault   */
diff -Nru a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
--- a/include/asm-arm/arch-sa1100/memory.h	Wed Nov 20 16:04:05 2002
+++ b/include/asm-arm/arch-sa1100/memory.h	Mon Apr 21 15:43:42 2003
@@ -60,7 +60,7 @@
  * Because of the wide memory address space between physical RAM banks on the 
  * SA1100, it's much convenient to use Linux's NUMA support to implement our 
  * memory map representation.  Assuming all memory nodes have equal access 
- * characteristics, we then have generic discontigous memory support.
+ * characteristics, we then have generic discontiguous memory support.
  *
  * Of course, all this isn't mandatory for SA1100 implementations with only
  * one used memory bank.  For those, simply undefine CONFIG_DISCONTIGMEM.
diff -Nru a/include/asm-arm/arch-sa1100/uncompress.h b/include/asm-arm/arch-sa1100/uncompress.h
--- a/include/asm-arm/arch-sa1100/uncompress.h	Mon Feb  4 23:52:37 2002
+++ b/include/asm-arm/arch-sa1100/uncompress.h	Mon Apr 21 15:43:43 2003
@@ -32,7 +32,7 @@
 	} while (0);
 
 	for (; *s; s++) {
-		/* wait for space in the UART's transmiter */
+		/* wait for space in the UART's transmitter */
 		while (!(UART(UTSR1) & UTSR1_TNF));
 
 		/* send the character out. */
diff -Nru a/include/asm-arm/arch-tbox/irqs.h b/include/asm-arm/arch-tbox/irqs.h
--- a/include/asm-arm/arch-tbox/irqs.h	Tue Feb  5 09:39:53 2002
+++ b/include/asm-arm/arch-tbox/irqs.h	Wed Apr 23 00:49:34 2003
@@ -26,4 +26,4 @@
 #define IRQ_EXPMODCS0		12
 #define IRQ_EXPMODCS1		13
 
-#define irq_cannonicalize(i)	(i)
+#define irq_canonicalize(i)	(i)
diff -Nru a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
--- a/include/asm-arm/dma-mapping.h	Mon Jan 13 08:30:03 2003
+++ b/include/asm-arm/dma-mapping.h	Mon Apr 21 15:43:43 2003
@@ -182,7 +182,7 @@
  * @dir: DMA transfer direction
  *
  * Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
+ * mode for DMA.  This is the scatter-gather version of the
  * above pci_map_single interface.  Here the scatter gather list
  * elements are each tagged with the appropriate dma address
  * and length.  They are obtained via sg_dma_{address,length}(SG).
diff -Nru a/include/asm-arm/irq.h b/include/asm-arm/irq.h
--- a/include/asm-arm/irq.h	Wed Jan  1 06:34:05 2003
+++ b/include/asm-arm/irq.h	Wed Apr 23 00:49:34 2003
@@ -3,8 +3,8 @@
 
 #include <asm/arch/irqs.h>
 
-#ifndef irq_cannonicalize
-#define irq_cannonicalize(i)	(i)
+#ifndef irq_canonicalize
+#define irq_canonicalize(i)	(i)
 #endif
 
 #ifndef NR_IRQS
diff -Nru a/include/asm-arm/proc-armo/pgalloc.h b/include/asm-arm/proc-armo/pgalloc.h
--- a/include/asm-arm/proc-armo/pgalloc.h	Sun Mar 10 04:04:31 2002
+++ b/include/asm-arm/proc-armo/pgalloc.h	Mon Apr 21 15:43:43 2003
@@ -37,7 +37,7 @@
 
 /*
  * We use the old 2.5.5-rmk1 hack for this.
- * This is not truely correct, but should be functional.
+ * This is not truly correct, but should be functional.
  */
 #define pte_alloc_one(mm,addr)	((struct page *)pte_alloc_one_kernel(mm,addr))
 #define pte_free(pte)		pte_free_kernel((pte_t *)pte)
diff -Nru a/include/asm-arm/proc-armv/pgalloc.h b/include/asm-arm/proc-armv/pgalloc.h
--- a/include/asm-arm/proc-armv/pgalloc.h	Sun Nov 17 11:16:37 2002
+++ b/include/asm-arm/proc-armv/pgalloc.h	Sat Apr 19 23:22:41 2003
@@ -27,17 +27,9 @@
 static inline pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
 {
-	int count = 0;
 	pte_t *pte;
 
-	do {
-		pte = (pte_t *)__get_free_page(GFP_KERNEL);
-		if (!pte) {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
-
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte) {
 		clear_page(pte);
 		clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE);
@@ -51,16 +43,8 @@
 pte_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
 	struct page *pte;
-	int count = 0;
-
-	do {
-		pte = alloc_pages(GFP_KERNEL, 0);
-		if (!pte) {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
 
+	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
 	if (pte) {
 		void *page = page_address(pte);
 		clear_page(page);
diff -Nru a/include/asm-arm/sizes.h b/include/asm-arm/sizes.h
--- a/include/asm-arm/sizes.h	Mon Feb  4 23:55:11 2002
+++ b/include/asm-arm/sizes.h	Mon Apr 21 15:43:43 2003
@@ -16,7 +16,7 @@
 /* DO NOT EDIT!! - this file automatically generated
  *                 from .s file by awk -f s2h.awk
  */
-/*  Size defintions
+/*  Size definitions
  *  Copyright (C) ARM Limited 1998. All rights reserved.
  */
 
diff -Nru a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h
--- a/include/asm-cris/pgalloc.h	Tue Feb  5 07:24:38 2002
+++ b/include/asm-cris/pgalloc.h	Sat Apr 19 23:22:41 2003
@@ -62,7 +62,7 @@
 {
         pte_t *pte;
 
-        pte = (pte_t *) __get_free_page(GFP_KERNEL);
+        pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
         if (pte)
                 clear_page(pte);
         return pte;
diff -Nru a/include/asm-h8300/irq.h b/include/asm-h8300/irq.h
--- a/include/asm-h8300/irq.h	Thu Apr 17 12:31:21 2003
+++ b/include/asm-h8300/irq.h	Wed Apr 23 00:49:34 2003
@@ -13,7 +13,7 @@
 
 #define IRQ_SCHED_TIMER	(40)    /* interrupt source for scheduling timer */
 
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	return irq;
 }
diff -Nru a/include/asm-i386/arch_hooks.h b/include/asm-i386/arch_hooks.h
--- a/include/asm-i386/arch_hooks.h	Sun Mar 10 19:00:12 2002
+++ b/include/asm-i386/arch_hooks.h	Sun Apr 20 14:14:29 2003
@@ -1,6 +1,8 @@
 #ifndef _ASM_ARCH_HOOKS_H
 #define _ASM_ARCH_HOOKS_H
 
+#include <linux/interrupt.h>
+
 /*
  *	linux/include/asm/arch_hooks.h
  *
@@ -12,7 +14,7 @@
 extern void init_ISA_irqs(void);
 extern void apic_intr_init(void);
 extern void smp_intr_init(void);
-extern void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /* these are the defined hooks */
 extern void intr_init_hook(void);
diff -Nru a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
--- a/include/asm-i386/bugs.h	Sun Dec 22 04:16:24 2002
+++ b/include/asm-i386/bugs.h	Sun Apr 20 12:24:22 2003
@@ -200,6 +200,8 @@
 #endif
 }
 
+extern void alternative_instructions(void);
+
 static void __init check_bugs(void)
 {
 	identify_cpu(&boot_cpu_data);
@@ -212,4 +214,5 @@
 	check_hlt();
 	check_popad();
 	system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
+	alternative_instructions(); 
 }
diff -Nru a/include/asm-i386/div64.h b/include/asm-i386/div64.h
--- a/include/asm-i386/div64.h	Tue Feb  5 09:39:44 2002
+++ b/include/asm-i386/div64.h	Sat Apr 19 23:22:26 2003
@@ -14,4 +14,22 @@
 	__mod; \
 })
 
+/*
+ * (long)X = ((long long)divs) / (long)div
+ * (long)rem = ((long long)divs) % (long)div
+ *
+ * Warning, this will do an exception if X overflows.
+ */
+#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c)
+
+extern inline long
+div_ll_X_l_rem(long long divs, long div, long *rem)
+{
+	long dum2;
+      __asm__("divl %2":"=a"(dum2), "=d"(*rem)
+      :	"rm"(div), "A"(divs));
+
+	return dum2;
+
+}
 #endif
diff -Nru a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
--- a/include/asm-i386/floppy.h	Mon Mar 31 15:55:40 2003
+++ b/include/asm-i386/floppy.h	Sun Apr 20 14:14:29 2003
@@ -51,7 +51,7 @@
 static int virtual_dma_mode;
 static int doing_pdma;
 
-static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
 {
 	register unsigned char st;
 
@@ -63,10 +63,8 @@
 	static int bytes=0;
 	static int dma_wait=0;
 #endif
-	if(!doing_pdma) {
-		floppy_interrupt(irq, dev_id, regs);
-		return;
-	}
+	if (!doing_pdma)
+		return floppy_interrupt(irq, dev_id, regs);
 
 #ifdef TRACE_FLPY_INT
 	if(!calls)
@@ -130,7 +128,7 @@
 	calls++;
 #endif
 	if(st == 0x20)
-		return;
+		return IRQ_HANDLED;
 	if(!(st & 0x20)) {
 		virtual_dma_residue += virtual_dma_count;
 		virtual_dma_count=0;
@@ -143,12 +141,13 @@
 #endif
 		doing_pdma = 0;
 		floppy_interrupt(irq, dev_id, regs);
-		return;
+		return IRQ_HANDLED;
 	}
 #ifdef TRACE_FLPY_INT
 	if(!virtual_dma_count)
 		dma_wait++;
 #endif
+	return IRQ_HANDLED;
 }
 
 static void fd_disable_dma(void)
diff -Nru a/include/asm-i386/irq.h b/include/asm-i386/irq.h
--- a/include/asm-i386/irq.h	Wed Dec 11 18:33:21 2002
+++ b/include/asm-i386/irq.h	Wed Apr 23 00:49:34 2003
@@ -15,7 +15,7 @@
 /* include comes from machine specific directory */
 #include "irq_vectors.h"
 
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	return ((irq == 2) ? 9 : irq);
 }
diff -Nru a/include/asm-i386/system.h b/include/asm-i386/system.h
--- a/include/asm-i386/system.h	Mon Apr 14 16:07:57 2003
+++ b/include/asm-i386/system.h	Sun Apr 20 12:24:22 2003
@@ -4,6 +4,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <asm/segment.h>
+#include <asm/cpufeature.h>
 #include <linux/bitops.h> /* for LOCK_PREFIX */
 
 #ifdef __KERNEL__
@@ -276,6 +277,37 @@
 /* Compiling for a 386 proper.	Is it worth implementing via cli/sti?  */
 #endif
 
+struct alt_instr { 
+	u8 *instr; 		/* original instruction */
+	u8  cpuid;		/* cpuid bit set for replacement */
+	u8  instrlen;		/* length of original instruction */
+	u8  replacementlen; 	/* length of new instruction, <= instrlen */ 
+	u8  replacement[0];   	/* new instruction */
+}; 
+
+/* 
+ * Alternative instructions for different CPU types or capabilities.
+ * 
+ * This allows to use optimized instructions even on generic binary
+ * kernels.
+ * 
+ * length of oldinstr must be longer or equal the length of newinstr
+ * It can be padded with nops as needed.
+ * 
+ * For non barrier like inlines please define new variants
+ * without volatile and memory clobber.
+ */
+#define alternative(oldinstr, newinstr, feature) 	\
+	asm volatile ("661:\n\t" oldinstr "\n662:\n" 		     \
+		      ".section .altinstructions,\"a\"\n"     	     \
+		      "  .align 4\n"				       \
+		      "  .long 661b\n"            /* label */          \
+		      "  .byte %c0\n"             /* feature bit */    \
+		      "  .byte 662b-661b\n"       /* sourcelen */      \
+		      "  .byte 664f-663f\n"       /* replacementlen */ \
+		      "663:\n\t" newinstr "\n664:\n"   /* replacement */    \
+		      ".previous" :: "i" (feature) : "memory")  
+
 /*
  * Force strict CPU ordering.
  * And yes, this is required on UP too when we're talking
@@ -294,13 +326,15 @@
  * nop for these.
  */
  
-#ifdef CONFIG_X86_SSE2
-#define mb()	asm volatile("mfence" ::: "memory")
-#define rmb()	asm volatile("lfence" ::: "memory")
-#else
-#define mb() 	__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
-#define rmb()	mb()
-#endif
+
+/* 
+ * Actually only lfence would be needed for mb() because all stores done 
+ * by the kernel should be already ordered. But keep a full barrier for now. 
+ */
+
+#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
+#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
+
 /**
  * read_barrier_depends - Flush all pending reads that subsequents reads
  * depend on.
@@ -356,7 +390,9 @@
 #define read_barrier_depends()	do { } while(0)
 
 #ifdef CONFIG_X86_OOSTORE
-#define wmb() 	__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
+/* Actually there are no OOO store capable CPUs for now that do SSE, 
+   but make it already an possibility. */
+#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
 #else
 #define wmb()	__asm__ __volatile__ ("": : :"memory")
 #endif
diff -Nru a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
--- a/include/asm-ia64/irq.h	Tue Aug 13 13:30:15 2002
+++ b/include/asm-ia64/irq.h	Wed Apr 23 00:49:34 2003
@@ -6,7 +6,7 @@
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  *	Stephane Eranian <eranian@hpl.hp.com>
  *
- * 11/24/98	S.Eranian 	updated TIMER_IRQ and irq_cannonicalize
+ * 11/24/98	S.Eranian 	updated TIMER_IRQ and irq_canonicalize
  * 01/20/99	S.Eranian	added keyboard interrupt
  * 02/29/00     D.Mosberger	moved most things into hw_irq.h
  */
@@ -14,7 +14,7 @@
 #define NR_IRQS		256
 
 static __inline__ int
-irq_cannonicalize (int irq)
+irq_canonicalize (int irq)
 {
 	/*
 	 * We do the legacy thing here of pretending that irqs < 16
diff -Nru a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
--- a/include/asm-ia64/pgalloc.h	Tue Aug 27 13:04:10 2002
+++ b/include/asm-ia64/pgalloc.h	Sat Apr 19 23:22:43 2003
@@ -93,7 +93,7 @@
 static inline pmd_t*
 pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
-	pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
+	pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 
 	if (likely(pmd != NULL))
 		clear_page(pmd);
@@ -125,7 +125,7 @@
 static inline struct page *
 pte_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
-	struct page *pte = alloc_pages(GFP_KERNEL, 0);
+	struct page *pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
 
 	if (likely(pte != NULL))
 		clear_page(page_address(pte));
@@ -135,7 +135,7 @@
 static inline pte_t *
 pte_alloc_one_kernel (struct mm_struct *mm, unsigned long addr)
 {
-	pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 
 	if (likely(pte != NULL))
 		clear_page(pte);
diff -Nru a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
--- a/include/asm-m68k/irq.h	Fri Jun  7 04:06:42 2002
+++ b/include/asm-m68k/irq.h	Wed Apr 23 00:49:34 2003
@@ -45,7 +45,7 @@
 
 #define IRQ_SCHED_TIMER	(8)    /* interrupt source for scheduling timer */
 
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	return irq;
 }
diff -Nru a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h
--- a/include/asm-m68k/motorola_pgalloc.h	Wed Jan  8 12:37:27 2003
+++ b/include/asm-m68k/motorola_pgalloc.h	Sat Apr 19 23:22:41 2003
@@ -11,7 +11,7 @@
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte) {
 		clear_page(pte);
 		__flush_page_to_ram(pte);
@@ -30,7 +30,7 @@
 
 static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	struct page *page = alloc_pages(GFP_KERNEL, 0);
+	struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
 	pte_t *pte;
 
 	if(!page)
diff -Nru a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h
--- a/include/asm-m68k/sun3_pgalloc.h	Wed Jan  8 12:37:27 2003
+++ b/include/asm-m68k/sun3_pgalloc.h	Tue Apr 22 02:52:03 2003
@@ -39,7 +39,7 @@
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 
 					  unsigned long address)
 {
-	unsigned long page = __get_free_page(GFP_KERNEL);
+	unsigned long page = __get_free_page(GFP_KERNEL|__GFP_REPEAT);
 
 	if (!page)
 		return NULL;
@@ -51,7 +51,7 @@
 static inline struct page *pte_alloc_one(struct mm_struct *mm, 
 					 unsigned long address)
 {
-        struct page *page = alloc_pages(GFP_KERNEL, 0);
+        struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
 
 	if (page == NULL)
 		return NULL;
diff -Nru a/include/asm-mips/irq.h b/include/asm-mips/irq.h
--- a/include/asm-mips/irq.h	Mon Feb  4 23:45:05 2002
+++ b/include/asm-mips/irq.h	Wed Apr 23 00:49:34 2003
@@ -16,12 +16,12 @@
 #define TIMER_IRQ 0
 
 #ifdef CONFIG_I8259
-static inline int irq_cannonicalize(int irq)
+static inline int irq_canonicalize(int irq)
 {
 	return ((irq == 2) ? 9 : irq);
 }
 #else
-#define irq_cannonicalize(irq) (irq)	/* Sane hardware, sane code ... */
+#define irq_canonicalize(irq) (irq)	/* Sane hardware, sane code ... */
 #endif
 
 struct irqaction;
diff -Nru a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
--- a/include/asm-mips/pgalloc.h	Tue Feb  5 07:24:35 2002
+++ b/include/asm-mips/pgalloc.h	Sat Apr 19 23:22:41 2003
@@ -132,7 +132,7 @@
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte = (pte_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte)
 		clear_page(pte);
 	return pte;
diff -Nru a/include/asm-mips64/irq.h b/include/asm-mips64/irq.h
--- a/include/asm-mips64/irq.h	Mon Feb  4 23:42:03 2002
+++ b/include/asm-mips64/irq.h	Wed Apr 23 00:49:34 2003
@@ -34,12 +34,12 @@
 			(node_level_to_irq[CPUID_TO_COMPACT_NODEID(c)][(l)])
 
 #ifdef CONFIG_I8259
-static inline int irq_cannonicalize(int irq)
+static inline int irq_canonicalize(int irq)
 {
 	return ((irq == 2) ? 9 : irq);
 }
 #else
-#define irq_cannonicalize(irq) (irq)	/* Sane hardware, sane code ... */
+#define irq_canonicalize(irq) (irq)	/* Sane hardware, sane code ... */
 #endif
 
 
diff -Nru a/include/asm-mips64/pgalloc.h b/include/asm-mips64/pgalloc.h
--- a/include/asm-mips64/pgalloc.h	Tue Feb  5 07:24:35 2002
+++ b/include/asm-mips64/pgalloc.h	Sat Apr 19 23:22:43 2003
@@ -93,7 +93,7 @@
 {
 	pte_t *pte;
 
-	pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte)
 		clear_page(pte);
 	return pte;
@@ -141,7 +141,7 @@
 {
 	pmd_t *pmd;
 
-	pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, 1);
+	pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT, 1);
 	if (pmd)
 		pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table);
 	return pmd;
diff -Nru a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h
--- a/include/asm-parisc/irq.h	Tue Feb 18 18:59:01 2003
+++ b/include/asm-parisc/irq.h	Wed Apr 23 00:49:34 2003
@@ -66,7 +66,7 @@
 
 extern struct irq_region *irq_region[NR_IRQ_REGS];
 
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 #ifdef CONFIG_EISA
 	return (irq == (IRQ_FROM_REGION(EISA_IRQ_REGION)+2) 
diff -Nru a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
--- a/include/asm-parisc/pgalloc.h	Mon Jul 22 02:42:24 2002
+++ b/include/asm-parisc/pgalloc.h	Sat Apr 19 23:22:43 2003
@@ -35,7 +35,7 @@
 
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
+	pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pmd)
 		clear_page(pmd);
 	return pmd;
@@ -73,7 +73,7 @@
 static inline struct page *
 pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	struct page *page = alloc_page(GFP_KERNEL);
+	struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
 	if (likely(page != NULL))
 		clear_page(page_address(page));
 	return page;
@@ -82,7 +82,7 @@
 static inline pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
 {
-	pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (likely(pte != NULL))
 		clear_page(pte);
 	return pte;
diff -Nru a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
--- a/include/asm-ppc/irq.h	Sat Jan  4 03:32:49 2003
+++ b/include/asm-ppc/irq.h	Wed Apr 23 00:49:34 2003
@@ -66,7 +66,7 @@
 #define NR_IRQS		((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS)
 #endif
 static __inline__ int
-irq_cannonicalize(int irq)
+irq_canonicalize(int irq)
 {
 	return (irq);
 }
@@ -78,7 +78,7 @@
 #define	NR_IRQS		(NR_UIC_IRQS + NR_BOARD_IRQS)
 
 static __inline__ int
-irq_cannonicalize(int irq)
+irq_canonicalize(int irq)
 {
 	return (irq);
 }
@@ -148,7 +148,7 @@
 #define	mk_int_int_mask(IL) (1 << (7 - (IL/2)))
 
 /* always the same on 8xx -- Cort */
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	return irq;
 }
@@ -196,10 +196,10 @@
  * powermacs as well as prep/chrp boxes.
  * Prep and chrp both have cascaded 8259 PICs.
  */
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
-	if (ppc_md.irq_cannonicalize)
-		return ppc_md.irq_cannonicalize(irq);
+	if (ppc_md.irq_canonicalize)
+		return ppc_md.irq_canonicalize(irq);
 	return irq;
 }
 
diff -Nru a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
--- a/include/asm-ppc/machdep.h	Thu Nov  7 01:21:10 2002
+++ b/include/asm-ppc/machdep.h	Wed Apr 23 00:49:34 2003
@@ -25,7 +25,7 @@
 	int		(*show_cpuinfo)(struct seq_file *m);
 	int		(*show_percpuinfo)(struct seq_file *m, int i);
 	/* Optional, may be NULL. */
-	unsigned int	(*irq_cannonicalize)(unsigned int irq);
+	unsigned int	(*irq_canonicalize)(unsigned int irq);
 	void		(*init_IRQ)(void);
 	int		(*get_irq)(struct pt_regs *);
 	
diff -Nru a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
--- a/include/asm-ppc/ocp.h	Tue Jan  7 21:52:02 2003
+++ b/include/asm-ppc/ocp.h	Sun Apr 20 16:21:18 2003
@@ -36,7 +36,6 @@
 #include <linux/list.h>
 #include <linux/config.h>
 #include <linux/device.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <asm/ocp_ids.h>
 #include <asm/mmu.h>		/* For phys_addr_t */
diff -Nru a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h
--- a/include/asm-ppc64/irq.h	Tue Sep 17 16:32:53 2002
+++ b/include/asm-ppc64/irq.h	Wed Apr 23 00:49:34 2003
@@ -46,7 +46,7 @@
  * powermacs as well as prep/chrp boxes.
  * Prep and chrp both have cascaded 8259 PICs.
  */
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	return irq;
 }
diff -Nru a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h
--- a/include/asm-ppc64/pgalloc.h	Fri Sep 13 03:36:28 2002
+++ b/include/asm-ppc64/pgalloc.h	Sat Apr 19 23:22:43 2003
@@ -31,19 +31,11 @@
 static inline pmd_t *
 pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
-	int count = 0;
 	pmd_t *pmd;
 
-	do {
-		pmd = (pmd_t *)__get_free_page(GFP_KERNEL);
-		if (pmd)
-			clear_page(pmd);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pmd && (count++ < 10));
-
+	pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	if (pmd)
+		clear_page(pmd);
 	return pmd;
 }
 
@@ -62,19 +54,11 @@
 static inline pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
 {
-	int count = 0;
 	pte_t *pte;
 
-	do {
-		pte = (pte_t *)__get_free_page(GFP_KERNEL);
-		if (pte)
-			clear_page(pte);
-		else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
-
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	if (pte)
+		clear_page(pte);
 	return pte;
 }
 
diff -Nru a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
--- a/include/asm-s390/pgalloc.h	Mon Apr 14 12:11:58 2003
+++ b/include/asm-s390/pgalloc.h	Sat Apr 19 23:22:41 2003
@@ -120,20 +120,13 @@
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long vmaddr)
 {
 	pte_t *pte;
-	int count;
         int i;
 
-	count = 0;
-	do {
-		pte = (pte_t *) __get_free_page(GFP_KERNEL);
-		if (pte != NULL) {
-			for (i=0; i < PTRS_PER_PTE; i++)
-				pte_clear(pte+i);
-		} else {
-			current->state = TASK_UNINTERRUPTIBLE;
-			schedule_timeout(HZ);
-		}
-	} while (!pte && (count++ < 10));
+	pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	if (pte != NULL) {
+		for (i=0; i < PTRS_PER_PTE; i++)
+			pte_clear(pte+i);
+	}
 	return pte;
 }
 
diff -Nru a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h
--- a/include/asm-sh/pgalloc.h	Fri May  3 04:27:09 2002
+++ b/include/asm-sh/pgalloc.h	Sat Apr 19 23:22:41 2003
@@ -35,7 +35,7 @@
 
 static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pte_t *pte = (pte_t *) __get_free_page(GFP_KERNEL);
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (pte)
 		clear_page(pte);
 	return pte;
diff -Nru a/include/asm-sh/serial-bigsur.h b/include/asm-sh/serial-bigsur.h
--- a/include/asm-sh/serial-bigsur.h	Tue Feb  5 10:48:20 2002
+++ b/include/asm-sh/serial-bigsur.h	Wed Apr 23 00:49:34 2003
@@ -25,6 +25,6 @@
 #define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
 
 /* XXX: This should be moved ino irq.h */
-#define irq_cannonicalize(x) (x)
+#define irq_canonicalize(x) (x)
 
 #endif /* _ASM_SERIAL_BIGSUR_H */
diff -Nru a/include/asm-sh/serial-ec3104.h b/include/asm-sh/serial-ec3104.h
--- a/include/asm-sh/serial-ec3104.h	Tue Feb  5 10:11:34 2002
+++ b/include/asm-sh/serial-ec3104.h	Wed Apr 23 00:49:34 2003
@@ -21,4 +21,4 @@
 #define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
 
 /* XXX: This should be moved ino irq.h */
-#define irq_cannonicalize(x) (x)
+#define irq_canonicalize(x) (x)
diff -Nru a/include/asm-sh/serial.h b/include/asm-sh/serial.h
--- a/include/asm-sh/serial.h	Mon Feb  4 23:41:12 2002
+++ b/include/asm-sh/serial.h	Wed Apr 23 00:49:34 2003
@@ -49,7 +49,7 @@
 #define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
 
 /* XXX: This should be moved ino irq.h */
-#define irq_cannonicalize(x) (x)
+#define irq_canonicalize(x) (x)
 
 #endif
 #endif /* _ASM_SERIAL_H */
diff -Nru a/include/asm-sparc/auxio.h b/include/asm-sparc/auxio.h
--- a/include/asm-sparc/auxio.h	Tue Feb  5 09:39:47 2002
+++ b/include/asm-sparc/auxio.h	Tue Apr 22 22:43:02 2003
@@ -9,8 +9,6 @@
 #include <asm/system.h>
 #include <asm/vaddrs.h>
 
-extern unsigned char *auxio_register;
-
 /* This register is an unsigned char in IO space.  It does two things.
  * First, it is used to control the front panel LED light on machines
  * that have it (good for testing entry points to trap handlers and irq's)
@@ -31,41 +29,52 @@
 #define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
 #define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
 
-#define AUXREG   ((volatile unsigned char *)(auxio_register))
+#ifndef __ASSEMBLY__
+
+/* 
+ * NOTE: these routines are implementation dependent-- 
+ * understand the hardware you are querying! 
+ */
+extern void set_auxio(unsigned char bits_on, unsigned char bits_off);
+extern unsigned char get_auxio(void); /* .../asm-sparc/floppy.h */
 
-/* These are available on sun4c */
-#define TURN_ON_LED   if (AUXREG) *AUXREG = (*AUXREG | AUXIO_ORMEIN | AUXIO_LED)
-#define TURN_OFF_LED  if (AUXREG) *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_LED))
-#define FLIP_LED      if (AUXREG) *AUXREG = ((*AUXREG | AUXIO_ORMEIN) ^ AUXIO_LED)
-#define FLPY_MOTORON  if (AUXREG) *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_DSEL)
-#define FLPY_MOTOROFF if (AUXREG) *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_DSEL))
-#define FLPY_TCNTON   if (AUXREG) *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_TCNT)
-#define FLPY_TCNTOFF  if (AUXREG) *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_TCNT))
+/*
+ * The following routines are provided for driver-compatibility
+ * with sparc64 (primarily sunlance.c)
+ */
 
-#ifndef __ASSEMBLY__
-#define set_auxio(bits_on, bits_off) \
+#define AUXIO_LTE_ON    1
+#define AUXIO_LTE_OFF   0
+
+/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
+ *
+ * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
+ */
+#define auxio_set_lte(on) \
 do { \
-	unsigned char regval; \
-	unsigned long flags; \
-	save_flags(flags); cli(); \
-	switch(sparc_cpu_model) { \
-	case sun4c: \
-		regval = *AUXREG; \
-		*AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN; \
-		break; \
-	case sun4m: \
-		if(!AUXREG) \
-			break;     /* VME chassic sun4m, no auxio. */ \
-		regval = *AUXREG; \
-		*AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M; \
-		break; \
-	case sun4d: \
-		break; \
-	default: \
-		panic("Can't set AUXIO register on this machine."); \
-	}; \
-	restore_flags(flags); \
-} while(0)
+	if(on) { \
+		set_auxio(AUXIO_LINK_TEST, 0); \
+	} else { \
+		set_auxio(0, AUXIO_LINK_TEST); \
+	} \
+} while (0)
+
+#define AUXIO_LED_ON    1
+#define AUXIO_LED_OFF   0
+
+/* auxio_set_led - Set system front panel LED
+ *
+ * on - AUXIO_LED_ON or AUXIO_LED_OFF
+ */
+#define auxio_set_led(on) \
+do { \
+	if(on) { \
+		set_auxio(AUXIO_LED, 0); \
+	} else { \
+		set_auxio(0, AUXIO_LED); \
+	} \
+} while (0)
+
 #endif /* !(__ASSEMBLY__) */
 
 
diff -Nru a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
--- a/include/asm-sparc/floppy.h	Mon Feb  4 23:53:47 2002
+++ b/include/asm-sparc/floppy.h	Tue Apr 22 22:43:02 2003
@@ -115,7 +115,7 @@
 	case 5: /* FD_DATA */
 		return sun_fdc->data_82072;
 	case 7: /* FD_DIR */
-		return (*AUXREG & AUXIO_FLPY_DCHG)? 0x80: 0;
+		return (get_auxio() & AUXIO_FLPY_DCHG)? 0x80: 0;
 	};
 	panic("sun_82072_fd_inb: How did I get here?");
 }
@@ -337,7 +337,7 @@
                 sun_fdops.fd_inb = sun_82072_fd_inb;
                 sun_fdops.fd_outb = sun_82072_fd_outb;
                 fdc_status = &sun_fdc->status_82072;
-                /* printk("AUXIO @0x%p\n", auxio_register); */ /* P3 */
+                /* printk("AUXIO @0x%lx\n", auxio_register); */ /* P3 */
         } else {
                 sun_fdops.fd_inb = sun_82077_fd_inb;
                 sun_fdops.fd_outb = sun_82077_fd_outb;
diff -Nru a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
--- a/include/asm-sparc/irq.h	Tue Nov 26 20:27:25 2002
+++ b/include/asm-sparc/irq.h	Wed Apr 23 00:49:34 2003
@@ -10,6 +10,7 @@
 #include <linux/config.h>
 #include <linux/linkage.h>
 #include <linux/threads.h>     /* For NR_CPUS */
+#include <linux/interrupt.h>
 
 #include <asm/system.h>     /* For SUN4M_NCPUS */
 #include <asm/btfixup.h>
@@ -21,7 +22,7 @@
 
 #define NR_IRQS    16
 
-#define irq_cannonicalize(irq)	(irq)
+#define irq_canonicalize(irq)	(irq)
 
 /* Dave Redman (djhr@tadpole.co.uk)
  * changed these to function pointers.. it saves cycles and will allow
@@ -47,8 +48,8 @@
 #define clear_profile_irq(cpu) BTFIXUP_CALL(clear_profile_irq)(cpu)
 #define load_profile_irq(cpu,limit) BTFIXUP_CALL(load_profile_irq)(cpu,limit)
 
-extern void (*sparc_init_timers)(void (*lvl10_irq)(int, void *, struct pt_regs *));
-extern void claim_ticker14(void (*irq_handler)(int, void *, struct pt_regs *),
+extern void (*sparc_init_timers)(irqreturn_t (*lvl10_irq)(int, void *, struct pt_regs *));
+extern void claim_ticker14(irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
 			   int irq,
 			   unsigned int timeout);
 
@@ -62,7 +63,7 @@
 #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu)
 #endif
 
-extern int request_fast_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, __const__ char *devname);
+extern int request_fast_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, __const__ char *devname);
 
 /* On the sun4m, just like the timers, we have both per-cpu and master
  * interrupt registers.
diff -Nru a/include/asm-sparc/kgdb.h b/include/asm-sparc/kgdb.h
--- a/include/asm-sparc/kgdb.h	Tue Feb  5 09:39:47 2002
+++ b/include/asm-sparc/kgdb.h	Tue Apr 22 21:35:55 2003
@@ -52,43 +52,43 @@
 #define KGDB_NPC    0x114
 
 #define SAVE_KGDB_GLOBALS(reg) \
-        std     %g0, [%reg + REGWIN_SZ + KGDB_G0]; \
-        std     %g2, [%reg + REGWIN_SZ + KGDB_G2]; \
-        std     %g4, [%reg + REGWIN_SZ + KGDB_G4]; \
-        std     %g6, [%reg + REGWIN_SZ + KGDB_G6];
+        std     %g0, [%reg + STACKFRAME_SZ + KGDB_G0]; \
+        std     %g2, [%reg + STACKFRAME_SZ + KGDB_G2]; \
+        std     %g4, [%reg + STACKFRAME_SZ + KGDB_G4]; \
+        std     %g6, [%reg + STACKFRAME_SZ + KGDB_G6];
 
 #define SAVE_KGDB_INS(reg) \
-        std     %i0, [%reg + REGWIN_SZ + KGDB_I0]; \
-        std     %i2, [%reg + REGWIN_SZ + KGDB_I2]; \
-        std     %i4, [%reg + REGWIN_SZ + KGDB_I4]; \
-        std     %i6, [%reg + REGWIN_SZ + KGDB_I6];
+        std     %i0, [%reg + STACKFRAME_SZ + KGDB_I0]; \
+        std     %i2, [%reg + STACKFRAME_SZ + KGDB_I2]; \
+        std     %i4, [%reg + STACKFRAME_SZ + KGDB_I4]; \
+        std     %i6, [%reg + STACKFRAME_SZ + KGDB_I6];
 
 #define SAVE_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
-        st      %reg_y, [%reg + REGWIN_SZ + KGDB_Y]; \
-        st      %reg_psr, [%reg + REGWIN_SZ + KGDB_PSR]; \
-        st      %reg_wim, [%reg + REGWIN_SZ + KGDB_WIM]; \
-        st      %reg_tbr, [%reg + REGWIN_SZ + KGDB_TBR]; \
-        st      %reg_pc, [%reg + REGWIN_SZ + KGDB_PC]; \
-        st      %reg_npc, [%reg + REGWIN_SZ + KGDB_NPC];
+        st      %reg_y, [%reg + STACKFRAME_SZ + KGDB_Y]; \
+        st      %reg_psr, [%reg + STACKFRAME_SZ + KGDB_PSR]; \
+        st      %reg_wim, [%reg + STACKFRAME_SZ + KGDB_WIM]; \
+        st      %reg_tbr, [%reg + STACKFRAME_SZ + KGDB_TBR]; \
+        st      %reg_pc, [%reg + STACKFRAME_SZ + KGDB_PC]; \
+        st      %reg_npc, [%reg + STACKFRAME_SZ + KGDB_NPC];
 
 #define LOAD_KGDB_GLOBALS(reg) \
-        ld      [%reg + REGWIN_SZ + KGDB_G1], %g1; \
-        ldd     [%reg + REGWIN_SZ + KGDB_G2], %g2; \
-        ldd     [%reg + REGWIN_SZ + KGDB_G4], %g4; \
-        ldd     [%reg + REGWIN_SZ + KGDB_G6], %g6;
+        ld      [%reg + STACKFRAME_SZ + KGDB_G1], %g1; \
+        ldd     [%reg + STACKFRAME_SZ + KGDB_G2], %g2; \
+        ldd     [%reg + STACKFRAME_SZ + KGDB_G4], %g4; \
+        ldd     [%reg + STACKFRAME_SZ + KGDB_G6], %g6;
 
 #define LOAD_KGDB_INS(reg) \
-        ldd     [%reg + REGWIN_SZ + KGDB_I0], %i0; \
-        ldd     [%reg + REGWIN_SZ + KGDB_I2], %i2; \
-        ldd     [%reg + REGWIN_SZ + KGDB_I4], %i4; \
-        ldd     [%reg + REGWIN_SZ + KGDB_I6], %i6;
+        ldd     [%reg + STACKFRAME_SZ + KGDB_I0], %i0; \
+        ldd     [%reg + STACKFRAME_SZ + KGDB_I2], %i2; \
+        ldd     [%reg + STACKFRAME_SZ + KGDB_I4], %i4; \
+        ldd     [%reg + STACKFRAME_SZ + KGDB_I6], %i6;
 
 #define LOAD_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
-	ld	[%reg + REGWIN_SZ + KGDB_Y], %reg_y; \
-	ld	[%reg + REGWIN_SZ + KGDB_PSR], %reg_psr; \
-	ld	[%reg + REGWIN_SZ + KGDB_WIM], %reg_wim; \
-	ld	[%reg + REGWIN_SZ + KGDB_TBR], %reg_tbr; \
-	ld	[%reg + REGWIN_SZ + KGDB_PC], %reg_pc; \
-	ld	[%reg + REGWIN_SZ + KGDB_NPC], %reg_npc;
+	ld	[%reg + STACKFRAME_SZ + KGDB_Y], %reg_y; \
+	ld	[%reg + STACKFRAME_SZ + KGDB_PSR], %reg_psr; \
+	ld	[%reg + STACKFRAME_SZ + KGDB_WIM], %reg_wim; \
+	ld	[%reg + STACKFRAME_SZ + KGDB_TBR], %reg_tbr; \
+	ld	[%reg + STACKFRAME_SZ + KGDB_PC], %reg_pc; \
+	ld	[%reg + STACKFRAME_SZ + KGDB_NPC], %reg_npc;
 
 #endif /* !(_SPARC_KGDB_H) */
diff -Nru a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
--- a/include/asm-sparc/processor.h	Mon Mar 10 10:20:31 2003
+++ b/include/asm-sparc/processor.h	Tue Apr 22 21:35:55 2003
@@ -131,7 +131,7 @@
 			     "std\t%%g0, [%0 + %3 + 0x30]\n\t"
 			     "st\t%1, [%0 + %3 + 0x38]\n\t"
 			     "st\t%%g0, [%0 + %3 + 0x3c]"
-			     : : "r" (regs), "r" (sp - REGWIN_SZ), "r" (zero),
+			     : : "r" (regs), "r" (sp - sizeof(struct reg_window)), "r" (zero),
 			     "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])));
 }
 
diff -Nru a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h
--- a/include/asm-sparc/ptrace.h	Thu Oct 17 00:55:17 2002
+++ b/include/asm-sparc/ptrace.h	Tue Apr 22 21:35:02 2003
@@ -58,7 +58,6 @@
 
 #define TRACEREG_SZ   sizeof(struct pt_regs)
 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
-#define REGWIN_SZ     sizeof(struct reg_window)
 
 #ifdef __KERNEL__
 #define user_mode(regs) (!((regs)->psr & PSR_PS))
@@ -70,7 +69,6 @@
 /* For assembly code. */
 #define TRACEREG_SZ       0x50
 #define STACKFRAME_SZ     0x60
-#define REGWIN_SZ         0x40
 #endif
 
 /*
diff -Nru a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
--- a/include/asm-sparc/signal.h	Wed Apr  9 15:00:18 2003
+++ b/include/asm-sparc/signal.h	Sun Apr 20 22:05:10 2003
@@ -118,10 +118,10 @@
 };
 
 /* Sigvec flags */
-#define SV_SSTACK    1u    /* This signal handler should use sig-stack */
-#define SV_INTR      2u    /* Sig return should not restart system call */
-#define SV_RESET     4u    /* Set handler to SIG_DFL upon taken signal */
-#define SV_IGNCHILD  8u    /* Do not send SIGCHLD */
+#define _SV_SSTACK    1u    /* This signal handler should use sig-stack */
+#define _SV_INTR      2u    /* Sig return should not restart system call */
+#define _SV_RESET     4u    /* Set handler to SIG_DFL upon taken signal */
+#define _SV_IGNCHILD  8u    /* Do not send SIGCHLD */
 
 /*
  * sa_flags values: SA_STACK is not currently supported, but will allow the
@@ -132,11 +132,11 @@
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
  */
-#define SA_NOCLDSTOP	SV_IGNCHILD
-#define SA_STACK	SV_SSTACK
-#define SA_ONSTACK	SV_SSTACK
-#define SA_RESTART	SV_INTR
-#define SA_ONESHOT	SV_RESET
+#define SA_NOCLDSTOP	_SV_IGNCHILD
+#define SA_STACK	_SV_SSTACK
+#define SA_ONSTACK	_SV_SSTACK
+#define SA_RESTART	_SV_INTR
+#define SA_ONESHOT	_SV_RESET
 #define SA_INTERRUPT	0x10u
 #define SA_NOMASK	0x20u
 #define SA_SHIRQ	0x40u
diff -Nru a/include/asm-sparc/winmacro.h b/include/asm-sparc/winmacro.h
--- a/include/asm-sparc/winmacro.h	Tue Feb  5 09:39:48 2002
+++ b/include/asm-sparc/winmacro.h	Tue Apr 22 21:35:55 2003
@@ -11,14 +11,6 @@
 #include <asm/ptrace.h>
 #include <asm/psr.h>
 
-/* These are just handy. */
-#define _SV	save	%sp, -REGWIN_SZ, %sp
-#define _RS     restore 
-
-#define FLUSH_ALL_KERNEL_WINDOWS \
-	_SV; _SV; _SV; _SV; _SV; _SV; _SV; \
-	_RS; _RS; _RS; _RS; _RS; _RS; _RS;
-
 /* Store the register window onto the 8-byte aligned area starting
  * at %reg.  It might be %sp, it might not, we don't care.
  */
@@ -45,25 +37,25 @@
 
 /* Loading and storing struct pt_reg trap frames. */
 #define LOAD_PT_INS(base_reg) \
-        ldd     [%base_reg + REGWIN_SZ + PT_I0], %i0; \
-        ldd     [%base_reg + REGWIN_SZ + PT_I2], %i2; \
-        ldd     [%base_reg + REGWIN_SZ + PT_I4], %i4; \
-        ldd     [%base_reg + REGWIN_SZ + PT_I6], %i6;
+        ldd     [%base_reg + STACKFRAME_SZ + PT_I0], %i0; \
+        ldd     [%base_reg + STACKFRAME_SZ + PT_I2], %i2; \
+        ldd     [%base_reg + STACKFRAME_SZ + PT_I4], %i4; \
+        ldd     [%base_reg + STACKFRAME_SZ + PT_I6], %i6;
 
 #define LOAD_PT_GLOBALS(base_reg) \
-        ld      [%base_reg + REGWIN_SZ + PT_G1], %g1; \
-        ldd     [%base_reg + REGWIN_SZ + PT_G2], %g2; \
-        ldd     [%base_reg + REGWIN_SZ + PT_G4], %g4; \
-        ldd     [%base_reg + REGWIN_SZ + PT_G6], %g6;
+        ld      [%base_reg + STACKFRAME_SZ + PT_G1], %g1; \
+        ldd     [%base_reg + STACKFRAME_SZ + PT_G2], %g2; \
+        ldd     [%base_reg + STACKFRAME_SZ + PT_G4], %g4; \
+        ldd     [%base_reg + STACKFRAME_SZ + PT_G6], %g6;
 
 #define LOAD_PT_YREG(base_reg, scratch) \
-        ld      [%base_reg + REGWIN_SZ + PT_Y], %scratch; \
+        ld      [%base_reg + STACKFRAME_SZ + PT_Y], %scratch; \
         wr      %scratch, 0x0, %y;
 
 #define LOAD_PT_PRIV(base_reg, pt_psr, pt_pc, pt_npc) \
-        ld      [%base_reg + REGWIN_SZ + PT_PSR], %pt_psr; \
-        ld      [%base_reg + REGWIN_SZ + PT_PC], %pt_pc; \
-        ld      [%base_reg + REGWIN_SZ + PT_NPC], %pt_npc;
+        ld      [%base_reg + STACKFRAME_SZ + PT_PSR], %pt_psr; \
+        ld      [%base_reg + STACKFRAME_SZ + PT_PC], %pt_pc; \
+        ld      [%base_reg + STACKFRAME_SZ + PT_NPC], %pt_npc;
 
 #define LOAD_PT_ALL(base_reg, pt_psr, pt_pc, pt_npc, scratch) \
         LOAD_PT_YREG(base_reg, scratch) \
@@ -72,25 +64,25 @@
         LOAD_PT_PRIV(base_reg, pt_psr, pt_pc, pt_npc)
 
 #define STORE_PT_INS(base_reg) \
-        std     %i0, [%base_reg + REGWIN_SZ + PT_I0]; \
-        std     %i2, [%base_reg + REGWIN_SZ + PT_I2]; \
-        std     %i4, [%base_reg + REGWIN_SZ + PT_I4]; \
-        std     %i6, [%base_reg + REGWIN_SZ + PT_I6];
+        std     %i0, [%base_reg + STACKFRAME_SZ + PT_I0]; \
+        std     %i2, [%base_reg + STACKFRAME_SZ + PT_I2]; \
+        std     %i4, [%base_reg + STACKFRAME_SZ + PT_I4]; \
+        std     %i6, [%base_reg + STACKFRAME_SZ + PT_I6];
 
 #define STORE_PT_GLOBALS(base_reg) \
-        st      %g1, [%base_reg + REGWIN_SZ + PT_G1]; \
-        std     %g2, [%base_reg + REGWIN_SZ + PT_G2]; \
-        std     %g4, [%base_reg + REGWIN_SZ + PT_G4]; \
-        std     %g6, [%base_reg + REGWIN_SZ + PT_G6];
+        st      %g1, [%base_reg + STACKFRAME_SZ + PT_G1]; \
+        std     %g2, [%base_reg + STACKFRAME_SZ + PT_G2]; \
+        std     %g4, [%base_reg + STACKFRAME_SZ + PT_G4]; \
+        std     %g6, [%base_reg + STACKFRAME_SZ + PT_G6];
 
 #define STORE_PT_YREG(base_reg, scratch) \
         rd      %y, %scratch; \
-        st      %scratch, [%base_reg + REGWIN_SZ + PT_Y];
+        st      %scratch, [%base_reg + STACKFRAME_SZ + PT_Y];
 
 #define STORE_PT_PRIV(base_reg, pt_psr, pt_pc, pt_npc) \
-        st      %pt_psr, [%base_reg + REGWIN_SZ + PT_PSR]; \
-        st      %pt_pc,  [%base_reg + REGWIN_SZ + PT_PC]; \
-        st      %pt_npc, [%base_reg + REGWIN_SZ + PT_NPC];
+        st      %pt_psr, [%base_reg + STACKFRAME_SZ + PT_PSR]; \
+        st      %pt_pc,  [%base_reg + STACKFRAME_SZ + PT_PC]; \
+        st      %pt_npc, [%base_reg + STACKFRAME_SZ + PT_NPC];
 
 #define STORE_PT_ALL(base_reg, reg_psr, reg_pc, reg_npc, g_scratch) \
         STORE_PT_PRIV(base_reg, reg_psr, reg_pc, reg_npc) \
diff -Nru a/include/asm-sparc64/asi.h b/include/asm-sparc64/asi.h
--- a/include/asm-sparc64/asi.h	Mon Aug 19 01:18:53 2002
+++ b/include/asm-sparc64/asi.h	Mon Apr 21 23:09:31 2003
@@ -102,13 +102,13 @@
 #define ASI_PST8_P		0xc0 /* Primary, 8 8-bit, partial		*/
 #define ASI_PST8_S		0xc1 /* Secondary, 8 8-bit, partial		*/
 #define ASI_PST16_P		0xc2 /* Primary, 4 16-bit, partial		*/
-#define ASI_PST16_S		0xc3 /* Seconary, 4 16-bit, partial		*/
+#define ASI_PST16_S		0xc3 /* Secondary, 4 16-bit, partial		*/
 #define ASI_PST32_P		0xc4 /* Primary, 2 32-bit, partial		*/
 #define ASI_PST32_S		0xc5 /* Secondary, 2 32-bit, partial		*/
 #define ASI_PST8_PL		0xc8 /* Primary, 8 8-bit, partial, little	*/
 #define ASI_PST8_SL		0xc9 /* Secondary, 8 8-bit, partial, little	*/
 #define ASI_PST16_PL		0xca /* Primary, 4 16-bit, partial, little	*/
-#define ASI_PST16_SL		0xcb /* Seconary, 4 16-bit, partial, little	*/
+#define ASI_PST16_SL		0xcb /* Secondary, 4 16-bit, partial, little	*/
 #define ASI_PST32_PL		0xcc /* Primary, 2 32-bit, partial, little	*/
 #define ASI_PST32_SL		0xcd /* Secondary, 2 32-bit, partial, little	*/
 #define ASI_FL8_P		0xd0 /* Primary, 1 8-bit, fpu ld/st		*/
diff -Nru a/include/asm-sparc64/auxio.h b/include/asm-sparc64/auxio.h
--- a/include/asm-sparc64/auxio.h	Mon Jul 22 22:14:58 2002
+++ b/include/asm-sparc64/auxio.h	Tue Apr 22 22:43:02 2003
@@ -1,111 +1,98 @@
 /* $Id: auxio.h,v 1.3 2001/06/05 08:16:34 davem Exp $
- * auxio.h:  Definitions and code for the Auxiliary I/O register.
+ * auxio.h:  Definitions and code for the Auxiliary I/O registers.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ *
+ * Refactoring for unified NCR/PCIO support 2002 Eric Brower (ebrower@usa.net)
  */
 #ifndef _SPARC64_AUXIO_H
 #define _SPARC64_AUXIO_H
 
-#include <asm/system.h>
-#include <asm/io.h>
-
-/* FIXME: All of this should be checked for sun4u. It has /sbus/auxio, but
-   I don't know whether it is the same and don't have a floppy */
+/* AUXIO implementations:
+ * sbus-based NCR89C105 "Slavio"
+ *	LED/Floppy (AUX1) register
+ *	Power (AUX2) register
+ *
+ * ebus-based auxio on PCIO 
+ *	LED Auxio Register
+ *	Power Auxio Register
+ *
+ * Register definitions from NCR _NCR89C105 Chip Specification_
+ * 
+ * SLAVIO AUX1 @ 0x1900000
+ * -------------------------------------------------
+ * | (R) | (R) |  D  | (R) |  E  |  M  |  T  |  L  |
+ * -------------------------------------------------
+ * (R) - bit 7:6,4 are reserved and should be masked in s/w
+ *  D  - Floppy Density Sense (1=high density) R/O
+ *  E  - Link Test Enable, directly reflected on AT&T 7213 LTE pin
+ *  M  - Monitor/Mouse Mux, directly reflected on MON_MSE_MUX pin
+ *  T  - Terminal Count: sends TC pulse to 82077 floppy controller
+ *  L  - System LED on front panel (0=off, 1=on) 
+ */
+#define AUXIO_AUX1_MASK		0xc0 /* Mask bits 		*/
+#define AUXIO_AUX1_FDENS	0x20 /* Floppy Density Sense	*/
+#define AUXIO_AUX1_LTE 		0x08 /* Link Test Enable 	*/
+#define AUXIO_AUX1_MMUX		0x04 /* Monitor/Mouse Mux	*/
+#define AUXIO_AUX1_FTCNT	0x02 /* Terminal Count, 	*/
+#define AUXIO_AUX1_LED		0x01 /* System LED		*/
+
+/* SLAVIO AUX2 @ 0x1910000
+ * -------------------------------------------------
+ * | (R) | (R) |  D  | (R) | (R) | (R) |  C  |  F  |
+ * -------------------------------------------------
+ * (R) - bits 7:6,4:2 are reserved and should be masked in s/w
+ *  D  - Power Failure Detect (1=power fail)
+ *  C  - Clear Power Failure Detect Int (1=clear)
+ *  F  - Power Off (1=power off)
+ */
+#define AUXIO_AUX2_MASK		0xdc /* Mask Bits		*/
+#define AUXIO_AUX2_PFAILDET	0x20 /* Power Fail Detect	*/
+#define AUXIO_AUX2_PFAILCLR 	0x02 /* Clear Pwr Fail Det Intr	*/
+#define AUXIO_AUX2_PWR_OFF	0x01 /* Power Off		*/
 
-extern unsigned long auxio_register;
+/* Register definitions from Sun Microsystems _PCIO_ p/n 802-7837
+ *
+ * PCIO LED Auxio @ 0x726000
+ * -------------------------------------------------
+ * |             31:1 Unused                 | LED |
+ * -------------------------------------------------
+ * Bits 31:1 unused
+ * LED - System LED on front panel (0=off, 1=on)
+ */
+#define AUXIO_PCIO_LED		0x01 /* System LED 		*/ 
 
-/* This register is an unsigned char in IO space.  It does two things.
- * First, it is used to control the front panel LED light on machines
- * that have it (good for testing entry points to trap handlers and irq's)
- * Secondly, it controls various floppy drive parameters.
- */
-#define AUXIO_ORMEIN      0xf0    /* All writes must set these bits. */
-#define AUXIO_ORMEIN4M    0xc0    /* sun4m - All writes must set these bits. */
-#define AUXIO_FLPY_DENS   0x20    /* Floppy density, high if set. Read only. */
-#define AUXIO_FLPY_DCHG   0x10    /* A disk change occurred.  Read only. */
-#define AUXIO_EDGE_ON     0x10    /* sun4m - On means Jumper block is in. */
-#define AUXIO_FLPY_DSEL   0x08    /* Drive select/start-motor. Write only. */
-#define AUXIO_LINK_TEST   0x08    /* sun4m - On means TPE Carrier detect. */
-
-/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
-#define AUXIO_FLPY_TCNT   0x04    /* Floppy terminal count. Write only. */
-
-/* Set the following to zero to eject the floppy. */
-#define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
-#define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
-
-#define AUXREG   (auxio_register)
-
-/* These are available on sun4c */
-#define TURN_ON_LED   \
-do {	if (AUXREG) \
-		sbus_writeb(sbus_readb(AUXREG) | \
-			    (AUXIO_ORMEIN | AUXIO_LED), AUXREG); \
-} while(0)
-#define TURN_OFF_LED  \
-do {	if (AUXREG) \
-		sbus_writeb((sbus_readb(AUXREG) | \
-			     AUXIO_ORMEIN) & (~AUXIO_LED), \
-			    AUXREG); \
-} while(0)
-#define FLIP_LED	\
-do {	if (AUXREG)  \
-		sbus_writeb((sbus_readb(AUXREG) | \
-			     AUXIO_ORMEIN) ^ AUXIO_LEN, \
-			    AUXREG); \
-} while(0)
-#define FLPY_MOTORON	\
-do {	if (AUXREG) \
-		sbus_writeb(sbus_readb(AUXREG) | \
-			    (AUXIO_ORMEIN | AUXIO_FLPY_DSEL), \
-			    AUXREG); \
-} while(0)
-#define FLPY_MOTOROFF	\
-do {	if (AUXREG) \
-		sbus_writeb((sbus_readb(AUXREG) | \
-			     AUXIO_ORMEIN) & (~AUXIO_FLPY_DSEL), \
-			    AUXREG); \
-} while(0)
-#define FLPY_TCNTON	\
-do {	if (AUXREG) \
-		sbus_writeb((sbus_readb(AUXREG) | \
-			     AUXIO_ORMEIN) | AUXIO_FLPY_TCNT, \
-			    AUXREG); \
-} while(0)
-#define FLPY_TCNTOFF	\
-do {	if (AUXREG) \
-		sbus_writeb((sbus_readb(AUXREG) | \
-			     AUXIO_ORMEIN) & (~AUXIO_FLPY_TCNT), \
-			    AUXREG); \
-} while(0)
+/* PCIO Power Auxio @ 0x724000
+ * -------------------------------------------------
+ * |             31:2 Unused           | CPO | SPO |
+ * -------------------------------------------------
+ * Bits 31:2 unused
+ * CPO - Courtesy Power Off (1=off)
+ * SPO - System Power Off   (1=off)
+ */
+#define AUXIO_PCIO_CPWR_OFF	0x02 /* Courtesy Power Off	*/
+#define AUXIO_PCIO_SPWR_OFF	0x01 /* System Power Off	*/
 
 #ifndef __ASSEMBLY__
-static __inline__ void set_auxio(unsigned char bits_on, unsigned char bits_off)
-{
-	unsigned char regval;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	if (AUXREG) {
-		unsigned char newval;
-
-		regval = sbus_readb(AUXREG);
-		newval  = regval | bits_on;
-		newval &= ~bits_off;
-		newval |= AUXIO_ORMEIN4M;
-		sbus_writeb(newval, AUXREG);
-	}
-	local_irq_restore(flags);
-}
-#endif /* !(__ASSEMBLY__) */
-
-
-/* AUXIO2 (Power Off Control) */
-extern __volatile__ unsigned char * auxio_power_register;
-
-#define	AUXIO_POWER_DETECT_FAILURE	32
-#define	AUXIO_POWER_CLEAR_FAILURE	2
-#define	AUXIO_POWER_OFF			1
 
+#define AUXIO_LTE_ON	1
+#define AUXIO_LTE_OFF	0
+
+/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
+ *
+ * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
+ */
+extern void auxio_set_lte(int on);
+
+#define AUXIO_LED_ON	1
+#define AUXIO_LED_OFF	0
+
+/* auxio_set_led - Set system front panel LED 
+ *
+ * on - AUXIO_LED_ON or AUXIO_LED_OFF
+ */
+extern void auxio_set_led(int on);
+
+#endif /* ifndef __ASSEMBLY__ */ 
 
-#endif /* !(_SPARC_AUXIO_H) */
+#endif /* !(_SPARC64_AUXIO_H) */
diff -Nru a/include/asm-sparc64/bpp.h b/include/asm-sparc64/bpp.h
--- a/include/asm-sparc64/bpp.h	Tue Feb  5 09:39:50 2002
+++ b/include/asm-sparc64/bpp.h	Mon Apr 21 23:09:31 2003
@@ -17,7 +17,7 @@
  * with compliant or compatible devices. It will use whatever features
  * the device supports, prefering those that are typically faster.
  *
- * When the device is opened, it is left in COMPATABILITY mode, and
+ * When the device is opened, it is left in COMPATIBILITY mode, and
  * writes work like any printer device. The driver only attempt to
  * negotiate 1284 modes when needed so that plugs can be pulled,
  * switch boxes switched, etc., without disrupting things. It will
diff -Nru a/include/asm-sparc64/chafsr.h b/include/asm-sparc64/chafsr.h
--- a/include/asm-sparc64/chafsr.h	Tue Feb  5 10:11:34 2002
+++ b/include/asm-sparc64/chafsr.h	Mon Apr 21 23:09:31 2003
@@ -61,7 +61,7 @@
 /* Uncorrectable system bus data ECC error for read of interrupt vector */
 #define CHAFSR_IVU		0x0000200000000000
 
-/* Unmappeed error from system bus */
+/* Unmapped error from system bus */
 #define CHAFSR_TO		0x0000100000000000
 
 /* Bus error response from system bus */
@@ -127,7 +127,7 @@
 
 /* The AFSR must be explicitly cleared by software, it is not cleared automatically
  * by a read.  Writes to bits <51:33> with bits set will clear the corresponding
- * bits in the AFSR.  Bits assosciated with disrupting traps must be cleared before
+ * bits in the AFSR.  Bits associated with disrupting traps must be cleared before
  * interrupts are re-enabled to prevent multiple traps for the same error.  I.e.
  * PSTATE.IE and AFSR bits control delivery of disrupting traps.
  *
diff -Nru a/include/asm-sparc64/estate.h b/include/asm-sparc64/estate.h
--- a/include/asm-sparc64/estate.h	Tue Feb  5 10:11:34 2002
+++ b/include/asm-sparc64/estate.h	Mon Apr 21 23:09:31 2003
@@ -15,7 +15,7 @@
  * errors 2) uncorrectable E-cache errors.  Such events only occur on reads
  * of the E-cache by the local processor for: 1) data loads 2) instruction
  * fetches 3) atomic operations.  Such events _cannot_ occur for: 1) merge
- * 2) writeback 2) copyout.  The AFSR bits assosciated with these traps are
+ * 2) writeback 2) copyout.  The AFSR bits associated with these traps are
  * UCC and UCU.
  */
 
@@ -31,7 +31,7 @@
  * 4) As the result of such errors on instruction vector fetch can generate any
  *    of the 3 trap types.
  *
- * The AFSR bits assosciated with these traps are EMU, EDU, WDU, CPU, IVU, UE,
+ * The AFSR bits associated with these traps are EMU, EDU, WDU, CPU, IVU, UE,
  * BERR, and TO.
  */
 
diff -Nru a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
--- a/include/asm-sparc64/irq.h	Wed Mar 12 03:53:15 2003
+++ b/include/asm-sparc64/irq.h	Wed Apr 23 00:49:34 2003
@@ -12,6 +12,7 @@
 #include <linux/linkage.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
+#include <linux/interrupt.h>
 #include <asm/pil.h>
 #include <asm/ptrace.h>
 
@@ -113,7 +114,7 @@
 
 #define NR_IRQS    16
 
-#define irq_cannonicalize(irq)	(irq)
+#define irq_canonicalize(irq)	(irq)
 extern void disable_irq(unsigned int);
 #define disable_irq_nosync disable_irq
 extern void enable_irq(unsigned int);
@@ -128,7 +129,7 @@
 #endif
 
 extern int request_fast_irq(unsigned int irq,
-			    void (*handler)(int, void *, struct pt_regs *),
+			    irqreturn_t (*handler)(int, void *, struct pt_regs *),
 			    unsigned long flags, __const__ char *devname,
 			    void *dev_id);
 
diff -Nru a/include/asm-sparc64/ns87303.h b/include/asm-sparc64/ns87303.h
--- a/include/asm-sparc64/ns87303.h	Sun Aug  4 02:08:37 2002
+++ b/include/asm-sparc64/ns87303.h	Mon Apr 21 23:09:31 2003
@@ -9,7 +9,7 @@
 #define _SPARC_NS87303_H 1
 
 /*
- * Controll Register Index Values
+ * Control Register Index Values
  */
 #define FER	0x00
 #define FAR	0x01
@@ -58,7 +58,7 @@
 #define TUP_EPP_TIMO	0x02	/* Enable EPP timeout IRQ                    */
 
 /* Advanced SuperIO Config Register (ASC) bits */
-#define ASC_LPT_IRQ7	0x01	/* Allways use IRQ7 for LPT                  */
+#define ASC_LPT_IRQ7	0x01	/* Always use IRQ7 for LPT                  */
 #define ASC_DRV2_SEL	0x02	/* Logical Drive Exchange controlled by TDR  */
 
 #define FER_RESERVED	0x00
diff -Nru a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
--- a/include/asm-sparc64/pci.h	Sat Mar 29 03:40:27 2003
+++ b/include/asm-sparc64/pci.h	Mon Apr 21 23:09:31 2003
@@ -50,7 +50,7 @@
  * size must be the same as what as passed into pci_alloc_consistent,
  * and likewise dma_addr must be the same as what *dma_addrp was set to.
  *
- * References to the memory and mappings assosciated with cpu_addr/dma_addr
+ * References to the memory and mappings associated with cpu_addr/dma_addr
  * past this call are illegal.
  */
 extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle);
@@ -92,7 +92,7 @@
 	(((PTR)->LEN_NAME) = (VAL))
 
 /* Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
+ * mode for DMA.  This is the scatter-gather version of the
  * above pci_map_single interface.  Here the scatter gather list
  * elements are each tagged with the appropriate dma address
  * and length.  They are obtained via sg_dma_{address,length}(SG).
diff -Nru a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
--- a/include/asm-sparc64/pgalloc.h	Mon Aug 26 17:10:23 2002
+++ b/include/asm-sparc64/pgalloc.h	Sun Apr 20 18:28:00 2003
@@ -71,7 +71,7 @@
 		struct page *page;
 
 		preempt_enable();
-		page = alloc_page(GFP_KERNEL);
+		page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
 		if (page) {
 			ret = (struct page *)page_address(page);
 			clear_page(ret);
@@ -110,7 +110,7 @@
 		preempt_enable();
 	} else {
 		preempt_enable();
-		ret = (unsigned long *) __get_free_page(GFP_KERNEL);
+		ret = (unsigned long *) __get_free_page(GFP_KERNEL|__GFP_REPEAT);
 		if(ret)
 			memset(ret, 0, PAGE_SIZE);
 	}
@@ -159,7 +159,7 @@
 
 	pmd = pmd_alloc_one_fast(mm, address);
 	if (!pmd) {
-		pmd = (pmd_t *)__get_free_page(GFP_KERNEL);
+		pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 		if (pmd)
 			memset(pmd, 0, PAGE_SIZE);
 	}
diff -Nru a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
--- a/include/asm-sparc64/signal.h	Wed Apr  9 15:00:18 2003
+++ b/include/asm-sparc64/signal.h	Sun Apr 20 22:05:10 2003
@@ -123,10 +123,10 @@
 };
 
 /* Sigvec flags */
-#define SV_SSTACK    1u    /* This signal handler should use sig-stack */
-#define SV_INTR      2u    /* Sig return should not restart system call */
-#define SV_RESET     4u    /* Set handler to SIG_DFL upon taken signal */
-#define SV_IGNCHILD  8u    /* Do not send SIGCHLD */
+#define _SV_SSTACK    1u    /* This signal handler should use sig-stack */
+#define _SV_INTR      2u    /* Sig return should not restart system call */
+#define _SV_RESET     4u    /* Set handler to SIG_DFL upon taken signal */
+#define _SV_IGNCHILD  8u    /* Do not send SIGCHLD */
 
 /*
  * sa_flags values: SA_STACK is not currently supported, but will allow the
@@ -137,11 +137,11 @@
  * SA_RESTART flag to get restarting signals (which were the default long ago)
  * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
  */
-#define SA_NOCLDSTOP	SV_IGNCHILD
-#define SA_STACK	SV_SSTACK
-#define SA_ONSTACK	SV_SSTACK
-#define SA_RESTART	SV_INTR
-#define SA_ONESHOT	SV_RESET
+#define SA_NOCLDSTOP	_SV_IGNCHILD
+#define SA_STACK	_SV_SSTACK
+#define SA_ONSTACK	_SV_SSTACK
+#define SA_RESTART	_SV_INTR
+#define SA_ONESHOT	_SV_RESET
 #define SA_INTERRUPT	0x10u
 #define SA_NOMASK	0x20u
 #define SA_SHIRQ	0x40u
diff -Nru a/include/asm-sparc64/svr4.h b/include/asm-sparc64/svr4.h
--- a/include/asm-sparc64/svr4.h	Tue Feb  5 09:39:50 2002
+++ b/include/asm-sparc64/svr4.h	Mon Apr 21 23:09:31 2003
@@ -85,7 +85,7 @@
 	SVR4_SS_DISABLE,
 };
 
-/* signal stack exection place, unsupported */
+/* signal stack execution place, unsupported */
 typedef struct svr4_stack_t {
         char *sp;
         int  size;
diff -Nru a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h
--- a/include/asm-sparc64/timer.h	Wed Mar 26 00:49:46 2003
+++ b/include/asm-sparc64/timer.h	Sun Apr 20 23:43:43 2003
@@ -7,6 +7,8 @@
 #ifndef _SPARC64_TIMER_H
 #define _SPARC64_TIMER_H
 
+#include <linux/types.h>
+
 /* How timers work:
  *
  * On uniprocessors we just use counter zero for the system wide
@@ -63,6 +65,7 @@
 
 #ifdef CONFIG_SMP
 extern unsigned long timer_tick_offset;
+struct pt_regs;
 extern void timer_tick_interrupt(struct pt_regs *);
 #endif
 
diff -Nru a/include/asm-sparc64/upa.h b/include/asm-sparc64/upa.h
--- a/include/asm-sparc64/upa.h	Thu Oct  3 11:02:09 2002
+++ b/include/asm-sparc64/upa.h	Mon Apr 21 23:09:31 2003
@@ -21,7 +21,7 @@
 #define UPA_PORTID_PREQDQ       0x000000007e000000 /* slave-wr's to mod supported  */
 #define UPA_PORTID_PREQRD       0x0000000001e00000 /* # incoming P_REQ's supported */
 #define UPA_PORTID_UPACAP       0x00000000001f0000 /* UPA capabilities of mod      */
-#define UPA_PORTID_ID           0x000000000000ffff /* Module Indentification bits  */
+#define UPA_PORTID_ID           0x000000000000ffff /* Module Identification bits  */
 
 /* UPA I/O space accessors */
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
diff -Nru a/include/asm-v850/irq.h b/include/asm-v850/irq.h
--- a/include/asm-v850/irq.h	Mon Nov 25 22:45:12 2002
+++ b/include/asm-v850/irq.h	Wed Apr 23 00:49:34 2003
@@ -37,7 +37,7 @@
 struct hw_interrupt_type;
 struct irqaction;
 
-#define irq_cannonicalize(irq)	(irq)
+#define irq_canonicalize(irq)	(irq)
 
 /* Initialize irq handling for IRQs.
    BASE_IRQ, BASE_IRQ+INTERVAL, ..., BASE_IRQ+NUM*INTERVAL
diff -Nru a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
--- a/include/asm-x86_64/irq.h	Thu Feb  7 02:55:27 2002
+++ b/include/asm-x86_64/irq.h	Wed Apr 23 00:49:34 2003
@@ -23,7 +23,7 @@
  */
 #define NR_IRQS 224
 
-static __inline__ int irq_cannonicalize(int irq)
+static __inline__ int irq_canonicalize(int irq)
 {
 	return ((irq == 2) ? 9 : irq);
 }
diff -Nru a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
--- a/include/asm-x86_64/pgalloc.h	Tue Jan 28 08:48:34 2003
+++ b/include/asm-x86_64/pgalloc.h	Sat Apr 19 23:22:43 2003
@@ -31,12 +31,12 @@
 
 static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 {
-	return (pmd_t *) get_zeroed_page(GFP_KERNEL); 
+	return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
 }
 
 static inline pgd_t *pgd_alloc (struct mm_struct *mm)
 {
-	return (pgd_t *)get_zeroed_page(GFP_KERNEL);
+	return (pgd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
 }
 
 static inline void pgd_free (pgd_t *pgd)
@@ -48,12 +48,12 @@
 
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-	return (pte_t *) get_zeroed_page(GFP_KERNEL);
+	return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
 }
 
 static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	void *p = (void *)get_zeroed_page(GFP_KERNEL); 
+	void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
 	if (!p)
 		return NULL;
 	return virt_to_page(p);
diff -Nru a/include/linux/8250_pci.h b/include/linux/8250_pci.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/linux/8250_pci.h	Mon Apr 21 02:00:20 2003
@@ -0,0 +1,2 @@
+int pci_siig10x_fn(struct pci_dev *dev, int enable);
+int pci_siig20x_fn(struct pci_dev *dev, int enable);
diff -Nru a/include/linux/acpi.h b/include/linux/acpi.h
--- a/include/linux/acpi.h	Mon Feb 24 23:13:14 2003
+++ b/include/linux/acpi.h	Wed Apr 23 10:22:08 2003
@@ -33,6 +33,7 @@
 
 #include <acpi/acpi.h>
 #include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
 #include <asm/acpi.h>
 
 
diff -Nru a/include/linux/blk.h b/include/linux/blk.h
--- a/include/linux/blk.h	Mon Oct 28 11:57:56 2002
+++ b/include/linux/blk.h	Sun Apr 20 16:22:00 2003
@@ -12,24 +12,6 @@
 extern void add_disk_randomness(struct gendisk *disk);
 extern void rand_initialize_disk(struct gendisk *disk);
 
-#ifdef CONFIG_BLK_DEV_RAM
-
-extern int rd_doload;          /* 1 = load ramdisk, 0 = don't load */
-extern int rd_prompt;          /* 1 = prompt for ramdisk, 0 = don't prompt */
-extern int rd_image_start;     /* starting block # of image */
-
-#ifdef CONFIG_BLK_DEV_INITRD
-
-#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */
-
-extern unsigned long initrd_start,initrd_end;
-extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < memory_start */
-void initrd_init(void);
-
-#endif /* CONFIG_BLK_DEV_INITRD */
-
-#endif
-
 /*
  * end_request() and friends. Must be called with the request queue spinlock
  * acquired. All functions called within end_request() _must_be_ atomic.
@@ -43,6 +25,7 @@
 extern int end_that_request_first(struct request *, int, int);
 extern int end_that_request_chunk(struct request *, int, int);
 extern void end_that_request_last(struct request *);
+extern void end_request(struct request *req, int uptodate);
 struct request *elv_next_request(request_queue_t *q);
 
 static inline void blkdev_dequeue_request(struct request *req)
@@ -54,20 +37,5 @@
 	if (req->q)
 		elv_remove_request(req->q, req);
 }
-
-/*
- * If we have our own end_request, we do not want to include this mess
- */
-#ifndef LOCAL_END_REQUEST
-static inline void end_request(struct request *req, int uptodate)
-{
-	if (end_that_request_first(req, uptodate, req->hard_cur_sectors))
-		return;
-
-	add_disk_randomness(req->rq_disk);
-	blkdev_dequeue_request(req);
-	end_that_request_last(req);
-}
-#endif /* !LOCAL_END_REQUEST */
 
 #endif /* _BLK_H */
diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h
--- a/include/linux/blkdev.h	Mon Apr  7 06:36:32 2003
+++ b/include/linux/blkdev.h	Thu Apr 24 03:23:09 2003
@@ -341,7 +341,7 @@
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void __blk_stop_queue(request_queue_t *q);
-extern void __blk_run_queue(request_queue_t *q);
+extern void blk_run_queue(request_queue_t *q);
 
 static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
 {
@@ -390,6 +390,8 @@
 extern void blk_queue_free_tags(request_queue_t *);
 extern void blk_queue_invalidate_tags(request_queue_t *);
 extern void blk_congestion_wait(int rw, long timeout);
+
+extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
 
 #define MAX_PHYS_SEGMENTS 128
 #define MAX_HW_SEGMENTS 128
diff -Nru a/include/linux/buffer_head.h b/include/linux/buffer_head.h
--- a/include/linux/buffer_head.h	Thu Mar 27 21:15:06 2003
+++ b/include/linux/buffer_head.h	Thu Apr 24 03:30:41 2003
@@ -128,9 +128,6 @@
 	})
 #define page_has_buffers(page)	PagePrivate(page)
 
-#define invalidate_buffers(dev)	__invalidate_buffers((dev), 0)
-
-
 /*
  * Declarations
  */
@@ -159,7 +156,6 @@
 void mark_buffer_async_read(struct buffer_head *bh);
 void mark_buffer_async_write(struct buffer_head *bh);
 void invalidate_bdev(struct block_device *, int);
-void __invalidate_buffers(kdev_t dev, int);
 int sync_blockdev(struct block_device *bdev);
 void __wait_on_buffer(struct buffer_head *);
 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
@@ -172,7 +168,7 @@
 void __brelse(struct buffer_head *);
 void __bforget(struct buffer_head *);
 struct buffer_head *__bread(struct block_device *, sector_t block, int size);
-struct buffer_head *alloc_buffer_head(void);
+struct buffer_head *alloc_buffer_head(int gfp_flags);
 void free_buffer_head(struct buffer_head * bh);
 void FASTCALL(unlock_buffer(struct buffer_head *bh));
 void ll_rw_block(int, int, struct buffer_head * bh[]);
diff -Nru a/include/linux/cdrom.h b/include/linux/cdrom.h
--- a/include/linux/cdrom.h	Tue Feb 18 10:25:13 2003
+++ b/include/linux/cdrom.h	Sun Apr 20 16:21:19 2003
@@ -715,7 +715,7 @@
 };
 
 #ifdef __KERNEL__
-#include <linux/devfs_fs_kernel.h>
+#include <linux/fs.h>		/* not really needed, later.. */
 #include <linux/device.h>
 
 struct cdrom_write_settings {
diff -Nru a/include/linux/console.h b/include/linux/console.h
--- a/include/linux/console.h	Thu Oct 31 12:05:56 2002
+++ b/include/linux/console.h	Thu Apr 24 03:30:40 2003
@@ -97,12 +97,13 @@
 	char	name[8];
 	void	(*write)(struct console *, const char *, unsigned);
 	int	(*read)(struct console *, const char *, unsigned);
-	kdev_t	(*device)(struct console *);
+	struct tty_driver *(*device)(struct console *, int *);
 	void	(*unblank)(void);
 	int	(*setup)(struct console *, char *);
 	short	flags;
 	short	index;
 	int	cflag;
+	void	*data;
 	struct	 console *next;
 };
 
diff -Nru a/include/linux/dcache.h b/include/linux/dcache.h
--- a/include/linux/dcache.h	Wed Apr  2 22:51:32 2003
+++ b/include/linux/dcache.h	Sat Apr 19 23:22:23 2003
@@ -270,7 +270,6 @@
 		if (!atomic_read(&dentry->d_count))
 			BUG();
 		atomic_inc(&dentry->d_count);
-		dentry->d_vfs_flags |= DCACHE_REFERENCED;
 	}
 	return dentry;
 }
diff -Nru a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
--- a/include/linux/devfs_fs_kernel.h	Fri Apr 18 08:59:17 2003
+++ b/include/linux/devfs_fs_kernel.h	Sun Apr 20 16:53:06 2003
@@ -25,18 +25,15 @@
 				      unsigned int flags,
 				      unsigned int major, unsigned int minor,
 				      umode_t mode, void *ops, void *info);
-extern void devfs_unregister (devfs_handle_t de);
-extern int devfs_mk_symlink (const char *name, const char *link);
-extern devfs_handle_t devfs_mk_dir(const char *fmt, ...)
+extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
+	__attribute__((format (printf, 3, 4)));
+extern int devfs_mk_symlink(const char *name, const char *link);
+extern int devfs_mk_dir(const char *fmt, ...)
 	__attribute__((format (printf, 1, 2)));
 extern void devfs_remove(const char *fmt, ...)
 	__attribute__((format (printf, 1, 2)));
 extern int devfs_register_tape(const char *name);
 extern void devfs_unregister_tape(int num);
-extern void devfs_create_partitions(struct gendisk *dev);
-extern void devfs_create_cdrom(struct gendisk *dev);
-extern void devfs_remove_partitions(struct gendisk *dev);
-extern void devfs_remove_cdrom(struct gendisk *dev);
 extern void devfs_register_partition(struct gendisk *dev, int part);
 extern void mount_devfs_fs(void);
 #else  /*  CONFIG_DEVFS_FS  */
@@ -50,17 +47,17 @@
 {
     return NULL;
 }
-static inline void devfs_unregister (devfs_handle_t de)
+static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
 {
-    return;
+	return 0;
 }
 static inline int devfs_mk_symlink (const char *name, const char *link)
 {
     return 0;
 }
-static inline devfs_handle_t devfs_mk_dir(const char *fmt, ...)
+static inline int devfs_mk_dir(const char *fmt, ...)
 {
-    return NULL;
+	return 0;
 }
 static inline void devfs_remove(const char *fmt, ...)
 {
@@ -70,18 +67,6 @@
     return -1;
 }
 static inline void devfs_unregister_tape(int num)
-{
-}
-static inline void devfs_create_partitions(struct gendisk *dev)
-{
-}
-static inline void devfs_create_cdrom(struct gendisk *dev)
-{
-}
-static inline void devfs_remove_partitions(struct gendisk *dev)
-{
-}
-static inline void devfs_remove_cdrom(struct gendisk *dev)
 {
 }
 static inline void devfs_register_partition(struct gendisk *dev, int part)
diff -Nru a/include/linux/eeprom.h b/include/linux/eeprom.h
--- a/include/linux/eeprom.h	Mon Feb  4 23:45:39 2002
+++ b/include/linux/eeprom.h	Sun Apr 20 21:58:28 2003
@@ -59,7 +59,7 @@
 /* foo. put this in a .c file */
 static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol)
 {
-	long flags;
+	unsigned long flags;
 	u32 data;
 
 	spin_lock_irqsave(ee->lock, flags);
diff -Nru a/include/linux/fb.h b/include/linux/fb.h
--- a/include/linux/fb.h	Sat Apr 12 17:33:15 2003
+++ b/include/linux/fb.h	Thu Apr 24 03:30:41 2003
@@ -348,7 +348,6 @@
 
 #include <linux/fs.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
 
 struct fb_info;
 struct vm_area_struct;
@@ -397,7 +396,7 @@
 };
 
 struct fb_info {
-   kdev_t node;
+   int node;
    int flags;
    int open;                            /* Has this been open already ? */
 #define FBINFO_FLAG_MODULE	1	/* Low-level driver is a module */
diff -Nru a/include/linux/fs.h b/include/linux/fs.h
--- a/include/linux/fs.h	Wed Apr 16 15:09:57 2003
+++ b/include/linux/fs.h	Thu Apr 24 03:30:41 2003
@@ -1102,9 +1102,8 @@
 #define bio_data_dir(bio)	((bio)->bi_rw & 1)
 
 extern int check_disk_change(struct block_device *);
-extern int full_check_disk_change(struct block_device *);
-extern int __check_disk_change(dev_t);
 extern int invalidate_inodes(struct super_block *);
+extern int __invalidate_device(struct block_device *, int);
 extern int invalidate_device(kdev_t, int);
 unsigned long invalidate_mapping_pages(struct address_space *mapping,
 					pgoff_t start, pgoff_t end);
diff -Nru a/include/linux/genhd.h b/include/linux/genhd.h
--- a/include/linux/genhd.h	Fri Apr 18 08:58:55 2003
+++ b/include/linux/genhd.h	Sun Apr 20 16:21:19 2003
@@ -15,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/smp.h>
 #include <linux/string.h>
+#include <linux/fs.h>
 
 enum {
 /* These three have identical behaviour; use the second one if DOS FDISK gets
@@ -55,16 +56,12 @@
 } __attribute__((packed));
 
 #ifdef __KERNEL__
-#include <linux/devfs_fs_kernel.h>	/* we don't need any devfs crap
-					   here, but some of the implicitly
-					   included headers.   will clean
-					   this mess up later.	--hch */
 struct hd_struct {
 	sector_t start_sect;
 	sector_t nr_sects;
 	struct kobject kobj;
 	unsigned reads, read_sectors, writes, write_sectors;
-	int policy;
+	int policy, partno;
 };
 
 #define GENHD_FL_REMOVABLE  1
@@ -89,7 +86,7 @@
 	int minor_shift;		/* number of times minor is shifted to
 					   get real minor */
 	char disk_name[16];		/* name of major driver */
-	struct hd_struct *part;		/* [indexed by minor] */
+	struct hd_struct **part;	/* [indexed by minor] */
 	struct block_device_operations *fops;
 	struct request_queue *queue;
 	void *private_data;
diff -Nru a/include/linux/gfp.h b/include/linux/gfp.h
--- a/include/linux/gfp.h	Sun Mar  2 18:14:26 2003
+++ b/include/linux/gfp.h	Sat Apr 19 23:22:40 2003
@@ -11,13 +11,26 @@
 #define __GFP_DMA	0x01
 #define __GFP_HIGHMEM	0x02
 
-/* Action modifiers - doesn't change the zoning */
+/*
+ * Action modifiers - doesn't change the zoning
+ *
+ * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt
+ * _might_ fail.  This depends upon the particular VM implementation.
+ *
+ * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller
+ * cannot handle allocation failures.
+ *
+ * __GFP_NORETRY: The VM implementation must not retry indefinitely.
+ */
 #define __GFP_WAIT	0x10	/* Can wait and reschedule? */
 #define __GFP_HIGH	0x20	/* Should access emergency pools? */
 #define __GFP_IO	0x40	/* Can start physical IO? */
 #define __GFP_FS	0x80	/* Can call down to low-level FS? */
 #define __GFP_COLD	0x100	/* Cache-cold page required */
 #define __GFP_NOWARN	0x200	/* Suppress page allocation failure warning */
+#define __GFP_REPEAT	0x400	/* Retry the allocation.  Might fail */
+#define __GFP_NOFAIL	0x800	/* Retry for ever.  Cannot fail */
+#define __GFP_NORETRY	0x1000	/* Do not retry.  Might fail */
 
 #define GFP_ATOMIC	(__GFP_HIGH)
 #define GFP_NOIO	(__GFP_WAIT)
diff -Nru a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h
--- a/include/linux/i2c-sensor.h	Wed Apr  2 12:01:10 2003
+++ b/include/linux/i2c-sensor.h	Thu Apr 24 06:36:20 2003
@@ -22,18 +22,6 @@
 #ifndef _LINUX_I2C_SENSOR_H
 #define _LINUX_I2C_SENSOR_H
 
-#include <linux/sysctl.h>
-
-/* The type of callback functions used in sensors_{proc,sysctl}_real */
-typedef void (*i2c_real_callback) (struct i2c_client * client,
-				       int operation, int ctl_name,
-				       int *nrels_mag, long *results);
-
-/* Values for the operation field in the above function type */
-#define SENSORS_PROC_REAL_INFO 1
-#define SENSORS_PROC_REAL_READ 2
-#define SENSORS_PROC_REAL_WRITE 3
-
 /* A structure containing detect information.
    Force variables overrule all other variables; they force a detection on
    that place. If a specific chip is given, the module blindly assumes this
@@ -41,8 +29,8 @@
    will still try to figure out what type of chip is present. This is useful
    if for some reasons the detect for SMBus or ISA address space filled
    fails.
-   probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.
-     A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
+   probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
+     A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second is the address. 
    kind: The kind of chip. 0 equals any chip.
 */
@@ -52,10 +40,10 @@
 };
 
 /* A structure containing the detect information.
-   normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END.
+   normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END.
      A list of I2C addresses which should normally be examined.
    normal_i2c_range: filled in by the module writer. Terminated by 
-     SENSORS_I2C_END
+     I2C_CLIENT_ISA_END
      A list of pairs of I2C addresses, each pair being an inclusive range of
      addresses which should normally be examined.
    normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.
@@ -66,24 +54,24 @@
      range of addresses which should normally be examined. The third is the
      modulo parameter: only addresses which are 0 module this value relative
      to the first address of the range are actually considered.
-   probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.
-     A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
+   probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
+     A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second is the address. These
      addresses are also probed, as if they were in the 'normal' list.
-   probe_range: insmod parameter. Initialize this list with SENSORS_I2C_END 
+   probe_range: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END 
      values.
-     A list of triples. The first value is a bus number (SENSORS_ISA_BUS for
+     A list of triples. The first value is a bus number (ANY_I2C_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second and third are addresses. 
      These form an inclusive range of addresses that are also probed, as
      if they were in the 'normal' list.
-   ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values.
-     A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
+   ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
+     A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second is the I2C address. These
      addresses are never probed. This parameter overrules 'normal' and 
      'probe', but not the 'force' lists.
-   ignore_range: insmod parameter. Initialize this list with SENSORS_I2C_END 
+   ignore_range: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END 
       values.
-     A list of triples. The first value is a bus number (SENSORS_ISA_BUS for
+     A list of triples. The first value is a bus number (ANY_I2C_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second and third are addresses. 
      These form an inclusive range of I2C addresses that are never probed.
      This parameter overrules 'normal' and 'probe', but not the 'force' lists.
@@ -102,74 +90,35 @@
 	struct i2c_force_data *forces;
 };
 
-/* Internal numbers to terminate lists */
-#define SENSORS_I2C_END 0xfffe
-#define SENSORS_ISA_END 0xfffefffe
-
-/* The numbers to use to set an ISA or I2C bus address */
-#define SENSORS_ISA_BUS 9191
-#define SENSORS_ANY_I2C_BUS 0xffff
-
-/* The length of the option lists */
-#define SENSORS_MAX_OPTS 48
-
-/* Default fill of many variables */
-#define SENSORS_DEFAULTS {SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \
-                          SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END}
-
-/* This is ugly. We need to evaluate SENSORS_MAX_OPTS before it is 
-   stringified */
-#define SENSORS_MODPARM_AUX1(x) "1-" #x "h"
-#define SENSORS_MODPARM_AUX(x) SENSORS_MODPARM_AUX1(x)
-#define SENSORS_MODPARM SENSORS_MODPARM_AUX(SENSORS_MAX_OPTS)
-
-/* SENSORS_MODULE_PARM creates a module parameter, and puts it in the
-   module header */
-#define SENSORS_MODULE_PARM(var,desc) \
-  static unsigned short var[SENSORS_MAX_OPTS] = SENSORS_DEFAULTS; \
-  MODULE_PARM(var,SENSORS_MODPARM); \
-  MODULE_PARM_DESC(var,desc)
-
-/* SENSORS_MODULE_PARM creates a 'force_*' module parameter, and puts it in
-   the module header */
 #define SENSORS_MODULE_PARM_FORCE(name) \
-  SENSORS_MODULE_PARM(force_ ## name, \
+  I2C_CLIENT_MODULE_PARM(force_ ## name, \
                       "List of adapter,address pairs which are unquestionably" \
                       " assumed to contain a `" # name "' chip")
 
 
 /* This defines several insmod variables, and the addr_data structure */
 #define SENSORS_INSMOD \
-  SENSORS_MODULE_PARM(probe, \
+  I2C_CLIENT_MODULE_PARM(probe, \
                       "List of adapter,address pairs to scan additionally"); \
-  SENSORS_MODULE_PARM(probe_range, \
+  I2C_CLIENT_MODULE_PARM(probe_range, \
                       "List of adapter,start-addr,end-addr triples to scan " \
                       "additionally"); \
-  SENSORS_MODULE_PARM(ignore, \
+  I2C_CLIENT_MODULE_PARM(ignore, \
                       "List of adapter,address pairs not to scan"); \
-  SENSORS_MODULE_PARM(ignore_range, \
+  I2C_CLIENT_MODULE_PARM(ignore_range, \
                       "List of adapter,start-addr,end-addr triples not to " \
                       "scan"); \
-  static struct i2c_address_data addr_data = \
-                                       {normal_i2c, normal_i2c_range, \
-                                        normal_isa, normal_isa_range, \
-                                        probe, probe_range, \
-                                        ignore, ignore_range, \
-                                        forces}
+	static struct i2c_address_data addr_data = {			\
+			.normal_i2c =		normal_i2c,		\
+			.normal_i2c_range =	normal_i2c_range,	\
+			.normal_isa =		normal_isa,		\
+			.normal_isa_range =	normal_isa_range,	\
+			.probe =		probe,			\
+			.probe_range =		probe_range,		\
+			.ignore =		ignore,			\
+			.ignore_range =		ignore_range,		\
+			.forces =		forces,			\
+		}
 
 /* The following functions create an enum with the chip names as elements. 
    The first element of the enum is any_chip. These are the only macros
@@ -177,7 +126,7 @@
 
 #define SENSORS_INSMOD_0 \
   enum chips { any_chip }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   static struct i2c_force_data forces[] = {{force,any_chip},{NULL}}; \
@@ -185,7 +134,7 @@
 
 #define SENSORS_INSMOD_1(chip1) \
   enum chips { any_chip, chip1 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -196,7 +145,7 @@
 
 #define SENSORS_INSMOD_2(chip1,chip2) \
   enum chips { any_chip, chip1, chip2 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -209,7 +158,7 @@
 
 #define SENSORS_INSMOD_3(chip1,chip2,chip3) \
   enum chips { any_chip, chip1, chip2, chip3 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -224,7 +173,7 @@
 
 #define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \
   enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -241,7 +190,7 @@
 
 #define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \
   enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -260,7 +209,7 @@
 
 #define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \
   enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -281,7 +230,7 @@
 
 #define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \
   enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -304,7 +253,7 @@
 
 #define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \
   enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \
-  SENSORS_MODULE_PARM(force, \
+  I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
   SENSORS_MODULE_PARM_FORCE(chip1); \
@@ -327,16 +276,13 @@
                                                  {NULL}}; \
   SENSORS_INSMOD
 
-typedef int i2c_found_addr_proc(struct i2c_adapter *adapter,
-				    int addr, int kind);
-
 /* Detect function. It iterates over all possible addresses itself. For
    SMBus addresses, it will only call found_proc if some client is connected
    to the SMBus (unless a 'force' matched); for ISA detections, this is not
    done. */
 extern int i2c_detect(struct i2c_adapter *adapter,
-			  struct i2c_address_data *address_data,
-			  i2c_found_addr_proc * found_proc);
+		      struct i2c_address_data *address_data,
+		      int (*found_proc) (struct i2c_adapter *, int, int));
 
 
 /* This macro is used to scale user-input to sensible values in almost all
@@ -350,24 +296,4 @@
 	else
 		return value;
 }
-
-
-/* The maximum length of the prefix */
-#define SENSORS_PREFIX_MAX 20
-
-/* Sysctl IDs */
-#ifdef DEV_HWMON
-#define DEV_SENSORS DEV_HWMON
-#else				/* ndef DEV_HWMOM */
-#define DEV_SENSORS 2		/* The id of the lm_sensors directory within the
-				   dev table */
-#endif				/* def DEV_HWMON */
-
-#define SENSORS_CHIPS 1
-struct i2c_chips_data {
-	int sysctl_id;
-	char name[SENSORS_PREFIX_MAX + 13];
-};
-
 #endif				/* def _LINUX_I2C_SENSOR_H */
-
diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h	Wed Apr  9 14:36:09 2003
+++ b/include/linux/i2c.h	Thu Apr 24 06:36:20 2003
@@ -290,10 +290,12 @@
 };
 
 /* Internal numbers to terminate lists */
-#define I2C_CLIENT_END 0xfffe
+#define I2C_CLIENT_END		0xfffe
+#define I2C_CLIENT_ISA_END	0xfffefffe
 
 /* The numbers to use to set I2C bus address */
-#define ANY_I2C_BUS 0xffff
+#define ANY_I2C_BUS		0xffff
+#define ANY_I2C_ISA_BUS		9191
 
 /* The length of the option lists */
 #define I2C_CLIENT_MAX_OPTS 48
@@ -338,12 +340,9 @@
  * It will only call found_proc if some client is connected at the
  * specific address (unless a 'force' matched);
  */
-typedef int i2c_client_found_addr_proc (struct i2c_adapter *adapter,
-                                     int addr, unsigned short flags,int kind);
-
 extern int i2c_probe(struct i2c_adapter *adapter, 
 		struct i2c_client_address_data *address_data,
-		i2c_client_found_addr_proc *found_proc);
+		int (*found_proc) (struct i2c_adapter *, int, int));
 
 /* An ioctl like call to set div. parameters of the adapter.
  */
@@ -559,11 +558,15 @@
   I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
-  static struct i2c_client_address_data addr_data = \
-                                       {normal_i2c, normal_i2c_range, \
-                                        probe, probe_range, \
-                                        ignore, ignore_range, \
-                                        force}
+	static struct i2c_client_address_data addr_data = {		\
+			.normal_i2c = 		normal_i2c,		\
+			.normal_i2c_range =	normal_i2c_range,	\
+			.probe =		probe,			\
+			.probe_range =		probe_range,		\
+			.ignore =		ignore,			\
+			.ignore_range =		ignore_range,		\
+			.force =		force,			\
+		}
 
 /* Detect whether we are on the isa bus. If this returns true, all i2c
    access will fail! */
diff -Nru a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h	Fri Apr 18 08:58:55 2003
+++ b/include/linux/ide.h	Sun Apr 20 16:21:19 2003
@@ -1245,7 +1245,6 @@
  * We need blk.h, but we replace its end_request by our own version.
  */
 #define IDE_DRIVER		/* Toggle some magic bits in blk.h */
-#define LOCAL_END_REQUEST	/* Don't generate end_request in blk.h */
 #include <linux/blk.h>
 
 extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs);
@@ -1568,7 +1567,7 @@
 
 extern int ide_spin_wait_hwgroup(ide_drive_t *);
 extern void ide_timer_expiry(unsigned long);
-extern void ide_intr(int irq, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t ide_intr(int irq, void *dev_id, struct pt_regs *regs);
 extern void do_ide_request(request_queue_t *);
 extern void ide_init_subdrivers(void);
 
diff -Nru a/include/linux/igmp.h b/include/linux/igmp.h
--- a/include/linux/igmp.h	Thu Apr 10 23:35:44 2003
+++ b/include/linux/igmp.h	Tue Apr 22 23:51:32 2003
@@ -191,7 +191,7 @@
          (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
 
 #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
-#define IGMPV3_MRC(value) IGMPV3_EXP(0x8000, 12, 3, value)
+#define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value)
 
 extern int ip_check_mc(struct in_device *dev, u32 mc_addr, u32 src_addr, u16 proto);
 extern int igmp_rcv(struct sk_buff *);
@@ -199,10 +199,12 @@
 extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr);
 extern void ip_mc_drop_socket(struct sock *sk);
 extern int ip_mc_source(int add, int omode, struct sock *sk,
-		struct ip_mreq_source *mreqs);
-extern int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf);
+		struct ip_mreq_source *mreqs, int ifindex);
+extern int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf,int ifindex);
 extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
 		struct ip_msfilter *optval, int *optlen);
+extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
+		struct group_filter *optval, int *optlen);
 extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif);
 extern void ip_mr_init(void);
 extern void ip_mc_init_dev(struct in_device *);
diff -Nru a/include/linux/initrd.h b/include/linux/initrd.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/linux/initrd.h	Sun Apr 20 13:15:58 2003
@@ -0,0 +1,16 @@
+
+#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */
+
+/* 1 = load ramdisk, 0 = don't load */
+extern int rd_doload;
+
+/* 1 = prompt for ramdisk, 0 = don't prompt */
+extern int rd_prompt;
+
+/* starting block # of image */
+extern int rd_image_start;
+
+/* 1 if it is not an error if initrd_start < memory_start */
+extern int initrd_below_start_ok;
+
+extern unsigned long initrd_start, initrd_end;
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Wed Feb 12 01:41:01 2003
+++ b/include/linux/input.h	Sun Apr 20 16:21:19 2003
@@ -734,7 +734,6 @@
  * In-kernel definitions.
  */
 
-#include <linux/devfs_fs_kernel.h>
 #include <linux/fs.h>
 #include <linux/timer.h>
 
@@ -895,8 +894,8 @@
 int input_accept_process(struct input_handle *handle, struct file *file);
 int input_flush_device(struct input_handle* handle, struct file* file);
 
-devfs_handle_t input_register_minor(char *name, int minor, int minor_base);
-void input_unregister_minor(devfs_handle_t handle);
+/* will go away once devfs_register gets sanitized */
+void input_register_minor(char *name, int minor, int minor_base);
 
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
 
diff -Nru a/include/linux/interrupt.h b/include/linux/interrupt.h
--- a/include/linux/interrupt.h	Mon Apr 14 12:11:44 2003
+++ b/include/linux/interrupt.h	Mon Apr 21 13:10:42 2003
@@ -11,8 +11,28 @@
 #include <asm/ptrace.h>
 #include <asm/system.h>
 
+/*
+ * For 2.4.x compatibility, 2.4.x can use
+ *
+ *	typedef void irqreturn_t;
+ *	#define IRQ_NONE
+ *	#define IRQ_HANDLED
+ *	#define IRQ_RETVAL(x)
+ *
+ * To mix old-style and new-style irq handler returns.
+ *
+ * IRQ_NONE means we didn't handle it.
+ * IRQ_HANDLED means that we did have a valid interrupt and handled it.
+ * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
+ */
+typedef int irqreturn_t;
+
+#define IRQ_NONE	(0)
+#define IRQ_HANDLED	(1)
+#define IRQ_RETVAL(x)	((x) != 0)
+
 struct irqaction {
-	void (*handler)(int, void *, struct pt_regs *);
+	irqreturn_t (*handler)(int, void *, struct pt_regs *);
 	unsigned long flags;
 	unsigned long mask;
 	const char *name;
@@ -20,8 +40,9 @@
 	struct irqaction *next;
 };
 
+extern irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs);
 extern int request_irq(unsigned int,
-		       void (*handler)(int, void *, struct pt_regs *),
+		       irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		       unsigned long, const char *, void *);
 extern void free_irq(unsigned int, void *);
 
diff -Nru a/include/linux/irq.h b/include/linux/irq.h
--- a/include/linux/irq.h	Mon May 27 05:07:35 2002
+++ b/include/linux/irq.h	Sun Apr 20 14:14:29 2003
@@ -72,7 +72,6 @@
 extern int setup_irq(unsigned int , struct irqaction * );
 
 extern hw_irq_controller no_irq_type;  /* needed in every arch ? */
-extern void no_action(int cpl, void *dev_id, struct pt_regs *regs);
 
 #endif
 
diff -Nru a/include/linux/isdn.h b/include/linux/isdn.h
--- a/include/linux/isdn.h	Mon Dec  2 14:21:06 2002
+++ b/include/linux/isdn.h	Sun Apr 20 16:21:19 2003
@@ -201,10 +201,6 @@
 #  include <linux/concap.h>
 #endif
 
-#ifdef CONFIG_DEVFS_FS
-#  include <linux/devfs_fs_kernel.h>
-#endif
-
 #include <linux/isdnif.h>
 
 #define ISDN_DRVIOCTL_MASK       0x7f  /* Mask for Device-ioctl */
diff -Nru a/include/linux/kdev_t.h b/include/linux/kdev_t.h
--- a/include/linux/kdev_t.h	Wed Mar 26 13:32:14 2003
+++ b/include/linux/kdev_t.h	Thu Apr 24 03:30:41 2003
@@ -99,7 +99,6 @@
 
 #define HASHDEV(dev)	(kdev_val(dev))
 #define NODEV		(mk_kdev(0,0))
-#define B_FREE		(mk_kdev(0xff,0xff))
 
 static inline int kdev_same(kdev_t dev1, kdev_t dev2)
 {
diff -Nru a/include/linux/linux_logo.h b/include/linux/linux_logo.h
--- a/include/linux/linux_logo.h	Tue Mar 25 17:25:37 2003
+++ b/include/linux/linux_logo.h	Sun Apr 20 02:43:12 2003
@@ -32,6 +32,6 @@
 	const unsigned char *data;
 };
 
-extern const struct linux_logo * __init find_logo(int depth);
+extern const struct linux_logo *fb_find_logo(int depth);
 
 #endif /* _LINUX_LINUX_LOGO_H */
diff -Nru a/include/linux/miscdevice.h b/include/linux/miscdevice.h
--- a/include/linux/miscdevice.h	Tue Jan 14 09:53:18 2003
+++ b/include/linux/miscdevice.h	Sun Apr 20 16:21:19 2003
@@ -1,8 +1,6 @@
 #ifndef _LINUX_MISCDEVICE_H
 #define _LINUX_MISCDEVICE_H
 
-#include <linux/devfs_fs_kernel.h>
-
 #define BUSMOUSE_MINOR 0
 #define PSMOUSE_MINOR  1
 #define MS_BUSMOUSE_MINOR 2
@@ -44,7 +42,7 @@
 	const char *name;
 	struct file_operations *fops;
 	struct miscdevice * next, * prev;
-	devfs_handle_t devfs_handle;
+	char devfs_name[64];
 };
 
 extern int misc_register(struct miscdevice * misc);
diff -Nru a/include/linux/mm.h b/include/linux/mm.h
--- a/include/linux/mm.h	Sat Apr 12 16:21:11 2003
+++ b/include/linux/mm.h	Sat Apr 19 23:22:50 2003
@@ -594,28 +594,10 @@
 
 extern unsigned int nr_used_zone_pages(void);
 
-#ifdef CONFIG_MMU
 extern struct page * vmalloc_to_page(void *addr);
 extern struct page * follow_page(struct mm_struct *mm, unsigned long address,
 		int write);
 extern int remap_page_range(struct vm_area_struct *vma, unsigned long from,
 		unsigned long to, unsigned long size, pgprot_t prot);
-#else
-static inline struct page * vmalloc_to_page(void *addr)
-{
-	return NULL;
-}
-static inline struct page * follow_page(struct mm_struct *mm,
-		unsigned long address, int write)
-{
-	return NULL;
-}
-static inline int remap_page_range(struct vm_area_struct *vma,
-		unsigned long from, unsigned long to,
-		unsigned long size, pgprot_t prot)
-{
-	return -EPERM;
-}
-#endif /* CONFIG_MMU */
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
diff -Nru a/include/linux/net.h b/include/linux/net.h
--- a/include/linux/net.h	Sun Apr  6 06:03:54 2003
+++ b/include/linux/net.h	Tue Apr 22 22:48:58 2003
@@ -127,15 +127,21 @@
 				      int offset, size_t size, int flags);
 };
 
+struct module;
+
 struct net_proto_family {
-	int	family;
-	int	(*create)(struct socket *sock, int protocol);
+	int		family;
+	int		(*create)(struct socket *sock, int protocol);
 	/* These are counters for the number of different methods of
 	   each we support */
-	short	authentication;
-	short	encryption;
-	short	encrypt_net;
+	short		authentication;
+	short		encryption;
+	short		encrypt_net;
+	struct module	*owner;
 };
+
+extern int	     net_family_get(int family);
+extern void	     net_family_put(int family);
 
 struct iovec;
 
diff -Nru a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
--- a/include/linux/nfsd/syscall.h	Wed Apr 16 14:09:42 2003
+++ b/include/linux/nfsd/syscall.h	Sat Apr 19 23:22:56 2003
@@ -59,7 +59,7 @@
 struct nfsctl_export {
 	char			ex_client[NFSCLNT_IDMAX+1];
 	char			ex_path[NFS_MAXPATHLEN+1];
-	__kernel_dev_t		ex_dev;
+	__kernel_old_dev_t	ex_dev;
 	__kernel_ino_t		ex_ino;
 	int			ex_flags;
 	__kernel_uid_t		ex_anon_uid;
@@ -104,7 +104,6 @@
 #define ca_export	u.u_export
 #define ca_getfd	u.u_getfd
 #define	ca_getfs	u.u_getfs
-#define ca_authd	u.u_authd
 };
 
 union nfsctl_res {
diff -Nru a/include/linux/sched.h b/include/linux/sched.h
--- a/include/linux/sched.h	Wed Apr 16 15:34:52 2003
+++ b/include/linux/sched.h	Sat Apr 19 23:22:46 2003
@@ -465,6 +465,7 @@
 #define PF_FROZEN	0x00010000	/* frozen for system suspend */
 #define PF_FSTRANS	0x00020000	/* inside a filesystem transaction */
 #define PF_KSWAPD	0x00040000	/* I am kswapd */
+#define PF_SWAPOFF	0x00080000	/* I am in swapoff */
 
 #if CONFIG_SMP
 extern void set_cpus_allowed(task_t *p, unsigned long new_mask);
diff -Nru a/include/linux/serial_core.h b/include/linux/serial_core.h
--- a/include/linux/serial_core.h	Tue Mar 18 09:12:12 2003
+++ b/include/linux/serial_core.h	Thu Apr 24 03:30:40 2003
@@ -300,6 +300,7 @@
 			int *flow);
 int uart_set_options(struct uart_port *port, struct console *co, int baud,
 		     int parity, int bits, int flow);
+struct tty_driver *uart_console_device(struct console *co, int *index);
 
 /*
  * Port/driver registration/removal
diff -Nru a/include/linux/serio.h b/include/linux/serio.h
--- a/include/linux/serio.h	Wed Feb 12 02:08:18 2003
+++ b/include/linux/serio.h	Mon Apr 21 04:06:57 2003
@@ -10,6 +10,7 @@
  */
 
 #include <linux/ioctl.h>
+#include <linux/interrupt.h>
 
 #define SPIOCSTYPE	_IOW('q', 0x01, unsigned long)
 
@@ -50,7 +51,8 @@
 	char *name;
 
 	void (*write_wakeup)(struct serio *);
-	void (*interrupt)(struct serio *, unsigned char, unsigned int, struct pt_regs *);
+	irqreturn_t (*interrupt)(struct serio *, unsigned char,
+			unsigned int, struct pt_regs *);
 	void (*connect)(struct serio *, struct serio_dev *dev);
 	void (*disconnect)(struct serio *);
 	void (*cleanup)(struct serio *);
@@ -61,7 +63,7 @@
 int serio_open(struct serio *serio, struct serio_dev *dev);
 void serio_close(struct serio *serio);
 void serio_rescan(struct serio *serio);
-void serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs);
+irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs);
 
 void serio_register_port(struct serio *serio);
 void serio_unregister_port(struct serio *serio);
diff -Nru a/include/linux/slab.h b/include/linux/slab.h
--- a/include/linux/slab.h	Sat Mar  8 14:50:35 2003
+++ b/include/linux/slab.h	Sat Apr 19 23:22:40 2003
@@ -22,7 +22,7 @@
 #define	SLAB_KERNEL		GFP_KERNEL
 #define	SLAB_DMA		GFP_DMA
 
-#define SLAB_LEVEL_MASK		(__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN)
+#define SLAB_LEVEL_MASK		(__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY)
 #define	SLAB_NO_GROW		0x00001000UL	/* don't grow a cache */
 
 /* flags to pass to kmem_cache_create().
diff -Nru a/include/linux/time.h b/include/linux/time.h
--- a/include/linux/time.h	Tue Apr  8 09:16:49 2003
+++ b/include/linux/time.h	Sat Apr 19 23:22:26 2003
@@ -26,6 +26,16 @@
 
 #include <linux/spinlock.h>
 #include <linux/seqlock.h>
+#include <linux/timex.h>
+#include <asm/div64.h>
+#ifndef div_long_long_rem
+
+#define div_long_long_rem(dividend,divisor,remainder) ({ \
+		       u64 result = dividend;		\
+		       *remainder = do_div(result,divisor); \
+		       result; })
+
+#endif
 
 /*
  * Have the 32 bit jiffies value wrap 5 minutes after boot
@@ -59,25 +69,52 @@
 #ifndef NSEC_PER_USEC
 #define NSEC_PER_USEC (1000L)
 #endif
+/*
+ * We want to do realistic conversions of time so we need to use the same
+ * values the update wall clock code uses as the jiffie size.  This value
+ * is: TICK_NSEC(TICK_USEC) (both of which are defined in timex.h).  This 
+ * is a constant and is in nanoseconds.  We will used scaled math and
+ * with a scales defined here as SEC_JIFFIE_SC,  USEC_JIFFIE_SC and 
+ * NSEC_JIFFIE_SC.  Note that these defines contain nothing but
+ * constants and so are computed at compile time.  SHIFT_HZ (computed in
+ * timex.h) adjusts the scaling for different HZ values.
+ */
+#define SEC_JIFFIE_SC (30 - SHIFT_HZ)
+#define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 30)
+#define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 20)
+#define SEC_CONVERSION ((unsigned long)(((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) /\
+                            (u64)TICK_NSEC(TICK_USEC))) 
+#define NSEC_CONVERSION ((unsigned long)(((u64)1 << NSEC_JIFFIE_SC) / \
+                            (u64)TICK_NSEC(TICK_USEC))) 
+#define USEC_CONVERSION \
+               ((unsigned long)(((u64)NSEC_PER_USEC << USEC_JIFFIE_SC)/ \
+                                 (u64)TICK_NSEC(TICK_USEC))) 
+#define MAX_SEC_IN_JIFFIES \
+    (u32)((u64)((u64)MAX_JIFFY_OFFSET * TICK_NSEC(TICK_USEC)) / NSEC_PER_SEC)
 
 static __inline__ unsigned long
 timespec_to_jiffies(struct timespec *value)
 {
 	unsigned long sec = value->tv_sec;
-	long nsec = value->tv_nsec;
+	long nsec = value->tv_nsec + TICK_NSEC(TICK_USEC) - 1;
 
-	if (sec >= (MAX_JIFFY_OFFSET / HZ))
+	if (sec >=  MAX_SEC_IN_JIFFIES)
 		return MAX_JIFFY_OFFSET;
-	nsec += 1000000000L / HZ - 1;
-	nsec /= 1000000000L / HZ;
-	return HZ * sec + nsec;
+	return (((u64)sec * SEC_CONVERSION) +
+		(((u64)nsec * NSEC_CONVERSION) >>
+		 (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
+
 }
 
 static __inline__ void
 jiffies_to_timespec(unsigned long jiffies, struct timespec *value)
 {
-	value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ);
-	value->tv_sec = jiffies / HZ;
+	/*
+	 * Convert jiffies to nanoseconds and seperate with
+	 * one divide.
+	 */
+	u64 nsec = (u64)jiffies * TICK_NSEC(TICK_USEC); 
+	value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_nsec);
 }
 
 /* Same for "timeval" */
@@ -85,20 +122,25 @@
 timeval_to_jiffies(struct timeval *value)
 {
 	unsigned long sec = value->tv_sec;
-	long usec = value->tv_usec;
+	long usec = value->tv_usec + USEC_PER_SEC / HZ - 1;
 
-	if (sec >= (MAX_JIFFY_OFFSET / HZ))
+	if (sec >= MAX_SEC_IN_JIFFIES)
 		return MAX_JIFFY_OFFSET;
-	usec += 1000000L / HZ - 1;
-	usec /= 1000000L / HZ;
-	return HZ * sec + usec;
+	return (((u64)sec * SEC_CONVERSION) +
+		(((u64)usec * USEC_CONVERSION) >>
+		 (USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
 }
 
 static __inline__ void
 jiffies_to_timeval(unsigned long jiffies, struct timeval *value)
 {
-	value->tv_usec = (jiffies % HZ) * (1000000L / HZ);
-	value->tv_sec = jiffies / HZ;
+	/*
+	 * Convert jiffies to nanoseconds and seperate with
+	 * one divide.
+	 */
+	u64 nsec = (u64)jiffies * TICK_NSEC(TICK_USEC); 
+	value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec);
+	value->tv_usec /= NSEC_PER_USEC;
 }
 
 static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) 
@@ -140,6 +182,7 @@
 }
 
 extern struct timespec xtime;
+extern struct timespec wall_to_monotonic;
 extern seqlock_t xtime_lock;
 
 static inline unsigned long get_seconds(void)
@@ -200,6 +243,9 @@
 #define CLOCK_MONOTONIC_HR	  5
 
 #define MAX_CLOCKS 6
+#define CLOCKS_MASK  (CLOCK_REALTIME | CLOCK_MONOTONIC | \
+                     CLOCK_REALTIME_HR | CLOCK_MONOTONIC_HR)
+#define CLOCKS_MONO (CLOCK_MONOTONIC & CLOCK_MONOTONIC_HR)
 
 /*
  * The various flags for setting POSIX.1b interval timers.
diff -Nru a/include/linux/timex.h b/include/linux/timex.h
--- a/include/linux/timex.h	Sun Sep  8 11:24:21 2002
+++ b/include/linux/timex.h	Sat Apr 19 23:22:26 2003
@@ -51,7 +51,6 @@
 #ifndef _LINUX_TIMEX_H
 #define _LINUX_TIMEX_H
 
-#include <linux/time.h>
 #include <asm/param.h>
 
 /*
@@ -177,6 +176,7 @@
 /* a value TUSEC for TICK_USEC (can be set bij adjtimex)		*/
 #define TICK_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8))
 
+#include <linux/time.h>
 /*
  * syscall interface - used (mainly by NTP daemon)
  * to discipline kernel clock oscillator
diff -Nru a/include/linux/tty.h b/include/linux/tty.h
--- a/include/linux/tty.h	Thu Mar  6 21:27:16 2003
+++ b/include/linux/tty.h	Mon Apr 21 20:58:43 2003
@@ -259,12 +259,14 @@
  */
 struct tty_struct {
 	int	magic;
-	struct tty_driver driver;
+	struct tty_driver *driver;
+	int index;
 	struct tty_ldisc ldisc;
 	struct termios *termios, *termios_locked;
+	char name[64];
 	int pgrp;
 	int session;
-	kdev_t	device;
+	dev_t	device;
 	unsigned long flags;
 	int count;
 	struct winsize winsize;
@@ -378,8 +380,8 @@
 extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
 extern int tty_register_driver(struct tty_driver *driver);
 extern int tty_unregister_driver(struct tty_driver *driver);
-extern void tty_register_device(struct tty_driver *driver, unsigned minor);
-extern void tty_unregister_device(struct tty_driver *driver, unsigned minor);
+extern void tty_register_device(struct tty_driver *driver, unsigned index);
+extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
 extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
 			     int buflen);
 extern void tty_write_message(struct tty_struct *tty, char *msg);
diff -Nru a/include/linux/umem.h b/include/linux/umem.h
--- a/include/linux/umem.h	Wed Nov  6 15:11:47 2002
+++ b/include/linux/umem.h	Mon Apr 21 21:54:36 2003
@@ -128,4 +128,11 @@
 #define PCI_VENDOR_ID_MICRO_MEMORY		0x1332
 #define PCI_DEVICE_ID_MICRO_MEMORY_5415CN	0x5415
 #define PCI_DEVICE_ID_MICRO_MEMORY_5425CN	0x5425
+#define PCI_DEVICE_ID_MICRO_MEMORY_6155		0x6155
+
+/* bits for card->flags */
+#define UM_FLAG_DMA_IN_REGS		1
+#define UM_FLAG_NO_BYTE_STATUS		2
+#define UM_FLAG_NO_BATTREG		4
+#define	UM_FLAG_NO_BATT			8
 #endif
diff -Nru a/include/linux/videodev.h b/include/linux/videodev.h
--- a/include/linux/videodev.h	Wed Dec 11 16:02:48 2002
+++ b/include/linux/videodev.h	Sun Apr 20 16:21:19 2003
@@ -19,7 +19,6 @@
 #ifdef __KERNEL__
 
 #include <linux/poll.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/mm.h>
 
 struct video_device
@@ -39,7 +38,7 @@
 	/* for videodev.c intenal usage -- don't touch */
 	int users;
 	struct semaphore lock;
-	devfs_handle_t devfs_handle;
+	char devfs_name[64];	/* devfs */
 };
 
 #define VIDEO_MAJOR	81
diff -Nru a/include/linux/vmalloc.h b/include/linux/vmalloc.h
--- a/include/linux/vmalloc.h	Thu Nov  7 23:47:15 2002
+++ b/include/linux/vmalloc.h	Sat Apr 19 23:22:50 2003
@@ -27,7 +27,8 @@
 extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot);
 extern void vfree(void *addr);
 
-extern void *vmap(struct page **pages, unsigned int count);
+extern void *vmap(struct page **pages, unsigned int count,
+			unsigned long flags, pgprot_t prot);
 extern void vunmap(void *addr);
  
 /*
diff -Nru a/include/linux/wrapper.h b/include/linux/wrapper.h
--- a/include/linux/wrapper.h	Tue Feb  5 09:39:41 2002
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,7 +0,0 @@
-#ifndef _WRAPPER_H_
-#define _WRAPPER_H_
-
-#define mem_map_reserve(p)	set_bit(PG_reserved, &((p)->flags))
-#define mem_map_unreserve(p)	clear_bit(PG_reserved, &((p)->flags))
-
-#endif /* _WRAPPER_H_ */
diff -Nru a/include/media/saa7146.h b/include/media/saa7146.h
--- a/include/media/saa7146.h	Mon Apr  7 13:16:30 2003
+++ b/include/media/saa7146.h	Thu Apr 24 03:35:53 2003
@@ -6,7 +6,6 @@
 #include <linux/delay.h>	/* for delay-stuff */
 #include <linux/slab.h>		/* for kmalloc/kfree */
 #include <linux/pci.h>		/* for pci-config-stuff, vendor ids etc. */
-#include <linux/wrapper.h>	/* for mem_map_reserve */
 #include <linux/init.h>		/* for "__init" */
 #include <linux/interrupt.h>	/* for IMMEDIATE_BH */
 #include <linux/kmod.h>		/* for kernel module loader */
diff -Nru a/include/net/ip6_route.h b/include/net/ip6_route.h
--- a/include/net/ip6_route.h	Thu Apr 10 23:43:33 2003
+++ b/include/net/ip6_route.h	Tue Apr 22 23:57:43 2003
@@ -59,7 +59,7 @@
 					    struct in6_addr *saddr,
 					    int oif, int flags);
 
-extern struct rt6_info		*ndisc_get_dummy_rt(void);
+extern struct rt6_info		*ip6_dst_alloc(void);
 
 /*
  *	support functions for ND
diff -Nru a/include/net/irda/irport.h b/include/net/irda/irport.h
--- a/include/net/irda/irport.h	Tue Feb  5 09:39:49 2002
+++ b/include/net/irda/irport.h	Tue Apr 22 04:54:53 2003
@@ -81,7 +81,7 @@
 void irport_start(struct irport_cb *self);
 void irport_stop(struct irport_cb *self);
 void irport_change_speed(void *priv, __u32 speed);
-void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t irport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 int  irport_hard_xmit(struct sk_buff *skb, struct net_device *dev);
 int  irport_net_open(struct net_device *dev);
 int  irport_net_close(struct net_device *dev);
diff -Nru a/include/net/pkt_cls.h b/include/net/pkt_cls.h
--- a/include/net/pkt_cls.h	Tue Feb  5 09:39:48 2002
+++ b/include/net/pkt_cls.h	Sun Apr 20 00:25:21 2003
@@ -39,6 +39,8 @@
 	int	(*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *);
 };
 
+struct module;
+
 struct tcf_proto_ops
 {
 	struct tcf_proto_ops	*next;
@@ -56,6 +58,8 @@
 
 	/* rtnetlink specific */
 	int			(*dump)(struct tcf_proto*, unsigned long, struct sk_buff *skb, struct tcmsg*);
+
+	struct module		*owner;
 };
 
 /* Main classifier routine: scans classifier chain attached
diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h
--- a/include/net/pkt_sched.h	Thu May 23 09:59:37 2002
+++ b/include/net/pkt_sched.h	Sun Apr 20 00:57:16 2003
@@ -49,6 +49,8 @@
 	int			(*dump)(struct Qdisc *, unsigned long, struct sk_buff *skb, struct tcmsg*);
 };
 
+struct module;
+
 struct Qdisc_ops
 {
 	struct Qdisc_ops	*next;
@@ -67,6 +69,8 @@
 	int			(*change)(struct Qdisc *, struct rtattr *arg);
 
 	int			(*dump)(struct Qdisc *, struct sk_buff *);
+
+	struct module		*owner;
 };
 
 extern rwlock_t qdisc_tree_lock;
diff -Nru a/include/pcmcia/bus_ops.h b/include/pcmcia/bus_ops.h
--- a/include/pcmcia/bus_ops.h	Mon Mar 17 07:43:05 2003
+++ b/include/pcmcia/bus_ops.h	Wed Apr 23 12:54:13 2003
@@ -1,2 +0,0 @@
-/* now empty */
-#warning please remove the reference to this file
diff -Nru a/include/pcmcia/driver_ops.h b/include/pcmcia/driver_ops.h
--- a/include/pcmcia/driver_ops.h	Wed Mar 26 16:05:10 2003
+++ b/include/pcmcia/driver_ops.h	Wed Apr 23 12:54:13 2003
@@ -1,2 +0,0 @@
-/* now empty */
-#warning please remove the reference to this file
diff -Nru a/include/pcmcia/ds.h b/include/pcmcia/ds.h
--- a/include/pcmcia/ds.h	Wed Mar 26 16:05:10 2003
+++ b/include/pcmcia/ds.h	Wed Apr 23 12:50:30 2003
@@ -31,7 +31,6 @@
 #define _LINUX_DS_H
 
 #include <pcmcia/bulkmem.h>
-#include <linux/device.h>
 #include <pcmcia/cs_types.h>
 
 typedef struct tuple_parse_t {
@@ -107,6 +106,7 @@
 #define DS_BIND_MTD			_IOWR('d', 64, mtd_info_t)
 
 #ifdef __KERNEL__
+#include <linux/device.h>
 
 typedef struct dev_node_t {
     char		dev_name[DEV_NAME_LEN];
diff -Nru a/include/sound/ad1848.h b/include/sound/ad1848.h
--- a/include/sound/ad1848.h	Mon Jan 27 10:41:40 2003
+++ b/include/sound/ad1848.h	Mon Apr 21 00:32:53 2003
@@ -23,6 +23,7 @@
  */
 
 #include "pcm.h"
+#include <linux/interrupt.h>
 
 /* IO ports */
 
@@ -163,7 +164,7 @@
 int snd_ad1848_pcm(ad1848_t * chip, int device, snd_pcm_t **rpcm);
 const snd_pcm_ops_t *snd_ad1848_get_pcm_ops(int direction);
 int snd_ad1848_mixer(ad1848_t * chip);
-void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /* exported mixer stuffs */
 enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE };
diff -Nru a/include/sound/cs4231.h b/include/sound/cs4231.h
--- a/include/sound/cs4231.h	Sun Nov 10 12:04:50 2002
+++ b/include/sound/cs4231.h	Mon Apr 21 00:32:53 2003
@@ -316,7 +316,7 @@
 void snd_cs4231_mce_up(cs4231_t *chip);
 void snd_cs4231_mce_down(cs4231_t *chip);
 
-void snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 const char *snd_cs4231_chip_id(cs4231_t *chip);
 
diff -Nru a/include/sound/emu10k1.h b/include/sound/emu10k1.h
--- a/include/sound/emu10k1.h	Thu Apr 10 03:28:10 2003
+++ b/include/sound/emu10k1.h	Mon Apr 21 10:36:31 2003
@@ -30,6 +30,7 @@
 #include <sound/hwdep.h>
 #include <sound/ac97_codec.h>
 #include <sound/util_mem.h>
+#include <linux/interrupt.h>
 #include <asm/io.h>
 
 #ifndef PCI_VENDOR_ID_CREATIVE
@@ -1014,7 +1015,7 @@
 int snd_emu10k1_mixer(emu10k1_t * emu);
 int snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep);
 
-void snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /* initialization */
 void snd_emu10k1_voice_init(emu10k1_t * emu, int voice);
diff -Nru a/include/sound/es1688.h b/include/sound/es1688.h
--- a/include/sound/es1688.h	Wed Feb 13 11:32:01 2002
+++ b/include/sound/es1688.h	Mon Apr 21 00:32:53 2003
@@ -24,6 +24,7 @@
 
 #include "control.h"
 #include "pcm.h"
+#include <linux/interrupt.h>
 
 #define ES1688_HW_AUTO		0x0000
 #define ES1688_HW_688		0x0001
@@ -109,7 +110,7 @@
 void snd_es1688_mixer_write(es1688_t *chip, unsigned char reg, unsigned char data);
 unsigned char snd_es1688_mixer_read(es1688_t *chip, unsigned char reg);
 
-void snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 int snd_es1688_create(snd_card_t * card,
 		      unsigned long port,
diff -Nru a/include/sound/gus.h b/include/sound/gus.h
--- a/include/sound/gus.h	Mon Jan 27 09:30:50 2003
+++ b/include/sound/gus.h	Mon Apr 21 00:32:53 2003
@@ -561,7 +561,7 @@
 };
 
 #if 0
-extern void snd_gf1_lfo_effect_interrupt(snd_gus_card_t * gus, snd_gf1_voice_t * voice);
+extern irqreturn_t snd_gf1_lfo_effect_interrupt(snd_gus_card_t * gus, snd_gf1_voice_t * voice);
 #endif
 extern void snd_gf1_lfo_init(snd_gus_card_t * gus);
 extern void snd_gf1_lfo_done(snd_gus_card_t * gus);
@@ -666,7 +666,7 @@
 
 /* gus_irq.c */
 
-void snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 #ifdef CONFIG_SND_DEBUG
 void snd_gus_irq_profile_init(snd_gus_card_t *gus);
 #endif
diff -Nru a/include/sound/initval.h b/include/sound/initval.h
--- a/include/sound/initval.h	Thu Apr 10 03:28:10 2003
+++ b/include/sound/initval.h	Mon Apr 21 00:32:53 2003
@@ -100,8 +100,9 @@
 #ifdef SNDRV_LEGACY_FIND_FREE_IRQ
 #include <linux/interrupt.h>
 
-static void snd_legacy_empty_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_legacy_empty_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
+	return IRQ_HANDLED;
 }
 
 static int snd_legacy_find_free_irq(int *irq_table)
diff -Nru a/include/sound/mpu401.h b/include/sound/mpu401.h
--- a/include/sound/mpu401.h	Thu Mar 20 08:41:11 2003
+++ b/include/sound/mpu401.h	Mon Apr 21 10:36:31 2003
@@ -22,7 +22,9 @@
  *
  */
 
+#include <linux/interrupt.h>
 #include "rawmidi.h"
+#include <linux/interrupt.h>
 
 #define MPU401_HW_MPU401		1	/* native MPU401 */
 #define MPU401_HW_SB			2	/* SoundBlaster MPU-401 UART */
@@ -102,7 +104,7 @@
 
  */
 
-void snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 int snd_mpu401_uart_new(snd_card_t * card,
 			int device,
diff -Nru a/include/sound/sb.h b/include/sound/sb.h
--- a/include/sound/sb.h	Mon Jan 27 10:41:40 2003
+++ b/include/sound/sb.h	Mon Apr 21 00:32:53 2003
@@ -24,6 +24,7 @@
 
 #include "pcm.h"
 #include "rawmidi.h"
+#include <linux/interrupt.h>
 #include <asm/io.h>
 
 enum sb_hw_type {
@@ -99,7 +100,7 @@
 	snd_rawmidi_t *rmidi;
 	snd_rawmidi_substream_t *midi_substream_input;
 	snd_rawmidi_substream_t *midi_substream_output;
-	void (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs);
+	irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs);
 
 	spinlock_t reg_lock;
 	spinlock_t open_lock;
@@ -282,7 +283,7 @@
 int snd_sbdsp_create(snd_card_t *card,
 		     unsigned long port,
 		     int irq,
-		     void (*irq_handler)(int, void *, struct pt_regs *),
+		     irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
 		     int dma8, int dma16,
 		     unsigned short hardware,
 		     sb_t **r_chip);
@@ -308,7 +309,7 @@
 const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction);
 int snd_sb16dsp_configure(sb_t *chip);
 /* sb16.c */
-void snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 int snd_sb16_playback_open(snd_pcm_substream_t *substream);
 int snd_sb16_capture_open(snd_pcm_substream_t *substream);
 int snd_sb16_playback_close(snd_pcm_substream_t *substream);
diff -Nru a/include/video/pm3fb.h b/include/video/pm3fb.h
--- a/include/video/pm3fb.h	Sat Feb 15 10:14:44 2003
+++ b/include/video/pm3fb.h	Thu Apr 24 03:30:41 2003
@@ -1147,11 +1147,6 @@
 #define MUST_BYTESWAP
 #endif
 
-/* for compatibility between 2.5, 2.4 and 2.2 */
-#ifndef B_FREE
-#define B_FREE   -1
-#endif
-
 /* permedia3 -specific definitions */
 #define PM3_SCALE_TO_CLOCK(pr, fe, po) ((2 * PM3_REF_CLOCK * fe) / (pr * (1 << (po))))
 
diff -Nru a/init/Kconfig b/init/Kconfig
--- a/init/Kconfig	Mon Mar 10 22:34:13 2003
+++ b/init/Kconfig	Sun Apr 20 12:56:52 2003
@@ -56,12 +56,12 @@
 	  and some programs won't run unless you say Y here. In particular, if
 	  you want to run the DOS emulator dosemu under Linux (read the
 	  DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>), you'll need to say Y
+	  <http://www.tldp.org/docs.html#howto>), you'll need to say Y
 	  here.
 
 	  You can find documentation about IPC with "info ipc" and also in
 	  section 6.4 of the Linux Programmer's Guide, available from
-	  <http://www.linuxdoc.org/docs.html#guide>.
+	  <http://www.tldp.org/docs.html#guide>.
 
 config BSD_PROCESS_ACCT
 	bool "BSD Process Accounting"
diff -Nru a/init/do_mounts_rd.c b/init/do_mounts_rd.c
--- a/init/do_mounts_rd.c	Thu Mar  6 16:27:25 2003
+++ b/init/do_mounts_rd.c	Sun Apr 20 09:14:41 2003
@@ -4,6 +4,7 @@
 #include <linux/minix_fs.h>
 #include <linux/ext2_fs.h>
 #include <linux/romfs_fs.h>
+#include <linux/initrd.h>
 
 #include "do_mounts.h"
 
diff -Nru a/init/main.c b/init/main.c
--- a/init/main.c	Fri Apr  4 09:01:32 2003
+++ b/init/main.c	Sun Apr 20 09:14:41 2003
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/blk.h>
+#include <linux/initrd.h>
 #include <linux/hdreg.h>
 #include <linux/bootmem.h>
 #include <linux/tty.h>
diff -Nru a/ipc/shm.c b/ipc/shm.c
--- a/ipc/shm.c	Wed Dec 18 05:36:54 2002
+++ b/ipc/shm.c	Sat Apr 19 23:22:48 2003
@@ -361,27 +361,35 @@
 	}
 }
 
-static void shm_get_stat (unsigned long *rss, unsigned long *swp) 
+static void shm_get_stat(unsigned long *rss, unsigned long *swp) 
 {
-	struct shmem_inode_info *info;
 	int i;
 
 	*rss = 0;
 	*swp = 0;
 
-	for(i = 0; i <= shm_ids.max_id; i++) {
-		struct shmid_kernel* shp;
-		struct inode * inode;
+	for (i = 0; i <= shm_ids.max_id; i++) {
+		struct shmid_kernel *shp;
+		struct inode *inode;
 
 		shp = shm_get(i);
-		if(shp == NULL)
+		if(!shp)
 			continue;
+
 		inode = shp->shm_file->f_dentry->d_inode;
-		info = SHMEM_I(inode);
-		spin_lock (&info->lock);
-		*rss += inode->i_mapping->nrpages;
-		*swp += info->swapped;
-		spin_unlock (&info->lock);
+
+		if (is_file_hugepages(shp->shm_file)) {
+			struct address_space *mapping = inode->i_mapping;
+			spin_lock(&mapping->page_lock);
+			*rss += (HPAGE_SIZE/PAGE_SIZE)*mapping->nrpages;
+			spin_unlock(&mapping->page_lock);
+		} else {
+			struct shmem_inode_info *info = SHMEM_I(inode);
+			spin_lock(&info->lock);
+			*rss += inode->i_mapping->nrpages;
+			*swp += info->swapped;
+			spin_unlock(&info->lock);
+		}
 	}
 }
 
@@ -737,21 +745,66 @@
  * detach and kill segment if marked destroyed.
  * The work is done in shm_close.
  */
-asmlinkage long sys_shmdt (char *shmaddr)
+asmlinkage long sys_shmdt(char *shmaddr)
 {
 	struct mm_struct *mm = current->mm;
-	struct vm_area_struct *shmd, *shmdnext;
+	struct vm_area_struct *vma, *next;
+	unsigned long addr = (unsigned long)shmaddr;
+	loff_t size = 0;
 	int retval = -EINVAL;
 
 	down_write(&mm->mmap_sem);
-	for (shmd = mm->mmap; shmd; shmd = shmdnext) {
-		shmdnext = shmd->vm_next;
-		if ((shmd->vm_ops == &shm_vm_ops || (shmd->vm_flags & VM_HUGETLB))
-		    && shmd->vm_start - (shmd->vm_pgoff << PAGE_SHIFT) == (ulong) shmaddr) {
-			do_munmap(mm, shmd->vm_start, shmd->vm_end - shmd->vm_start);
+
+	/*
+	 * If it had been mremap()'d, the starting address would not
+	 * match the usual checks anyway. So assume all vma's are
+	 * above the starting address given.
+	 */
+	vma = find_vma(mm, addr);
+
+	while (vma) {
+		next = vma->vm_next;
+
+		/*
+		 * Check if the starting address would match, i.e. it's
+		 * a fragment created by mprotect() and/or munmap(), or it
+		 * otherwise it starts at this address with no hassles.
+		 */
+		if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) &&
+			(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
+
+
+			size = vma->vm_file->f_dentry->d_inode->i_size;
+			do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
+			/*
+			 * We discovered the size of the shm segment, so
+			 * break out of here and fall through to the next
+			 * loop that uses the size information to stop
+			 * searching for matching vma's.
+			 */
 			retval = 0;
+			vma = next;
+			break;
 		}
+		vma = next;
+	}
+
+	/*
+	 * We need look no further than the maximum address a fragment
+	 * could possibly have landed at. Also cast things to loff_t to
+	 * prevent overflows and make comparisions vs. equal-width types.
+	 */
+	while (vma && (loff_t)(vma->vm_end - addr) <= size) {
+		next = vma->vm_next;
+
+		/* finding a matching vma now does not alter retval */
+		if ((vma->vm_ops == &shm_vm_ops || is_vm_hugetlb_page(vma)) &&
+			(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff)
+
+			do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
+		vma = next;
 	}
+
 	up_write(&mm->mmap_sem);
 	return retval;
 }
diff -Nru a/kernel/acct.c b/kernel/acct.c
--- a/kernel/acct.c	Sun Nov 10 01:31:37 2002
+++ b/kernel/acct.c	Mon Apr 21 20:58:43 2003
@@ -335,7 +335,7 @@
 	ac.ac_stime = encode_comp_t(current->stime);
 	ac.ac_uid = current->uid;
 	ac.ac_gid = current->gid;
-	ac.ac_tty = (current->tty) ? kdev_t_to_nr(current->tty->device) : 0;
+	ac.ac_tty = current->tty ? current->tty->device : 0;
 
 	ac.ac_flag = 0;
 	if (current->flags & PF_FORKNOEXEC)
diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c
--- a/kernel/ksyms.c	Sat Apr 12 15:37:08 2003
+++ b/kernel/ksyms.c	Thu Apr 24 03:30:41 2003
@@ -186,11 +186,10 @@
 EXPORT_SYMBOL(put_filp);
 EXPORT_SYMBOL(files_lock);
 EXPORT_SYMBOL(check_disk_change);
-EXPORT_SYMBOL(__check_disk_change);
-EXPORT_SYMBOL(__invalidate_buffers);
 EXPORT_SYMBOL(invalidate_bdev);
 EXPORT_SYMBOL(invalidate_inodes);
 EXPORT_SYMBOL(invalidate_device);
+EXPORT_SYMBOL(__invalidate_device);
 EXPORT_SYMBOL(invalidate_inode_pages);
 EXPORT_SYMBOL_GPL(invalidate_inode_pages2);
 EXPORT_SYMBOL(truncate_inode_pages);
diff -Nru a/kernel/posix-timers.c b/kernel/posix-timers.c
--- a/kernel/posix-timers.c	Tue Apr 15 16:11:01 2003
+++ b/kernel/posix-timers.c	Sat Apr 19 23:22:26 2003
@@ -33,7 +33,12 @@
 		       result; })
 
 #endif
+#define CLOCK_REALTIME_RES TICK_NSEC(TICK_USEC)  // In nano seconds.
 
+static inline u64  mpy_l_X_l_ll(unsigned long mpy1,unsigned long mpy2)
+{
+	return (u64)mpy1 * mpy2;
+}
 /*
  * Management arrays for POSIX timers.	 Timers are kept in slab memory
  * Timer ids are allocated by an external routine that keeps track of the
@@ -48,7 +53,7 @@
  * The idr_get_new *may* call slab for more memory so it must not be
  * called under a spin lock.  Likewise idr_remore may release memory
  * (but it may be ok to do this under a lock...).
- * idr_find is just a memory look up and is quite fast.  A zero return
+ * idr_find is just a memory look up and is quite fast.  A -1 return
  * indicates that the requested id does not exist.
  */
 
@@ -82,6 +87,7 @@
  * For some reason mips/mips64 define the SIGEV constants plus 128.
  * Here we define a mask to get rid of the common bits.	 The
  * optimizer should make this costless to all but mips.
+ * Note that no common bits (the non-mips case) will give 0xffffffff.
  */
 #define MIPS_SIGEV ~(SIGEV_NONE & \
 		      SIGEV_SIGNAL & \
@@ -93,7 +99,7 @@
  * The timer ID is turned into a timer address by idr_find().
  * Verifying a valid ID consists of:
  *
- * a) checking that idr_find() returns other than zero.
+ * a) checking that idr_find() returns other than -1.
  * b) checking that the timer id matches the one in the timer itself.
  * c) that the timer owner is in the callers thread group.
  */
@@ -162,6 +168,8 @@
 
 void register_posix_clock(int clock_id, struct k_clock *new_clock);
 static int do_posix_gettime(struct k_clock *clock, struct timespec *tp);
+static u64 do_posix_clock_monotonic_gettime_parts(
+	struct timespec *tp, struct timespec *mo);
 int do_posix_clock_monotonic_gettime(struct timespec *tp);
 int do_posix_clock_monotonic_settime(struct timespec *tp);
 static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags);
@@ -172,8 +180,8 @@
  */
 static __init int init_posix_timers(void)
 {
-	struct k_clock clock_realtime = {.res = NSEC_PER_SEC / HZ };
-	struct k_clock clock_monotonic = {.res = NSEC_PER_SEC / HZ,
+	struct k_clock clock_realtime = {.res = CLOCK_REALTIME_RES };
+	struct k_clock clock_monotonic = {.res = CLOCK_REALTIME_RES,
 		.clock_get = do_posix_clock_monotonic_gettime,
 		.clock_set = do_posix_clock_monotonic_settime
 	};
@@ -192,7 +200,7 @@
 
 static void tstojiffie(struct timespec *tp, int res, u64 *jiff)
 {
-	unsigned long sec = tp->tv_sec;
+	long sec = tp->tv_sec;
 	long nsec = tp->tv_nsec + res - 1;
 
 	if (nsec > NSEC_PER_SEC) {
@@ -201,35 +209,14 @@
 	}
 
 	/*
-	 * A note on jiffy overflow: It is possible for the system to
-	 * have been up long enough for the jiffies quanity to overflow.
-	 * In order for correct timer evaluations we require that the
-	 * specified time be somewhere between now and now + (max
-	 * unsigned int/2).  Times beyond this will be truncated back to
-	 * this value.   This is done in the absolute adjustment code,
-	 * below.  Here it is enough to just discard the high order
-	 * bits.
-	 */
-	*jiff = (u64)sec * HZ;
-	/*
-	 * Do the res thing. (Don't forget the add in the declaration of nsec)
-	 */
-	nsec -= nsec % res;
-	/*
-	 * Split to jiffie and sub jiffie
-	 */
-	*jiff += nsec / (NSEC_PER_SEC / HZ);
-}
-
-static void tstotimer(struct itimerspec *time, struct k_itimer *timer)
-{
-	u64 result;
-	int res = posix_clocks[timer->it_clock].res;
-
-	tstojiffie(&time->it_value, res, &result);
-	timer->it_timer.expires = (unsigned long)result;
-	tstojiffie(&time->it_interval, res, &result);
-	timer->it_incr = (unsigned long)result;
+	 * The scaling constants are defined in <linux/time.h>
+	 * The difference between there and here is that we do the
+	 * res rounding and compute a 64-bit result (well so does that
+	 * but it then throws away the high bits).
+  	 */
+	*jiff =  (mpy_l_X_l_ll(sec, SEC_CONVERSION) +
+		  (mpy_l_X_l_ll(nsec, NSEC_CONVERSION) >> 
+		   (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
 }
 
 static void schedule_next_timer(struct k_itimer *timr)
@@ -690,57 +677,81 @@
  * If it is relative time, we need to add the current (CLOCK_MONOTONIC)
  * time to it to get the proper time for the timer.
  */
-static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, int abs)
+static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, 
+			   int abs, u64 *exp)
 {
 	struct timespec now;
-	struct timespec oc;
-	do_posix_clock_monotonic_gettime(&now);
-
-	if (!abs || (posix_clocks[CLOCK_MONOTONIC].clock_get !=
-							clock->clock_get)) {
-		if (abs)
-			do_posix_gettime(clock, &oc);
-		else
-			oc.tv_nsec = oc.tv_sec = 0;
-
-		tp->tv_sec += now.tv_sec - oc.tv_sec;
-		tp->tv_nsec += now.tv_nsec - oc.tv_nsec;
+	struct timespec oc = *tp;
+	struct timespec wall_to_mono;
+	u64 jiffies_64_f;
+	int rtn =0;
 
+	if (abs) {
+		/*
+		 * The mask pick up the 4 basic clocks 
+		 */
+		if (!(clock - &posix_clocks[0]) & ~CLOCKS_MASK) {
+			jiffies_64_f = do_posix_clock_monotonic_gettime_parts(
+				&now,  &wall_to_mono);
+			/*
+			 * If we are doing a MONOTONIC clock
+			 */
+			if((clock - &posix_clocks[0]) & CLOCKS_MONO){
+				now.tv_sec += wall_to_mono.tv_sec;
+				now.tv_nsec += wall_to_mono.tv_nsec;
+			}
+		} else {
+			/*
+			 * Not one of the basic clocks
+			 */
+			do_posix_gettime(clock, &now);	
+			jiffies_64_f = get_jiffies_64();
+		}
+		/*
+		 * Take away now to get delta
+		 */
+		oc.tv_sec -= now.tv_sec;
+		oc.tv_nsec -= now.tv_nsec;
 		/*
 		 * Normalize...
 		 */
-		if ((tp->tv_nsec - NSEC_PER_SEC) >= 0) {
-			tp->tv_nsec -= NSEC_PER_SEC;
-			tp->tv_sec++;
+		while ((oc.tv_nsec - NSEC_PER_SEC) >= 0) {
+			oc.tv_nsec -= NSEC_PER_SEC;
+			oc.tv_sec++;
 		}
-		if ((tp->tv_nsec) < 0) {
-			tp->tv_nsec += NSEC_PER_SEC;
-			tp->tv_sec--;
+		while ((oc.tv_nsec) < 0) {
+			oc.tv_nsec += NSEC_PER_SEC;
+			oc.tv_sec--;
 		}
+	}else{
+		jiffies_64_f = get_jiffies_64();
 	}
 	/*
-	 * Check if the requested time is prior to now (if so set now) or
-	 * is more than the timer code can handle (if so we error out).
-	 * The (unsigned) catches the case of prior to "now" with the same
-	 * test.  Only on failure do we sort out what happened, and then
-	 * we use the (unsigned) to error out negative seconds.
+	 * Check if the requested time is prior to now (if so set now)
+	 */
+	if (oc.tv_sec < 0)
+		oc.tv_sec = oc.tv_nsec = 0;
+	tstojiffie(&oc, clock->res, exp);
+
+	/*
+	 * Check if the requested time is more than the timer code
+	 * can handle (if so we error out but return the value too).
 	 */
-	if ((unsigned) (tp->tv_sec - now.tv_sec) > (MAX_JIFFY_OFFSET / HZ)) {
-		if ((unsigned) tp->tv_sec < now.tv_sec) {
-			tp->tv_sec = now.tv_sec;
-			tp->tv_nsec = now.tv_nsec;
-		} else
+	if (*exp > ((u64)MAX_JIFFY_OFFSET))
 			/*
 			 * This is a considered response, not exactly in
 			 * line with the standard (in fact it is silent on
-			 * possible overflows).  We assume such a large
+			 * possible overflows).  We assume such a large 
 			 * value is ALMOST always a programming error and
 			 * try not to compound it by setting a really dumb
 			 * value.
 			 */
-			return -EINVAL;
-	}
-	return 0;
+			rtn = -EINVAL;
+	/*
+	 * return the actual jiffies expire time, full 64 bits
+	 */
+	*exp += jiffies_64_f;
+	return rtn;
 }
 
 /* Set a POSIX.1b interval timer. */
@@ -750,6 +761,7 @@
 		 struct itimerspec *new_setting, struct itimerspec *old_setting)
 {
 	struct k_clock *clock = &posix_clocks[timr->it_clock];
+	u64 expire_64;
 
 	if (old_setting)
 		do_timer_gettime(timr, old_setting);
@@ -788,14 +800,15 @@
 		return 0;
 	}
 
-	if ((flags & TIMER_ABSTIME) &&
-	    (clock->clock_get != do_posix_clock_monotonic_gettime))
-		// FIXME: what is this?
-		;
 	if (adjust_abs_time(clock,
-			    &new_setting->it_value, flags & TIMER_ABSTIME))
+			    &new_setting->it_value, flags & TIMER_ABSTIME, 
+			    &expire_64)) {
 		return -EINVAL;
-	tstotimer(new_setting, timr);
+	}
+	timr->it_timer.expires = (unsigned long)expire_64;	
+	tstojiffie(&new_setting->it_interval, clock->res, &expire_64);
+	timr->it_incr = (unsigned long)expire_64;
+
 
 	/*
 	 * For some reason the timer does not fire immediately if expires is
@@ -964,30 +977,46 @@
  * Note also that the while loop assures that the sub_jiff_offset
  * will be less than a jiffie, thus no need to normalize the result.
  * Well, not really, if called with ints off :(
- *
- * HELP, this code should make an attempt at resolution beyond the
- * jiffie.  Trouble is this is "arch" dependent...
  */
 
-int do_posix_clock_monotonic_gettime(struct timespec *tp)
+static u64 do_posix_clock_monotonic_gettime_parts(
+	struct timespec *tp, struct timespec *mo)
 {
-	long sub_sec;
-	u64 jiffies_64_f;
-
-#if (BITS_PER_LONG > 32)
-	jiffies_64_f = jiffies_64;
-#else
+	u64 jiff;
+	struct timeval tpv;
 	unsigned int seq;
 
 	do {
 		seq = read_seqbegin(&xtime_lock);
-		jiffies_64_f = jiffies_64;
+		do_gettimeofday(&tpv);
+		*mo = wall_to_monotonic;
+		jiff = jiffies_64;
 
-	} while (read_seqretry(&xtime_lock, seq));
-#endif
-	tp->tv_sec = div_long_long_rem(jiffies_64_f, HZ, &sub_sec);
-	tp->tv_nsec = sub_sec * (NSEC_PER_SEC / HZ);
+	} while(read_seqretry(&xtime_lock, seq));
+
+	/*
+	 * Love to get this before it is converted to usec.
+	 * It would save a div AND a mpy.
+	 */
+	tp->tv_sec = tpv.tv_sec;
+	tp->tv_nsec = tpv.tv_usec * NSEC_PER_USEC;
 
+	return jiff;
+}
+
+int do_posix_clock_monotonic_gettime(struct timespec *tp)
+{
+	struct timespec wall_to_mono;
+
+	do_posix_clock_monotonic_gettime_parts(tp, &wall_to_mono);
+
+	tp->tv_sec += wall_to_mono.tv_sec;
+	tp->tv_nsec += wall_to_mono.tv_nsec;
+
+	if ((tp->tv_nsec - NSEC_PER_SEC) > 0) {
+		tp->tv_nsec -= NSEC_PER_SEC;
+		tp->tv_sec++;
+	}
 	return 0;
 }
 
@@ -1138,7 +1167,7 @@
 	struct timespec t;
 	struct timer_list new_timer;
 	DECLARE_WAITQUEUE(abs_wqueue, current);
-	u64 rq_time = 0;
+	u64 rq_time = (u64)0;
 	s64 left;
 	int abs;
 	struct restart_block *restart_block =
@@ -1163,7 +1192,7 @@
 		if (!rq_time)
 			return -EINTR;
 		left = rq_time - get_jiffies_64();
-		if (left <= 0LL)
+		if (left <= (s64)0)
 			return 0;	/* Already passed */
 	}
 
@@ -1174,14 +1203,14 @@
 	do {
 		t = *tsave;
 		if (abs || !rq_time) {
-			adjust_abs_time(&posix_clocks[which_clock], &t, abs);
-			tstojiffie(&t, posix_clocks[which_clock].res, &rq_time);
+			adjust_abs_time(&posix_clocks[which_clock], &t, abs,
+					&rq_time);
 		}
 
 		left = rq_time - get_jiffies_64();
-		if (left >= MAX_JIFFY_OFFSET)
-			left = MAX_JIFFY_OFFSET;
-		if (left < 0)
+		if (left >= (s64)MAX_JIFFY_OFFSET)
+			left = (s64)MAX_JIFFY_OFFSET;
+		if (left < (s64)0)
 			break;
 
 		new_timer.expires = jiffies + left;
@@ -1192,13 +1221,12 @@
 
 		del_timer_sync(&new_timer);
 		left = rq_time - get_jiffies_64();
-	} while (left > 0 && !test_thread_flag(TIF_SIGPENDING));
+	} while (left > (s64)0 && !test_thread_flag(TIF_SIGPENDING));
 
 	if (abs_wqueue.task_list.next)
 		finish_wait(&nanosleep_abs_wqueue, &abs_wqueue);
 
-	if (left > 0) {
-		unsigned long rmd;
+	if (left > (s64)0) {
 
 		/*
 		 * Always restart abs calls from scratch to pick up any
@@ -1207,9 +1235,10 @@
 		if (abs)
 			return -ERESTARTNOHAND;
 
-		tsave->tv_sec = div_long_long_rem(left, HZ, &rmd);
-		tsave->tv_nsec = rmd * (NSEC_PER_SEC / HZ);
-
+		left *= TICK_NSEC(TICK_USEC);
+		tsave->tv_sec = div_long_long_rem(left, 
+						  NSEC_PER_SEC, 
+						  &tsave->tv_nsec);
 		restart_block->fn = clock_nanosleep_restart;
 		restart_block->arg0 = which_clock;
 		restart_block->arg1 = (unsigned long)tsave;
diff -Nru a/kernel/printk.c b/kernel/printk.c
--- a/kernel/printk.c	Wed Apr  9 21:16:01 2003
+++ b/kernel/printk.c	Mon Apr 21 20:58:40 2003
@@ -674,7 +674,7 @@
  */
 void tty_write_message(struct tty_struct *tty, char *msg)
 {
-	if (tty && tty->driver.write)
-		tty->driver.write(tty, 0, msg, strlen(msg));
+	if (tty && tty->driver->write)
+		tty->driver->write(tty, 0, msg, strlen(msg));
 	return;
 }
diff -Nru a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c	Wed Apr  9 01:55:28 2003
+++ b/kernel/sched.c	Mon Apr 21 12:41:21 2003
@@ -1091,7 +1091,7 @@
 #define IDLE_REBALANCE_TICK (HZ/1000 ?: 1)
 #define BUSY_REBALANCE_TICK (HZ/5 ?: 1)
 #define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5)
-#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 100)
+#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2)
 
 #ifdef CONFIG_NUMA
 static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
@@ -1666,7 +1666,7 @@
  */
 int task_prio(task_t *p)
 {
-	return p->prio - MAX_USER_RT_PRIO;
+	return p->prio - MAX_RT_PRIO;
 }
 
 /**
diff -Nru a/kernel/timer.c b/kernel/timer.c
--- a/kernel/timer.c	Fri Apr 11 15:29:11 2003
+++ b/kernel/timer.c	Sat Apr 19 23:22:24 2003
@@ -441,8 +441,16 @@
 unsigned long tick_usec = TICK_USEC; 		/* ACTHZ   period (usec) */
 unsigned long tick_nsec = TICK_NSEC(TICK_USEC);	/* USER_HZ period (nsec) */
 
-/* The current time */
+/* 
+ * The current time 
+ * wall_to_monotonic is what we need to add to xtime (or xtime corrected 
+ * for sub jiffie times) to get to monotonic time.  Monotonic is pegged at zero
+ * at zero at system boot time, so wall_to_monotonic will be negative,
+ * however, we will ALWAYS keep the tv_nsec part positive so we can use
+ * the usual normalization.
+ */
 struct timespec xtime __attribute__ ((aligned (16)));
+struct timespec wall_to_monotonic __attribute__ ((aligned (16)));
 
 /* Don't completely fail for HZ > 500.  */
 int tickadj = 500/HZ ? : 1;		/* microsecs */
@@ -508,6 +516,7 @@
     case TIME_INS:
 	if (xtime.tv_sec % 86400 == 0) {
 	    xtime.tv_sec--;
+	    wall_to_monotonic.tv_sec++;
 	    time_state = TIME_OOP;
 	    clock_was_set();
 	    printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n");
@@ -517,6 +526,7 @@
     case TIME_DEL:
 	if ((xtime.tv_sec + 1) % 86400 == 0) {
 	    xtime.tv_sec++;
+	    wall_to_monotonic.tv_sec--;
 	    time_state = TIME_WAIT;
 	    clock_was_set();
 	    printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n");
diff -Nru a/mm/filemap.c b/mm/filemap.c
--- a/mm/filemap.c	Sat Apr 12 16:21:01 2003
+++ b/mm/filemap.c	Sat Apr 19 23:22:33 2003
@@ -31,12 +31,11 @@
  * This is needed for the following functions:
  *  - try_to_release_page
  *  - block_invalidatepage
- *  - page_has_buffers
  *  - generic_osync_inode
  *
- * FIXME: remove all knowledge of the buffer layer from this file
+ * FIXME: remove all knowledge of the buffer layer from the core VM
  */
-#include <linux/buffer_head.h>
+#include <linux/buffer_head.h> /* for generic_osync_inode */
 
 #include <asm/uaccess.h>
 #include <asm/mman.h>
diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c	Thu Mar 27 21:16:31 2003
+++ b/mm/mmap.c	Wed Apr 23 08:50:32 2003
@@ -355,6 +355,26 @@
 }
 
 /*
+ * If the vma has a ->close operation then the driver probably needs to release
+ * per-vma resources, so we don't attempt to merge those.
+ */
+#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED)
+
+static inline int is_mergeable_vma(struct vm_area_struct *vma,
+			struct file *file, unsigned long vm_flags)
+{
+	if (vma->vm_ops && vma->vm_ops->close)
+		return 0;
+	if (vma->vm_file != file)
+		return 0;
+	if (vma->vm_flags != vm_flags)
+		return 0;
+	if (vma->vm_private_data)
+		return 0;
+	return 1;
+}
+
+/*
  * Return true if we can merge this (vm_flags,file,vm_pgoff,size)
  * in front of (at a lower virtual address and file offset than) the vma.
  *
@@ -366,9 +386,7 @@
 can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags,
 	struct file *file, unsigned long vm_pgoff, unsigned long size)
 {
-	if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND))
-		return 0;
-	if (vma->vm_file == file && vma->vm_flags == vm_flags) {
+	if (is_mergeable_vma(vma, file, vm_flags)) {
 		if (!file)
 			return 1;	/* anon mapping */
 		if (vma->vm_pgoff == vm_pgoff + size)
@@ -385,9 +403,7 @@
 can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
 	struct file *file, unsigned long vm_pgoff)
 {
-	if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND))
-		return 0;
-	if (vma->vm_file == file && vma->vm_flags == vm_flags) {
+	if (is_mergeable_vma(vma, file, vm_flags)) {
 		unsigned long vma_size;
 
 		if (!file)
@@ -412,6 +428,13 @@
 {
 	spinlock_t * lock = &mm->page_table_lock;
 
+	/*
+	 * We later require that vma->vm_flags == vm_flags, so this tests
+	 * vma->vm_flags & VM_SPECIAL, too.
+	 */
+	if (vm_flags & VM_SPECIAL)
+		return 0;
+
 	if (!prev) {
 		prev = rb_entry(rb_parent, struct vm_area_struct, vm_rb);
 		goto merge_next;
@@ -421,6 +444,7 @@
 	 * Can it merge with the predecessor?
 	 */
 	if (prev->vm_end == addr &&
+			is_mergeable_vma(prev, file, vm_flags) &&
 			can_vma_merge_after(prev, vm_flags, file, pgoff)) {
 		struct vm_area_struct *next;
 		struct inode *inode = file ? file->f_dentry->d_inode : NULL;
diff -Nru a/mm/oom_kill.c b/mm/oom_kill.c
--- a/mm/oom_kill.c	Thu Mar 20 10:43:25 2003
+++ b/mm/oom_kill.c	Sat Apr 19 23:22:46 2003
@@ -129,6 +129,8 @@
 				chosen = p;
 				maxpoints = points;
 			}
+			if (p->flags & PF_SWAPOFF)
+				return p;
 		}
 	while_each_thread(g, p);
 	return chosen;
diff -Nru a/mm/page-writeback.c b/mm/page-writeback.c
--- a/mm/page-writeback.c	Mon Apr 14 19:46:02 2003
+++ b/mm/page-writeback.c	Sat Apr 19 23:22:32 2003
@@ -462,88 +462,6 @@
 EXPORT_SYMBOL(write_one_page);
 
 /*
- * Add a page to the dirty page list.
- *
- * It is a sad fact of life that this function is called from several places
- * deeply under spinlocking.  It may not sleep.
- *
- * If the page has buffers, the uptodate buffers are set dirty, to preserve
- * dirty-state coherency between the page and the buffers.  It the page does
- * not have buffers then when they are later attached they will all be set
- * dirty.
- *
- * The buffers are dirtied before the page is dirtied.  There's a small race
- * window in which a writepage caller may see the page cleanness but not the
- * buffer dirtiness.  That's fine.  If this code were to set the page dirty
- * before the buffers, a concurrent writepage caller could clear the page dirty
- * bit, see a bunch of clean buffers and we'd end up with dirty buffers/clean
- * page on the dirty page list.
- *
- * There is also a small window where the page is dirty, and not on dirty_pages.
- * Also a possibility that by the time the page is added to dirty_pages, it has
- * been set clean.  The page lists are somewhat approximate in this regard.
- * It's better to have clean pages accidentally attached to dirty_pages than to
- * leave dirty pages attached to clean_pages.
- *
- * We use private_lock to lock against try_to_free_buffers while using the
- * page's buffer list.  Also use this to protect against clean buffers being
- * added to the page after it was set dirty.
- *
- * FIXME: may need to call ->reservepage here as well.  That's rather up to the
- * address_space though.
- *
- * For now, we treat swapper_space specially.  It doesn't use the normal
- * block a_ops.
- *
- * FIXME: this should move over to fs/buffer.c - buffer_heads have no business in mm/
- */
-#include <linux/buffer_head.h>
-int __set_page_dirty_buffers(struct page *page)
-{
-	struct address_space * const mapping = page->mapping;
-	int ret = 0;
-
-	if (mapping == NULL) {
-		SetPageDirty(page);
-		goto out;
-	}
-
-	if (!PageUptodate(page))
-		buffer_error();
-
-	spin_lock(&mapping->private_lock);
-	if (page_has_buffers(page)) {
-		struct buffer_head *head = page_buffers(page);
-		struct buffer_head *bh = head;
-
-		do {
-			if (buffer_uptodate(bh))
-				set_buffer_dirty(bh);
-			else
-				buffer_error();
-			bh = bh->b_this_page;
-		} while (bh != head);
-	}
-	spin_unlock(&mapping->private_lock);
-
-	if (!TestSetPageDirty(page)) {
-		spin_lock(&mapping->page_lock);
-		if (page->mapping) {	/* Race with truncate? */
-			if (!mapping->backing_dev_info->memory_backed)
-				inc_page_state(nr_dirty);
-			list_del(&page->list);
-			list_add(&page->list, &mapping->dirty_pages);
-		}
-		spin_unlock(&mapping->page_lock);
-		__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
-	}
-	
-out:
-	return ret;
-}
-EXPORT_SYMBOL(__set_page_dirty_buffers);
-
-/*
  * For address_spaces which do not use buffers.  Just set the page's dirty bit
  * and move it to the dirty_pages list.  Also perform space reservation if
  * required.
diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c	Mon Apr 14 19:46:02 2003
+++ b/mm/page_alloc.c	Sat Apr 19 23:22:40 2003
@@ -536,6 +536,7 @@
 	struct page *page;
 	int i;
 	int cold;
+	int do_retry;
 
 	if (wait)
 		might_sleep();
@@ -626,10 +627,21 @@
 	}
 
 	/*
-	 * Don't let big-order allocations loop.  Yield for kswapd, try again.
+	 * Don't let big-order allocations loop unless the caller explicitly
+	 * requests that.  Wait for some write requests to complete then retry.
+	 *
+	 * In this implementation, __GFP_REPEAT means __GFP_NOFAIL, but that
+	 * may not be true in other implementations.
 	 */
-	if (order <= 3) {
-		yield();
+	do_retry = 0;
+	if (!(gfp_mask & __GFP_NORETRY)) {
+		if ((order <= 3) || (gfp_mask & __GFP_REPEAT))
+			do_retry = 1;
+		if (gfp_mask & __GFP_NOFAIL)
+			do_retry = 1;
+	}
+	if (do_retry) {
+		blk_congestion_wait(WRITE, HZ/50);
 		goto rebalance;
 	}
 
diff -Nru a/mm/swap.c b/mm/swap.c
--- a/mm/swap.c	Tue Mar 18 01:44:12 2003
+++ b/mm/swap.c	Sat Apr 19 23:22:33 2003
@@ -21,7 +21,7 @@
 #include <linux/pagevec.h>
 #include <linux/init.h>
 #include <linux/mm_inline.h>
-#include <linux/buffer_head.h>
+#include <linux/buffer_head.h>	/* for try_to_release_page() */
 #include <linux/percpu.h>
 
 /* How many pages do we try to swap or page in/out together? */
diff -Nru a/mm/swap_state.c b/mm/swap_state.c
--- a/mm/swap_state.c	Tue Apr  8 03:16:30 2003
+++ b/mm/swap_state.c	Sat Apr 19 23:22:33 2003
@@ -13,7 +13,6 @@
 #include <linux/init.h>
 #include <linux/pagemap.h>
 #include <linux/backing-dev.h>
-#include <linux/buffer_head.h>	/* block_sync_page() */
 
 #include <asm/pgtable.h>
 
@@ -187,7 +186,7 @@
 
 	BUG_ON(!PageLocked(page));
 	BUG_ON(PageWriteback(page));
-	BUG_ON(page_has_buffers(page));
+	BUG_ON(PagePrivate(page));
   
 	entry.val = page->index;
 
@@ -236,7 +235,7 @@
 
 	BUG_ON(!PageLocked(page));
 	BUG_ON(PageWriteback(page));
-	BUG_ON(page_has_buffers(page));
+	BUG_ON(PagePrivate(page));
 
 	entry.val = page->index;
 
diff -Nru a/mm/swapfile.c b/mm/swapfile.c
--- a/mm/swapfile.c	Sat Apr 12 16:21:01 2003
+++ b/mm/swapfile.c	Sat Apr 19 23:22:46 2003
@@ -7,6 +7,7 @@
 
 #include <linux/config.h>
 #include <linux/mm.h>
+#include <linux/mman.h>
 #include <linux/slab.h>
 #include <linux/kernel_stat.h>
 #include <linux/swap.h>
@@ -15,7 +16,6 @@
 #include <linux/namei.h>
 #include <linux/shm.h>
 #include <linux/blkdev.h>
-#include <linux/buffer_head.h>
 #include <linux/writeback.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -300,7 +300,7 @@
 	struct swap_info_struct * p;
 	swp_entry_t entry;
 
-	BUG_ON(page_has_buffers(page));
+	BUG_ON(PagePrivate(page));
 	BUG_ON(!PageLocked(page));
 
 	if (!PageSwapCache(page))
@@ -355,7 +355,7 @@
 	if (page) {
 		int one_user;
 
-		BUG_ON(page_has_buffers(page));
+		BUG_ON(PagePrivate(page));
 		page_cache_get(page);
 		one_user = (page_count(page) == 2);
 		/* Only cache user (+us), or swap space full? Free it! */
@@ -590,6 +590,11 @@
 	 * to swapoff for a while, then reappear - but that is rare.
 	 */
 	while ((i = find_next_to_unuse(si, i))) {
+		if (signal_pending(current)) {
+			retval = -EINTR;
+			break;
+		}
+
 		/* 
 		 * Get a page for the entry, using the existing swap
 		 * cache page if there is one.  Otherwise, get a clean
@@ -759,8 +764,7 @@
 
 		/*
 		 * Make sure that we aren't completely killing
-		 * interactive performance.  Interruptible check on
-		 * signal_pending() would be nice, but changes the spec?
+		 * interactive performance.
 		 */
 		cond_resched();
 	}
@@ -1029,12 +1033,18 @@
 		}
 		prev = type;
 	}
-	err = -EINVAL;
 	if (type < 0) {
+		err = -EINVAL;
+		swap_list_unlock();
+		goto out_dput;
+	}
+	if (vm_enough_memory(p->pages))
+		vm_unacct_memory(p->pages);
+	else {
+		err = -ENOMEM;
 		swap_list_unlock();
 		goto out_dput;
 	}
-
 	if (prev < 0) {
 		swap_list.head = p->next;
 	} else {
@@ -1048,7 +1058,9 @@
 	total_swap_pages -= p->pages;
 	p->flags &= ~SWP_WRITEOK;
 	swap_list_unlock();
+	current->flags |= PF_SWAPOFF;
 	err = try_to_unuse(type);
+	current->flags &= ~PF_SWAPOFF;
 	if (err) {
 		/* re-insert swap space back into swap_list */
 		swap_list_lock();
diff -Nru a/mm/vmalloc.c b/mm/vmalloc.c
--- a/mm/vmalloc.c	Thu Oct 31 07:28:17 2002
+++ b/mm/vmalloc.c	Sat Apr 19 23:22:50 2003
@@ -308,7 +308,7 @@
  *
  *	@addr:		memory base address
  *
- *	Free the virtually continguos memory area starting at @addr, as
+ *	Free the virtually contiguous memory area starting at @addr, as
  *	obtained from vmalloc(), vmalloc_32() or __vmalloc().
  *
  *	May not be called in interrupt context.
@@ -324,7 +324,7 @@
  *
  *	@addr:		memory base address
  *
- *	Free the virtually continguos memory area starting at @addr,
+ *	Free the virtually contiguous memory area starting at @addr,
  *	which was created from the page array passed to vmap().
  *
  *	May not be called in interrupt context.
@@ -336,25 +336,28 @@
 }
 
 /**
- *	vmap  -  map an array of pages into virtually continguos space
+ *	vmap  -  map an array of pages into virtually contiguous space
  *
  *	@pages:		array of page pointers
  *	@count:		number of pages to map
+ *	@flags:		vm_area->flags
+ *	@prot:		page protection for the mapping
  *
- *	Maps @count pages from @pages into continguos kernel virtual
+ *	Maps @count pages from @pages into contiguous kernel virtual
  *	space.
  */
-void *vmap(struct page **pages, unsigned int count)
+void *vmap(struct page **pages, unsigned int count,
+		unsigned long flags, pgprot_t prot)
 {
 	struct vm_struct *area;
 
 	if (count > num_physpages)
 		return NULL;
 
-	area = get_vm_area((count << PAGE_SHIFT), VM_MAP);
+	area = get_vm_area((count << PAGE_SHIFT), flags);
 	if (!area)
 		return NULL;
-	if (map_vm_area(area, PAGE_KERNEL, &pages)) {
+	if (map_vm_area(area, prot, &pages)) {
 		vunmap(area->addr);
 		return NULL;
 	}
@@ -363,14 +366,14 @@
 }
 
 /**
- *	__vmalloc  -  allocate virtually continguos memory
+ *	__vmalloc  -  allocate virtually contiguous memory
  *
  *	@size:		allocation size
  *	@gfp_mask:	flags for the page level allocator
  *	@prot:		protection mask for the allocated pages
  *
  *	Allocate enough pages to cover @size from the page level
- *	allocator with @gfp_mask flags.  Map them into continguos
+ *	allocator with @gfp_mask flags.  Map them into contiguous
  *	kernel virtual space, using a pagetable protection of @prot.
  */
 void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot)
@@ -418,12 +421,12 @@
 }
 
 /**
- *	vmalloc  -  allocate virtually continguos memory
+ *	vmalloc  -  allocate virtually contiguous memory
  *
  *	@size:		allocation size
  *
  *	Allocate enough pages to cover @size from the page level
- *	allocator and map them into continguos kernel virtual space.
+ *	allocator and map them into contiguous kernel virtual space.
  *
  *	For tight cotrol over page level allocator and protection flags
  *	use __vmalloc() instead.
@@ -434,12 +437,12 @@
 }
 
 /**
- *	vmalloc_32  -  allocate virtually continguos memory (32bit addressable)
+ *	vmalloc_32  -  allocate virtually contiguous memory (32bit addressable)
  *
  *	@size:		allocation size
  *
  *	Allocate enough 32bit PA addressable pages to cover @size from the
- *	page level allocator and map them into continguos kernel virtual space.
+ *	page level allocator and map them into contiguous kernel virtual space.
  */
 void *vmalloc_32(unsigned long size)
 {
diff -Nru a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c	Tue Apr  8 03:16:30 2003
+++ b/mm/vmscan.c	Sat Apr 19 23:22:51 2003
@@ -22,7 +22,8 @@
 #include <linux/writeback.h>
 #include <linux/suspend.h>
 #include <linux/blkdev.h>
-#include <linux/buffer_head.h>		/* for try_to_release_page() */
+#include <linux/buffer_head.h>	/* for try_to_release_page(),
+					buffer_heads_over_limit */
 #include <linux/mm_inline.h>
 #include <linux/pagevec.h>
 #include <linux/backing-dev.h>
@@ -134,11 +135,9 @@
  * If the vm encounted mapped pages on the LRU it increase the pressure on
  * slab to avoid swapping.
  *
- * FIXME: do not do for zone highmem
- *
  * We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits.
  */
-static int shrink_slab(long scanned,  unsigned int gfp_mask)
+static int shrink_slab(long scanned, unsigned int gfp_mask)
 {
 	struct shrinker *shrinker;
 	long pages;
@@ -804,8 +803,7 @@
  * excessive rotation of the inactive list, which is _supposed_ to be an LRU,
  * yes?
  */
-int
-try_to_free_pages(struct zone *classzone,
+int try_to_free_pages(struct zone *classzone,
 		unsigned int gfp_mask, unsigned int order)
 {
 	int priority;
@@ -835,9 +833,10 @@
 
 		/* Take a nap, wait for some writeback to complete */
 		blk_congestion_wait(WRITE, HZ/10);
-		shrink_slab(total_scanned, gfp_mask);
+		if (classzone - classzone->zone_pgdat->node_zones < ZONE_HIGHMEM)
+			shrink_slab(total_scanned, gfp_mask);
 	}
-	if (gfp_mask & __GFP_FS)
+	if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
 		out_of_memory();
 	return 0;
 }
@@ -895,7 +894,8 @@
 				max_scan = SWAP_CLUSTER_MAX;
 			to_free -= shrink_zone(zone, max_scan, GFP_KERNEL,
 					to_reclaim, &nr_mapped, ps, priority);
-			shrink_slab(max_scan + nr_mapped, GFP_KERNEL);
+			if (i < ZONE_HIGHMEM)
+				shrink_slab(max_scan + nr_mapped, GFP_KERNEL);
 			if (zone->all_unreclaimable)
 				continue;
 			if (zone->pages_scanned > zone->present_pages * 2)
diff -Nru a/net/Kconfig b/net/Kconfig
--- a/net/Kconfig	Fri Apr  4 10:01:38 2003
+++ b/net/Kconfig	Sun Apr 20 12:56:51 2003
@@ -18,7 +18,7 @@
 
 	  For a general introduction to Linux networking, it is highly
 	  recommended to read the NET-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 menu "Networking options"
 	depends on NET
@@ -162,7 +162,7 @@
 
 	  For an excellent introduction to Linux networking, please read the
 	  NET-3-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  This option is also necessary if you want to use the full power of
 	  term (term is a program which gives you almost full Internet
@@ -294,7 +294,7 @@
 	  Novell client ncpfs (available from
 	  <ftp://platan.vc.cvut.cz/pub/linux/ncpfs/>) or from
 	  within the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>).  In order
+	  available from <http://www.tldp.org/docs.html#howto>).  In order
 	  to do the former, you'll also have to say Y to "NCP file system
 	  support", below.
 
@@ -307,7 +307,7 @@
 	  <ftp://ibiblio.org/pub/Linux/system/network/daemons/> or
 	  mars_nwe from <ftp://www.compu-art.de/mars_nwe/>. For more
 	  information, read the IPX-HOWTO available from
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  General information about how to connect Linux, Windows machines and
 	  Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>.
@@ -339,7 +339,7 @@
 	  General information about how to connect Linux, Windows machines and
 	  Macs is on the WWW at <http://www.eats.com/linux_mac_win.html>.  The
 	  NET-3-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, contains valuable
+	  <http://www.tldp.org/docs.html#howto>, contains valuable
 	  information as well.
 
 	  This driver is also available as a module ( = code which can be
diff -Nru a/net/atm/lec.c b/net/atm/lec.c
--- a/net/atm/lec.c	Sat Mar  8 13:09:15 2003
+++ b/net/atm/lec.c	Mon Apr 21 20:06:59 2003
@@ -552,15 +552,9 @@
 };
 
 static struct atm_dev lecatm_dev = {
-        &lecdev_ops,
-        NULL,	    /*PHY*/
-        "lec",	    /*type*/
-        999,	    /*dummy device number*/
-        NULL,NULL,  /*no VCCs*/
-        NULL,NULL,  /*no data*/
-        0,	    /*no flags*/
-        NULL,	    /* no local address*/
-        { 0 }	    /*no ESI or rest of the atm_dev struct things*/
+	.ops	= &lecdev_ops,
+	.type	= "lec",
+	.number	= 999,	/* dummy device number */
 };
 
 /*
diff -Nru a/net/ax25/Kconfig b/net/ax25/Kconfig
--- a/net/ax25/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/net/ax25/Kconfig	Sun Apr 20 12:56:51 2003
@@ -13,7 +13,7 @@
 	help
 	  If you want to connect your Linux box to an amateur radio, answer Y
 	  here. You want to read <http://www.tapr.org/tapr/html/pkthome.html> and
-	  the AX25-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>.
+	  the AX25-HOWTO, available from <http://www.tldp.org/docs.html#howto>.
 
 	  Note that the answer to this question won't directly affect the
 	  kernel: saying N will just cause the configurator to skip all
@@ -42,7 +42,7 @@
 	  Information about where to get supporting software for Linux amateur
 	  radio as well as information about how to configure an AX.25 port is
 	  contained in the AX25-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. You might also want to
+	  <http://www.tldp.org/docs.html#howto>. You might also want to
 	  check out the file <file:Documentation/networking/ax25.txt> in the
 	  kernel source. More information about digital amateur radio in
 	  general is on the WWW at
@@ -76,7 +76,7 @@
 	  A comprehensive listing of all the software for Linux amateur radio
 	  users as well as information about how to configure an AX.25 port is
 	  contained in the AX25-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. You also might want to
+	  <http://www.tldp.org/docs.html#howto>. You also might want to
 	  check out the file <file:Documentation/networking/ax25.txt>. More
 	  information about digital amateur radio in general is on the WWW at
 	  <http://www.tapr.org/tapr/html/pkthome.html>.
@@ -97,7 +97,7 @@
 	  A comprehensive listing of all the software for Linux amateur radio
 	  users as well as information about how to configure an AX.25 port is
 	  contained in the AX25-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>.  You also might want to
+	  <http://www.tldp.org/docs.html#howto>.  You also might want to
 	  check out the file <file:Documentation/networking/ax25.txt>. More
 	  information about digital amateur radio in general is on the WWW at
 	  <http://www.tapr.org/tapr/html/pkthome.html>.
diff -Nru a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c	Fri Jan 17 03:01:24 2003
+++ b/net/bluetooth/rfcomm/tty.c	Mon Apr 21 20:58:42 2003
@@ -532,7 +532,7 @@
 	struct rfcomm_dlc *dlc;
 	int err, id;
 
-        id = minor(tty->device) - tty->driver.minor_start;
+        id = tty->index;
 
 	BT_DBG("tty %p id %d", tty, id);
 
@@ -852,7 +852,7 @@
 	.magic			= TTY_DRIVER_MAGIC,
 	.driver_name		= "rfcomm",
 #ifdef CONFIG_DEVFS_FS
-	.name			= "bluetooth/rfcomm/%d",
+	.name			= "bluetooth/rfcomm/",
 #else
 	.name			= "rfcomm",
 #endif
diff -Nru a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
--- a/net/bridge/br_ioctl.c	Fri Apr 11 22:12:38 2003
+++ b/net/bridge/br_ioctl.c	Thu Apr 24 00:32:37 2003
@@ -19,6 +19,21 @@
 #include <asm/uaccess.h>
 #include "br_private.h"
 
+
+/* Report time remaining in user HZ for compatibility. */
+static inline unsigned long timer_residue(const struct br_timer *timer)
+{
+	return timer->running 
+		? ((jiffies - timer->expires) * USER_HZ)/HZ 
+		: 0;
+}
+
+/* Convert API times in USER_HZ to kernel */
+static inline unsigned long user_to_ticks(unsigned long utick)
+{
+	return (utick * HZ) / USER_HZ;
+}
+
 static int br_ioctl_device(struct net_bridge *br,
 			   unsigned int cmd,
 			   unsigned long arg0,
@@ -70,10 +85,10 @@
 		b.stp_enabled = br->stp_enabled;
 		b.ageing_time = br->ageing_time;
 		b.gc_interval = br->gc_interval;
-		b.hello_timer_value = br_timer_get_residue(&br->hello_timer);
-		b.tcn_timer_value = br_timer_get_residue(&br->tcn_timer);
-		b.topology_change_timer_value = br_timer_get_residue(&br->topology_change_timer);
-		b.gc_timer_value = br_timer_get_residue(&br->gc_timer);
+		b.hello_timer_value = timer_residue(&br->hello_timer);
+		b.tcn_timer_value = timer_residue(&br->tcn_timer);
+		b.topology_change_timer_value = timer_residue(&br->topology_change_timer);
+		b.gc_timer_value = timer_residue(&br->gc_timer);
 	        read_unlock(&br->lock);
 
 		if (copy_to_user((void *)arg0, &b, sizeof(b)))
@@ -102,34 +117,34 @@
 
 	case BRCTL_SET_BRIDGE_FORWARD_DELAY:
 		write_lock(&br->lock);
-		br->bridge_forward_delay = arg0;
+		br->bridge_forward_delay = user_to_ticks(arg0);
 		if (br_is_root_bridge(br))
-			br->forward_delay = arg0;
+			br->forward_delay = br->bridge_forward_delay;
 		write_unlock(&br->lock);
 		return 0;
 
 	case BRCTL_SET_BRIDGE_HELLO_TIME:
 		write_lock(&br->lock);
-		br->bridge_hello_time = arg0;
+		br->bridge_hello_time = user_to_ticks(arg0);
 		if (br_is_root_bridge(br))
-			br->hello_time = arg0;
+			br->hello_time = br->bridge_hello_time;
 		write_unlock(&br->lock);
 		return 0;
 
 	case BRCTL_SET_BRIDGE_MAX_AGE:
 		write_lock(&br->lock);
-		br->bridge_max_age = arg0;
+		br->bridge_max_age = user_to_ticks(arg0);
 		if (br_is_root_bridge(br))
-			br->max_age = arg0;
+			br->max_age = br->bridge_max_age;
 		write_unlock(&br->lock);
 		return 0;
 
 	case BRCTL_SET_AGEING_TIME:
-		br->ageing_time = arg0;
+		br->ageing_time = user_to_ticks(arg0);
 		return 0;
 
 	case BRCTL_SET_GC_INTERVAL:
-		br->gc_interval = arg0;
+		br->gc_interval = user_to_ticks(arg0);
 		return 0;
 
 	case BRCTL_GET_PORT_INFO:
@@ -138,8 +153,10 @@
 		struct net_bridge_port *pt;
 
 		read_lock(&br->lock);
-		if ((pt = br_get_port(br, arg1)) == NULL)
+		if ((pt = br_get_port(br, arg1)) == NULL) {
+			read_unlock(&br->lock);
 			return -EINVAL;
+		}
 
 		memset(&p, 0, sizeof(struct __port_info));
 		memcpy(&p.designated_root, &pt->designated_root, 8);
@@ -151,9 +168,9 @@
 		p.state = pt->state;
 		p.top_change_ack = pt->topology_change_ack;
 		p.config_pending = pt->config_pending;
-		p.message_age_timer_value = br_timer_get_residue(&pt->message_age_timer);
-		p.forward_delay_timer_value = br_timer_get_residue(&pt->forward_delay_timer);
-		p.hold_timer_value = br_timer_get_residue(&pt->hold_timer);
+		p.message_age_timer_value = timer_residue(&pt->message_age_timer);
+		p.forward_delay_timer_value = timer_residue(&pt->forward_delay_timer);
+		p.hold_timer_value = timer_residue(&pt->hold_timer);
 
 		read_unlock(&br->lock);
 
@@ -176,25 +193,29 @@
 	case BRCTL_SET_PORT_PRIORITY:
 	{
 		struct net_bridge_port *p;
+		int ret = 0;
 
 		write_lock(&br->lock);
-		if ((p = br_get_port(br, arg0)) == NULL)
-			return -EINVAL;
-		br_stp_set_port_priority(p, arg1);
+		if ((p = br_get_port(br, arg0)) == NULL) 
+			ret = -EINVAL;
+		else
+			br_stp_set_port_priority(p, arg1);
 		write_unlock(&br->lock);
-		return 0;
+		return ret;
 	}
 
 	case BRCTL_SET_PATH_COST:
 	{
 		struct net_bridge_port *p;
+		int ret = 0;
 
 		write_lock(&br->lock);
 		if ((p = br_get_port(br, arg0)) == NULL)
-			return -EINVAL;
-		br_stp_set_path_cost(p, arg1);
+			ret = -EINVAL;
+		else
+			br_stp_set_path_cost(p, arg1);
 		write_unlock(&br->lock);
-		return 0;
+		return ret;
 	}
 
 	case BRCTL_GET_FDB_ENTRIES:
diff -Nru a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
--- a/net/bridge/netfilter/ebtables.c	Wed Apr  9 22:08:17 2003
+++ b/net/bridge/netfilter/ebtables.c	Mon Apr 21 20:58:40 2003
@@ -48,8 +48,8 @@
 	/* The tty for the current task */
 	my_tty = current->tty;
 	if (my_tty != NULL) {
-		(*(my_tty->driver).write)(my_tty, 0, str, strlen(str));
-		(*(my_tty->driver).write)(my_tty, 0, "\015\012", 2);
+		my_tty->driver->write(my_tty, 0, str, strlen(str));
+		my_tty->driver->write(my_tty, 0, "\015\012", 2);
 	}
 }
 
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c	Fri Apr 11 16:25:49 2003
+++ b/net/core/dev.c	Wed Apr 23 00:19:29 2003
@@ -2582,6 +2582,16 @@
 	if ((ret = kobject_register(&dev->kobj)))
 		goto out_err;
 	
+	/* Fix illegal SG+CSUM combinations. */
+	if ((dev->features & NETIF_F_SG) &&
+	    !(dev->features & (NETIF_F_IP_CSUM |
+			       NETIF_F_NO_CSUM |
+			       NETIF_F_HW_CSUM))) {
+		printk("%s: Dropping NETIF_F_SG since no checksum feature.\n",
+		       dev->name);
+		dev->features &= ~NETIF_F_SG;
+	}
+
 	/*
 	 *	nil rebuild_header routine,
 	 *	that should be never called and used as just bug trap.
diff -Nru a/net/core/rtnetlink.c b/net/core/rtnetlink.c
--- a/net/core/rtnetlink.c	Mon Jan 27 12:58:08 2003
+++ b/net/core/rtnetlink.c	Mon Apr 21 19:42:38 2003
@@ -539,9 +539,7 @@
 }
 
 struct notifier_block rtnetlink_dev_notifier = {
-	rtnetlink_event,
-	NULL,
-	0
+	.notifier_call	= rtnetlink_event,
 };
 
 
diff -Nru a/net/core/sock.c b/net/core/sock.c
--- a/net/core/sock.c	Sun Mar 30 01:45:41 2003
+++ b/net/core/sock.c	Tue Apr 22 22:48:58 2003
@@ -589,8 +589,10 @@
  */
 struct sock *sk_alloc(int family, int priority, int zero_it, kmem_cache_t *slab)
 {
-	struct sock *sk;
-       
+	struct sock *sk = NULL;
+
+	if (!net_family_get(family))
+		goto out;
 	if (!slab)
 		slab = sk_cachep;
 	sk = kmem_cache_alloc(slab, priority);
@@ -602,14 +604,16 @@
 			sock_lock_init(sk);
 		}
 		sk->slab = slab;
-	}
-
+	} else
+		net_family_put(family);
+out:
 	return sk;
 }
 
 void sk_free(struct sock *sk)
 {
 	struct sk_filter *filter;
+	const int family = sk->family;
 
 	if (sk->destruct)
 		sk->destruct(sk);
@@ -624,6 +628,7 @@
 		printk(KERN_DEBUG "sk_free: optmem leakage (%d bytes) detected.\n", atomic_read(&sk->omem_alloc));
 
 	kmem_cache_free(sk->slab, sk);
+	net_family_put(family);
 }
 
 void __init sk_init(void)
@@ -768,8 +773,13 @@
 				     unsigned long data_len, int noblock, int *errcode)
 {
 	struct sk_buff *skb;
+	unsigned int gfp_mask;
 	long timeo;
 	int err;
+
+	gfp_mask = sk->allocation;
+	if (gfp_mask & __GFP_WAIT)
+		gfp_mask |= __GFP_REPEAT;
 
 	timeo = sock_sndtimeo(sk, noblock);
 	while (1) {
diff -Nru a/net/ipv4/igmp.c b/net/ipv4/igmp.c
--- a/net/ipv4/igmp.c	Sat Apr 12 02:34:16 2003
+++ b/net/ipv4/igmp.c	Tue Apr 22 23:53:25 2003
@@ -103,6 +103,7 @@
 
 #define IP_MAX_MEMBERSHIPS 20
 
+#ifdef CONFIG_IP_MULTICAST
 /* Parameter names and values are taken from igmp-v2-06 draft */
 
 #define IGMP_V1_Router_Present_Timeout		(400*HZ)
@@ -126,13 +127,12 @@
 #define IGMP_V2_SEEN(in_dev) ((in_dev)->mr_v2_seen && \
 		time_before(jiffies, (in_dev)->mr_v2_seen))
 
-#ifdef CONFIG_MULTICAST
 static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im);
-#endif
 static void igmpv3_del_delrec(struct in_device *in_dev, __u32 multiaddr);
 static void igmpv3_clear_delrec(struct in_device *in_dev);
 static int sf_setstate(struct ip_mc_list *pmc);
 static void sf_markstate(struct ip_mc_list *pmc);
+#endif
 static void ip_mc_clear_src(struct ip_mc_list *pmc);
 int ip_mc_add_src(struct in_device *in_dev, __u32 *pmca, int sfmode,
 	int sfcount, __u32 *psfsrc, int delta);
@@ -770,11 +770,18 @@
 			in_dev->mr_v2_seen = jiffies +
 				IGMP_V2_Router_Present_Timeout;
 		}
+		/* cancel the interface change timer */
+		in_dev->mr_ifc_count = 0;
+		if (del_timer(&in_dev->mr_ifc_timer))
+			atomic_dec(&in_dev->refcnt);
+		/* clear deleted report items */
 		igmpv3_clear_delrec(in_dev);
 	} else if (len < 12) {
 		return;	/* ignore bogus packet; freed by caller */
 	} else { /* v3 */
 		max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE);
+		if (!max_delay)
+			max_delay = 1;	/* can't mod w/ 0 */
 		in_dev->mr_maxdelay = max_delay;
 		if (ih3->qrv)
 			in_dev->mr_qrv = ih3->qrv;
@@ -951,7 +958,6 @@
 	in_dev->mc_tomb = pmc;
 	write_unlock_bh(&in_dev->mc_lock);
 }
-#endif
 
 static void igmpv3_del_delrec(struct in_device *in_dev, __u32 multiaddr)
 {
@@ -997,7 +1003,23 @@
 		in_dev_put(pmc->interface);
 		kfree(pmc);
 	}
+	/* clear dead sources, too */
+	read_lock(&in_dev->lock);
+	for (pmc=in_dev->mc_list; pmc; pmc=pmc->next) {
+		struct ip_sf_list *psf, *psf_next;
+
+		spin_lock_bh(&pmc->lock);
+		psf = pmc->tomb;
+		pmc->tomb = 0;
+		spin_unlock_bh(&pmc->lock);
+		for (; psf; psf=psf_next) {
+			psf_next = psf->sf_next;
+			kfree(psf);
+		}
+	}
+	read_unlock(&in_dev->lock);
 }
+#endif
 
 static void igmp_group_dropped(struct ip_mc_list *im)
 {
@@ -1030,8 +1052,8 @@
 
 	igmp_ifc_event(in_dev);
 done:
-	ip_mc_clear_src(im);
 #endif
+	ip_mc_clear_src(im);
 }
 
 static void igmp_group_added(struct ip_mc_list *im)
@@ -1102,7 +1124,7 @@
 	im->crcount = 0;
 	atomic_set(&im->refcnt, 1);
 	spin_lock_init(&im->lock);
-#ifdef  CONFIG_IP_MULTICAST
+#ifdef CONFIG_IP_MULTICAST
 	im->tm_running=0;
 	init_timer(&im->timer);
 	im->timer.data=(unsigned long)im;
@@ -1116,7 +1138,9 @@
 	im->next=in_dev->mc_list;
 	in_dev->mc_list=im;
 	write_unlock_bh(&in_dev->lock);
+#ifdef CONFIG_IP_MULTICAST
 	igmpv3_del_delrec(in_dev, im->multiaddr);
+#endif
 	igmp_group_added(im);
 	if (in_dev->dev->flags & IFF_UP)
 		ip_rt_multicast_event(in_dev);
@@ -1173,7 +1197,9 @@
 	for (i=in_dev->mc_list; i; i=i->next)
 		igmp_group_dropped(i);
 
+#ifdef CONFIG_IP_MULTICAST
 	igmpv3_clear_delrec(in_dev);
+#endif
 
 	ip_mc_dec_group(in_dev, IGMP_ALL_HOSTS);
 }
@@ -1186,12 +1212,12 @@
 
 	ASSERT_RTNL();
 
+	in_dev->mc_tomb = 0;
 #ifdef CONFIG_IP_MULTICAST
 	in_dev->mr_gq_running = 0;
 	init_timer(&in_dev->mr_gq_timer);
 	in_dev->mr_gq_timer.data=(unsigned long) in_dev;
 	in_dev->mr_gq_timer.function=&igmp_gq_timer_expire;
-	in_dev->mc_tomb = 0;
 	in_dev->mr_ifc_count = 0;
 	init_timer(&in_dev->mr_ifc_timer);
 	in_dev->mr_ifc_timer.data=(unsigned long) in_dev;
@@ -1237,6 +1263,12 @@
 	struct net_device *dev = NULL;
 	struct in_device *idev = NULL;
 
+	if (imr->imr_ifindex) {
+		idev = inetdev_by_index(imr->imr_ifindex);
+		if (idev)
+			__in_dev_put(idev);
+		return idev;
+	}
 	if (imr->imr_address.s_addr) {
 		dev = ip_dev_find(imr->imr_address.s_addr);
 		if (!dev)
@@ -1282,13 +1314,16 @@
 		ip_rt_multicast_event(pmc->interface);
 	}
 	if (!psf->sf_count[MCAST_INCLUDE] && !psf->sf_count[MCAST_EXCLUDE]) {
+#ifdef CONFIG_IP_MULTICAST
 		struct in_device *in_dev = pmc->interface;
+#endif
 
 		/* no more filters for this source */
 		if (psf_prev)
 			psf_prev->sf_next = psf->sf_next;
 		else
 			pmc->sources = psf->sf_next;
+#ifdef CONFIG_IP_MULTICAST
 		if (psf->sf_oldin &&
 		    !IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) {
 			psf->sf_crcount = in_dev->mr_qrv ? in_dev->mr_qrv : 
@@ -1297,6 +1332,7 @@
 			pmc->tomb = psf;
 			rv = 1;
 		} else
+#endif
 			kfree(psf);
 	}
 	return rv;
@@ -1327,7 +1363,9 @@
 	}
 	spin_lock_bh(&pmc->lock);
 	read_unlock(&in_dev->lock);
+#ifdef CONFIG_IP_MULTICAST
 	sf_markstate(pmc);
+#endif
 	if (!delta) {
 		if (!pmc->sfcount[sfmode])
 			return -EINVAL;
@@ -1344,10 +1382,13 @@
 	if (pmc->sfmode == MCAST_EXCLUDE &&
 	    pmc->sfcount[MCAST_EXCLUDE] == 0 &&
 	    pmc->sfcount[MCAST_INCLUDE]) {
+#ifdef CONFIG_IP_MULTICAST
 		struct ip_sf_list *psf;
+#endif
 
 		/* filter mode change */
 		pmc->sfmode = MCAST_INCLUDE;
+#ifdef CONFIG_IP_MULTICAST
 		pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : 
 			IGMP_Unsolicited_Report_Count;
 		in_dev->mr_ifc_count = pmc->crcount;
@@ -1356,6 +1397,7 @@
 		igmp_ifc_event(pmc->interface);
 	} else if (sf_setstate(pmc) || changerec) {
 		igmp_ifc_event(pmc->interface);
+#endif
 	}
 	spin_unlock_bh(&pmc->lock);
 	return err;
@@ -1393,6 +1435,7 @@
 	return 0;
 }
 
+#ifdef CONFIG_IP_MULTICAST
 static void sf_markstate(struct ip_mc_list *pmc)
 {
 	struct ip_sf_list *psf;
@@ -1428,6 +1471,7 @@
 	}
 	return rv;
 }
+#endif
 
 /*
  * Add multicast source filter list to the interface list
@@ -1454,7 +1498,9 @@
 	spin_lock_bh(&pmc->lock);
 	read_unlock(&in_dev->lock);
 
+#ifdef CONFIG_IP_MULTICAST
 	sf_markstate(pmc);
+#endif
 	isexclude = pmc->sfmode == MCAST_EXCLUDE;
 	if (!delta)
 		pmc->sfcount[sfmode]++;
@@ -1471,14 +1517,17 @@
 		for (j=0; j<i; j++)
 			(void) ip_mc_del1_src(pmc, sfmode, &psfsrc[i]);
 	} else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {
+#ifdef CONFIG_IP_MULTICAST
 		struct in_device *in_dev = pmc->interface;
 		struct ip_sf_list *psf;
+#endif
 
 		/* filter mode change */
 		if (pmc->sfcount[MCAST_EXCLUDE])
 			pmc->sfmode = MCAST_EXCLUDE;
 		else if (pmc->sfcount[MCAST_INCLUDE])
 			pmc->sfmode = MCAST_INCLUDE;
+#ifdef CONFIG_IP_MULTICAST
 		/* else no filters; keep old mode for reports */
 
 		pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : 
@@ -1487,8 +1536,10 @@
 		for (psf=pmc->sources; psf; psf = psf->sf_next)
 			psf->sf_crcount = 0;
 		igmp_ifc_event(in_dev);
-	} else if (sf_setstate(pmc))
+	} else if (sf_setstate(pmc)) {
 		igmp_ifc_event(in_dev);
+#endif
+	}
 	spin_unlock_bh(&pmc->lock);
 	return err;
 }
@@ -1530,13 +1581,7 @@
 
 	rtnl_shlock();
 
-	if (!imr->imr_ifindex)
-		in_dev = ip_mc_find_dev(imr);
-	else {
-		in_dev = inetdev_by_index(imr->imr_ifindex);
-		if (in_dev)
-			__in_dev_put(in_dev);
-	}
+	in_dev = ip_mc_find_dev(imr);
 
 	if (!in_dev) {
 		iml = NULL;
@@ -1638,13 +1683,13 @@
 }
 
 int ip_mc_source(int add, int omode, struct sock *sk, struct
-	ip_mreq_source *mreqs)
+	ip_mreq_source *mreqs, int ifindex)
 {
 	int err;
-	struct ip_mreqn	imr;
+	struct ip_mreqn imr;
 	u32 addr = mreqs->imr_multiaddr;
 	struct ip_mc_socklist *pmc;
-	struct in_device *in_dev;
+	struct in_device *in_dev = 0;
 	struct inet_opt *inet = inet_sk(sk);
 	struct ip_sf_socklist *psl;
 	int i, j, rv;
@@ -1656,7 +1701,7 @@
 
 	imr.imr_multiaddr.s_addr = mreqs->imr_multiaddr;
 	imr.imr_address.s_addr = mreqs->imr_interface;
-	imr.imr_ifindex = 0;
+	imr.imr_ifindex = ifindex;
 	in_dev = ip_mc_find_dev(&imr);
 
 	if (!in_dev) {
@@ -1753,7 +1798,7 @@
 	return err;
 }
 
-int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf)
+int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
 {
 	int err;
 	struct ip_mreqn	imr;
@@ -1773,7 +1818,7 @@
 
 	imr.imr_multiaddr.s_addr = msf->imsf_multiaddr;
 	imr.imr_address.s_addr = msf->imsf_interface;
-	imr.imr_ifindex = 0;
+	imr.imr_ifindex = ifindex;
 	in_dev = ip_mc_find_dev(&imr);
 
 	if (!in_dev) {
@@ -1783,7 +1828,8 @@
 	err = -EADDRNOTAVAIL;
 
 	for (pmc=inet->mc_list; pmc; pmc=pmc->next) {
-		if (memcmp(&pmc->multi, &imr, sizeof(imr)) == 0)
+		if (pmc->multi.imr_multiaddr.s_addr == msf->imsf_multiaddr &&
+		    pmc->multi.imr_ifindex == imr.imr_ifindex)
 			break;
 	}
 	if (!pmc)		/* must have a prior join */
@@ -1834,9 +1880,6 @@
 
 	if (!MULTICAST(addr))
 		return -EINVAL;
-	if (msf->imsf_fmode != MCAST_INCLUDE &&
-	    msf->imsf_fmode != MCAST_EXCLUDE)
-		return -EINVAL;
 
 	rtnl_shlock();
 
@@ -1852,7 +1895,8 @@
 	err = -EADDRNOTAVAIL;
 
 	for (pmc=inet->mc_list; pmc; pmc=pmc->next) {
-		if (memcmp(&pmc->multi, &imr, sizeof(imr)) == 0)
+		if (pmc->multi.imr_multiaddr.s_addr == msf->imsf_multiaddr &&
+		    pmc->multi.imr_ifindex == imr.imr_ifindex)
 			break;
 	}
 	if (!pmc)		/* must have a prior join */
@@ -1882,6 +1926,61 @@
 	return err;
 }
 
+int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
+	struct group_filter *optval, int *optlen)
+{
+	int err, i, count, copycount;
+	struct sockaddr_in *psin;
+	u32 addr;
+	struct ip_mc_socklist *pmc;
+	struct inet_opt *inet = inet_sk(sk);
+	struct ip_sf_socklist *psl;
+
+	psin = (struct sockaddr_in *)&gsf->gf_group;
+	if (psin->sin_family != AF_INET)
+		return -EINVAL;
+	addr = psin->sin_addr.s_addr;
+	if (!MULTICAST(addr))
+		return -EINVAL;
+
+	rtnl_shlock();
+
+	err = -EADDRNOTAVAIL;
+
+	for (pmc=inet->mc_list; pmc; pmc=pmc->next) {
+		if (pmc->multi.imr_multiaddr.s_addr == addr &&
+		    pmc->multi.imr_ifindex == gsf->gf_interface)
+			break;
+	}
+	if (!pmc)		/* must have a prior join */
+		goto done;
+	gsf->gf_fmode = pmc->sfmode;
+	psl = pmc->sflist;
+	rtnl_shunlock();
+	count = psl ? psl->sl_count : 0;
+	copycount = count < gsf->gf_numsrc ? count : gsf->gf_numsrc;
+	gsf->gf_numsrc = count;
+	if (put_user(GROUP_FILTER_SIZE(copycount), optlen) ||
+	    copy_to_user((void *)optval, gsf, GROUP_FILTER_SIZE(0))) {
+		return -EFAULT;
+	}
+	for (i=0; i<copycount; i++) {
+		struct sockaddr_in *psin;
+		struct sockaddr_storage ss;
+
+		psin = (struct sockaddr_in *)&ss;
+		memset(&ss, 0, sizeof(ss));
+		psin->sin_family = AF_INET;
+		psin->sin_addr.s_addr = psl->sl_addr[i];
+		if (copy_to_user((void *)&optval->gf_slist[i], &ss, sizeof(ss)))
+			return -EFAULT;
+	}
+	return 0;
+done:
+	rtnl_shunlock();
+	return err;
+}
+
 /*
  * check if a multicast source filter allows delivery for a given <src,dst,intf>
  */
@@ -1892,6 +1991,9 @@
 	struct ip_sf_socklist *psl;
 	int i;
 
+	if (!MULTICAST(loc_addr))
+		return 1;
+
 	for (pmc=inet->mc_list; pmc; pmc=pmc->next) {
 		if (pmc->multi.imr_multiaddr.s_addr == loc_addr &&
 		    pmc->multi.imr_ifindex == dif)
@@ -1972,8 +2074,6 @@
 }
 
 
-#ifdef CONFIG_IP_MULTICAST
- 
 int ip_mc_procinfo(char *buffer, char **start, off_t offset, int length)
 {
 	off_t pos=0, begin=0;
@@ -1991,7 +2091,9 @@
 		if (in_dev == NULL)
 			continue;
 
+#ifdef CONFIG_IP_MULTICAST
 		querier = IGMP_V1_SEEN(in_dev) ? "V1" : "V2";
+#endif
 
 		len+=sprintf(buffer+len,"%d\t%-10s: %5d %7s\n",
 			     dev->ifindex, dev->name, dev->mc_count, querier);
@@ -2049,11 +2151,8 @@
 
 		for (imc=in_dev->mc_list; imc; imc=imc->next) {
 			struct ip_sf_list *psf;
-			unsigned long icount, xcount;
 
 			spin_lock_bh(&imc->lock);
-			icount = imc->sfcount[MCAST_INCLUDE];
-			xcount = imc->sfcount[MCAST_EXCLUDE];
 			for (psf=imc->sources; psf; psf=psf->sf_next) {
 				if (first) {
 					len += sprintf(buffer+len, "%3s %6s "
@@ -2080,33 +2179,6 @@
 					in_dev_put(in_dev);
 					goto done;
 				}
-				icount -= psf->sf_count[MCAST_INCLUDE];
-				xcount -= psf->sf_count[MCAST_EXCLUDE];
-			}
-			if (icount > 0 || xcount > 0) {
-				if (first) {
-					len += sprintf(buffer+len, "%3s %6s "
-						"%10s %10s %6s %6s\n", "Idx",
-						"Device", "MCA", "SRC", "INC",
-						"EXC");
-					first = 0;
-				}
-				len += sprintf(buffer+len, "%3d %6.6s 0x%08x "
-					"%10s %6lu %6lu\n", dev->ifindex,
-					dev->name, ntohl(imc->multiaddr),
-					"NONE", icount, xcount);
-				pos=begin+len;
-				if(pos<offset)
-				{
-					len=0;
-					begin=pos;
-				}
-				if(pos>offset+length) {
-					spin_unlock_bh(&imc->lock);
-					read_unlock(&in_dev->lock);
-					in_dev_put(in_dev);
-					goto done;
-				}
 			}
 			spin_unlock_bh(&imc->lock);
 		}
@@ -2124,6 +2196,4 @@
 		len=0;
 	return len;
 }
-
-#endif
 
diff -Nru a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
--- a/net/ipv4/ip_gre.c	Wed Apr  9 23:33:08 2003
+++ b/net/ipv4/ip_gre.c	Tue Apr 22 00:47:05 2003
@@ -777,9 +777,6 @@
 		skb->dst->ops->update_pmtu(skb->dst, mtu);
 
 	if (skb->protocol == htons(ETH_P_IP)) {
-		if (skb->dst)
-			skb->dst->ops->update_pmtu(skb->dst, mtu);
-
 		df |= (old_iph->frag_off&htons(IP_DF));
 
 		if ((old_iph->frag_off&htons(IP_DF)) &&
diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c	Thu Apr 10 23:35:45 2003
+++ b/net/ipv4/ip_output.c	Tue Apr 22 23:51:32 2003
@@ -1312,6 +1312,6 @@
 
 #ifdef CONFIG_IP_MULTICAST
 	proc_net_create("igmp", 0, ip_mc_procinfo);
-	proc_net_create("mcfilter", 0, ip_mcf_procinfo);
 #endif
+	proc_net_create("mcfilter", 0, ip_mcf_procinfo);
 }
diff -Nru a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
--- a/net/ipv4/ip_sockglue.c	Thu Apr 10 23:35:45 2003
+++ b/net/ipv4/ip_sockglue.c	Tue Apr 22 23:51:32 2003
@@ -631,7 +631,7 @@
 				kfree(msf);
 				break;
 			}
-			err = ip_mc_msfilter(sk, msf);
+			err = ip_mc_msfilter(sk, msf, 0);
 			kfree(msf);
 			break;
 		}
@@ -670,7 +670,142 @@
 				omode = MCAST_INCLUDE;
 				add = 0;
 			}
-			err = ip_mc_source(add, omode, sk, &mreqs);
+			err = ip_mc_source(add, omode, sk, &mreqs, 0);
+			break;
+		}
+		case MCAST_JOIN_GROUP:
+		case MCAST_LEAVE_GROUP: 
+		{
+			struct group_req greq;
+			struct sockaddr_in *psin;
+			struct ip_mreqn mreq;
+
+			if (optlen < sizeof(struct group_req))
+				goto e_inval;
+			err = -EFAULT;
+			if(copy_from_user(&greq, optval, sizeof(greq)))
+				break;
+			psin = (struct sockaddr_in *)&greq.gr_group;
+			if (psin->sin_family != AF_INET)
+				goto e_inval;
+			memset(&mreq, 0, sizeof(mreq));
+			mreq.imr_multiaddr = psin->sin_addr;
+			mreq.imr_ifindex = greq.gr_interface;
+
+			if (optname == MCAST_JOIN_GROUP)
+				err = ip_mc_join_group(sk, &mreq);
+			else
+				err = ip_mc_leave_group(sk, &mreq);
+			break;
+		}
+		case MCAST_JOIN_SOURCE_GROUP:
+		case MCAST_LEAVE_SOURCE_GROUP:
+		case MCAST_BLOCK_SOURCE:
+		case MCAST_UNBLOCK_SOURCE:
+		{
+			struct group_source_req greqs;
+			struct ip_mreq_source mreqs;
+			struct sockaddr_in *psin;
+			int omode, add;
+
+			if (optlen != sizeof(struct group_source_req))
+				goto e_inval;
+			if (copy_from_user(&greqs, optval, sizeof(greqs))) {
+				err = -EFAULT;
+				break;
+			}
+			if (greqs.gsr_group.ss_family != AF_INET ||
+			    greqs.gsr_source.ss_family != AF_INET) {
+				err = -EADDRNOTAVAIL;
+				break;
+			}
+			psin = (struct sockaddr_in *)&greqs.gsr_group;
+			mreqs.imr_multiaddr = psin->sin_addr.s_addr;
+			psin = (struct sockaddr_in *)&greqs.gsr_source;
+			mreqs.imr_sourceaddr = psin->sin_addr.s_addr;
+			mreqs.imr_interface = 0; /* use index for mc_source */
+
+			if (optname == MCAST_BLOCK_SOURCE) {
+				omode = MCAST_EXCLUDE;
+				add = 1;
+			} else if (optname == MCAST_UNBLOCK_SOURCE) {
+				omode = MCAST_EXCLUDE;
+				add = 0;
+			} else if (optname == MCAST_JOIN_SOURCE_GROUP) {
+				struct ip_mreqn mreq;
+
+				psin = (struct sockaddr_in *)&greqs.gsr_group;
+				mreq.imr_multiaddr = psin->sin_addr;
+				mreq.imr_address.s_addr = 0;
+				mreq.imr_ifindex = greqs.gsr_interface;
+				err = ip_mc_join_group(sk, &mreq);
+				if (err)
+					break;
+				omode = MCAST_INCLUDE;
+				add = 1;
+			} else /* MCAST_LEAVE_SOURCE_GROUP */ {
+				omode = MCAST_INCLUDE;
+				add = 0;
+			}
+			err = ip_mc_source(add, omode, sk, &mreqs,
+				greqs.gsr_interface);
+			break;
+		}
+		case MCAST_MSFILTER:
+		{
+			struct sockaddr_in *psin;
+			struct ip_msfilter *msf = 0;
+			struct group_filter *gsf = 0;
+			int msize, i, ifindex;
+
+			if (optlen < GROUP_FILTER_SIZE(0))
+				goto e_inval;
+			gsf = (struct group_filter *)kmalloc(optlen,GFP_KERNEL);
+			if (gsf == 0) {
+				err = -ENOBUFS;
+				break;
+			}
+			err = -EFAULT;
+			if (copy_from_user(gsf, optval, optlen)) {
+				goto mc_msf_out;
+			}
+			if (GROUP_FILTER_SIZE(gsf->gf_numsrc) < optlen) {
+				err = EINVAL;
+				goto mc_msf_out;
+			}
+			msize = IP_MSFILTER_SIZE(gsf->gf_numsrc);
+			msf = (struct ip_msfilter *)kmalloc(msize,GFP_KERNEL);
+			if (msf == 0) {
+				err = -ENOBUFS;
+				goto mc_msf_out;
+			}
+			ifindex = gsf->gf_interface;
+			psin = (struct sockaddr_in *)&gsf->gf_group;
+			if (psin->sin_family != AF_INET) {
+				err = -EADDRNOTAVAIL;
+				goto mc_msf_out;
+			}
+			msf->imsf_multiaddr = psin->sin_addr.s_addr;
+			msf->imsf_interface = 0;
+			msf->imsf_fmode = gsf->gf_fmode;
+			msf->imsf_numsrc = gsf->gf_numsrc;
+			err = -EADDRNOTAVAIL;
+			for (i=0; i<gsf->gf_numsrc; ++i) {
+				psin = (struct sockaddr_in *)&gsf->gf_slist[i];
+
+				if (psin->sin_family != AF_INET)
+					goto mc_msf_out;
+				msf->imsf_slist[i] = psin->sin_addr.s_addr;
+			}
+			kfree(gsf);
+			gsf = 0;
+
+			err = ip_mc_msfilter(sk, msf, ifindex);
+mc_msf_out:
+			if (msf)
+				kfree(msf);
+			if (gsf)
+				kfree(gsf);
 			break;
 		}
 		case IP_ROUTER_ALERT:	
@@ -826,12 +961,34 @@
 			struct ip_msfilter msf;
 			int err;
 
-			if (len < IP_MSFILTER_SIZE(0))
+			if (len < IP_MSFILTER_SIZE(0)) {
+				release_sock(sk);
 				return -EINVAL;
-			if (copy_from_user(&msf, optval, IP_MSFILTER_SIZE(0)))
+			}
+			if (copy_from_user(&msf, optval, IP_MSFILTER_SIZE(0))) {
+				release_sock(sk);
 				return -EFAULT;
+			}
 			err = ip_mc_msfget(sk, &msf,
 				(struct ip_msfilter *)optval, optlen);
+			release_sock(sk);
+			return err;
+		}
+		case MCAST_MSFILTER:
+		{
+			struct group_filter gsf;
+			int err;
+
+			if (len < GROUP_FILTER_SIZE(0)) {
+				release_sock(sk);
+				return -EINVAL;
+			}
+			if (copy_from_user(&gsf, optval, GROUP_FILTER_SIZE(0))) {
+				release_sock(sk);
+				return -EFAULT;
+			}
+			err = ip_mc_gsfget(sk, &gsf,
+				(struct group_filter *)optval, optlen);
 			release_sock(sk);
 			return err;
 		}
diff -Nru a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
--- a/net/ipv4/netfilter/Kconfig	Sun Apr  6 07:34:02 2003
+++ b/net/ipv4/netfilter/Kconfig	Tue Apr 22 23:55:57 2003
@@ -48,7 +48,7 @@
 	  <file:Documentation/modules.txt>.  If unsure, say `Y'.
 
 config IP_NF_TFTP
-	tristate "TFTP prtocol support"
+	tristate "TFTP protocol support"
 	depends on IP_NF_CONNTRACK
 	help
 	  TFTP connection tracking helper, this is required depending
diff -Nru a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
--- a/net/ipv6/ipv6_sockglue.c	Wed Apr 16 01:45:42 2003
+++ b/net/ipv6/ipv6_sockglue.c	Tue Apr 22 23:51:32 2003
@@ -120,6 +120,12 @@
 	return 0;
 }
 
+extern int ip6_mc_source(int add, int omode, struct sock *sk,
+	struct group_source_req *pgsr);
+extern int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf);
+extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
+	struct group_filter *optval, int *optlen);
+
 
 int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval, 
 		    int optlen)
@@ -393,12 +399,13 @@
 			break;
 		}
 		psin6 = (struct sockaddr_in6 *)&greq.gr_group;
-		if (optname == IPV6_ADD_MEMBERSHIP)
+		if (optname == MCAST_JOIN_GROUP)
 			retv = ipv6_sock_mc_join(sk, greq.gr_interface,
 				&psin6->sin6_addr);
 		else
 			retv = ipv6_sock_mc_drop(sk, greq.gr_interface,
 				&psin6->sin6_addr);
+		break;
 	}
 	case MCAST_JOIN_SOURCE_GROUP:
 	case MCAST_LEAVE_SOURCE_GROUP:
@@ -414,7 +421,8 @@
 			retv = -EFAULT;
 			break;
 		}
-		if (greqs.gsr_group.ss_family != AF_INET6) {
+		if (greqs.gsr_group.ss_family != AF_INET6 ||
+		    greqs.gsr_source.ss_family != AF_INET6) {
 			retv = -EADDRNOTAVAIL;
 			break;
 		}
diff -Nru a/net/ipv6/mcast.c b/net/ipv6/mcast.c
--- a/net/ipv6/mcast.c	Wed Apr 16 01:45:42 2003
+++ b/net/ipv6/mcast.c	Tue Apr 22 23:51:32 2003
@@ -768,7 +768,7 @@
 		psf = pmc->mca_tomb;
 		pmc->mca_tomb = 0;
 		spin_unlock_bh(&pmc->mca_lock);
-		for (psf=pmc->mca_tomb; psf; psf=psf_next) {
+		for (; psf; psf=psf_next) {
 			psf_next = psf->sf_next;
 			kfree(psf);
 		}
@@ -1042,6 +1042,8 @@
 		mld_clear_delrec(idev);
 	} else if (len >= 28) {
 		max_delay = MLDV2_MRC(ntohs(mlh2->mrc))*(HZ/10);
+		if (!max_delay)
+			max_delay = 1;
 		idev->mc_maxdelay = max_delay;
 		if (mlh2->qrv)
 			idev->mc_qrv = mlh2->qrv;
@@ -2096,8 +2098,6 @@
 			unsigned long icount, xcount, i;
 
 			spin_lock_bh(&imc->mca_lock);
-			icount = imc->mca_sfcount[MCAST_INCLUDE];
-			xcount = imc->mca_sfcount[MCAST_EXCLUDE];
 			for (psf=imc->mca_sources; psf; psf=psf->sf_next) {
 				if (first) {
 					len += sprintf(buffer+len, "%3s %6s "
@@ -2119,36 +2119,6 @@
 				len += sprintf(buffer+len, " %6lu %6lu\n",
 					psf->sf_count[MCAST_INCLUDE],
 					psf->sf_count[MCAST_EXCLUDE]);
-				pos = begin+len;
-				if (pos < offset) {
-					len=0;
-					begin=pos;
-				}
-				if (pos > offset+length) {
-					spin_unlock_bh(&imc->mca_lock);
-					read_unlock_bh(&idev->lock);
-					in6_dev_put(idev);
-					goto done;
-				}
-				icount -= psf->sf_count[MCAST_INCLUDE];
-				xcount -= psf->sf_count[MCAST_EXCLUDE];
-			}
-			if (icount > 0 || xcount > 0) {
-				if (first) {
-					len += sprintf(buffer+len, "%3s %6s "
-						"%32s %32s %6s %6s\n", "Idx",
-						"Device", "Multicast Address",
-						"Source Address", "INC", "EXC");
-					first = 0;
-				}
-				len += sprintf(buffer+len,"%3d %6.6s ",
-					dev->ifindex, dev->name);
-
-				for (i=0; i<16; i++)
-					len += sprintf(buffer+len, "%02x",
-						imc->mca_addr.s6_addr[i]);
-				len += sprintf(buffer+len, " %32s %6lu %6lu\n",
-					"NONE", icount, xcount);
 				pos = begin+len;
 				if (pos < offset) {
 					len=0;
diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
--- a/net/ipv6/ndisc.c	Thu Apr 17 18:56:05 2003
+++ b/net/ipv6/ndisc.c	Tue Apr 22 23:57:43 2003
@@ -427,7 +427,7 @@
 
 	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
 
-	rt = ndisc_get_dummy_rt();
+	rt = ip6_dst_alloc();
 	if (!rt) 
 		return;
 
@@ -524,7 +524,7 @@
 		saddr = &addr_buf;
 	}
 
-	rt = ndisc_get_dummy_rt();
+	rt = ip6_dst_alloc();
 	if (!rt) 
 		return;
 
@@ -595,7 +595,7 @@
         int len;
 	int err;
 
-	rt = ndisc_get_dummy_rt();
+	rt = ip6_dst_alloc();
 	if (!rt) 
 		return;
 
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c	Thu Apr 17 18:56:05 2003
+++ b/net/ipv6/route.c	Tue Apr 22 23:57:43 2003
@@ -130,12 +130,17 @@
 rwlock_t rt6_lock = RW_LOCK_UNLOCKED;
 
 
-/*	Dummy rt for ndisc */
-struct rt6_info *ndisc_get_dummy_rt()
+/* allocate dst with ip6_dst_ops */
+static __inline__ struct rt6_info *__ip6_dst_alloc(void)
 {
 	return dst_alloc(&ip6_dst_ops);
 }
 
+struct rt6_info *ip6_dst_alloc(void)
+{
+	return __ip6_dst_alloc();
+}
+
 /*
  *	Route lookup. Any rt6_lock is implied.
  */
@@ -640,7 +645,7 @@
 	if (rtmsg->rtmsg_metric == 0)
 		rtmsg->rtmsg_metric = IP6_RT_PRIO_USER;
 
-	rt = dst_alloc(&ip6_dst_ops);
+	rt = __ip6_dst_alloc();
 
 	if (rt == NULL)
 		return -ENOMEM;
@@ -1035,9 +1040,7 @@
 
 static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
 {
-	struct rt6_info *rt;
-
-	rt = dst_alloc(&ip6_dst_ops);
+	struct rt6_info *rt = __ip6_dst_alloc();
 
 	if (rt) {
 		rt->u.dst.input = ort->u.dst.input;
@@ -1181,9 +1184,8 @@
 
 int ip6_rt_addr_add(struct in6_addr *addr, struct net_device *dev)
 {
-	struct rt6_info *rt;
+	struct rt6_info *rt = __ip6_dst_alloc();
 
-	rt = dst_alloc(&ip6_dst_ops);
 	if (rt == NULL)
 		return -ENOMEM;
 
diff -Nru a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
--- a/net/ipv6/xfrm6_input.c	Mon Apr 14 11:25:51 2003
+++ b/net/ipv6/xfrm6_input.c	Sat Apr 19 20:41:29 2003
@@ -136,7 +136,7 @@
 	unsigned char *tmp_hdr = NULL;
 	int hdr_len = 0;
 	u16 nh_offset = 0;
-	u8 nexthdr = 0;
+	int nexthdr = 0;
 
 	nh_offset = ((unsigned char*)&skb->nh.ipv6h->nexthdr) - skb->nh.raw;
 	hdr_len = sizeof(struct ipv6hdr);
diff -Nru a/net/ipx/Kconfig b/net/ipx/Kconfig
--- a/net/ipx/Kconfig	Tue Oct 29 17:16:55 2002
+++ b/net/ipx/Kconfig	Sun Apr 20 12:56:51 2003
@@ -12,7 +12,7 @@
 	  same address). The way this is done is to create a virtual internal
 	  "network" inside your box and to assign an IPX address to this
 	  network. Say Y here if you want to do this; read the IPX-HOWTO at
-	  <http://www.linuxdoc.org/docs.html#howto> for details.
+	  <http://www.tldp.org/docs.html#howto> for details.
 
 	  The full internal IPX network enables you to allocate sockets on
 	  different virtual nodes of the internal network. This is done by
diff -Nru a/net/irda/Kconfig b/net/irda/Kconfig
--- a/net/irda/Kconfig	Sun Feb  9 17:29:49 2003
+++ b/net/irda/Kconfig	Sun Apr 20 12:56:51 2003
@@ -16,7 +16,7 @@
 	  some user-space utilities like irattach.  For more information, see
 	  the file <file:Documentation/networking/irda.txt>.  You also want to
 	  read the IR-HOWTO, available at
-	  <http://www.linuxdoc.org/docs.html#howto>.
+	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you want to exchange bits of data (vCal, vCard) with a PDA, you
 	  will need to install some OBEX application, such as OpenObex :
diff -Nru a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
--- a/net/irda/ircomm/ircomm_tty.c	Thu Feb 13 00:10:21 2003
+++ b/net/irda/ircomm/ircomm_tty.c	Mon Apr 21 20:58:42 2003
@@ -99,11 +99,7 @@
 	memset(&driver, 0, sizeof(struct tty_driver));
 	driver.magic           = TTY_DRIVER_MAGIC;
 	driver.driver_name     = "ircomm";
-#ifdef CONFIG_DEVFS_FS
-	driver.name            = "ircomm%d";
-#else
 	driver.name            = "ircomm";
-#endif
 	driver.major           = IRCOMM_TTY_MAJOR;
 	driver.minor_start     = IRCOMM_TTY_MINOR;
 	driver.num             = IRCOMM_TTY_PORTS;
@@ -251,7 +247,7 @@
 
 	tty = self->tty;
 
-	if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) {
+	if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) {
 		/* this is a callout device */
 		/* just verify that normal device is not in use */
 		if (self->flags & ASYNC_NORMAL_ACTIVE)
@@ -306,7 +302,7 @@
 	add_wait_queue(&self->open_wait, &wait);
 	
 	IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n",
-	      __FILE__,__LINE__, tty->driver.name, self->open_count );
+	      __FILE__,__LINE__, tty->driver->name, self->open_count );
 
 	/* As far as I can see, we protect open_count - Jean II */
 	spin_lock_irqsave(&self->spinlock, flags);
@@ -356,7 +352,7 @@
 		}
 		
 		IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n",
-		      __FILE__,__LINE__, tty->driver.name, self->open_count );
+		      __FILE__,__LINE__, tty->driver->name, self->open_count );
 		
 		schedule();
 	}
@@ -373,7 +369,7 @@
 	self->blocked_open--;
 	
 	IRDA_DEBUG(1, "%s(%d):block_til_ready after blocking on %s open_count=%d\n",
-	      __FILE__,__LINE__, tty->driver.name, self->open_count);
+	      __FILE__,__LINE__, tty->driver->name, self->open_count);
 			 
 	if (!retval)
 		self->flags |= ASYNC_NORMAL_ACTIVE;
@@ -398,7 +394,7 @@
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 
 	MOD_INC_USE_COUNT;
-	line = minor(tty->device) - tty->driver.minor_start;
+	line = tty->index;
 	if ((line < 0) || (line >= IRCOMM_TTY_PORTS)) {
 		MOD_DEC_USE_COUNT;
 		return -ENODEV;
@@ -451,7 +447,7 @@
 	self->tty = tty;
 	spin_unlock_irqrestore(&self->spinlock, flags);
 
-	IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __FUNCTION__ , tty->driver.name, 
+	IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __FUNCTION__ , tty->driver->name, 
 		   self->line, self->open_count);
 
 	/* Not really used by us, but lets do it anyway */
@@ -592,8 +588,8 @@
 
 	ircomm_tty_shutdown(self);
 
-	if (tty->driver.flush_buffer)
-		tty->driver.flush_buffer(tty);
+	if (tty->driver->flush_buffer)
+		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
--- a/net/netlink/af_netlink.c	Thu Apr  3 06:47:45 2003
+++ b/net/netlink/af_netlink.c	Tue Apr 22 22:48:58 2003
@@ -1052,6 +1052,7 @@
 struct net_proto_family netlink_family_ops = {
 	.family = PF_NETLINK,
 	.create = netlink_create,
+	.owner	= THIS_MODULE,	/* for consistency 8) */
 };
 
 static int __init netlink_proto_init(void)
@@ -1066,6 +1067,11 @@
 #ifdef CONFIG_PROC_FS
 	create_proc_read_entry("net/netlink", 0, 0, netlink_read_proc, NULL);
 #endif
+	/* The netlink device handler may be needed early. */ 
+	rtnetlink_init();
+#ifdef CONFIG_NETLINK_DEV
+	init_netlink();
+#endif
 	return 0;
 }
 
@@ -1075,7 +1081,7 @@
        remove_proc_entry("net/netlink", NULL);
 }
 
-module_init(netlink_proto_init);
+subsys_initcall(netlink_proto_init);
 module_exit(netlink_proto_exit);
 
 MODULE_LICENSE("GPL");
diff -Nru a/net/netlink/netlink_dev.c b/net/netlink/netlink_dev.c
--- a/net/netlink/netlink_dev.c	Sat Mar 22 07:38:04 2003
+++ b/net/netlink/netlink_dev.c	Tue Apr 22 00:00:05 2003
@@ -170,16 +170,54 @@
 	.release =	netlink_release,
 };
 
-static struct { char *name; int minor; } entries[] = {
-	{"route", 0},
-	{"skip", 1},
-	{"usersock", 2},
-	{"fwmonitor", 3},
-	{"tcpdiag", 4},
-	{"arpd", 8},
-	{"route6", 11},
-	{"ip6_fw", 13},
-	{"dnrtmsg", 13},
+static struct {
+	char *name;
+	int minor;
+} entries[] = {
+	{
+		.name	= "route",
+		.minor	= NETLINK_ROUTE,
+	},
+	{
+		.name	= "skip",
+		.minor	= NETLINK_SKIP,
+	},
+	{
+		.name	= "usersock",
+		.minor	= NETLINK_USERSOCK,
+	},
+	{
+		.name	= "fwmonitor",
+		.minor	= NETLINK_FIREWALL,
+	},
+	{
+		.name	= "tcpdiag",
+		.minor	= NETLINK_TCPDIAG,
+	},
+	{
+		.name	= "nflog",
+		.minor	= NETLINK_NFLOG,
+	},
+	{
+		.name	= "xfrm",
+		.minor	= NETLINK_XFRM,
+	},
+	{
+		.name	= "arpd",
+		.minor	= NETLINK_ARPD,
+	},
+	{
+		.name	= "route6",
+		.minor	= NETLINK_ROUTE6,
+	},
+	{
+		.name	= "ip6_fw",
+		.minor	= NETLINK_IP6_FW,
+	},
+	{
+		.name	= "dnrtmsg",
+		.minor	= NETLINK_DNRTMSG,
+	},
 };
 
 static void __init make_devfs_entries (const char *name, int minor)
diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c
--- a/net/sched/cls_api.c	Tue Feb  5 07:24:36 2002
+++ b/net/sched/cls_api.c	Sun Apr 20 00:25:22 2003
@@ -17,6 +17,7 @@
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -223,8 +224,9 @@
 		tp->q = q;
 		tp->classify = tp_ops->classify;
 		tp->classid = parent;
-		err = tp_ops->init(tp);
-		if (err) {
+		err = -EBUSY;
+		if (!try_module_get(tp_ops->owner) ||
+		    (err = tp_ops->init(tp)) != 0) {
 			kfree(tp);
 			goto errout;
 		}
@@ -248,6 +250,7 @@
 			write_unlock(&qdisc_tree_lock);
 
 			tp->ops->destroy(tp);
+			module_put(tp->ops->owner);
 			kfree(tp);
 			err = 0;
 			goto errout;
diff -Nru a/net/sched/cls_fw.c b/net/sched/cls_fw.c
--- a/net/sched/cls_fw.c	Tue Feb  5 07:24:36 2002
+++ b/net/sched/cls_fw.c	Sun Apr 20 00:25:22 2003
@@ -117,7 +117,6 @@
 
 static int fw_init(struct tcf_proto *tp)
 {
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -127,10 +126,8 @@
 	struct fw_filter *f;
 	int h;
 
-	if (head == NULL) {
-		MOD_DEC_USE_COUNT;
+	if (head == NULL)
 		return;
-	}
 
 	for (h=0; h<256; h++) {
 		while ((f=head->ht[h]) != NULL) {
@@ -146,7 +143,6 @@
 		}
 	}
 	kfree(head);
-	MOD_DEC_USE_COUNT;
 }
 
 static int fw_delete(struct tcf_proto *tp, unsigned long arg)
@@ -351,18 +347,18 @@
 }
 
 struct tcf_proto_ops cls_fw_ops = {
-	NULL,
-	"fw",
-	fw_classify,
-	fw_init,
-	fw_destroy,
-
-	fw_get,
-	fw_put,
-	fw_change,
-	fw_delete,
-	fw_walk,
-	fw_dump
+	.next		=	NULL,
+	.kind		=	"fw",
+	.classify	=	fw_classify,
+	.init		=	fw_init,
+	.destroy	=	fw_destroy,
+	.get		=	fw_get,
+	.put		=	fw_put,
+	.change		=	fw_change,
+	.delete		=	fw_delete,
+	.walk		=	fw_walk,
+	.dump		=	fw_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/cls_route.c b/net/sched/cls_route.c
--- a/net/sched/cls_route.c	Fri Oct 11 16:07:31 2002
+++ b/net/sched/cls_route.c	Sun Apr 20 00:25:22 2003
@@ -272,7 +272,6 @@
 
 static int route4_init(struct tcf_proto *tp)
 {
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -281,10 +280,8 @@
 	struct route4_head *head = xchg(&tp->root, NULL);
 	int h1, h2;
 
-	if (head == NULL) {
-		MOD_DEC_USE_COUNT;
+	if (head == NULL)
 		return;
-	}
 
 	for (h1=0; h1<=256; h1++) {
 		struct route4_bucket *b;
@@ -309,7 +306,6 @@
 		}
 	}
 	kfree(head);
-	MOD_DEC_USE_COUNT;
 }
 
 static int route4_delete(struct tcf_proto *tp, unsigned long arg)
@@ -607,18 +603,18 @@
 }
 
 struct tcf_proto_ops cls_route4_ops = {
-	NULL,
-	"route",
-	route4_classify,
-	route4_init,
-	route4_destroy,
-
-	route4_get,
-	route4_put,
-	route4_change,
-	route4_delete,
-	route4_walk,
-	route4_dump
+	.next		=	NULL,
+	.kind		=	"route",
+	.classify	=	route4_classify,
+	.init		=	route4_init,
+	.destroy	=	route4_destroy,
+	.get		=	route4_get,
+	.put		=	route4_put,
+	.change		=	route4_change,
+	.delete		=	route4_delete,
+	.walk		=	route4_walk,
+	.dump		=	route4_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
--- a/net/sched/cls_rsvp.h	Mon Apr 14 15:42:04 2003
+++ b/net/sched/cls_rsvp.h	Sun Apr 20 00:25:22 2003
@@ -242,14 +242,12 @@
 {
 	struct rsvp_head *data;
 
-	MOD_INC_USE_COUNT;
 	data = kmalloc(sizeof(struct rsvp_head), GFP_KERNEL);
 	if (data) {
 		memset(data, 0, sizeof(struct rsvp_head));
 		tp->root = data;
 		return 0;
 	}
-	MOD_DEC_USE_COUNT;
 	return -ENOBUFS;
 }
 
@@ -289,7 +287,6 @@
 		}
 	}
 	kfree(data);
-	MOD_DEC_USE_COUNT;
 }
 
 static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
@@ -668,18 +665,18 @@
 }
 
 struct tcf_proto_ops RSVP_OPS = {
-	NULL,
-	RSVP_ID,
-	rsvp_classify,
-	rsvp_init,
-	rsvp_destroy,
-
-	rsvp_get,
-	rsvp_put,
-	rsvp_change,
-	rsvp_delete,
-	rsvp_walk,
-	rsvp_dump
+	.next		=	NULL,
+	.kind		=	RSVP_ID,
+	.classify	=	rsvp_classify,
+	.init		=	rsvp_init,
+	.destroy	=	rsvp_destroy,
+	.get		=	rsvp_get,
+	.put		=	rsvp_put,
+	.change		=	rsvp_change,
+	.delete		=	rsvp_delete,
+	.walk		=	rsvp_walk,
+	.dump		=	rsvp_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
--- a/net/sched/cls_tcindex.c	Tue Feb  5 07:24:36 2002
+++ b/net/sched/cls_tcindex.c	Sun Apr 20 00:25:22 2003
@@ -144,12 +144,10 @@
 	struct tcindex_data *p;
 
 	DPRINTK("tcindex_init(tp %p)\n",tp);
-	MOD_INC_USE_COUNT;
 	p = kmalloc(sizeof(struct tcindex_data),GFP_KERNEL);
-	if (!p) {
-		MOD_DEC_USE_COUNT;
+	if (!p)
 		return -ENOMEM;
-	}
+
 	tp->root = p;
 	p->perfect = NULL;
 	p->h = NULL;
@@ -417,7 +415,6 @@
 		kfree(p->h);
 	kfree(p);
 	tp->root = NULL;
-	MOD_DEC_USE_COUNT;
 }
 
 
@@ -480,18 +477,18 @@
 }
 
 struct tcf_proto_ops cls_tcindex_ops = {
-	NULL,
-	"tcindex",
-	tcindex_classify,
-	tcindex_init,
-	tcindex_destroy,
-
-	tcindex_get,
-	tcindex_put,
-	tcindex_change,
-	tcindex_delete,
-	tcindex_walk,
-	tcindex_dump
+	.next		=	NULL,
+	.kind		=	"tcindex",
+	.classify	=	tcindex_classify,
+	.init		=	tcindex_init,
+	.destroy	=	tcindex_destroy,
+	.get		=	tcindex_get,
+	.put		=	tcindex_put,
+	.change		=	tcindex_change,
+	.delete		=	tcindex_delete,
+	.walk		=	tcindex_walk,
+	.dump		=	tcindex_dump,
+	.owner		=	THIS_MODULE,
 };
 
 
diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c
--- a/net/sched/cls_u32.c	Mon Apr 14 15:42:04 2003
+++ b/net/sched/cls_u32.c	Sun Apr 20 00:25:22 2003
@@ -257,17 +257,14 @@
 	struct tc_u_hnode *root_ht;
 	struct tc_u_common *tp_c;
 
-	MOD_INC_USE_COUNT;
-
 	for (tp_c = u32_list; tp_c; tp_c = tp_c->next)
 		if (tp_c->q == tp->q)
 			break;
 
 	root_ht = kmalloc(sizeof(*root_ht), GFP_KERNEL);
-	if (root_ht == NULL) {
-		MOD_DEC_USE_COUNT;
+	if (root_ht == NULL)
 		return -ENOBUFS;
-	}
+
 	memset(root_ht, 0, sizeof(*root_ht));
 	root_ht->divisor = 0;
 	root_ht->refcnt++;
@@ -277,7 +274,6 @@
 		tp_c = kmalloc(sizeof(*tp_c), GFP_KERNEL);
 		if (tp_c == NULL) {
 			kfree(root_ht);
-			MOD_DEC_USE_COUNT;
 			return -ENOBUFS;
 		}
 		memset(tp_c, 0, sizeof(*tp_c));
@@ -402,7 +398,6 @@
 		kfree(tp_c);
 	}
 
-	MOD_DEC_USE_COUNT;
 	tp->data = NULL;
 }
 
@@ -690,18 +685,18 @@
 }
 
 struct tcf_proto_ops cls_u32_ops = {
-	NULL,
-	"u32",
-	u32_classify,
-	u32_init,
-	u32_destroy,
-
-	u32_get,
-	u32_put,
-	u32_change,
-	u32_delete,
-	u32_walk,
-	u32_dump
+	.next		=	NULL,
+	.kind		=	"u32",
+	.classify	=	u32_classify,
+	.init		=	u32_init,
+	.destroy	=	u32_destroy,
+	.get		=	u32_get,
+	.put		=	u32_put,
+	.change		=	u32_change,
+	.delete		=	u32_delete,
+	.walk		=	u32_walk,
+	.dump		=	u32_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
--- a/net/sched/sch_api.c	Wed Nov  6 17:27:58 2002
+++ b/net/sched/sch_api.c	Sun Apr 20 00:57:16 2003
@@ -16,6 +16,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -447,6 +448,10 @@
         else
                 sch->handle = handle;
 
+	err = -EBUSY;
+	if (!try_module_get(ops->owner))
+		goto err_out;
+
 	if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) {
 		write_lock(&qdisc_tree_lock);
 		sch->next = dev->qdisc_list;
@@ -458,6 +463,7 @@
 #endif
 		return sch;
 	}
+	module_put(ops->owner);
 
 err_out:
 	*errp = err;
diff -Nru a/net/sched/sch_atm.c b/net/sched/sch_atm.c
--- a/net/sched/sch_atm.c	Thu Mar 20 00:45:11 2003
+++ b/net/sched/sch_atm.c	Sun Apr 20 00:57:16 2003
@@ -575,7 +575,6 @@
 	p->link.ref = 1;
 	p->link.next = NULL;
 	tasklet_init(&p->task,sch_atm_dequeue,(unsigned long) sch);
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -612,7 +611,6 @@
 		}
 	}
 	tasklet_kill(&p->task);
-	MOD_DEC_USE_COUNT;
 }
 
 
@@ -663,41 +661,35 @@
 	return 0;
 }
 
-static struct Qdisc_class_ops atm_class_ops =
-{
-	.graft		= atm_tc_graft,
-	.leaf		= atm_tc_leaf,
-	.get		= atm_tc_get,
-	.put		= atm_tc_put,
-	.change		= atm_tc_change,
-	.delete		= atm_tc_delete,
-	.walk		= atm_tc_walk,
-
-	.tcf_chain	= atm_tc_find_tcf,
-	.bind_tcf	= atm_tc_bind_filter,
-	.unbind_tcf	= atm_tc_put,
-
-	.dump		= atm_tc_dump_class,
+static struct Qdisc_class_ops atm_class_ops = {
+	.graft		=	atm_tc_graft,
+	.leaf		=	atm_tc_leaf,
+	.get		=	atm_tc_get,
+	.put		=	atm_tc_put,
+	.change		=	atm_tc_change,
+	.delete		=	atm_tc_delete,
+	.walk		=	atm_tc_walk,
+	.tcf_chain	=	atm_tc_find_tcf,
+	.bind_tcf	=	atm_tc_bind_filter,
+	.unbind_tcf	=	atm_tc_put,
+	.dump		=	atm_tc_dump_class,
 };
 
-struct Qdisc_ops atm_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= &atm_class_ops,
-	.id		= "atm",
-	.priv_size	= sizeof(struct atm_qdisc_data),
-
-	.enqueue	= atm_tc_enqueue,
-	.dequeue	= atm_tc_dequeue,
-	.requeue	= atm_tc_requeue,
-	.drop		= atm_tc_drop,
-
-	.init		= atm_tc_init,
-	.reset		= atm_tc_reset,
-	.destroy	= atm_tc_destroy,
-	.change		= NULL,
-
-	.dump		= atm_tc_dump
+struct Qdisc_ops atm_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&atm_class_ops,
+	.id		=	"atm",
+	.priv_size	=	sizeof(struct atm_qdisc_data),
+	.enqueue	=	atm_tc_enqueue,
+	.dequeue	=	atm_tc_dequeue,
+	.requeue	=	atm_tc_requeue,
+	.drop		=	atm_tc_drop,
+	.init		=	atm_tc_init,
+	.reset		=	atm_tc_reset,
+	.destroy	=	atm_tc_destroy,
+	.change		=	NULL,
+	.dump		=	atm_tc_dump,
+	.owner		=	THIS_MODULE,
 };
 
 
diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
--- a/net/sched/sch_cbq.c	Sat Feb 15 13:11:57 2003
+++ b/net/sched/sch_cbq.c	Sun Apr 20 00:57:16 2003
@@ -1411,11 +1411,8 @@
 
 	r = RTA_DATA(tb[TCA_CBQ_RATE-1]);
 
-	MOD_INC_USE_COUNT;
-	if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB-1])) == NULL) {
-		MOD_DEC_USE_COUNT;
+	if ((q->link.R_tab = qdisc_get_rtab(r, tb[TCA_CBQ_RTAB-1])) == NULL)
 		return -EINVAL;
-	}
 
 	q->link.refcnt = 1;
 	q->link.sibling = &q->link;
@@ -1749,7 +1746,6 @@
 	}
 
 	qdisc_put_rtab(q->link.R_tab);
-	MOD_DEC_USE_COUNT;
 }
 
 static void cbq_put(struct Qdisc *sch, unsigned long arg)
@@ -2064,41 +2060,35 @@
 	}
 }
 
-static struct Qdisc_class_ops cbq_class_ops =
-{
-	.graft		= cbq_graft,
-	.leaf		= cbq_leaf,
-	.get		= cbq_get,
-	.put		= cbq_put,
-	.change		= cbq_change_class,
-	.delete		= cbq_delete,
-	.walk		= cbq_walk,
-
-	.tcf_chain	= cbq_find_tcf,
-	.bind_tcf	= cbq_bind_filter,
-	.unbind_tcf	= cbq_unbind_filter,
-
-	.dump		= cbq_dump_class,
+static struct Qdisc_class_ops cbq_class_ops = {
+	.graft		=	cbq_graft,
+	.leaf		=	cbq_leaf,
+	.get		=	cbq_get,
+	.put		=	cbq_put,
+	.change		=	cbq_change_class,
+	.delete		=	cbq_delete,
+	.walk		=	cbq_walk,
+	.tcf_chain	=	cbq_find_tcf,
+	.bind_tcf	=	cbq_bind_filter,
+	.unbind_tcf	=	cbq_unbind_filter,
+	.dump		=	cbq_dump_class,
 };
 
-struct Qdisc_ops cbq_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= &cbq_class_ops,
-	.id		= "cbq",
-	.priv_size	= sizeof(struct cbq_sched_data),
-
-	.enqueue	= cbq_enqueue,
-	.dequeue	= cbq_dequeue,
-	.requeue	= cbq_requeue,
-	.drop		= cbq_drop,
-
-	.init		= cbq_init,
-	.reset		= cbq_reset,
-	.destroy	= cbq_destroy,
-	.change		= NULL,
-
-	.dump		= cbq_dump,
+struct Qdisc_ops cbq_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&cbq_class_ops,
+	.id		=	"cbq",
+	.priv_size	=	sizeof(struct cbq_sched_data),
+	.enqueue	=	cbq_enqueue,
+	.dequeue	=	cbq_dequeue,
+	.requeue	=	cbq_requeue,
+	.drop		=	cbq_drop,
+	.init		=	cbq_init,
+	.reset		=	cbq_reset,
+	.destroy	=	cbq_destroy,
+	.change		=	NULL,
+	.dump		=	cbq_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/sch_csz.c b/net/sched/sch_csz.c
--- a/net/sched/sch_csz.c	Thu Apr 10 22:56:20 2003
+++ b/net/sched/sch_csz.c	Sun Apr 20 00:57:16 2003
@@ -756,8 +756,6 @@
 		q->filter_list = tp->next;
 		tp->ops->destroy(tp);
 	}
-
-	MOD_DEC_USE_COUNT;
 }
 
 static int csz_init(struct Qdisc *sch, struct rtattr *opt)
@@ -799,7 +797,6 @@
 	q->wd_timer.data = (unsigned long)sch;
 	q->wd_timer.function = csz_watchdog;
 #endif
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -1018,42 +1015,35 @@
 	return &q->filter_list;
 }
 
-struct Qdisc_class_ops csz_class_ops =
-{
-	.graft		= csz_graft,
-	.leaf		= csz_leaf,
-
-	.get		= csz_get,
-	.put		= csz_put,
-	.change		= csz_change,
-	.delete		= csz_delete,
-	.walk		= csz_walk,
-
-	.tcf_chain	= csz_find_tcf,
-	.bind_tcf	= csz_bind,
-	.unbind_tcf	= csz_put,
-
-	.dump		= csz_dump_class,
+struct Qdisc_class_ops csz_class_ops = {
+	.graft		=	csz_graft,
+	.leaf		=	csz_leaf,
+	.get		=	csz_get,
+	.put		=	csz_put,
+	.change		=	csz_change,
+	.delete		=	csz_delete,
+	.walk		=	csz_walk,
+	.tcf_chain	=	csz_find_tcf,
+	.bind_tcf	=	csz_bind,
+	.unbind_tcf	=	csz_put,
+	.dump		=	csz_dump_class,
 };
 
-struct Qdisc_ops csz_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= &csz_class_ops,
-	.id		= "csz",
-	.priv_size	= sizeof(struct csz_sched_data),
-
-	.enqueue	= csz_enqueue,
-	.dequeue	= csz_dequeue,
-	.requeue	= NULL,
-	.drop		= NULL,
-
-	.init		= csz_init,
-	.reset		= csz_reset,
-	.destroy	= csz_destroy,
-	.change		= NULL,
-
-	.dump		= csz_dump,
+struct Qdisc_ops csz_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&csz_class_ops,
+	.id		=	"csz",
+	.priv_size	=	sizeof(struct csz_sched_data),
+	.enqueue	=	csz_enqueue,
+	.dequeue	=	csz_dequeue,
+	.requeue	=	NULL,
+	.drop		=	NULL,
+	.init		=	csz_init,
+	.reset		=	csz_reset,
+	.destroy	=	csz_destroy,
+	.change		=	NULL,
+	.dump		=	csz_dump,
+	.owner		=	THIS_MODULE,
 };
 
 
diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
--- a/net/sched/sch_dsmark.c	Wed Apr  9 22:08:17 2003
+++ b/net/sched/sch_dsmark.c	Sun Apr 20 00:57:16 2003
@@ -353,7 +353,6 @@
 	if (!(p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops)))
 		p->q = &noop_qdisc;
 	DPRINTK("dsmark_init: qdisc %p\n",&p->q);
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -382,7 +381,6 @@
 	qdisc_destroy(p->q);
 	p->q = &noop_qdisc;
 	kfree(p->mask);
-	MOD_DEC_USE_COUNT;
 }
 
 
@@ -433,41 +431,35 @@
 	return -1;
 }
 
-static struct Qdisc_class_ops dsmark_class_ops =
-{
-	.graft		= dsmark_graft,
-	.leaf		= dsmark_leaf,
-	.get		= dsmark_get,
-	.put		= dsmark_put,
-	.change		= dsmark_change,
-	.delete		= dsmark_delete,
-	.walk		= dsmark_walk,
-
-	.tcf_chain	= dsmark_find_tcf,
-	.bind_tcf	= dsmark_bind_filter,
-	.unbind_tcf	= dsmark_put,
-
-	.dump		= dsmark_dump_class,
+static struct Qdisc_class_ops dsmark_class_ops = {
+	.graft		=	dsmark_graft,
+	.leaf		=	dsmark_leaf,
+	.get		=	dsmark_get,
+	.put		=	dsmark_put,
+	.change		=	dsmark_change,
+	.delete		=	dsmark_delete,
+	.walk		=	dsmark_walk,
+	.tcf_chain	=	dsmark_find_tcf,
+	.bind_tcf	=	dsmark_bind_filter,
+	.unbind_tcf	=	dsmark_put,
+	.dump		=	dsmark_dump_class,
 };
 
-struct Qdisc_ops dsmark_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= &dsmark_class_ops,
-	.id		= "dsmark",
-	.priv_size	= sizeof(struct dsmark_qdisc_data),
-
-	.enqueue	= dsmark_enqueue,
-	.dequeue	= dsmark_dequeue,
-	.requeue	= dsmark_requeue,
-	.drop		= dsmark_drop,
-
-	.init		= dsmark_init,
-	.reset		= dsmark_reset,
-	.destroy	= dsmark_destroy,
-	.change		= NULL,
-
-	.dump		= dsmark_dump
+struct Qdisc_ops dsmark_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&dsmark_class_ops,
+	.id		=	"dsmark",
+	.priv_size	=	sizeof(struct dsmark_qdisc_data),
+	.enqueue	=	dsmark_enqueue,
+	.dequeue	=	dsmark_dequeue,
+	.requeue	=	dsmark_requeue,
+	.drop		=	dsmark_drop,
+	.init		=	dsmark_init,
+	.reset		=	dsmark_reset,
+	.destroy	=	dsmark_destroy,
+	.change		=	NULL,
+	.dump		=	dsmark_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
--- a/net/sched/sch_fifo.c	Mon Oct  7 07:44:51 2002
+++ b/net/sched/sch_fifo.c	Sun Apr 20 00:57:16 2003
@@ -10,6 +10,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
@@ -168,42 +169,36 @@
 	return -1;
 }
 
-struct Qdisc_ops pfifo_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "pfifo",
-	.priv_size	= sizeof(struct fifo_sched_data),
-
-	.enqueue	= pfifo_enqueue,
-	.dequeue	= pfifo_dequeue,
-	.requeue	= pfifo_requeue,
-	.drop		= fifo_drop,
-
-	.init		= fifo_init,
-	.reset		= fifo_reset,
-	.destroy	= NULL,
-	.change		= fifo_init,
-
-	.dump		= fifo_dump,
+struct Qdisc_ops pfifo_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"pfifo",
+	.priv_size	=	sizeof(struct fifo_sched_data),
+	.enqueue	=	pfifo_enqueue,
+	.dequeue	=	pfifo_dequeue,
+	.requeue	=	pfifo_requeue,
+	.drop		=	fifo_drop,
+	.init		=	fifo_init,
+	.reset		=	fifo_reset,
+	.destroy	=	NULL,
+	.change		=	fifo_init,
+	.dump		=	fifo_dump,
+	.owner		=	THIS_MODULE,
 };
 
-struct Qdisc_ops bfifo_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "bfifo",
-	.priv_size	= sizeof(struct fifo_sched_data),
-
-	.enqueue	= bfifo_enqueue,
-	.dequeue	= bfifo_dequeue,
-	.requeue	= bfifo_requeue,
-	.drop		= fifo_drop,
-
-	.init		= fifo_init,
-	.reset		= fifo_reset,
-	.destroy	= NULL,
-	.change		= fifo_init,
-
-	.dump		= fifo_dump,
+struct Qdisc_ops bfifo_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"bfifo",
+	.priv_size	=	sizeof(struct fifo_sched_data),
+	.enqueue	=	bfifo_enqueue,
+	.dequeue	=	bfifo_dequeue,
+	.requeue	=	bfifo_requeue,
+	.drop		=	fifo_drop,
+	.init		=	fifo_init,
+	.reset		=	fifo_reset,
+	.destroy	=	NULL,
+	.change		=	fifo_init,
+	.dump		=	fifo_dump,
+	.owner		=	THIS_MODULE,
 };
diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c	Mon Oct  7 07:44:51 2002
+++ b/net/sched/sch_generic.c	Sun Apr 20 00:57:16 2003
@@ -15,6 +15,7 @@
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -222,45 +223,40 @@
 	return NET_XMIT_CN;
 }
 
-struct Qdisc_ops noop_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "noop",
-	.priv_size	= 0,
-
-	.enqueue	= noop_enqueue,
-	.dequeue	= noop_dequeue,
-	.requeue	= noop_requeue,
+struct Qdisc_ops noop_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"noop",
+	.priv_size	=	0,
+	.enqueue	=	noop_enqueue,
+	.dequeue	=	noop_dequeue,
+	.requeue	=	noop_requeue,
+	.owner		=	THIS_MODULE,
 };
 
-struct Qdisc noop_qdisc =
-{
-	.enqueue	= noop_enqueue,
-	.dequeue	= noop_dequeue,
-	.flags		= TCQ_F_BUILTIN,
-	.ops		= &noop_qdisc_ops,	
+struct Qdisc noop_qdisc = {
+	.enqueue	=	noop_enqueue,
+	.dequeue	=	noop_dequeue,
+	.flags		=	TCQ_F_BUILTIN,
+	.ops		=	&noop_qdisc_ops,	
 };
 
-
-struct Qdisc_ops noqueue_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "noqueue",
-	.priv_size	= 0,
-
-	.enqueue	= noop_enqueue,
-	.dequeue	= noop_dequeue,
-	.requeue	= noop_requeue,
+struct Qdisc_ops noqueue_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"noqueue",
+	.priv_size	=	0,
+	.enqueue	=	noop_enqueue,
+	.dequeue	=	noop_dequeue,
+	.requeue	=	noop_requeue,
+	.owner		=	THIS_MODULE,
 };
 
-struct Qdisc noqueue_qdisc =
-{
-	.enqueue	= NULL,
-	.dequeue	= noop_dequeue,
-	.flags		= TCQ_F_BUILTIN,
-	.ops		= &noqueue_qdisc_ops,
+struct Qdisc noqueue_qdisc = {
+	.enqueue	=	NULL,
+	.dequeue	=	noop_dequeue,
+	.flags		=	TCQ_F_BUILTIN,
+	.ops		=	&noqueue_qdisc_ops,
 };
 
 
@@ -343,19 +339,17 @@
 	return 0;
 }
 
-static struct Qdisc_ops pfifo_fast_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "pfifo_fast",
-	.priv_size	= 3 * sizeof(struct sk_buff_head),
-
-	.enqueue	= pfifo_fast_enqueue,
-	.dequeue	= pfifo_fast_dequeue,
-	.requeue	= pfifo_fast_requeue,
-
-	.init		= pfifo_fast_init,
-	.reset		= pfifo_fast_reset,
+static struct Qdisc_ops pfifo_fast_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"pfifo_fast",
+	.priv_size	=	3 * sizeof(struct sk_buff_head),
+	.enqueue	=	pfifo_fast_enqueue,
+	.dequeue	=	pfifo_fast_dequeue,
+	.requeue	=	pfifo_fast_requeue,
+	.init		=	pfifo_fast_init,
+	.reset		=	pfifo_fast_reset,
+	.owner		=	THIS_MODULE,
 };
 
 struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops)
@@ -422,6 +416,7 @@
 		ops->reset(qdisc);
 	if (ops->destroy)
 		ops->destroy(qdisc);
+	module_put(ops->owner);
 	if (!(qdisc->flags&TCQ_F_BUILTIN))
 		kfree(qdisc);
 }
diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c
--- a/net/sched/sch_gred.c	Tue Feb 25 11:05:27 2003
+++ b/net/sched/sch_gred.c	Sun Apr 20 00:57:16 2003
@@ -348,7 +348,6 @@
 		table->grio=sopt->grio; 
 		table->initd=0;
 		/* probably need to clear all the table DP entries as well */
-		MOD_INC_USE_COUNT;
 		return 0;
 	    }
 
@@ -490,7 +489,6 @@
 		table->def=sopt->def_DP; 
 		table->grio=sopt->grio; 
 		table->initd=0;
-		MOD_INC_USE_COUNT;
 		return 0;
 	}
 
@@ -602,27 +600,23 @@
 		if (table->tab[i])
 			kfree(table->tab[i]);
 	}
-	MOD_DEC_USE_COUNT;
 }
 
-struct Qdisc_ops gred_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "gred",
-	.priv_size	= sizeof(struct gred_sched),
-
-	.enqueue	= gred_enqueue,
-	.dequeue	= gred_dequeue,
-	.requeue	= gred_requeue,
-	.drop		= gred_drop,
-
-	.init		= gred_init,
-	.reset		= gred_reset,
-	.destroy	= gred_destroy,
-	.change		= gred_change,
-
-	.dump		= gred_dump,
+struct Qdisc_ops gred_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"gred",
+	.priv_size	=	sizeof(struct gred_sched),
+	.enqueue	=	gred_enqueue,
+	.dequeue	=	gred_dequeue,
+	.requeue	=	gred_requeue,
+	.drop		=	gred_drop,
+	.init		=	gred_init,
+	.reset		=	gred_reset,
+	.destroy	=	gred_destroy,
+	.change		=	gred_change,
+	.dump		=	gred_dump,
+	.owner		=	THIS_MODULE,
 };
 
 
diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c
--- a/net/sched/sch_htb.c	Fri Apr 11 00:08:40 2003
+++ b/net/sched/sch_htb.c	Sun Apr 20 00:57:16 2003
@@ -1167,7 +1167,6 @@
 		q->rate2quantum = 1;
 	q->defcls = gopt->defcls;
 
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -1352,7 +1351,6 @@
 
 	htb_destroy_filters(&q->filter_list);
 	__skb_queue_purge(&q->direct_queue);
-	MOD_DEC_USE_COUNT;
 }
 
 static int htb_delete(struct Qdisc *sch, unsigned long arg)
@@ -1588,41 +1586,35 @@
 	}
 }
 
-static struct Qdisc_class_ops htb_class_ops =
-{
-    htb_graft,
-    htb_leaf,
-    htb_get,
-    htb_put,
-    htb_change_class,
-    htb_delete,
-    htb_walk,
-
-    htb_find_tcf,
-    htb_bind_filter,
-    htb_unbind_filter,
-
-    htb_dump_class,
+static struct Qdisc_class_ops htb_class_ops = {
+	.graft		=	htb_graft,
+	.leaf		=	htb_leaf,
+	.get		=	htb_get,
+	.put		=	htb_put,
+	.change		=	htb_change_class,
+	.delete		=	htb_delete,
+	.walk		=	htb_walk,
+	.tcf_chain	=	htb_find_tcf,
+	.bind_tcf	=	htb_bind_filter,
+	.unbind_tcf	=	htb_unbind_filter,
+	.dump		=	htb_dump_class,
 };
 
-struct Qdisc_ops htb_qdisc_ops =
-{
-    NULL,
-    &htb_class_ops,
-    "htb",
-    sizeof(struct htb_sched),
-
-    htb_enqueue,
-    htb_dequeue,
-    htb_requeue,
-    htb_drop,
-
-    htb_init,
-    htb_reset,
-    htb_destroy,
-    NULL /* htb_change */,
-
-    htb_dump,
+struct Qdisc_ops htb_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&htb_class_ops,
+	.id		=	"htb",
+	.priv_size	=	sizeof(struct htb_sched),
+	.enqueue	=	htb_enqueue,
+	.dequeue	=	htb_dequeue,
+	.requeue	=	htb_requeue,
+	.drop		=	htb_drop,
+	.init		=	htb_init,
+	.reset		=	htb_reset,
+	.destroy	=	htb_destroy,
+	.change		=	NULL /* htb_change */,
+	.dump		=	htb_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
--- a/net/sched/sch_ingress.c	Wed Apr  9 22:08:17 2003
+++ b/net/sched/sch_ingress.c	Sun Apr 20 00:57:16 2003
@@ -262,7 +262,6 @@
 	memset(p, 0, sizeof(*p));
 	p->filter_list = NULL;
 	p->q = &noop_qdisc;
-	MOD_INC_USE_COUNT;
 	return 0;
 error:
 	return -EINVAL;
@@ -308,9 +307,6 @@
 /* for future use */
 	qdisc_destroy(p->q);
 #endif
- 
-	MOD_DEC_USE_COUNT;
-
 }
 
 
@@ -329,41 +325,35 @@
 	return -1;
 }
 
-static struct Qdisc_class_ops ingress_class_ops =
-{
-	.graft		= ingress_graft,
-	.leaf		= ingress_leaf,
-	.get		= ingress_get,
-	.put		= ingress_put,
-	.change		= ingress_change,
-	.delete		= NULL,
-	.walk		= ingress_walk,
-
-	.tcf_chain	= ingress_find_tcf,
-	.bind_tcf	= ingress_bind_filter,
-	.unbind_tcf	= ingress_put,
-
-	.dump		= NULL,
+static struct Qdisc_class_ops ingress_class_ops = {
+	.graft		=	ingress_graft,
+	.leaf		=	ingress_leaf,
+	.get		=	ingress_get,
+	.put		=	ingress_put,
+	.change		=	ingress_change,
+	.delete		=	NULL,
+	.walk		=	ingress_walk,
+	.tcf_chain	=	ingress_find_tcf,
+	.bind_tcf	=	ingress_bind_filter,
+	.unbind_tcf	=	ingress_put,
+	.dump		=	NULL,
 };
 
-struct Qdisc_ops ingress_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= &ingress_class_ops,
-	.id		= "ingress",
-	.priv_size	= sizeof(struct ingress_qdisc_data),
-
-	.enqueue	= ingress_enqueue,
-	.dequeue	= ingress_dequeue,
-	.requeue	= ingress_requeue,
-	.drop		= ingress_drop,
-
-	.init		= ingress_init,
-	.reset		= ingress_reset,
-	.destroy	= ingress_destroy,
-	.change		= NULL,
-
-	.dump		= ingress_dump,
+struct Qdisc_ops ingress_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&ingress_class_ops,
+	.id		=	"ingress",
+	.priv_size	=	sizeof(struct ingress_qdisc_data),
+	.enqueue	=	ingress_enqueue,
+	.dequeue	=	ingress_dequeue,
+	.requeue	=	ingress_requeue,
+	.drop		=	ingress_drop,
+	.init		=	ingress_init,
+	.reset		=	ingress_reset,
+	.destroy	=	ingress_destroy,
+	.change		=	NULL,
+	.dump		=	ingress_dump,
+	.owner		=	THIS_MODULE,
 };
 
 
diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c
--- a/net/sched/sch_prio.c	Thu Apr 10 22:56:20 2003
+++ b/net/sched/sch_prio.c	Sun Apr 20 00:57:16 2003
@@ -169,7 +169,6 @@
 		qdisc_destroy(q->queues[prio]);
 		q->queues[prio] = &noop_qdisc;
 	}
-	MOD_DEC_USE_COUNT;
 }
 
 static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
@@ -233,7 +232,6 @@
 		if ((err= prio_tune(sch, opt)) != 0)
 			return err;
 	}
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -369,42 +367,35 @@
 	return &q->filter_list;
 }
 
-static struct Qdisc_class_ops prio_class_ops =
-{
-	.graft		= prio_graft,
-	.leaf		= prio_leaf,
-
-	.get		= prio_get,
-	.put		= prio_put,
-	.change		= prio_change,
-	.delete		= prio_delete,
-	.walk		= prio_walk,
-
-	.tcf_chain	= prio_find_tcf,
-	.bind_tcf	= prio_bind,
-	.unbind_tcf	= prio_put,
-
-	.dump		= prio_dump_class,
+static struct Qdisc_class_ops prio_class_ops = {
+	.graft		=	prio_graft,
+	.leaf		=	prio_leaf,
+	.get		=	prio_get,
+	.put		=	prio_put,
+	.change		=	prio_change,
+	.delete		=	prio_delete,
+	.walk		=	prio_walk,
+	.tcf_chain	=	prio_find_tcf,
+	.bind_tcf	=	prio_bind,
+	.unbind_tcf	=	prio_put,
+	.dump		=	prio_dump_class,
 };
 
-struct Qdisc_ops prio_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= &prio_class_ops,
-	.id		= "prio",
-	.priv_size	= sizeof(struct prio_sched_data),
-
-	.enqueue	= prio_enqueue,
-	.dequeue	= prio_dequeue,
-	.requeue	= prio_requeue,
-	.drop		= prio_drop,
-
-	.init		= prio_init,
-	.reset		= prio_reset,
-	.destroy	= prio_destroy,
-	.change		= prio_tune,
-
-	.dump		= prio_dump,
+struct Qdisc_ops prio_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	&prio_class_ops,
+	.id		=	"prio",
+	.priv_size	=	sizeof(struct prio_sched_data),
+	.enqueue	=	prio_enqueue,
+	.dequeue	=	prio_dequeue,
+	.requeue	=	prio_requeue,
+	.drop		=	prio_drop,
+	.init		=	prio_init,
+	.reset		=	prio_reset,
+	.destroy	=	prio_destroy,
+	.change		=	prio_tune,
+	.dump		=	prio_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c
--- a/net/sched/sch_red.c	Mon Oct  7 07:44:52 2002
+++ b/net/sched/sch_red.c	Sun Apr 20 00:57:16 2003
@@ -407,14 +407,7 @@
 
 static int red_init(struct Qdisc* sch, struct rtattr *opt)
 {
-	int err;
-
-	MOD_INC_USE_COUNT;
-
-	if ((err = red_change(sch, opt)) != 0) {
-		MOD_DEC_USE_COUNT;
-	}
-	return err;
+	return red_change(sch, opt);
 }
 
 
@@ -458,27 +451,23 @@
 
 static void red_destroy(struct Qdisc *sch)
 {
-	MOD_DEC_USE_COUNT;
 }
 
-struct Qdisc_ops red_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "red",
-	.priv_size	= sizeof(struct red_sched_data),
-
-	.enqueue	= red_enqueue,
-	.dequeue	= red_dequeue,
-	.requeue	= red_requeue,
-	.drop		= red_drop,
-
-	.init		= red_init,
-	.reset		= red_reset,
-	.destroy	= red_destroy,
-	.change		= red_change,
-
-	.dump		= red_dump,
+struct Qdisc_ops red_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"red",
+	.priv_size	=	sizeof(struct red_sched_data),
+	.enqueue	=	red_enqueue,
+	.dequeue	=	red_dequeue,
+	.requeue	=	red_requeue,
+	.drop		=	red_drop,
+	.init		=	red_init,
+	.reset		=	red_reset,
+	.destroy	=	red_destroy,
+	.change		=	red_change,
+	.dump		=	red_dump,
+	.owner		=	THIS_MODULE,
 };
 
 
diff -Nru a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
--- a/net/sched/sch_sfq.c	Sat Apr 12 15:42:42 2003
+++ b/net/sched/sch_sfq.c	Sun Apr 20 00:57:16 2003
@@ -431,7 +431,6 @@
 	}
 	for (i=0; i<SFQ_DEPTH; i++)
 		sfq_link(q, i);
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -439,7 +438,6 @@
 {
 	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
 	del_timer(&q->perturb_timer);
-	MOD_DEC_USE_COUNT;
 }
 
 static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
@@ -464,24 +462,21 @@
 	return -1;
 }
 
-struct Qdisc_ops sfq_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "sfq",
-	.priv_size	= sizeof(struct sfq_sched_data),
-
-	.enqueue	= sfq_enqueue,
-	.dequeue	= sfq_dequeue,
-	.requeue	= sfq_requeue,
-	.drop		= sfq_drop,
-
-	.init		= sfq_init,
-	.reset		= sfq_reset,
-	.destroy	= sfq_destroy,
-	.change		= NULL,
-
-	.dump		= sfq_dump,
+struct Qdisc_ops sfq_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"sfq",
+	.priv_size	=	sizeof(struct sfq_sched_data),
+	.enqueue	=	sfq_enqueue,
+	.dequeue	=	sfq_dequeue,
+	.requeue	=	sfq_requeue,
+	.drop		=	sfq_drop,
+	.init		=	sfq_init,
+	.reset		=	sfq_reset,
+	.destroy	=	sfq_destroy,
+	.change		=	NULL,
+	.dump		=	sfq_dump,
+	.owner		=	THIS_MODULE,
 };
 
 #ifdef MODULE
diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
--- a/net/sched/sch_tbf.c	Mon Oct  7 07:44:52 2002
+++ b/net/sched/sch_tbf.c	Sun Apr 20 00:57:16 2003
@@ -330,23 +330,17 @@
 
 static int tbf_init(struct Qdisc* sch, struct rtattr *opt)
 {
-	int err;
 	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
 	
 	if (opt == NULL)
 		return -EINVAL;
 	
-	MOD_INC_USE_COUNT;
-	
 	PSCHED_GET_TIME(q->t_c);
 	init_timer(&q->wd_timer);
 	q->wd_timer.function = tbf_watchdog;
 	q->wd_timer.data = (unsigned long)sch;
 	
-	if ((err = tbf_change(sch, opt)) != 0) {
-		MOD_DEC_USE_COUNT;
-	}
-	return err;
+	return tbf_change(sch, opt);
 }
 
 static void tbf_destroy(struct Qdisc *sch)
@@ -359,8 +353,6 @@
 		qdisc_put_rtab(q->P_tab);
 	if (q->R_tab)
 		qdisc_put_rtab(q->R_tab);
-
-	MOD_DEC_USE_COUNT;
 }
 
 static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)
@@ -391,24 +383,20 @@
 	return -1;
 }
 
-struct Qdisc_ops tbf_qdisc_ops =
-{
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "tbf",
-	.priv_size	= sizeof(struct tbf_sched_data),
-
-	.enqueue	= tbf_enqueue,
-	.dequeue	= tbf_dequeue,
-	.requeue	= tbf_requeue,
-	.drop		= tbf_drop,
-
-	.init		= tbf_init,
-	.reset		= tbf_reset,
-	.destroy	= tbf_destroy,
-	.change		= tbf_change,
-
-	.dump		= tbf_dump,
+struct Qdisc_ops tbf_qdisc_ops = {
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"tbf",
+	.priv_size	=	sizeof(struct tbf_sched_data),
+	.enqueue	=	tbf_enqueue,
+	.dequeue	=	tbf_dequeue,
+	.requeue	=	tbf_requeue,
+	.drop		=	tbf_drop,
+	.init		=	tbf_init,
+	.reset		=	tbf_reset,
+	.destroy	=	tbf_destroy,
+	.change		=	tbf_change,
+	.dump		=	tbf_dump,
 };
 
 
diff -Nru a/net/sched/sch_teql.c b/net/sched/sch_teql.c
--- a/net/sched/sch_teql.c	Mon Oct  7 07:44:52 2002
+++ b/net/sched/sch_teql.c	Sun Apr 20 00:57:16 2003
@@ -177,8 +177,6 @@
 				
 		} while ((prev = q) != master->slaves);
 	}
-
-	MOD_DEC_USE_COUNT;
 }
 
 static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
@@ -222,8 +220,6 @@
 		m->dev.mtu = dev->mtu;
 		m->dev.flags = (m->dev.flags&~FMASK)|(dev->flags&FMASK);
 	}
-	
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
@@ -386,14 +382,12 @@
 	m->dev.mtu = mtu;
 	m->dev.flags = (m->dev.flags&~FMASK) | flags;
 	netif_start_queue(&m->dev);
-	MOD_INC_USE_COUNT;
 	return 0;
 }
 
 static int teql_master_close(struct net_device *dev)
 {
 	netif_stop_queue(dev);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -440,20 +434,19 @@
 
 static struct teql_master the_master = {
 {
-	.next		= NULL,
-	.cl_ops		= NULL,
-	.id		= "",
-	.priv_size	= sizeof(struct teql_sched_data),
-
-	.enqueue	= teql_enqueue,
-	.dequeue	= teql_dequeue,
-	.requeue	= teql_requeue,
-	.drop		= NULL,
-
-	.init		= teql_qdisc_init,
-	.reset		= teql_reset,
-	.destroy	= teql_destroy,
-	.dump		= NULL,
+	.next		=	NULL,
+	.cl_ops		=	NULL,
+	.id		=	"",
+	.priv_size	=	sizeof(struct teql_sched_data),
+	.enqueue	=	teql_enqueue,
+	.dequeue	=	teql_dequeue,
+	.requeue	=	teql_requeue,
+	.drop		=	NULL,
+	.init		=	teql_qdisc_init,
+	.reset		=	teql_reset,
+	.destroy	=	teql_destroy,
+	.dump		=	NULL,
+	.owner		=	THIS_MODULE,
 },};
 
 
@@ -474,6 +467,7 @@
 	memcpy(the_master.qops.id, the_master.dev.name, IFNAMSIZ);
 	the_master.dev.init = teql_master_init;
 
+	SET_MODULE_OWNER(&the_master.dev);
 	err = register_netdevice(&the_master.dev);
 	if (err == 0) {
 		err = register_qdisc(&the_master.qops);
diff -Nru a/net/socket.c b/net/socket.c
--- a/net/socket.c	Fri Apr 18 10:39:05 2003
+++ b/net/socket.c	Tue Apr 22 23:13:31 2003
@@ -69,8 +69,6 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/wanrouter.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
 #include <linux/if_bridge.h>
 #include <linux/init.h>
 #include <linux/poll.h>
@@ -143,6 +141,36 @@
 
 static struct net_proto_family *net_families[NPROTO];
 
+static __inline__ void net_family_bug(int family)
+{
+	printk(KERN_ERR "%d is not yet sock_registered!\n", family);
+	BUG();
+}
+
+int net_family_get(int family)
+{
+	struct net_proto_family *prot = net_families[family];
+	int rc = 1;
+
+	barrier();
+	if (likely(prot != NULL))
+		rc = try_module_get(prot->owner);
+	else
+		net_family_bug(family);
+	return rc;
+}
+
+void net_family_put(int family)
+{
+	struct net_proto_family *prot = net_families[family];
+
+	barrier();
+	if (likely(prot != NULL))
+		module_put(prot->owner);
+	else
+		net_family_bug(family);
+}
+
 #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
 static atomic_t net_family_lockct = ATOMIC_INIT(0);
 static spinlock_t net_family_lock = SPIN_LOCK_UNLOCKED;
@@ -506,8 +534,13 @@
  
 void sock_release(struct socket *sock)
 {
-	if (sock->ops) 
+	if (sock->ops) {
+		const int family = sock->ops->family;
+
 		sock->ops->release(sock);
+		sock->ops = NULL;
+		net_family_put(family);
+	}
 
 	if (sock->fasync_list)
 		printk(KERN_ERR "sock_release: fasync list not empty!\n");
@@ -1058,11 +1091,12 @@
 
 	sock->type  = type;
 
+	i = -EBUSY;
+	if (!net_family_get(family))
+		goto out_release;
+
 	if ((i = net_families[family]->create(sock, protocol)) < 0) 
-	{
-		sock_release(sock);
-		goto out;
-	}
+		goto out_release;
 
 	*res = sock;
 	security_socket_post_create(sock, family, type, protocol);
@@ -1070,6 +1104,9 @@
 out:
 	net_family_read_unlock();
 	return i;
+out_release:
+	sock_release(sock);
+	goto out;
 }
 
 asmlinkage long sys_socket(int family, int type, int protocol)
@@ -1944,17 +1981,6 @@
 	 *  do_initcalls is run.  
 	 */
 
-
-	/*
-	 * The netlink device handler may be needed early.
-	 */
-
-#ifdef CONFIG_NET
-	rtnetlink_init();
-#endif
-#ifdef CONFIG_NETLINK_DEV
-	init_netlink();
-#endif
 #ifdef CONFIG_NETFILTER
 	netfilter_init();
 #endif
diff -Nru a/sound/core/sgbuf.c b/sound/core/sgbuf.c
--- a/sound/core/sgbuf.c	Thu Apr 10 03:28:11 2003
+++ b/sound/core/sgbuf.c	Sat Apr 19 23:22:50 2003
@@ -85,7 +85,7 @@
 	}
 
 	sgbuf->size = size;
-	dmab->area = vmap(sgbuf->page_table, sgbuf->pages);
+	dmab->area = vmap(sgbuf->page_table, sgbuf->pages, VM_MAP, PAGE_KERNEL);
 	if (! dmab->area)
 		goto _failed;
 	return dmab->area;
diff -Nru a/sound/core/sound.c b/sound/core/sound.c
--- a/sound/core/sound.c	Thu Apr 10 03:28:11 2003
+++ b/sound/core/sound.c	Fri Apr 18 11:18:17 2003
@@ -68,10 +68,6 @@
 
 static DECLARE_MUTEX(sound_mutex);
 
-#ifdef CONFIG_DEVFS_FS
-static devfs_handle_t devfs_handle = NULL;
-#endif
-
 #ifdef CONFIG_KMOD
 
 /**
@@ -343,15 +339,7 @@
 	if ((err = snd_oss_init_module()) < 0)
 		return err;
 #endif
-#ifdef CONFIG_DEVFS_FS
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-	devfs_handle = devfs_mk_dir(NULL, "snd", 3, NULL);
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,5,67)
-	devfs_handle = devfs_mk_dir(NULL, "snd", NULL);
-#else
-	devfs_handle = devfs_mk_dir("snd");
-#endif
-#endif
+	devfs_mk_dir("snd");
 	if (register_chrdev(major, "alsa", &snd_fops)) {
 		snd_printk(KERN_ERR "unable to register native major device number %d\n", major);
 		return -EIO;
@@ -404,9 +392,7 @@
 #endif
 	if (unregister_chrdev(major, "alsa") != 0)
 		snd_printk(KERN_ERR "unable to unregister major device number %d\n", major);
-#ifdef CONFIG_DEVFS_FS
-	devfs_unregister(devfs_handle);
-#endif
+	devfs_remove("snd");
 }
 
 module_init(alsa_sound_init)
diff -Nru a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
--- a/sound/drivers/mpu401/mpu401_uart.c	Thu Mar 20 08:41:13 2003
+++ b/sound/drivers/mpu401/mpu401_uart.c	Thu Apr 24 05:17:35 2003
@@ -90,7 +90,7 @@
 #endif
 }
 
-static void _snd_mpu401_uart_interrupt(mpu401_t *mpu)
+static irqreturn_t _snd_mpu401_uart_interrupt(mpu401_t *mpu)
 {
 	if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
 		if (! test_and_set_bit(MPU401_MODE_BIT_RX_LOOP, &mpu->mode)) {
@@ -108,6 +108,9 @@
 		snd_mpu401_uart_output_write(mpu);
 		spin_unlock(&mpu->output_lock);
 	}
+
+	/* FIXME! This should really check whether the irq was for us */
+	return IRQ_HANDLED;
 }
 
 /**
@@ -118,13 +121,13 @@
  *
  * Processes the interrupt for MPU401-UART i/o.
  */
-void snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	mpu401_t *mpu = snd_magic_cast(mpu401_t, dev_id, return);
+	mpu401_t *mpu = snd_magic_cast(mpu401_t, dev_id, return IRQ_NONE);
 	
 	if (mpu == NULL)
-		return;
-	_snd_mpu401_uart_interrupt(mpu);
+		return IRQ_NONE;
+	return _snd_mpu401_uart_interrupt(mpu);
 }
 
 /*
diff -Nru a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
--- a/sound/drivers/mtpav.c	Wed Mar 19 09:22:05 2003
+++ b/sound/drivers/mtpav.c	Thu Apr 24 05:17:35 2003
@@ -585,14 +585,15 @@
 	} while (sbyt & SIGS_BYTE);
 }
 
-static void snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs)
 {
-	mtpav_t *mcard = snd_magic_cast(mtpav_t, dev_id, return);
+	mtpav_t *mcard = snd_magic_cast(mtpav_t, dev_id, return IRQ_NONE);
 
 	//printk("irqh()\n");
 	spin_lock(&mcard->spinlock);
 	snd_mtpav_read_bytes(mcard);
 	spin_unlock(&mcard->spinlock);
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
--- a/sound/drivers/serial-u16550.c	Tue Feb 18 10:31:36 2003
+++ b/sound/drivers/serial-u16550.c	Mon Apr 21 00:32:53 2003
@@ -290,7 +290,7 @@
  * Note that some devices need OUT2 to be set before they will generate
  * interrupts at all. (Possibly tied to an internal pull-up on CTS?)
  */
-static void snd_uart16550_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_uart16550_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	snd_uart16550_t *uart;
 
@@ -298,11 +298,12 @@
 	spin_lock(&uart->open_lock);
 	if (uart->filemode == SERIAL_MODE_NOT_OPENED) {
 		spin_unlock(&uart->open_lock);
-		return;
+		return IRQ_NONE;
 	}
 	inb(uart->base + UART_IIR);		/* indicate to the UART that the interrupt has been serviced */
 	snd_uart16550_io_loop(uart);
 	spin_unlock(&uart->open_lock);
+	return IRQ_HANDLED;
 }
 
 /* When the polling mode, this function calls snd_uart16550_io_loop. */
diff -Nru a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
--- a/sound/isa/ad1816a/ad1816a_lib.c	Sat Feb  8 12:10:49 2003
+++ b/sound/isa/ad1816a/ad1816a_lib.c	Thu Apr 24 05:17:35 2003
@@ -311,9 +311,9 @@
 }
 
 
-static void snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	ad1816a_t *chip = snd_magic_cast(ad1816a_t, dev_id, return);
+	ad1816a_t *chip = snd_magic_cast(ad1816a_t, dev_id, return IRQ_NONE);
 	unsigned char status;
 
 	spin_lock(&chip->lock);
@@ -332,6 +332,7 @@
 	spin_lock(&chip->lock);
 	snd_ad1816a_out(chip, AD1816A_INTERRUPT_STATUS, 0x00);
 	spin_unlock(&chip->lock);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
--- a/sound/isa/ad1848/ad1848_lib.c	Sat Feb  8 12:10:49 2003
+++ b/sound/isa/ad1848/ad1848_lib.c	Thu Apr 24 05:17:35 2003
@@ -585,9 +585,9 @@
 	return 0;
 }
 
-void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	ad1848_t *chip = snd_magic_cast(ad1848_t, dev_id, return);
+	ad1848_t *chip = snd_magic_cast(ad1848_t, dev_id, return IRQ_NONE);
 
 	if ((chip->mode & AD1848_MODE_PLAY) && chip->playback_substream &&
 	    (chip->mode & AD1848_MODE_RUNNING))
@@ -596,6 +596,7 @@
 	    (chip->mode & AD1848_MODE_RUNNING))
 		snd_pcm_period_elapsed(chip->capture_substream);
 	outb(0, AD1848P(chip, STATUS));	/* clear global interrupt bit */
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_uframes_t snd_ad1848_playback_pointer(snd_pcm_substream_t * substream)
diff -Nru a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
--- a/sound/isa/cs423x/cs4231_lib.c	Sun Feb 16 05:47:42 2003
+++ b/sound/isa/cs423x/cs4231_lib.c	Thu Apr 24 05:17:35 2003
@@ -967,9 +967,9 @@
 		chip->capture_substream->runtime->overrange++;
 }
 
-void snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return);
+	cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return IRQ_NONE);
 	unsigned char status;
 
 	status = snd_cs4231_in(chip, CS4231_IRQ_STATUS);
@@ -998,6 +998,7 @@
 	spin_lock(&chip->reg_lock);
 	snd_cs4231_outm(chip, CS4231_IRQ_STATUS, ~CS4231_ALL_IRQS | ~status, 0);
 	spin_unlock(&chip->reg_lock);
+	return IRQ_HANDLED;
 }
 
 #ifdef LEGACY_SUPPORT
diff -Nru a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
--- a/sound/isa/es1688/es1688_lib.c	Sat Feb  8 12:10:50 2003
+++ b/sound/isa/es1688/es1688_lib.c	Thu Apr 24 05:17:35 2003
@@ -482,9 +482,9 @@
 	return snd_es1688_trigger(chip, cmd, 0x0f);
 }
 
-void snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	es1688_t *chip = snd_magic_cast(es1688_t, dev_id, return);
+	es1688_t *chip = snd_magic_cast(es1688_t, dev_id, return IRQ_NONE);
 
 	if (chip->trigger_value == 0x05)	/* ok.. playback is active */
 		snd_pcm_period_elapsed(chip->playback_substream);
@@ -492,6 +492,7 @@
 		snd_pcm_period_elapsed(chip->capture_substream);
 
 	inb(ES1688P(chip, DATA_AVAIL));	/* ack interrupt */
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_uframes_t snd_es1688_playback_pointer(snd_pcm_substream_t * substream)
diff -Nru a/sound/isa/es18xx.c b/sound/isa/es18xx.c
--- a/sound/isa/es18xx.c	Thu Apr 10 06:38:19 2003
+++ b/sound/isa/es18xx.c	Thu Apr 24 05:17:35 2003
@@ -727,12 +727,11 @@
 		return snd_es18xx_playback2_trigger(chip, substream, cmd);
 }
 
-static void snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	es18xx_t *chip = snd_magic_cast(es18xx_t, dev_id, return);
+	es18xx_t *chip = snd_magic_cast(es18xx_t, dev_id, return IRQ_NONE);
 	unsigned char status;
 
-
 	if (chip->caps & ES18XX_CONTROL) {
 		/* Read Interrupt status */
 		status = inb(chip->ctrl_port + 6);
@@ -787,7 +786,7 @@
 		/* ack interrupt */
 		snd_es18xx_mixer_write(chip, 0x66, 0x00);
 	}
-
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_uframes_t snd_es18xx_playback_pointer(snd_pcm_substream_t * substream)
diff -Nru a/sound/isa/gus/gus_irq.c b/sound/isa/gus/gus_irq.c
--- a/sound/isa/gus/gus_irq.c	Mon Jan 27 09:30:52 2003
+++ b/sound/isa/gus/gus_irq.c	Thu Apr 24 05:17:35 2003
@@ -30,16 +30,19 @@
 #define STAT_ADD(x)	while (0) { ; }
 #endif
 
-void snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	snd_gus_card_t * gus = snd_magic_cast(snd_gus_card_t, dev_id, return);
+	snd_gus_card_t * gus = snd_magic_cast(snd_gus_card_t,
+					dev_id, return IRQ_NONE);
 	unsigned char status;
 	int loop = 100;
-	
-      __again:
+	int handled = 0;
+
+__again:
 	status = inb(gus->gf1.reg_irqstat);
 	if (status == 0)
-		return;
+		return IRQ_RETVAL(handled);
+	handled = 1;
 	// snd_printk("IRQ: status = 0x%x\n", status);
 	if (status & 0x02) {
 		STAT_ADD(gus->gf1.interrupt_stat_midi_in);
@@ -101,6 +104,7 @@
 	}
 	if (--loop > 0)
 		goto __again;
+	return IRQ_NONE;
 }
 
 #ifdef CONFIG_SND_DEBUG
diff -Nru a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
--- a/sound/isa/gus/gusmax.c	Tue Oct 22 06:04:00 2002
+++ b/sound/isa/gus/gusmax.c	Mon Apr 21 00:32:53 2003
@@ -129,22 +129,26 @@
 	return 0;
 }
 
-static void snd_gusmax_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct snd_gusmax *maxcard = (struct snd_gusmax *) dev_id;
 	int loop, max = 5;
+	int handled = 0;
 
 	do {
 		loop = 0;
 		if (inb(maxcard->gus_status_reg)) {
+			handled = 1;
 			snd_gus_interrupt(irq, maxcard->gus, regs);
 			loop++;
 		}
 		if (inb(maxcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */
+			handled = 1;
 			snd_cs4231_interrupt(irq, maxcard->cs4231, regs);
 			loop++;
 		}
 	} while (loop && --max > 0);
+	return IRQ_RETVAL(handled);
 }
 
 static void __init snd_gusmax_init(int dev, snd_card_t * card, snd_gus_card_t * gus)
diff -Nru a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
--- a/sound/isa/gus/interwave.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/gus/interwave.c	Mon Apr 21 00:32:53 2003
@@ -312,22 +312,26 @@
 	return -ENODEV;
 }
 
-static void snd_interwave_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_interwave_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct snd_interwave *iwcard = (struct snd_interwave *) dev_id;
 	int loop, max = 5;
+	int handled = 0;
 
 	do {
 		loop = 0;
 		if (inb(iwcard->gus_status_reg)) {
+			handled = 1;
 			snd_gus_interrupt(irq, iwcard->gus, regs);
 			loop++;
 		}
 		if (inb(iwcard->pcm_status_reg) & 0x01) {	/* IRQ bit is set? */
+			handled = 1;
 			snd_cs4231_interrupt(irq, iwcard->cs4231, regs);
 			loop++;
 		}
 	} while (loop && --max > 0);
+	return IRQ_RETVAL(handled);
 }
 
 static void __devinit snd_interwave_reset(snd_gus_card_t * gus)
diff -Nru a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
--- a/sound/isa/opl3sa2.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/opl3sa2.c	Thu Apr 24 05:17:35 2003
@@ -297,26 +297,34 @@
 	return 0;
 }
 
-static void snd_opl3sa2_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_opl3sa2_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned short status;
-	opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, dev_id, return);
+	opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, dev_id, return IRQ_NONE);
+	int handled = 0;
 
 	if (chip == NULL || chip->card == NULL)
-		return;
+		return IRQ_NONE;
 
 	status = snd_opl3sa2_read(chip, OPL3SA2_IRQ_STATUS);
 
-	if (status & 0x20)
+	if (status & 0x20) {
+		handled = 1;
 		snd_opl3_interrupt(chip->synth);
+	}
 
-	if ((status & 0x10) && chip->rmidi != NULL)
+	if ((status & 0x10) && chip->rmidi != NULL) {
+		handled = 1;
 		snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
+	}
 
-	if (status & 0x07)	/* TI,CI,PI */
+	if (status & 0x07) {	/* TI,CI,PI */
+		handled = 1;
 		snd_cs4231_interrupt(irq, chip->cs4231, regs);
+	}
 
 	if (status & 0x40) { /* hardware volume change */
+		handled = 1;
 		/* reading from Master Lch register at 0x07 clears this bit */
 		snd_opl3sa2_read(chip, OPL3SA2_MASTER_RIGHT);
 		snd_opl3sa2_read(chip, OPL3SA2_MASTER_LEFT);
@@ -325,6 +333,7 @@
 			snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->master_volume->id);
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 #define OPL3SA2_SINGLE(xname, xindex, reg, shift, mask, invert) \
diff -Nru a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
--- a/sound/isa/opti9xx/opti92x-ad1848.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/opti9xx/opti92x-ad1848.c	Thu Apr 24 05:17:35 2003
@@ -1125,9 +1125,9 @@
 	spin_unlock_irqrestore(&chip->lock, flags);
 }
 
-void snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	opti93x_t *codec = snd_magic_cast(opti93x_t, dev_id, return);
+	opti93x_t *codec = snd_magic_cast(opti93x_t, dev_id, return IRQ_NONE);
 	unsigned char status;
 
 	status = snd_opti9xx_read(codec->chip, OPTi9XX_MC_REG(11));
@@ -1138,6 +1138,7 @@
 		snd_pcm_period_elapsed(codec->capture_substream);
 	}
 	outb(0x00, OPTi93X_PORT(codec, STATUS));
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c
--- a/sound/isa/sb/es968.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/sb/es968.c	Thu Apr 24 05:17:35 2003
@@ -78,16 +78,17 @@
 
 #define	DRIVER_NAME	"snd-card-es968"
 
-static void snd_card_es968_interrupt(int irq, void *dev_id,
+static irqreturn_t snd_card_es968_interrupt(int irq, void *dev_id,
 				     struct pt_regs *regs)
 {
-	sb_t *chip = snd_magic_cast(sb_t, dev_id, return);
+	sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE);
 
 	if (chip->open & SB_OPEN_PCM) {
 		snd_sb8dsp_interrupt(chip);
 	} else {
 		snd_sb8dsp_midi_interrupt(chip);
 	}
+	return IRQ_HANDLED;
 }
 
 static int __devinit snd_card_es968_pnp(int dev, struct snd_card_es968 *acard,
diff -Nru a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
--- a/sound/isa/sb/sb16_main.c	Sat Feb  8 12:10:51 2003
+++ b/sound/isa/sb/sb16_main.c	Thu Apr 24 05:17:35 2003
@@ -393,9 +393,9 @@
 	return result;
 }
 
-void snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	sb_t *chip = snd_magic_cast(sb_t, dev_id, return);
+	sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE);
 	unsigned char status;
 	int ok;
 
@@ -438,6 +438,7 @@
 		snd_sb_ack_16bit(chip);
 		spin_unlock(&chip->reg_lock);
 	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
--- a/sound/isa/sb/sb8.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/sb/sb8.c	Thu Apr 24 05:17:35 2003
@@ -70,15 +70,16 @@
 
 static snd_card_t *snd_sb8_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
 
-static void snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	sb_t *chip = snd_magic_cast(sb_t, dev_id, return);
+	sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE);
 
 	if (chip->open & SB_OPEN_PCM) {
 		snd_sb8dsp_interrupt(chip);
 	} else {
 		snd_sb8dsp_midi_interrupt(chip);
 	}
+	return IRQ_HANDLED;
 }
 
 static void snd_sb8_free(snd_card_t *card)
diff -Nru a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
--- a/sound/isa/sb/sb_common.c	Mon Jan 27 10:41:40 2003
+++ b/sound/isa/sb/sb_common.c	Mon Apr 21 00:32:59 2003
@@ -214,7 +214,7 @@
 int snd_sbdsp_create(snd_card_t *card,
 		     unsigned long port,
 		     int irq,
-		     void (*irq_handler)(int, void *, struct pt_regs *),
+		     irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
 		     int dma8,
 		     int dma16,
 		     unsigned short hardware,
diff -Nru a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c
--- a/sound/isa/sgalaxy.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/sgalaxy.c	Mon Apr 21 00:32:53 2003
@@ -112,8 +112,9 @@
 	return 0;
 }
 
-static void snd_sgalaxy_dummy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_sgalaxy_dummy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
+	return IRQ_NONE;
 }
 
 static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma)
diff -Nru a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
--- a/sound/isa/wavefront/wavefront.c	Thu Apr 10 03:28:12 2003
+++ b/sound/isa/wavefront/wavefront.c	Mon Apr 21 00:32:53 2003
@@ -276,7 +276,7 @@
 
 #endif /* CONFIG_PNP */
 
-static void snd_wavefront_ics2115_interrupt(int irq, 
+static irqreturn_t snd_wavefront_ics2115_interrupt(int irq, 
 					    void *dev_id, 
 					    struct pt_regs *regs)
 {
@@ -285,13 +285,14 @@
 	acard = (snd_wavefront_card_t *) dev_id;
 
 	if (acard == NULL) 
-		return;
+		return IRQ_NONE;
 
 	if (acard->wavefront.interrupts_are_midi) {
 		snd_wavefront_midi_interrupt (acard);
 	} else {
 		snd_wavefront_internal_interrupt (acard);
 	}
+	return IRQ_HANDLED;
 }
 
 snd_hwdep_t * __devinit
diff -Nru a/sound/oss/Kconfig b/sound/oss/Kconfig
--- a/sound/oss/Kconfig	Mon Mar  3 13:09:18 2003
+++ b/sound/oss/Kconfig	Sun Apr 20 12:56:52 2003
@@ -872,7 +872,7 @@
 	  Say Y here if you have a Sound Blaster SB32, AWE32-PnP, SB AWE64 or
 	  similar sound card. See <file:Documentation/sound/oss/README.awe>,
 	  <file:Documentation/sound/oss/AWE32> and the Soundblaster-AWE
-	  mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>
+	  mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
 	  for more info.
 
 config SOUND_WAVEFRONT
diff -Nru a/sound/oss/ad1816.c b/sound/oss/ad1816.c
--- a/sound/oss/ad1816.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/ad1816.c	Mon Apr 21 00:32:53 2003
@@ -540,7 +540,7 @@
 /* Interrupt handler */
 
 
-static void ad1816_interrupt (int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t ad1816_interrupt (int irq, void *dev_id, struct pt_regs *dummy)
 {
 	unsigned char	status;
 	ad1816_info	*devc;
@@ -549,7 +549,7 @@
 	
 	if (irq < 0 || irq > 15) {
 	        printk(KERN_WARNING "ad1816: Got bogus interrupt %d\n", irq);
-		return;
+		return IRQ_NONE;
 	}
 
 	dev = irq2dev[irq];
@@ -557,7 +557,7 @@
 	if (dev < 0 || dev >= num_audiodevs) {
 	        printk(KERN_WARNING "ad1816: IRQ2AD1816-mapping failed for "
 				    "irq %d device %d\n", irq,dev);
-		return;	        
+		return IRQ_NONE;
 	}
 
 	devc = (ad1816_info *) audio_devs[dev]->devc;
@@ -583,6 +583,7 @@
 		DMAbuf_outputintr (dev, 1);
 
 	spin_unlock(&devc->lock);
+	return IRQ_HANDLED;
 }
 
 /* ------------------------------------------------------------------- */
diff -Nru a/sound/oss/ad1848.c b/sound/oss/ad1848.c
--- a/sound/oss/ad1848.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/ad1848.c	Mon Apr 21 00:32:53 2003
@@ -2212,7 +2212,7 @@
 		printk(KERN_ERR "ad1848: Can't find device to be unloaded. Base=%x\n", io_base);
 }
 
-void adintr(int irq, void *dev_id, struct pt_regs *dummy)
+irqreturn_t adintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	unsigned char status;
 	ad1848_info *devc;
@@ -2287,6 +2287,7 @@
 	{
 		  goto interrupt_again;
 	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/oss/ad1848.h b/sound/oss/ad1848.h
--- a/sound/oss/ad1848.h	Mon Feb  4 14:15:17 2002
+++ b/sound/oss/ad1848.h	Mon Apr 21 00:32:53 2003
@@ -1,4 +1,6 @@
 
+#include <linux/interrupt.h>
+
 #define AD_F_CS4231     0x0001  /* Returned if a CS4232 (or compatible) detected */
 #define AD_F_CS4248     0x0001  /* Returned if a CS4248 (or compatible) detected */
 
@@ -16,7 +18,7 @@
 int ad1848_detect (int io_base, int *flags, int *osp);
 int ad1848_control(int cmd, int arg);
 
-void adintr(int irq, void *dev_id, struct pt_regs * dummy);
+irqreturn_t adintr(int irq, void *dev_id, struct pt_regs * dummy);
 void attach_ms_sound(struct address_info * hw_config, struct module * owner);
 
 int probe_ms_sound(struct address_info *hw_config);
diff -Nru a/sound/oss/btaudio.c b/sound/oss/btaudio.c
--- a/sound/oss/btaudio.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/btaudio.c	Thu Apr 24 03:36:18 2003
@@ -25,7 +25,6 @@
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/types.h>
-#include <linux/wrapper.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/poll.h>
@@ -817,18 +816,20 @@
 			    "RISCI", "FBUS", "FTRGT", "FDSR", "PPERR",
 			    "RIPERR", "PABORT", "OCERR", "SCERR" };
 
-static void btaudio_irq(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t btaudio_irq(int irq, void *dev_id, struct pt_regs * regs)
 {
 	int count = 0;
 	u32 stat,astat;
 	struct btaudio *bta = dev_id;
+	int handled = 0;
 
 	for (;;) {
 		count++;
 		stat  = btread(REG_INT_STAT);
 		astat = stat & btread(REG_INT_MASK);
 		if (!astat)
-			return;
+			return IRQ_RETVAL(handled);
+		handled = 1;
 		btwrite(astat,REG_INT_STAT);
 
 		if (irq_debug) {
@@ -864,7 +865,7 @@
 			btwrite(0, REG_INT_MASK);
 		}
 	}
-	return;
+	return IRQ_NONE;
 }
 
 /* -------------------------------------------------------------- */
diff -Nru a/sound/oss/cmpci.c b/sound/oss/cmpci.c
--- a/sound/oss/cmpci.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/cmpci.c	Thu Apr 24 03:36:20 2003
@@ -98,7 +98,6 @@
 #include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
-#include <linux/wrapper.h>
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/spinlock.h>
@@ -938,7 +937,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (pstart = virt_to_page(db->rawbuf); pstart <= pend; pstart++)
-			mem_map_unreserve(pstart);
+			ClearPageReserved(pstart);
 		free_pages((unsigned long)db->rawbuf, db->buforder);
 	}
 	db->rawbuf = NULL;
@@ -987,7 +986,7 @@
 		/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (pstart = virt_to_page(db->rawbuf); pstart <= pend; pstart++)
-			mem_map_reserve(pstart);
+			SetPageReserved(pstart);
 	}
 	bytepersec = rate << sample_shift[fmt];
 	bufs = PAGE_SIZE << db->buforder;
@@ -1156,7 +1155,7 @@
 }
 #endif
 
-static void cm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t cm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct cm_state *s = (struct cm_state *)dev_id;
 	unsigned int intsrc, intstat;
@@ -1165,7 +1164,7 @@
 	/* fastpath out, to ease interrupt sharing */
 	intsrc = inl(s->iobase + CODEC_CMI_INT_STATUS);
 	if (!(intsrc & 0x80000000))
-		return;
+		return IRQ_NONE;
 	spin_lock(&s->lock);
 	intstat = inb(s->iobase + CODEC_CMI_INT_HLDCLR + 2);
 	/* acknowledge interrupt */
@@ -1180,6 +1179,7 @@
 	cm_handle_midi(s);
 #endif
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_SOUND_CMPCI_MIDI
diff -Nru a/sound/oss/cs4281/cs4281_wrapper-24.c b/sound/oss/cs4281/cs4281_wrapper-24.c
--- a/sound/oss/cs4281/cs4281_wrapper-24.c	Mon Nov 18 04:40:55 2002
+++ b/sound/oss/cs4281/cs4281_wrapper-24.c	Mon Apr 21 02:02:34 2003
@@ -28,8 +28,6 @@
 
 int cs4281_resume_null(struct pci_dev *pcidev) { return 0; }
 int cs4281_suspend_null(struct pci_dev *pcidev, u32 state) { return 0; }
-#define cs4x_mem_map_reserve(page) mem_map_reserve(page)
-#define cs4x_mem_map_unreserve(page) mem_map_unreserve(page)
 
 #define free_dmabuf(state, dmabuf) \
 	pci_free_consistent(state->pcidev, \
diff -Nru a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
--- a/sound/oss/cs4281/cs4281m.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/cs4281/cs4281m.c	Thu Apr 24 03:36:08 2003
@@ -71,7 +71,6 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/poll.h>
-#include <linux/wrapper.h>
 #include <linux/fs.h>
 #include <linux/wait.h>
 
@@ -1705,7 +1704,7 @@
 		    virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) -
 				 1);
 		for (map = virt_to_page(db->rawbuf); map <= mapend; map++)
-			cs4x_mem_map_unreserve(map);
+			ClearPageReserved(map);
 		free_dmabuf(s, db);
 	}
 	if (s->tmpbuff && (db->type == CS_TYPE_ADC)) {
@@ -1714,7 +1713,7 @@
 		    virt_to_page(s->tmpbuff +
 				 (PAGE_SIZE << s->buforder_tmpbuff) - 1);
 		for (map = virt_to_page(s->tmpbuff); map <= mapend; map++)
-			cs4x_mem_map_unreserve(map);
+			ClearPageReserved(map);
 		free_dmabuf2(s, db);
 	}
 	s->tmpbuff = NULL;
@@ -1763,7 +1762,7 @@
 
 		// 2. mark each physical page in range as 'reserved'.
 		for (map = virt_to_page(db->rawbuf); map <= mapend; map++)
-			cs4x_mem_map_reserve(map);
+			SetPageReserved(map);
 	}
 	if (!s->tmpbuff && (db->type == CS_TYPE_ADC)) {
 		for (order = df; order >= DMABUF_MINORDER;
@@ -1786,7 +1785,7 @@
 
 		// 2. mark each physical page in range as 'reserved'.
 		for (map = virt_to_page(s->tmpbuff); map <= mapend; map++)
-			cs4x_mem_map_reserve(map);
+			SetPageReserved(map);
 	}
 	if (db->type == CS_TYPE_DAC) {
 		if (s->prop_dac.fmt & (AFMT_S16_LE | AFMT_U16_LE))
@@ -3792,7 +3791,7 @@
 
 
 
-static void cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct cs4281_state *s = (struct cs4281_state *) dev_id;
 	unsigned int temp1;
@@ -3809,7 +3808,7 @@
 		writel(HICR_IEV | HICR_CHGM, s->pBA0 + BA0_HICR);
 		CS_DBGOUT(CS_INTERRUPT, 9, printk(KERN_INFO
 			"cs4281: cs4281_interrupt(): returning not cs4281 interrupt.\n"));
-		return;
+		return IRQ_NONE;
 	}
 
 	if (temp1 & HISR_DMA0)	// If play interrupt,
@@ -3823,6 +3822,7 @@
 	cs4281_update_ptr(s,CS_TRUE);
 	cs4281_handle_midi(s);
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 // **************************************************************************
diff -Nru a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
--- a/sound/oss/cs46xx.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/cs46xx.c	Thu Apr 24 03:36:25 2003
@@ -89,7 +89,6 @@
 #include <linux/bitops.h>
 #include <linux/init.h>
 #include <linux/poll.h>
-#include <linux/wrapper.h>
 #include <linux/ac97_codec.h>
 
 #include <asm/io.h>
@@ -1196,7 +1195,7 @@
 
 	// 2. mark each physical page in range as 'reserved'.
 	for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++)
-		cs4x_mem_map_reserve(map);
+		SetPageReserved(map);
 
 	CS_DBGOUT(CS_PARMS, 9, printk("cs46xx: alloc_dmabuf(): allocated %ld (order = %d) bytes at %p\n",
 	       PAGE_SIZE << order, order, rawbuf) );
@@ -1233,7 +1232,7 @@
 
 	// 2. mark each physical page in range as 'reserved'.
 	for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++)
-		cs4x_mem_map_reserve(map);
+		SetPageReserved(map);
 	return 0;
 }
 
@@ -1248,7 +1247,7 @@
 		mapend = virt_to_page(dmabuf->rawbuf + 
 				(PAGE_SIZE << dmabuf->buforder) - 1);
 		for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++)
-			cs4x_mem_map_unreserve(map);
+			cs4x_ClearPageReserved(map);
 		free_dmabuf(state->card, dmabuf);
 	}
 
@@ -1257,7 +1256,7 @@
 		mapend = virt_to_page(dmabuf->tmpbuff +
 				(PAGE_SIZE << dmabuf->buforder_tmpbuff) - 1);
 		for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++)
-			cs4x_mem_map_unreserve(map);
+			cs4x_ClearPageReserved(map);
 		free_dmabuf2(state->card, dmabuf);
 	}
 
@@ -1670,7 +1669,7 @@
                 wake_up(&card->midi.owait);
 }
 
-static void cs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t cs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct cs_card *card = (struct cs_card *)dev_id;
 	/* Single channel card */
@@ -1688,7 +1687,7 @@
 	{
 		cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV);
 		spin_unlock(&card->lock);
-		return;
+		return IRQ_HANDLED;	/* Might be IRQ_NONE.. */
 	}
 	
 	/*
@@ -1709,6 +1708,7 @@
 	cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV);
 	spin_unlock(&card->lock);
 	CS_DBGOUT(CS_INTERRUPT, 9, printk("cs46xx: cs_interrupt()- \n"));
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/oss/cs46xx_wrapper-24.h b/sound/oss/cs46xx_wrapper-24.h
--- a/sound/oss/cs46xx_wrapper-24.h	Sun Feb 10 18:50:09 2002
+++ b/sound/oss/cs46xx_wrapper-24.h	Mon Apr 21 02:02:19 2003
@@ -31,9 +31,6 @@
 #define CS_OWNER owner:
 #define CS_THIS_MODULE THIS_MODULE,
 void cs46xx_null(struct pci_dev *pcidev) { return; }
-#define cs4x_mem_map_reserve(page) mem_map_reserve(page)
-#define cs4x_mem_map_unreserve(page) mem_map_unreserve(page)
-
 #define free_dmabuf(card, dmabuf) \
 	pci_free_consistent((card)->pci_dev, \
 			    PAGE_SIZE << (dmabuf)->buforder, \
diff -Nru a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
--- a/sound/oss/dmabuf.c	Sun Oct  6 14:13:18 2002
+++ b/sound/oss/dmabuf.c	Thu Apr 24 03:36:29 2003
@@ -26,7 +26,6 @@
 #define SAMPLE_ROUNDUP 0
 
 #include "sound_config.h"
-#include <linux/wrapper.h>
 
 #define DMAP_FREE_ON_CLOSE      0
 #define DMAP_KEEP_ON_CLOSE      1
@@ -116,7 +115,7 @@
 	dmap->raw_buf_phys = virt_to_bus(start_addr);
 
 	for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++)
-		mem_map_reserve(page);
+		SetPageReserved(page);
 	return 0;
 }
 
@@ -136,7 +135,7 @@
 	end_addr = start_addr + dmap->buffsize;
 
 	for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++)
-		mem_map_unreserve(page);
+		ClearPageReserved(page);
 
 	free_pages((unsigned long) dmap->raw_buf, sz);
 	dmap->raw_buf = NULL;
diff -Nru a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
--- a/sound/oss/dmasound/dmasound_atari.c	Thu Apr  3 14:34:57 2003
+++ b/sound/oss/dmasound/dmasound_atari.c	Mon Apr 21 00:32:53 2003
@@ -134,7 +134,7 @@
 static int FalconSetVolume(int volume);
 static void AtaPlayNextFrame(int index);
 static void AtaPlay(void);
-static void AtaInterrupt(int irq, void *dummy, struct pt_regs *fp);
+static irqreturn_t AtaInterrupt(int irq, void *dummy, struct pt_regs *fp);
 
 /*** Mid level stuff *********************************************************/
 
@@ -1250,7 +1250,7 @@
 }
 
 
-static void AtaInterrupt(int irq, void *dummy, struct pt_regs *fp)
+static irqreturn_t AtaInterrupt(int irq, void *dummy, struct pt_regs *fp)
 {
 #if 0
 	/* ++TeSche: if you should want to test this... */
@@ -1259,7 +1259,7 @@
 		if (++cnt == 10) {
 			/* simulate losing an interrupt */
 			cnt = 0;
-			return;
+			return IRQ_HANDLED;
 		}
 #endif
 	spin_lock(&dmasound.lock);
@@ -1269,7 +1269,7 @@
 		 * (almost) like on the TT.
 		 */
 		write_sq_ignore_int = 0;
-		return;
+		return IRQ_HANDLED;
 	}
 
 	if (!write_sq.active) {
@@ -1277,7 +1277,7 @@
 		 * the sq variables, so better don't do anything here.
 		 */
 		WAKE_UP(write_sq.sync_queue);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	/* Probably ;) one frame is finished. Well, in fact it may be that a
@@ -1315,6 +1315,7 @@
 	   is nothing to play any more. Wake up a process
 	   waiting for audio output to drain. */
 	spin_unlock(&dmasound.lock);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
--- a/sound/oss/dmasound/dmasound_awacs.c	Thu Apr  3 14:34:57 2003
+++ b/sound/oss/dmasound/dmasound_awacs.c	Mon Apr 21 00:32:53 2003
@@ -266,9 +266,9 @@
 static int PMacSetVolume(int volume);
 static void PMacPlay(void);
 static void PMacRecord(void);
-static void pmac_awacs_tx_intr(int irq, void *devid, struct pt_regs *regs);
-static void pmac_awacs_rx_intr(int irq, void *devid, struct pt_regs *regs);
-static void pmac_awacs_intr(int irq, void *devid, struct pt_regs *regs);
+static irqreturn_t pmac_awacs_tx_intr(int irq, void *devid, struct pt_regs *regs);
+static irqreturn_t pmac_awacs_rx_intr(int irq, void *devid, struct pt_regs *regs);
+static irqreturn_t pmac_awacs_intr(int irq, void *devid, struct pt_regs *regs);
 static void awacs_write(int val);
 static int awacs_get_volume(int reg, int lshift);
 static int awacs_volume_setter(int volume, int n, int mute, int lshift);
@@ -395,20 +395,24 @@
 	return ((pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_addr, 0) & 0x02) !=0);
 }
 
-static void
+static irqreturn_t
 headphone_intr(int irq, void *devid, struct pt_regs *regs)
 {
+	int handled = 0;
 	spin_lock(&dmasound.lock);
 	if (read_audio_gpio(gpio_headphone_detect) == gpio_headphone_detect_pol) {
+		handled = 1;
 		printk(KERN_INFO "Audio jack plugged, muting speakers.\n");
 		write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
 		write_audio_gpio(gpio_headphone_mute, !gpio_headphone_mute_pol);
 	} else {
+		handled = 1;
 		printk(KERN_INFO "Audio jack unplugged, enabling speakers.\n");
 		write_audio_gpio(gpio_amp_mute, !gpio_amp_mute_pol);
 		write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
 	}
 	spin_unlock(&dmasound.lock);
+	return IRQ_RETVAL(handled);
 }
 
 
@@ -923,7 +927,7 @@
    'next_cmd' field will already point back to the original loop of blocks.
 */
 
-static void
+static irqreturn_t
 pmac_awacs_tx_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	int i = write_sq.front;
@@ -1009,10 +1013,11 @@
 	if (!write_sq.active && (write_sq.syncing & 1))
 		WAKE_UP(write_sq.sync_queue); /* any time we're empty */
 	spin_unlock(&dmasound.lock);
+	return IRQ_HANDLED;
 }
 
 
-static void
+static irqreturn_t
 pmac_awacs_rx_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	int stat ;
@@ -1023,12 +1028,12 @@
 	 * just blow it off.
 	 */
 	if (in_le32(&awacs_rxdma->cmdptr) == 0)
-		return;
+		return IRQ_HANDLED;
 
 	/* We also want to blow 'em off when shutting down.
 	*/
 	if (read_sq.active == 0)
-		return;
+		return IRQ_HANDLED;
 
 	spin_lock(&dmasound.lock);
 	/* Check multiple buffers in case we were held off from
@@ -1063,7 +1068,7 @@
 			out_le32(&awacs_rxdma->control,
 				((RUN|WAKE) << 16) + (RUN|WAKE));
 			spin_unlock(&dmasound.lock);
-			return; /* try this block again */
+			return IRQ_HANDLED; /* try this block again */
 		}
 		/* Clear status and move on to next buffer.
 		*/
@@ -1091,10 +1096,11 @@
 
 	WAKE_UP(read_sq.action_queue);
 	spin_unlock(&dmasound.lock);
+	return IRQ_HANDLED;
 }
 
 
-static void
+static irqreturn_t
 pmac_awacs_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	int ctrl;
@@ -1113,6 +1119,7 @@
 	/* Writing 1s to the CNTLERR and PORTCHG bits clears them... */
 	out_le32(&awacs->control, ctrl);
 	spin_unlock(&dmasound.lock);
+	return IRQ_HANDLED;
 }
 
 static void
diff -Nru a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c
--- a/sound/oss/dmasound/dmasound_paula.c	Thu Apr  3 14:34:57 2003
+++ b/sound/oss/dmasound/dmasound_paula.c	Mon Apr 21 00:32:53 2003
@@ -83,7 +83,7 @@
 static int AmiSetTreble(int treble);
 static void AmiPlayNextFrame(int index);
 static void AmiPlay(void);
-static void AmiInterrupt(int irq, void *dummy, struct pt_regs *fp);
+static irqreturn_t AmiInterrupt(int irq, void *dummy, struct pt_regs *fp);
 
 #ifdef CONFIG_HEARTBEAT
 
@@ -567,7 +567,7 @@
 }
 
 
-static void AmiInterrupt(int irq, void *dummy, struct pt_regs *fp)
+static irqreturn_t AmiInterrupt(int irq, void *dummy, struct pt_regs *fp)
 {
 	int minframes = 1;
 
@@ -578,7 +578,7 @@
 		 * the sq variables, so better don't do anything here.
 		 */
 		WAKE_UP(write_sq.sync_queue);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	if (write_sq.active & AMI_PLAY_PLAYING) {
@@ -608,6 +608,7 @@
 		/* Nothing to play anymore.
 		   Wake up a process waiting for audio output to drain. */
 		WAKE_UP(write_sq.sync_queue);
+	return IRQ_HANDLED;
 }
 
 /*** Mid level stuff *********************************************************/
diff -Nru a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c
--- a/sound/oss/dmasound/dmasound_q40.c	Thu Apr  3 14:34:57 2003
+++ b/sound/oss/dmasound/dmasound_q40.c	Mon Apr 21 00:32:53 2003
@@ -49,8 +49,8 @@
 static int Q40SetVolume(int volume);
 static void Q40PlayNextFrame(int index);
 static void Q40Play(void);
-static void Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp);
-static void Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp);
+static irqreturn_t Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp);
+static irqreturn_t Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp);
 static void Q40Interrupt(void);
 
 
@@ -464,7 +464,7 @@
 	spin_unlock_irqrestore_flags(&dmasound.lock, flags);
 }
 
-static void Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp)
+static irqreturn_t Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp)
 {
 	spin_lock(&dmasound.lock);
         if (q40_sc>1){
@@ -474,8 +474,9 @@
 	    master_outb(1,SAMPLE_CLEAR_REG);
 	}else Q40Interrupt();
 	spin_unlock(&dmasound.lock);
+	return IRQ_HANDLED;
 }
-static void Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp)
+static irqreturn_t Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp)
 {
 	spin_lock(&dmasound.lock);
         if (q40_sc>0){
@@ -485,6 +486,7 @@
 	    master_outb(1,SAMPLE_CLEAR_REG);
 	}else Q40Interrupt();
 	spin_unlock(&dmasound.lock);
+	return IRQ_HANDLED;
 }
 static void Q40Interrupt(void)
 {
diff -Nru a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
--- a/sound/oss/emu10k1/audio.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/emu10k1/audio.c	Thu Apr 24 03:36:11 2003
@@ -37,8 +37,6 @@
 #include <asm/io.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
-#include <linux/wrapper.h>
-
 
 #include "hwaccess.h"
 #include "cardwo.h"
diff -Nru a/sound/oss/emu10k1/cardwo.c b/sound/oss/emu10k1/cardwo.c
--- a/sound/oss/emu10k1/cardwo.c	Sat Mar 22 04:41:48 2003
+++ b/sound/oss/emu10k1/cardwo.c	Mon Apr 21 00:32:53 2003
@@ -444,7 +444,7 @@
 	while (len) { 
 		for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) {
 			if (__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample))
-				return -EFAULT;
+				return;
 			src += woinst->format.bytespervoicesample;
 		}
 
diff -Nru a/sound/oss/emu10k1/irqmgr.c b/sound/oss/emu10k1/irqmgr.c
--- a/sound/oss/emu10k1/irqmgr.c	Sun Feb 16 16:30:06 2003
+++ b/sound/oss/emu10k1/irqmgr.c	Mon Apr 21 00:32:53 2003
@@ -37,10 +37,11 @@
 
 /* Interrupt handler */
 
-void emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct emu10k1_card *card = (struct emu10k1_card *) dev_id;
 	u32 irqstatus, irqstatus_tmp;
+	int handled = 0;
 
 	DPD(4, "emu10k1_interrupt called, irq =  %u\n", irq);
 
@@ -105,6 +106,8 @@
 		}
 
 		/* acknowledge interrupt */
-                outl(irqstatus_tmp, card->iobase + IPR);
+		outl(irqstatus_tmp, card->iobase + IPR);
+		handled = 1;
 	}
+	return IRQ_RETVAL(handled);
 }
diff -Nru a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
--- a/sound/oss/emu10k1/main.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/emu10k1/main.c	Mon Apr 21 00:32:53 2003
@@ -157,7 +157,7 @@
 static struct midi_operations emu10k1_midi_operations;
 #endif
 
-extern void emu10k1_interrupt(int, void *, struct pt_regs *s);
+extern irqreturn_t emu10k1_interrupt(int, void *, struct pt_regs *s);
 
 static int __devinit emu10k1_audio_init(struct emu10k1_card *card)
 {
diff -Nru a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c
--- a/sound/oss/emu10k1/passthrough.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/emu10k1/passthrough.c	Thu Apr 24 03:36:14 2003
@@ -36,7 +36,6 @@
 #include <asm/io.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
-#include <linux/wrapper.h>
 
 #include "hwaccess.h"
 #include "cardwo.h"
diff -Nru a/sound/oss/es1370.c b/sound/oss/es1370.c
--- a/sound/oss/es1370.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/es1370.c	Thu Apr 24 03:36:33 2003
@@ -151,7 +151,6 @@
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/smp_lock.h>
-#include <linux/wrapper.h>
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/spinlock.h>
@@ -551,7 +550,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(s->dev, PAGE_SIZE << db->buforder, db->rawbuf, db->dmaaddr);
 	}
 	db->rawbuf = NULL;
@@ -577,7 +576,7 @@
 		/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_reserve(page);
+			SetPageReserved(page);
 	}
 	fmt &= ES1370_FMT_MASK;
 	bytepersec = rate << sample_shift[fmt];
@@ -755,7 +754,7 @@
 	outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1370_REG_UART_CONTROL);
 }
 
-static void es1370_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t es1370_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct es1370_state *s = (struct es1370_state *)dev_id;
 	unsigned int intsrc, sctl;
@@ -763,7 +762,7 @@
 	/* fastpath out, to ease interrupt sharing */
 	intsrc = inl(s->io+ES1370_REG_STATUS);
 	if (!(intsrc & 0x80000000))
-		return;
+		return IRQ_NONE;
 	spin_lock(&s->lock);
 	/* clear audio interrupts first */
 	sctl = s->sctrl;
@@ -778,6 +777,7 @@
 	es1370_update_ptr(s);
 	es1370_handle_midi(s);
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 /* --------------------------------------------------------------------- */
diff -Nru a/sound/oss/es1371.c b/sound/oss/es1371.c
--- a/sound/oss/es1371.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/es1371.c	Thu Apr 24 03:36:36 2003
@@ -126,7 +126,6 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
-#include <linux/wrapper.h>
 #include <linux/gameport.h>
 #include <linux/wait.h>
 
@@ -887,7 +886,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(s->dev, PAGE_SIZE << db->buforder, db->rawbuf, db->dmaaddr);
 	}
 	db->rawbuf = NULL;
@@ -913,7 +912,7 @@
 		/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_reserve(page);
+			SetPageReserved(page);
 	}
 	fmt &= ES1371_FMT_MASK;
 	bytepersec = rate << sample_shift[fmt];
@@ -1091,7 +1090,7 @@
 	outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1371_REG_UART_CONTROL);
 }
 
-static void es1371_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t es1371_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct es1371_state *s = (struct es1371_state *)dev_id;
 	unsigned int intsrc, sctl;
@@ -1099,7 +1098,7 @@
 	/* fastpath out, to ease interrupt sharing */
 	intsrc = inl(s->io+ES1371_REG_STATUS);
 	if (!(intsrc & 0x80000000))
-		return;
+		return IRQ_NONE;
 	spin_lock(&s->lock);
 	/* clear audio interrupts first */
 	sctl = s->sctrl;
@@ -1114,6 +1113,7 @@
 	es1371_update_ptr(s);
 	es1371_handle_midi(s);
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 /* --------------------------------------------------------------------- */
diff -Nru a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
--- a/sound/oss/esssolo1.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/esssolo1.c	Thu Apr 24 03:36:39 2003
@@ -102,7 +102,6 @@
 #include <linux/poll.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
-#include <linux/wrapper.h>
 #include <linux/gameport.h>
 #include <linux/wait.h>
 
@@ -423,7 +422,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(s->dev, PAGE_SIZE << db->buforder, db->rawbuf, db->dmaaddr);
 	}
 	db->rawbuf = NULL;
@@ -449,7 +448,7 @@
 		/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_reserve(page);
+			SetPageReserved(page);
 	}
 	if (s->fmt & (AFMT_S16_LE | AFMT_U16_LE))
 		sample_shift++;
@@ -1694,7 +1693,7 @@
 		wake_up(&s->midi.owait);
 }
 
-static void solo1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t solo1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct solo1_state *s = (struct solo1_state *)dev_id;
 	unsigned int intsrc;
@@ -1702,7 +1701,7 @@
 	/* fastpath out, to ease interrupt sharing */
 	intsrc = inb(s->iobase+7); /* get interrupt source(s) */
 	if (!intsrc)
-		return;
+		return IRQ_NONE;
 	(void)inb(s->sbbase+0xe);  /* clear interrupt */
 	spin_lock(&s->lock);
 	/* clear audio interrupts first */
@@ -1711,6 +1710,7 @@
 	solo1_update_ptr(s);
 	solo1_handle_midi(s);
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 static void solo1_midi_timer(unsigned long data)
diff -Nru a/sound/oss/gus.h b/sound/oss/gus.h
--- a/sound/oss/gus.h	Mon Feb  4 14:15:17 2002
+++ b/sound/oss/gus.h	Mon Apr 21 00:32:53 2003
@@ -3,7 +3,7 @@
 
 /*	From gus_card.c */
 int gus_set_midi_irq(int num);
-void gusintr(int irq, void *dev_id, struct pt_regs * dummy);
+irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs * dummy);
 
 /*	From gus_wave.c */
 int gus_wave_detect(int baseaddr);
diff -Nru a/sound/oss/gus_card.c b/sound/oss/gus_card.c
--- a/sound/oss/gus_card.c	Sun Nov 17 19:33:01 2002
+++ b/sound/oss/gus_card.c	Mon Apr 21 00:32:53 2003
@@ -25,7 +25,7 @@
 #include "gus.h"
 #include "gus_hw.h"
 
-void            gusintr(int irq, void *dev_id, struct pt_regs *dummy);
+irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs *dummy);
 
 int             gus_base = 0, gus_irq = 0, gus_dma = 0;
 int             gus_no_wave_dma = 0; 
@@ -119,10 +119,11 @@
 		sound_free_dma(hw_config->dma2);
 }
 
-void gusintr(int irq, void *dev_id, struct pt_regs *dummy)
+irqreturn_t gusintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	unsigned char src;
 	extern int gus_timer_enabled;
+	int handled = 0;
 
 #ifdef CONFIG_SOUND_GUSMAX
 	if (have_gus_max) {
@@ -140,8 +141,8 @@
 	while (1)
 	{
 		if (!(src = inb(u_IrqStatus)))
-			return;
-
+			break;
+		handled = 1;
 		if (src & DMA_TC_IRQ)
 		{
 			guswave_dma_irq();
@@ -160,6 +161,7 @@
 		if (src & (WAVETABLE_IRQ | ENVELOPE_IRQ))
 			gus_voice_irq();
 	}
+	return IRQ_RETVAL(handled);
 }
 
 /*
diff -Nru a/sound/oss/gus_wave.c b/sound/oss/gus_wave.c
--- a/sound/oss/gus_wave.c	Thu Apr  3 14:45:12 2003
+++ b/sound/oss/gus_wave.c	Mon Apr 21 00:32:53 2003
@@ -508,7 +508,7 @@
 {
 	unsigned        vol, prev_vol, phase;
 	unsigned char   rate;
-	long int        flags;
+	unsigned long flags;
 
 	if (voices[voice].mode & WAVE_SUSTAIN_ON && voices[voice].env_phase == 2)
 	{
@@ -593,7 +593,7 @@
 static void gus_voice_fade(int voice)
 {
 	int instr_no = sample_map[voice], is16bits;
-	long int flags;
+	unsigned long flags;
 
 	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
@@ -1511,7 +1511,7 @@
 
 static int guswave_start_note(int dev, int voice, int note_num, int volume)
 {
-	long int flags;
+	unsigned long flags;
 	int mode;
 	int ret_val = 0;
 
diff -Nru a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
--- a/sound/oss/i810_audio.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/i810_audio.c	Thu Apr 24 03:36:42 2003
@@ -96,7 +96,6 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
-#include <linux/wrapper.h>
 #include <asm/uaccess.h>
 #include <asm/hardirq.h>
 
@@ -941,7 +940,7 @@
 	/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 	pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
 	for (page = virt_to_page(rawbuf); page <= pend; page++)
-		mem_map_reserve(page);
+		SetPageReserved(page);
 
 	return 0;
 }
@@ -956,7 +955,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1);
 		for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(state->card->pci_dev, PAGE_SIZE << dmabuf->buforder,
 				    dmabuf->rawbuf, dmabuf->dma_handle);
 	}
@@ -1389,7 +1388,7 @@
 #endif
 }
 
-static void i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct i810_card *card = (struct i810_card *)dev_id;
 	u32 status;
@@ -1401,7 +1400,7 @@
 	if(!(status & INT_MASK)) 
 	{
 		spin_unlock(&card->lock);
-		return;  /* not for us */
+		return IRQ_NONE;  /* not for us */
 	}
 
 	if(status & (INT_PO|INT_PI|INT_MC))
@@ -1410,6 +1409,7 @@
  	/* clear 'em */
 	outl(status & INT_MASK, card->iobase + GLOB_STA);
 	spin_unlock(&card->lock);
+	return IRQ_HANDLED;
 }
 
 /* in this loop, dmabuf.count signifies the amount of data that is
diff -Nru a/sound/oss/ite8172.c b/sound/oss/ite8172.c
--- a/sound/oss/ite8172.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/ite8172.c	Thu Apr 24 03:36:43 2003
@@ -67,7 +67,6 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
-#include <linux/wrapper.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/uaccess.h>
@@ -640,7 +639,7 @@
 	/* undo marking the pages as reserved */
 	pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 	for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-	    mem_map_unreserve(page);
+	    ClearPageReserved(page);
 	pci_free_consistent(s->dev, PAGE_SIZE << db->buforder,
 			    db->rawbuf, db->dmaaddr);
     }
@@ -670,7 +669,7 @@
 	   otherwise remap_page_range doesn't do what we want */
 	pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 	for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-	    mem_map_reserve(page);
+	    SetPageReserved(page);
     }
 
     db->count = 0;
@@ -727,7 +726,7 @@
 
 /* hold spinlock for the following! */
 
-static void it8172_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t it8172_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
     struct it8172_state *s = (struct it8172_state *)dev_id;
     struct dmabuf* dac = &s->dma_dac;
@@ -741,8 +740,10 @@
     isc = inb(s->io+IT_AC_ISC);
 
     /* fastpath out, to ease interrupt sharing */
-    if (!(isc & (ISC_VCI | ISC_CCI | ISC_PCI)))
-	return;
+    if (!(isc & (ISC_VCI | ISC_CCI | ISC_PCI))) {
+	spin_unlock(&s->lock);
+	return IRQ_NONE;
+    }
 
     /* clear audio interrupts first */
     outb(isc | ISC_VCI | ISC_CCI | ISC_PCI, s->io+IT_AC_ISC);
@@ -819,6 +820,7 @@
     }
     
     spin_unlock(&s->lock);
+    return IRQ_HANDLED;
 }
 
 /* --------------------------------------------------------------------- */
diff -Nru a/sound/oss/maestro.c b/sound/oss/maestro.c
--- a/sound/oss/maestro.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/maestro.c	Thu Apr 24 03:36:45 2003
@@ -208,7 +208,6 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
-#include <linux/wrapper.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/ioport.h>
@@ -1631,7 +1630,7 @@
  *	Meet Bob, the timer...
  */
 
-static void ess_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ess_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static void stop_bob(struct ess_state *s)
 {
@@ -1900,7 +1899,7 @@
 	}
 }
 
-static void 
+static irqreturn_t
 ess_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct ess_state *s;
@@ -1908,7 +1907,8 @@
 	int i;
 	u32 event;
 
-	if ( ! (event = inb(c->iobase+0x1A)) ) return;
+	if ( ! (event = inb(c->iobase+0x1A)) )
+		return IRQ_NONE;
 
 	outw(inw(c->iobase+4)&1, c->iobase+4);
 
@@ -1972,6 +1972,7 @@
 		ess_update_ptr(s);
 		spin_unlock(&s->lock);
 	}
+	return IRQ_HANDLED;
 }
 
 
@@ -2947,7 +2948,7 @@
 	/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 	pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
 	for (page = virt_to_page(rawbuf); page <= pend; page++)
-		mem_map_reserve(page);
+		SetPageReserved(page);
 
 	return 0;
 } 
@@ -2965,7 +2966,7 @@
 
 	pend = virt_to_page(s->card->dmapages + (PAGE_SIZE << s->card->dmaorder) - 1);
 	for (page = virt_to_page(s->card->dmapages); page <= pend; page++)
-		mem_map_unreserve(page);
+		ClearPageReserved(page);
 
 	free_pages((unsigned long)s->card->dmapages,s->card->dmaorder);
 	s->card->dmapages = NULL;
diff -Nru a/sound/oss/maestro3.c b/sound/oss/maestro3.c
--- a/sound/oss/maestro3.c	Tue Feb 25 09:57:27 2003
+++ b/sound/oss/maestro3.c	Thu Apr 24 03:36:50 2003
@@ -149,11 +149,6 @@
 #include <asm/dma.h>
 #include <asm/uaccess.h>
 
- /*
-  * for crizappy mmap()
-  */
-#include <linux/wrapper.h>
-
 #include "maestro3.h"
 
 #define M_DEBUG 1
@@ -1232,7 +1227,7 @@
     }
 }
 
-static void m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
     struct m3_card *c = (struct m3_card *)dev_id;
     struct m3_state *s = &c->channels[0];
@@ -1240,13 +1235,14 @@
 
     status = inb(c->iobase+0x1A);
 
-    if(status == 0xff) return;
+    if(status == 0xff)
+	return IRQ_NONE;
    
     /* presumably acking the ints? */
     outw(status, c->iobase+0x1A); 
 
     if(c->in_suspend)
-        return;
+        return IRQ_HANDLED;
 
     /*
      * ack an assp int if its running
@@ -1269,6 +1265,7 @@
     /* XXX is this needed? */
     if(status & 0x40) 
         outb(0x40, c->iobase+0x1A);
+    return IRQ_HANDLED;
 }
 
 
@@ -1937,7 +1934,7 @@
 
         pend = virt_to_page(db->rawbuf + (PAGE_SIZE << order) - 1);
         for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-            mem_map_reserve(page);
+            SetPageReserved(page);
     }
 
 
@@ -1968,7 +1965,7 @@
         struct page *page, *pend;
         pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
         for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-            mem_map_unreserve(page);
+            ClearPageReserved(page);
     }
 
 
diff -Nru a/sound/oss/maui.c b/sound/oss/maui.c
--- a/sound/oss/maui.c	Sun Dec  8 05:04:01 2002
+++ b/sound/oss/maui.c	Mon Apr 21 00:32:53 2003
@@ -102,9 +102,10 @@
 	return 0;
 }
 
-static void mauiintr(int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t mauiintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	irq_ok = 1;
+	return IRQ_HANDLED;
 }
 
 static int __init download_code(void)
diff -Nru a/sound/oss/mpu401.c b/sound/oss/mpu401.c
--- a/sound/oss/mpu401.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/mpu401.c	Mon Apr 21 00:32:53 2003
@@ -444,15 +444,17 @@
 	return input_avail(devc);
 }
 
-void mpuintr(int irq, void *dev_id, struct pt_regs *dummy)
+irqreturn_t mpuintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	struct mpu_config *devc;
 	int dev = (int) dev_id;
+	int handled = 0;
 
 	devc = &dev_conf[dev];
 
 	if (input_avail(devc))
 	{
+		handled = 1;
 		if (devc->base != 0 && (devc->opened & OPEN_READ || devc->mode == MODE_SYNTH))
 			mpu401_input_loop(devc);
 		else
@@ -461,6 +463,7 @@
 			read_data(devc);
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 static int mpu401_open(int dev, int mode,
@@ -500,7 +503,7 @@
 	{
 		if (!try_module_get(coprocessor->owner)) {
 			mpu401_close(dev);
-			return err;
+			return -ENODEV;
 		}
 
 		if ((err = coprocessor->open(coprocessor->devc, COPR_MIDI)) < 0)
@@ -839,7 +842,7 @@
 	coprocessor = midi_devs[midi_dev]->coproc;
 	if (coprocessor) {
 		if (!try_module_get(coprocessor->owner))
-			return err;
+			return -ENODEV;
 
 		if ((err = coprocessor->open(coprocessor->devc, COPR_MIDI)) < 0)
 		{
diff -Nru a/sound/oss/mpu401.h b/sound/oss/mpu401.h
--- a/sound/oss/mpu401.h	Sat Dec  7 18:59:03 2002
+++ b/sound/oss/mpu401.h	Mon Apr 21 00:32:53 2003
@@ -3,7 +3,7 @@
 int probe_uart401 (struct address_info *hw_config, struct module *owner);
 void unload_uart401 (struct address_info *hw_config);
 
-void uart401intr (int irq, void *dev_id, struct pt_regs * dummy);
+irqreturn_t uart401intr (int irq, void *dev_id, struct pt_regs * dummy);
 
 /*	From mpu401.c */
 int probe_mpu401(struct address_info *hw_config);
@@ -11,4 +11,4 @@
 void unload_mpu401(struct address_info *hw_info);
 
 int intchk_mpu401(void *dev_id);
-void mpuintr(int irq, void *dev_id, struct pt_regs * dummy);
+irqreturn_t mpuintr(int irq, void *dev_id, struct pt_regs * dummy);
diff -Nru a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
--- a/sound/oss/msnd_pinnacle.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/msnd_pinnacle.c	Mon Apr 21 00:32:53 2003
@@ -45,6 +45,7 @@
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/smp_lock.h>
 #include <asm/irq.h>
 #include <asm/io.h>
@@ -1061,7 +1062,7 @@
 	}
 }
 
-static void intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/* Send ack to DSP */
 	inb(dev.io + HP_RXL);
@@ -1077,6 +1078,7 @@
 		else
 			isa_writew(wTmp, dev.DSPQ + JQS_wHead);
 	}
+	return IRQ_HANDLED;
 }
 
 static struct file_operations dev_fileops = {
diff -Nru a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
--- a/sound/oss/nec_vrc5477.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/nec_vrc5477.c	Thu Apr 24 03:36:52 2003
@@ -78,7 +78,6 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
-#include <linux/wrapper.h>
 #include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -813,7 +812,7 @@
 		wake_up_interruptible(&dac->wait);
 }
 
-static void vrc5477_ac97_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t vrc5477_ac97_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct vrc5477_ac97_state *s = (struct vrc5477_ac97_state *)dev_id;
 	u32 irqStatus;
@@ -851,6 +850,7 @@
 	}
 
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 /* --------------------------------------------------------------------- */
diff -Nru a/sound/oss/nm256.h b/sound/oss/nm256.h
--- a/sound/oss/nm256.h	Tue Aug 13 07:04:59 2002
+++ b/sound/oss/nm256.h	Mon Apr 21 00:32:53 2003
@@ -2,6 +2,8 @@
 #define _NM256_H_
 
 #include <linux/spinlock.h>
+#include <linux/interrupt.h>
+
 #include "ac97.h"
 
 /* The revisions that we currently handle.  */
@@ -113,7 +115,7 @@
     int has_irq;
 
     /* The card interrupt service routine. */
-    void (*introutine) (int, void *, struct pt_regs *);
+    irqreturn_t (*introutine) (int, void *, struct pt_regs *);
 
     /* Current audio config, cached. */
     struct sinfo {
diff -Nru a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c
--- a/sound/oss/nm256_audio.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/nm256_audio.c	Mon Apr 21 00:32:53 2003
@@ -44,8 +44,8 @@
 
 static int nm256_grabInterrupt (struct nm256_info *card);
 static int nm256_releaseInterrupt (struct nm256_info *card);
-static void nm256_interrupt (int irq, void *dev_id, struct pt_regs *dummy);
-static void nm256_interrupt_zx (int irq, void *dev_id, struct pt_regs *dummy);
+static irqreturn_t nm256_interrupt (int irq, void *dev_id, struct pt_regs *dummy);
+static irqreturn_t nm256_interrupt_zx (int irq, void *dev_id, struct pt_regs *dummy);
 static int handle_pm_event (struct pm_dev *dev, pm_request_t rqst, void *data);
 
 /* These belong in linux/pci.h. */
@@ -528,16 +528,17 @@
  * I suppose...yucky bleah.)
  */
 
-static void
+static irqreturn_t
 nm256_interrupt (int irq, void *dev_id, struct pt_regs *dummy)
 {
     struct nm256_info *card = (struct nm256_info *)dev_id;
     u16 status;
     static int badintrcount = 0;
+    int handled = 0;
 
     if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) {
 	printk (KERN_ERR "NM256: Bad card pointer\n");
-	return;
+	return IRQ_NONE;
     }
 
     status = nm256_readPort16 (card, 2, NM_INT_REG);
@@ -558,13 +559,14 @@
 	     * inserted a PCMCIA card and someone's spamming us with IRQ 9s.
 	     */
 
+	    handled = 1;
 	    if (card->playing)
 		stopPlay (card);
 	    if (card->recording)
 		stopRecord (card);
 	    badintrcount = 0;
 	}
-	return;
+	return IRQ_RETVAL(handled);
     }
 
     badintrcount = 0;
@@ -572,6 +574,7 @@
     /* Rather boring; check for individual interrupts and process them. */
 
     if (status & NM_PLAYBACK_INT) {
+	handled = 1;
 	status &= ~NM_PLAYBACK_INT;
 	NM_ACK_INT (card, NM_PLAYBACK_INT);
 
@@ -580,6 +583,7 @@
     }
 
     if (status & NM_RECORD_INT) {
+	handled = 1;
 	status &= ~NM_RECORD_INT;
 	NM_ACK_INT (card, NM_RECORD_INT);
 
@@ -590,6 +594,7 @@
     if (status & NM_MISC_INT_1) {
 	u8 cbyte;
 
+	handled = 1;
 	status &= ~NM_MISC_INT_1;
 	printk (KERN_ERR "NM256: Got misc interrupt #1\n");
 	NM_ACK_INT (card, NM_MISC_INT_1);
@@ -601,6 +606,7 @@
     if (status & NM_MISC_INT_2) {
 	u8 cbyte;
 
+	handled = 1;
 	status &= ~NM_MISC_INT_2;
 	printk (KERN_ERR "NM256: Got misc interrupt #2\n");
 	NM_ACK_INT (card, NM_MISC_INT_2);
@@ -610,11 +616,13 @@
 
     /* Unknown interrupt. */
     if (status) {
+	handled = 1;
 	printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n",
 		status);
 	/* Pray. */
 	NM_ACK_INT (card, status);
     }
+    return IRQ_RETVAL(handled);
 }
 
 /*
@@ -623,16 +631,17 @@
  * routine.
  */
 
-static void
+static irqreturn_t
 nm256_interrupt_zx (int irq, void *dev_id, struct pt_regs *dummy)
 {
     struct nm256_info *card = (struct nm256_info *)dev_id;
     u32 status;
     static int badintrcount = 0;
+    int handled = 0;
 
     if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) {
 	printk (KERN_ERR "NM256: Bad card pointer\n");
-	return;
+	return IRQ_NONE;
     }
 
     status = nm256_readPort32 (card, 2, NM_INT_REG);
@@ -655,13 +664,14 @@
 	     * IRQ 9s.
 	     */
 
+	    handled = 1;
 	    if (card->playing)
 		stopPlay (card);
 	    if (card->recording)
 		stopRecord (card);
 	    badintrcount = 0;
 	}
-	return;
+	return IRQ_RETVAL(handled);
     }
 
     badintrcount = 0;
@@ -669,6 +679,7 @@
     /* Rather boring; check for individual interrupts and process them. */
 
     if (status & NM2_PLAYBACK_INT) {
+	handled = 1;
 	status &= ~NM2_PLAYBACK_INT;
 	NM2_ACK_INT (card, NM2_PLAYBACK_INT);
 
@@ -677,6 +688,7 @@
     }
 
     if (status & NM2_RECORD_INT) {
+	handled = 1;
 	status &= ~NM2_RECORD_INT;
 	NM2_ACK_INT (card, NM2_RECORD_INT);
 
@@ -687,6 +699,7 @@
     if (status & NM2_MISC_INT_1) {
 	u8 cbyte;
 
+	handled = 1;
 	status &= ~NM2_MISC_INT_1;
 	printk (KERN_ERR "NM256: Got misc interrupt #1\n");
 	NM2_ACK_INT (card, NM2_MISC_INT_1);
@@ -697,6 +710,7 @@
     if (status & NM2_MISC_INT_2) {
 	u8 cbyte;
 
+	handled = 1;
 	status &= ~NM2_MISC_INT_2;
 	printk (KERN_ERR "NM256: Got misc interrupt #2\n");
 	NM2_ACK_INT (card, NM2_MISC_INT_2);
@@ -706,11 +720,13 @@
 
     /* Unknown interrupt. */
     if (status) {
+	handled = 1;
 	printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n",
 		status);
 	/* Pray. */
 	NM2_ACK_INT (card, status);
     }
+    return IRQ_RETVAL(handled);
 }
 
 /* 
diff -Nru a/sound/oss/os.h b/sound/oss/os.h
--- a/sound/oss/os.h	Mon Oct  7 07:45:16 2002
+++ b/sound/oss/os.h	Thu Apr 24 03:36:55 2003
@@ -32,7 +32,6 @@
 #include <linux/pci.h>
 #endif
 
-#include <linux/wrapper.h>
 #include <linux/soundcard.h>
 
 #define FALSE	0
diff -Nru a/sound/oss/pas2_card.c b/sound/oss/pas2_card.c
--- a/sound/oss/pas2_card.c	Mon Jan 13 17:11:59 2003
+++ b/sound/oss/pas2_card.c	Mon Apr 21 00:32:53 2003
@@ -89,7 +89,7 @@
 
 /******************* Begin of the Interrupt Handler ********************/
 
-void pasintr(int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t pasintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	int             status;
 
@@ -106,6 +106,7 @@
 		  pas_midi_interrupt();
 		  status &= ~0x10;
 	}
+	return IRQ_HANDLED;
 }
 
 int pas_set_intr(int mask)
diff -Nru a/sound/oss/pss.c b/sound/oss/pss.c
--- a/sound/oss/pss.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/pss.c	Mon Apr 21 00:32:53 2003
@@ -152,7 +152,7 @@
 
 static void pss_write(pss_confdata *devc, int data)
 {
-	int i, limit;
+	unsigned long i, limit;
 
 	limit = jiffies + HZ/10;	/* The timeout is 0.1 seconds */
 	/*
@@ -305,7 +305,8 @@
 
 static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size, int flags)
 {
-	int i, limit, val, count;
+	int i, val, count;
+	unsigned long limit;
 
 	if (flags & CPF_FIRST)
 	{
diff -Nru a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
--- a/sound/oss/rme96xx.c	Mon Feb 24 12:51:23 2003
+++ b/sound/oss/rme96xx.c	Mon Apr 21 00:32:53 2003
@@ -542,7 +542,7 @@
 
 inline int rme96xx_gethwptr(rme96xx_info* s,int exact)
 {
-	long flags;
+	unsigned long flags;
 	if (exact) {
 		unsigned int hwp;
 /* the hwptr seems to be rather unreliable :(, so we don't use it */
@@ -587,7 +587,7 @@
 static int rme96xx_startcard(rme96xx_info *s,int stop)
 {
 	int i;
-	long flags;
+	unsigned long flags;
 
 	COMM       ("startcard");
 	if(s->control_register & RME96xx_IE){
@@ -760,7 +760,7 @@
 }
 
 
-static void rme96xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t rme96xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int i;
 	rme96xx_info *s = (rme96xx_info *)dev_id;
@@ -770,7 +770,7 @@
 
 	status = readl(s->iobase + RME96xx_status_register);
 	if (!(status & RME96xx_IRQ)) {
-		return;
+		return IRQ_NONE;
 	}
 
 	spin_lock_irqsave(&s->lock,flags);
@@ -785,6 +785,7 @@
 			wake_up(&(db->wait));		
 	}  
 	spin_unlock_irqrestore(&s->lock,flags);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/oss/sb_common.c b/sound/oss/sb_common.c
--- a/sound/oss/sb_common.c	Sun Nov 17 19:33:01 2002
+++ b/sound/oss/sb_common.c	Mon Apr 21 00:32:53 2003
@@ -201,7 +201,7 @@
 		sb_intr(devc);
 }
 
-static void sbintr(int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t sbintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	sb_devc *devc = dev_id;
 
@@ -219,6 +219,7 @@
 		sb_intr (devc);
 		break;
 	}
+	return IRQ_HANDLED;
 }
 
 int sb_dsp_reset(sb_devc * devc)
diff -Nru a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
--- a/sound/oss/sonicvibes.c	Thu Apr 17 12:36:40 2003
+++ b/sound/oss/sonicvibes.c	Thu Apr 24 03:36:58 2003
@@ -115,7 +115,6 @@
 #include <linux/poll.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
-#include <linux/wrapper.h>
 #include <linux/gameport.h>
 
 #include <asm/io.h>
@@ -709,7 +708,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(s->dev, PAGE_SIZE << db->buforder, db->rawbuf, db->dmaaddr);
 	}
 	db->rawbuf = NULL;
@@ -760,7 +759,7 @@
 		/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-			mem_map_reserve(page);
+			SetPageReserved(page);
 	}
 	bytepersec = rate << sample_shift[fmt];
 	bufs = PAGE_SIZE << db->buforder;
@@ -899,7 +898,7 @@
 		wake_up(&s->midi.owait);
 }
 
-static void sv_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sv_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct sv_state *s = (struct sv_state *)dev_id;
 	unsigned int intsrc;
@@ -907,11 +906,12 @@
 	/* fastpath out, to ease interrupt sharing */
 	intsrc = inb(s->ioenh + SV_CODEC_STATUS);
 	if (!(intsrc & (SV_CSTAT_DMAA | SV_CSTAT_DMAC | SV_CSTAT_MIDI)))
-		return;
+		return IRQ_NONE;
 	spin_lock(&s->lock);
 	sv_update_ptr(s);
 	sv_handle_midi(s);
 	spin_unlock(&s->lock);
+	return IRQ_HANDLED;
 }
 
 static void sv_midi_timer(unsigned long data)
diff -Nru a/sound/oss/sscape.c b/sound/oss/sscape.c
--- a/sound/oss/sscape.c	Tue Aug 13 08:36:38 2002
+++ b/sound/oss/sscape.c	Thu Apr 24 03:37:00 2003
@@ -39,7 +39,6 @@
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/proc_fs.h>
-#include <linux/wrapper.h>
 #include <linux/spinlock.h>
 
 #include "coproc.h"
@@ -839,7 +838,7 @@
 	devc->raw_buf_phys = virt_to_bus(start_addr);
 
 	for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++)
-		mem_map_reserve(page);
+		SetPageReserved(page);
 	return 1;
 }
 
@@ -855,7 +854,7 @@
 	end_addr = start_addr + devc->buffsize;
 
 	for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++)
-		mem_map_unreserve(page);
+		ClearPageReserved(page);
 
 	free_pages((unsigned long) devc->raw_buf, sz);
 	devc->raw_buf = NULL;
diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c
--- a/sound/oss/trident.c	Thu Apr  3 14:52:57 2003
+++ b/sound/oss/trident.c	Thu Apr 24 03:37:02 2003
@@ -195,7 +195,6 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
-#include <linux/wrapper.h>
 #include <linux/bitops.h>
 #include <linux/proc_fs.h>
 #include <linux/interrupt.h>
@@ -1222,7 +1221,7 @@
 	/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 	pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
 	for (page = virt_to_page(rawbuf); page <= pend; page++)
-		mem_map_reserve(page);
+		SetPageReserved(page);
 
 	return 0;
 }
@@ -1253,7 +1252,7 @@
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1);
 		for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++)
-			mem_map_unreserve(page);
+			ClearPageReserved(page);
 		pci_free_consistent(pci_dev, PAGE_SIZE << dmabuf->buforder,
 				    dmabuf->rawbuf, dmabuf->dma_handle);
 		dmabuf->rawbuf = NULL;
@@ -1728,7 +1727,7 @@
 	}
 }
 
-static void trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct trident_card *card = (struct trident_card *)dev_id;
 	u32 event;
@@ -1755,13 +1754,14 @@
 		event = inl(TRID_REG(card, T4D_MISCINT));
 		outl(event | (ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(card, T4D_MISCINT));
 		spin_unlock(&card->lock);
-		return;
+		return IRQ_HANDLED;
 	}
 
 	/* manually clear interrupt status, bad hardware design, blame T^2 */
 	outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW),
 	     TRID_REG(card, T4D_MISCINT));
 	spin_unlock(&card->lock);
+	return IRQ_HANDLED;
 }
 
 /* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to
diff -Nru a/sound/oss/uart401.c b/sound/oss/uart401.c
--- a/sound/oss/uart401.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/uart401.c	Mon Apr 21 00:32:53 2003
@@ -96,18 +96,19 @@
 		printk(KERN_WARNING "Too much work in interrupt on uart401 (0x%X). UART jabbering ??\n", devc->base);
 }
 
-void uart401intr(int irq, void *dev_id, struct pt_regs *dummy)
+irqreturn_t uart401intr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	uart401_devc *devc = dev_id;
 
 	if (devc == NULL)
 	{
 		printk(KERN_ERR "uart401: bad devc\n");
-		return;
+		return IRQ_NONE;
 	}
 
 	if (input_avail(devc))
 		uart401_input_loop(devc);
+	return IRQ_HANDLED;
 }
 
 static int
diff -Nru a/sound/oss/uart6850.c b/sound/oss/uart6850.c
--- a/sound/oss/uart6850.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/uart6850.c	Mon Apr 21 00:32:53 2003
@@ -105,10 +105,11 @@
 	}
 }
 
-void m6850intr(int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t m6850intr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	if (input_avail())
 		uart6850_input_loop();
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
--- a/sound/oss/via82cxxx_audio.c	Thu Apr  3 15:55:38 2003
+++ b/sound/oss/via82cxxx_audio.c	Thu Apr 24 03:37:05 2003
@@ -31,7 +31,6 @@
 #include <linux/ac97_codec.h>
 #include <linux/smp_lock.h>
 #include <linux/ioport.h>
-#include <linux/wrapper.h>
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -1694,10 +1693,11 @@
 }
 
 
-static void via_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t via_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct via_info *card = dev_id;
 	u32 status32;
+	int handled = 0;
 
 	/* to minimize interrupt sharing costs, we use the SGD status
 	 * shadow register to check the status of all inputs and
@@ -1708,10 +1708,12 @@
 	if (!(status32 & VIA_INTR_MASK))
         {
 #ifdef CONFIG_MIDI_VIA82CXXX
-	    	 if (card->midi_devc)
+	    	 if (card->midi_devc) {
                     	uart401intr(irq, card->midi_devc, regs);
+			handled = 1;
+		}
 #endif
-		return;
+		goto out;
     	}
 	DPRINTK ("intr, status32 == 0x%08X\n", status32);
 
@@ -1720,14 +1722,21 @@
 	 */
 	spin_lock (&card->lock);
 
-	if (status32 & VIA_INTR_OUT)
+	if (status32 & VIA_INTR_OUT) {
+		handled = 1;
 		via_intr_channel (&card->ch_out);
-	if (status32 & VIA_INTR_IN)
+	}
+	if (status32 & VIA_INTR_IN) {
+		handled = 1;
 		via_intr_channel (&card->ch_in);
-	if (status32 & VIA_INTR_FM)
+	}
+	if (status32 & VIA_INTR_FM) {
+		handled = 1;
 		via_intr_channel (&card->ch_fm);
-
+	}
 	spin_unlock (&card->lock);
+out:
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/sound/oss/vidc.h b/sound/oss/vidc.h
--- a/sound/oss/vidc.h	Sun Feb 10 18:50:08 2002
+++ b/sound/oss/vidc.h	Mon Apr 21 00:32:53 2003
@@ -37,7 +37,7 @@
  * DMA Interrupt handler
  */
 
-extern void vidc_sound_dma_irq(int irqnr, void *ref, struct pt_regs *regs);
+extern irqreturn_t vidc_sound_dma_irq(int irqnr, void *ref, struct pt_regs *regs);
 
 /*
  * Filler routine pointer
diff -Nru a/sound/oss/vidc_fill.S b/sound/oss/vidc_fill.S
--- a/sound/oss/vidc_fill.S	Sun Nov 24 15:14:23 2002
+++ b/sound/oss/vidc_fill.S	Mon Apr 21 00:32:53 2003
@@ -133,6 +133,10 @@
  *  ip = corrupted
  */
 
+%%%%%%%%%%%%%%%%%%%
+fixme!  This funtion needs to return IRQ_HANDLED
+%%%%%%%%%%%%%%%%%%%
+
 ENTRY(vidc_sound_dma_irq)
 		stmfd	sp!, {r4 - r8, lr}
 		ldr	r8, =dma_start
diff -Nru a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
--- a/sound/oss/vwsnd.c	Tue Feb 18 18:58:58 2003
+++ b/sound/oss/vwsnd.c	Mon Apr 21 00:32:53 2003
@@ -2236,7 +2236,7 @@
 		pcm_output(devc, underflown, 0);
 }
 
-static void vwsnd_audio_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t vwsnd_audio_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	vwsnd_dev_t *devc = (vwsnd_dev_t *) dev_id;
 	unsigned int status;
@@ -2246,6 +2246,7 @@
 	status = li_get_clear_intr_status(&devc->lith);
 	vwsnd_audio_read_intr(devc, status);
 	vwsnd_audio_write_intr(devc, status);
+	return IRQ_HANDLED;
 }
 
 static ssize_t vwsnd_audio_do_read(struct file *file,
diff -Nru a/sound/oss/waveartist.c b/sound/oss/waveartist.c
--- a/sound/oss/waveartist.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/waveartist.c	Mon Apr 21 00:32:53 2003
@@ -833,7 +833,7 @@
 };
 
 
-static void
+static irqreturn_t
 waveartist_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	wavnc_info *devc = (wavnc_info *)dev_id;
@@ -872,6 +872,7 @@
 		// We do not use SB mode natively...
 		printk(KERN_WARNING "waveartist: Unexpected SB interrupt...\n");
 	spin_unlock(&waveartist_lock);
+	return IRQ_HANDLED;
 }
 
 /* -------------------------------------------------------------------------
diff -Nru a/sound/oss/wavfront.c b/sound/oss/wavfront.c
--- a/sound/oss/wavfront.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/wavfront.c	Mon Apr 21 00:32:53 2003
@@ -2123,8 +2123,8 @@
 /* WaveFront: Linux modular sound kernel installation interface        */
 /***********************************************************************/
 
-void
-wavefrontintr (int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t
+wavefrontintr(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	struct wf_config *hw = dev_id;
 
@@ -2149,12 +2149,13 @@
 	*/
 
 	if ((wavefront_status() & (STAT_INTR_READ|STAT_INTR_WRITE)) == 0) {
-		return;
+		return IRQ_NONE;
 	}
 
 	hw->irq_ok = 1;
 	hw->irq_cnt++;
 	wake_up_interruptible (&hw->interrupt_sleeper);
+	return IRQ_HANDLED;
 }
 
 /* STATUS REGISTER 
diff -Nru a/sound/oss/wf_midi.c b/sound/oss/wf_midi.c
--- a/sound/oss/wf_midi.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/wf_midi.c	Mon Apr 21 00:32:53 2003
@@ -354,8 +354,8 @@
 	return 1;
 }
 
-void
-wf_mpuintr (int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t
+wf_mpuintr(int irq, void *dev_id, struct pt_regs *dummy)
 
 {
 	struct wf_mpu_config *physical_dev = dev_id;
@@ -364,10 +364,11 @@
 	int n;
 
 	if (!input_avail()) { /* not for us */
-		return;
+		return IRQ_NONE;
 	}
 
-	if (mi->m_busy) return;
+	if (mi->m_busy)
+		return IRQ_HANDLED;
 	spin_lock(&lock);
 	mi->m_busy = 1;
 
@@ -410,6 +411,7 @@
 
 	mi->m_busy = 0;
 	spin_unlock(&lock);
+	return IRQ_HANDLED;
 }
 
 static int
diff -Nru a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
--- a/sound/oss/ymfpci.c	Thu Apr  3 14:35:48 2003
+++ b/sound/oss/ymfpci.c	Mon Apr 21 00:32:53 2003
@@ -1016,7 +1016,7 @@
 	return 0;
 }
 
-void ymf_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ymf_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	ymfpci_t *codec = dev_id;
 	u32 status, nvoice, mode;
@@ -1050,6 +1050,7 @@
 		/* timer handler */
 		ymfpci_writel(codec, YDSXGR_INTFLAG, ~0);
 	}
+	return IRQ_HANDLED;
 }
 
 static void ymf_pcm_free_substream(struct ymf_pcm *ypcm)
diff -Nru a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
--- a/sound/pci/ali5451/ali5451.c	Thu Apr 10 03:28:12 2003
+++ b/sound/pci/ali5451/ali5451.c	Thu Apr 24 05:17:35 2003
@@ -1032,15 +1032,16 @@
 }
 
 
-static void snd_ali_card_interrupt(int irq,
-				   void *dev_id,
-				   struct pt_regs *regs)
+static irqreturn_t snd_ali_card_interrupt(int irq,
+					  void *dev_id,
+					  struct pt_regs *regs)
 {
-	ali_t 	*codec = snd_magic_cast(ali_t, dev_id, return);
+	ali_t *codec = snd_magic_cast(ali_t, dev_id, return IRQ_NONE);
 
 	if (codec == NULL)
-		return;
+		return IRQ_NONE;
 	snd_ali_interrupt(codec);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/pci/als4000.c b/sound/pci/als4000.c
--- a/sound/pci/als4000.c	Tue Feb 18 10:31:36 2003
+++ b/sound/pci/als4000.c	Thu Apr 24 05:17:35 2003
@@ -356,9 +356,9 @@
 	return bytes_to_frames( substream->runtime, result );
 }
 
-static void snd_als4000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	sb_t *chip = snd_magic_cast(sb_t, dev_id, return);
+	sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE);
 	unsigned long flags;
 	unsigned gcr_status;
 	unsigned sb_status;
@@ -387,6 +387,7 @@
 		inb(chip->mpu_port);
 	if (sb_status & 0x20)
 		inb(SBP(chip, RESET));
+	return IRQ_HANDLED;
 }
 
 /*****************************************************************/
diff -Nru a/sound/pci/cmipci.c b/sound/pci/cmipci.c
--- a/sound/pci/cmipci.c	Thu Apr 10 03:28:12 2003
+++ b/sound/pci/cmipci.c	Thu Apr 24 05:17:35 2003
@@ -1640,15 +1640,15 @@
 /*
  * interrupt handler
  */
-static void snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	cmipci_t *cm = snd_magic_cast(cmipci_t, dev_id, return);
+	cmipci_t *cm = snd_magic_cast(cmipci_t, dev_id, return IRQ_NONE);
 	unsigned int status, mask = 0;
 	
 	/* fastpath out, to ease interrupt sharing */
 	status = snd_cmipci_read(cm, CM_REG_INT_STATUS);
 	if (!(status & CM_INTR))
-		return;
+		return IRQ_NONE;
 
 	/* acknowledge interrupt */
 	spin_lock(&cm->reg_lock);
@@ -1669,6 +1669,8 @@
 		if ((status & CM_CHINT1) && cm->channel[1].running)
 			snd_pcm_period_elapsed(cm->channel[1].substream);
 	}
+
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/pci/cs4281.c b/sound/pci/cs4281.c
--- a/sound/pci/cs4281.c	Thu Apr 10 03:28:12 2003
+++ b/sound/pci/cs4281.c	Thu Apr 24 05:17:35 2003
@@ -511,7 +511,7 @@
 
 };
 
-static void snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static struct pci_device_id snd_cs4281_ids[] __devinitdata = {
 	{ 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },	/* CS4281 */
@@ -1883,18 +1883,18 @@
  *  Interrupt handler
  */
 
-static void snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	cs4281_t *chip = snd_magic_cast(cs4281_t, dev_id, return);
+	cs4281_t *chip = snd_magic_cast(cs4281_t, dev_id, return IRQ_NONE);
 	unsigned int status, dma, val;
 	cs4281_dma_t *cdma;
 
 	if (chip == NULL)
-		return;
+		return IRQ_NONE;
 	status = snd_cs4281_peekBA0(chip, BA0_HISR);
 	if ((status & 0x7fffffff) == 0) {
 		snd_cs4281_pokeBA0(chip, BA0_HICR, BA0_HICR_EOI);
-		return;
+		return IRQ_NONE;
 	}
 
 	if (status & (BA0_HISR_DMA(0)|BA0_HISR_DMA(1)|BA0_HISR_DMA(2)|BA0_HISR_DMA(3))) {
@@ -1949,6 +1949,8 @@
 
 	/* EOI to the PCI part... reenables interrupts */
 	snd_cs4281_pokeBA0(chip, BA0_HICR, BA0_HICR_EOI);
+
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
--- a/sound/pci/cs46xx/cs46xx_lib.c	Thu Apr 10 03:28:12 2003
+++ b/sound/pci/cs46xx/cs46xx_lib.c	Thu Apr 24 05:17:35 2003
@@ -1217,9 +1217,9 @@
 	return 0;
 }
 
-static void snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	cs46xx_t *chip = snd_magic_cast(cs46xx_t, dev_id, return);
+	cs46xx_t *chip = snd_magic_cast(cs46xx_t, dev_id, return IRQ_NONE);
 	u32 status1;
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
 	dsp_spos_instance_t * ins = chip->dsp_spos_instance;
@@ -1234,7 +1234,7 @@
 	status1 = snd_cs46xx_peekBA0(chip, BA0_HISR);
 	if ((status1 & 0x7fffffff) == 0) {
 		snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_CHGM | HICR_IEV);
-		return;
+		return IRQ_NONE;
 	}
 
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
@@ -1305,6 +1305,8 @@
 	 *  EOI to the PCI part....reenables interrupts
 	 */
 	snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_CHGM | HICR_IEV);
+
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_hardware_t snd_cs46xx_playback =
diff -Nru a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
--- a/sound/pci/emu10k1/irq.c	Tue Oct  1 10:06:00 2002
+++ b/sound/pci/emu10k1/irq.c	Thu Apr 24 05:17:35 2003
@@ -30,13 +30,15 @@
 #include <sound/core.h>
 #include <sound/emu10k1.h>
 
-void snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	emu10k1_t *emu = snd_magic_cast(emu10k1_t, dev_id, return);
+	emu10k1_t *emu = snd_magic_cast(emu10k1_t, dev_id, return IRQ_NONE);
 	unsigned int status;
+	int handled = 0;
 
 	while ((status = inl(emu->port + IPR)) != 0) {
 		// printk("irq - status = 0x%x\n", status);
+		handled = 1;
 		if (status & IPR_PCIERROR) {
 			snd_printk("interrupt: PCI error\n");
 			snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE);
@@ -145,4 +147,5 @@
 			outl(IPR_FXDSP, emu->port + IPR);
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
diff -Nru a/sound/pci/ens1370.c b/sound/pci/ens1370.c
--- a/sound/pci/ens1370.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/ens1370.c	Thu Apr 24 05:17:35 2003
@@ -412,7 +412,7 @@
 #endif
 };
 
-static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static struct pci_device_id snd_audiopci_ids[] __devinitdata = {
 #ifdef CHIP1370
@@ -2231,17 +2231,17 @@
  *  Interrupt handler
  */
 
-static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, dev_id, return);
+	ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, dev_id, return IRQ_NONE);
 	unsigned int status, sctrl;
 
 	if (ensoniq == NULL)
-		return;
+		return IRQ_NONE;
 
 	status = inl(ES_REG(ensoniq, STATUS));
 	if (!(status & ES_INTR))
-		return;
+		return IRQ_NONE;
 
 	spin_lock(&ensoniq->reg_lock);
 	sctrl = ensoniq->sctrl;
@@ -2263,6 +2263,7 @@
 		snd_pcm_period_elapsed(ensoniq->capture_substream);
 	if ((status & ES_DAC1) && ensoniq->playback1_substream)
 		snd_pcm_period_elapsed(ensoniq->playback1_substream);
+	return IRQ_HANDLED;
 }
 
 static int __devinit snd_audiopci_probe(struct pci_dev *pci,
diff -Nru a/sound/pci/es1938.c b/sound/pci/es1938.c
--- a/sound/pci/es1938.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/es1938.c	Thu Apr 24 05:17:35 2003
@@ -249,7 +249,7 @@
 #endif
 };
 
-static void snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static struct pci_device_id snd_es1938_ids[] __devinitdata = {
         { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* Solo-1 */
@@ -1490,10 +1490,11 @@
 /* --------------------------------------------------------------------
  * Interrupt handler
  * -------------------------------------------------------------------- */
-static void snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	es1938_t *chip = snd_magic_cast(es1938_t, dev_id, return);
+	es1938_t *chip = snd_magic_cast(es1938_t, dev_id, return IRQ_NONE);
 	unsigned char status, audiostatus;
+	int handled = 0;
 
 	status = inb(SLIO_REG(chip, IRQCONTROL));
 #if 0
@@ -1509,6 +1510,7 @@
 		printk("Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n", inl(SLDM_REG(chip, DMASTATUS)));
 #endif
 		/* clear irq */
+		handled = 1;
 		audiostatus = inb(SLSB_REG(chip, STATUS));
 		if (chip->active & ADC1)
 			snd_pcm_period_elapsed(chip->capture_substream);
@@ -1525,6 +1527,7 @@
 
 #endif
 		/* clear irq */
+		handled = 1;
 		snd_es1938_mixer_bits(chip, ESSSB_IREG_AUDIO2CONTROL2, 0x80, 0);
 		if (chip->active & DAC2)
 			snd_pcm_period_elapsed(chip->playback1_substream);
@@ -1533,6 +1536,7 @@
 	/* Hardware volume */
 	if (status & 0x40) {
 		int split = snd_es1938_mixer_read(chip, 0x64) & 0x80;
+		handled = 1;
 		snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->hw_switch->id);
 		snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->hw_volume->id);
 		if (!split) {
@@ -1546,9 +1550,12 @@
 	/* MPU401 */
 	if (status & 0x80) {
 		// snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); /* ack? */
-		if (chip->rmidi)
+		if (chip->rmidi) {
+			handled = 1;
 			snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
+		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 #define ES1938_DMA_SIZE 64
diff -Nru a/sound/pci/es1968.c b/sound/pci/es1968.c
--- a/sound/pci/es1968.c	Thu Mar 20 08:41:14 2003
+++ b/sound/pci/es1968.c	Thu Apr 24 05:17:35 2003
@@ -600,7 +600,7 @@
 #endif
 };
 
-static void snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 static struct pci_device_id snd_es1968_ids[] __devinitdata = {
 	/* Maestro 1 */
@@ -2009,13 +2009,13 @@
 /*
  * interrupt handler
  */
-static void snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	es1968_t *chip = snd_magic_cast(es1968_t, dev_id, return);
+	es1968_t *chip = snd_magic_cast(es1968_t, dev_id, return IRQ_NONE);
 	u32 event;
 
 	if (!(event = inb(chip->io_port + 0x1A)))
-		return;
+		return IRQ_NONE;
 
 	outw(inw(chip->io_port + 4) & 1, chip->io_port + 4);
 
@@ -2041,6 +2041,8 @@
 		}
 		spin_unlock(&chip->substream_lock);
 	}
+
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/pci/fm801.c b/sound/pci/fm801.c
--- a/sound/pci/fm801.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/fm801.c	Thu Apr 24 05:17:35 2003
@@ -481,16 +481,16 @@
 	return bytes_to_frames(substream->runtime, ptr);
 }
 
-static void snd_fm801_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_fm801_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	fm801_t *chip = snd_magic_cast(fm801_t, dev_id, return);
+	fm801_t *chip = snd_magic_cast(fm801_t, dev_id, return IRQ_NONE);
 	unsigned short status;
 	unsigned int tmp;
 
 	status = inw(FM801_REG(chip, IRQ_STATUS));
 	status &= FM801_IRQ_PLAYBACK|FM801_IRQ_CAPTURE|FM801_IRQ_MPU|FM801_IRQ_VOLUME;
 	if (! status)
-		return;
+		return IRQ_NONE;
 	/* ack first */
 	outw(status, FM801_REG(chip, IRQ_STATUS));
 	if (chip->pcm && (status & FM801_IRQ_PLAYBACK) && chip->playback_substream) {
@@ -525,6 +525,8 @@
 		snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
 	if (status & FM801_IRQ_VOLUME)
 		;/* TODO */
+
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_hardware_t snd_fm801_playback =
diff -Nru a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
--- a/sound/pci/ice1712/ice1712.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/ice1712/ice1712.c	Thu Apr 24 05:17:35 2003
@@ -398,15 +398,17 @@
  *  Interrupt handler
  */
 
-static void snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return);
+	ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return IRQ_NONE);
 	unsigned char status;
+	int handled = 0;
 
 	while (1) {
 		status = inb(ICEREG(ice, IRQSTAT));
 		if (status == 0)
 			break;
+		handled = 1;
 		if (status & ICE1712_IRQ_MPU1) {
 			if (ice->rmidi[0])
 				snd_mpu401_uart_interrupt(irq, ice->rmidi[0]->private_data, regs);
@@ -462,6 +464,7 @@
 			outb(ICE1712_IRQ_CONPBK, ICEREG(ice, IRQSTAT));
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 
diff -Nru a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
--- a/sound/pci/ice1712/ice1724.c	Thu Mar 20 08:41:20 2003
+++ b/sound/pci/ice1712/ice1724.c	Thu Apr 24 05:17:35 2003
@@ -194,16 +194,18 @@
  *  Interrupt handler
  */
 
-static void snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return);
+	ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return IRQ_NONE);
 	unsigned char status;
+	int handled = 0;
 
 	while (1) {
 		status = inb(ICEREG1724(ice, IRQSTAT));
 		if (status == 0)
 			break;
-		
+
+		handled = 1;		
 		/*  these should probably be separated at some point, 
 			but as we don't currently have MPU support on the board I will leave it */
 		if ((status & VT1724_IRQ_MPU_RX)||(status & VT1724_IRQ_MPU_TX)) {
@@ -242,6 +244,7 @@
 
 		}
 	}
+	return IRQ_RETVAL(handled);
 }
 
 /*
diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
--- a/sound/pci/intel8x0.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/intel8x0.c	Thu Apr 24 05:17:35 2003
@@ -716,9 +716,9 @@
 	iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
 }
 
-static void snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, dev_id, return);
+	intel8x0_t *chip = snd_magic_cast(intel8x0_t, dev_id, return IRQ_NONE);
 	ichdev_t *ichdev;
 	unsigned int status;
 	unsigned int i;
@@ -727,7 +727,7 @@
 	status = igetdword(chip, chip->int_sta_reg);
 	if ((status & chip->int_sta_mask) == 0) {
 		spin_unlock(&chip->reg_lock);
-		return;
+		return IRQ_NONE;
 	}
 	/* ack first */
 	iputdword(chip, chip->int_sta_reg, status & ~chip->int_sta_mask);
@@ -738,6 +738,7 @@
 		if (status & ichdev->int_sta_mask)
 			snd_intel8x0_update(chip, ichdev);
 	}
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
--- a/sound/pci/korg1212/korg1212.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/korg1212/korg1212.c	Thu Apr 24 05:17:35 2003
@@ -1133,18 +1133,19 @@
 	snd_korg1212_setCardState(korg1212, K1212_STATE_DSP_COMPLETE);
 }
 
-static void snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         u32 doorbellValue;
-        korg1212_t *korg1212 = snd_magic_cast(korg1212_t, dev_id, return);
+        korg1212_t *korg1212 = snd_magic_cast(korg1212_t, dev_id,
+						return IRQ_NONE);
 
 	if(irq != korg1212->irq)
-		return;
+		return IRQ_NONE;
 
         doorbellValue = readl(korg1212->inDoorbellPtr);
 
         if (!doorbellValue)
-		return;
+		return IRQ_NONE;
 
 	spin_lock(&korg1212->lock);
 
@@ -1218,6 +1219,8 @@
 	korg1212->inIRQ--;
 
 	spin_unlock(&korg1212->lock);
+
+	return IRQ_HANDLED;
 }
 
 static int snd_korg1212_downloadDSPCode(korg1212_t *korg1212)
diff -Nru a/sound/pci/maestro3.c b/sound/pci/maestro3.c
--- a/sound/pci/maestro3.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/maestro3.c	Mon Apr 21 10:36:32 2003
@@ -1549,7 +1549,7 @@
 	}
 }
 
-static void 
+static irqreturn_t
 snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	m3_t *chip = snd_magic_cast(m3_t, dev_id, );
@@ -1559,13 +1559,13 @@
 	status = inb(chip->iobase + 0x1A);
 
 	if (status == 0xff)
-		return;
+		return IRQ_NONE;
    
 	/* presumably acking the ints? */
 	outw(status, chip->iobase + 0x1A);
 
 	/*if (in_suspend)
-		return;*/
+		return IRQ_NONE;*/
 
 	/*
 	 * ack an assp int if its running
@@ -1592,6 +1592,8 @@
 	/* XXX is this needed? */
 	if (status & 0x40) 
 		outb(0x40, chip->iobase+0x1A);
+
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
--- a/sound/pci/nm256/nm256.c	Sun Feb 16 05:47:44 2003
+++ b/sound/pci/nm256/nm256.c	Thu Apr 24 05:17:35 2003
@@ -238,7 +238,7 @@
 	int mixer_status_mask;		/* bit mask to test the mixer status */
 
 	int irq;
-	void (*interrupt)(int, void *, struct pt_regs *);
+	irqreturn_t (*interrupt)(int, void *, struct pt_regs *);
 	int badintrcount;		/* counter to check bogus interrupts */
 
 	nm256_stream_t streams[2];
@@ -972,10 +972,10 @@
  * I suppose...yucky bleah.)
  */
 
-static void
+static irqreturn_t
 snd_nm256_interrupt(int irq, void *dev_id, struct pt_regs *dummy)
 {
-	nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return);
+	nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return IRQ_NONE);
 	u16 status;
 	u8 cbyte;
 
@@ -984,7 +984,7 @@
 	/* Not ours. */
 	if (status == 0) {
 		snd_nm256_intr_check(chip);
-		return;
+		return IRQ_NONE;
 	}
 
 	chip->badintrcount = 0;
@@ -1030,6 +1030,7 @@
 	}
 
 	spin_unlock(&chip->reg_lock);
+	return IRQ_HANDLED;
 }
 
 /*
@@ -1038,7 +1039,7 @@
  * routine.
  */
 
-static void
+static irqreturn_t
 snd_nm256_interrupt_zx(int irq, void *dev_id, struct pt_regs *dummy)
 {
 	nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return);
@@ -1050,7 +1051,7 @@
 	/* Not ours. */
 	if (status == 0) {
 		snd_nm256_intr_check(chip);
-		return;
+		return IRQ_NONE;
 	}
 
 	chip->badintrcount = 0;
@@ -1095,6 +1096,7 @@
 	}
 
 	spin_unlock(&chip->reg_lock);
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/pci/rme32.c b/sound/pci/rme32.c
--- a/sound/pci/rme32.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/rme32.c	Mon Apr 21 00:32:53 2003
@@ -833,14 +833,14 @@
 	writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
 }
 
-static void
+static irqreturn_t
 snd_rme32_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	rme32_t *rme32 = (rme32_t *) dev_id;
 
 	rme32->rcreg = readl(rme32->iobase + RME32_IO_CONTROL_REGISTER);
 	if (!(rme32->rcreg & RME32_RCR_IRQ)) {
-		return;
+		return IRQ_NONE;
 	} else {
 		if (rme32->capture_substream) {
 			snd_pcm_period_elapsed(rme32->capture_substream);
@@ -850,6 +850,7 @@
 		}
 		writel(0, rme32->iobase + RME32_IO_CONFIRM_ACTION_IRQ);
 	}
+	return IRQ_HANDLED;
 }
 
 static unsigned int period_bytes[] = { RME32_BLOCK_SIZE };
diff -Nru a/sound/pci/rme96.c b/sound/pci/rme96.c
--- a/sound/pci/rme96.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/rme96.c	Mon Apr 21 00:32:53 2003
@@ -1153,7 +1153,7 @@
 	writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
 }
 
-static void
+static irqreturn_t
 snd_rme96_interrupt(int irq,
 		    void *dev_id,
 		    struct pt_regs *regs)
@@ -1165,7 +1165,7 @@
 	if (!((rme96->rcreg & RME96_RCR_IRQ) ||
 	      (rme96->rcreg & RME96_RCR_IRQ_2)))
 	{
-		return;
+		return IRQ_NONE;
 	}
 	
 	if (rme96->rcreg & RME96_RCR_IRQ) {
@@ -1178,6 +1178,7 @@
 		snd_pcm_period_elapsed(rme96->capture_substream);		
 		writel(0, rme96->iobase + RME96_IO_CONFIRM_REC_IRQ);
 	}
+	return IRQ_HANDLED;
 }
 
 static unsigned int period_bytes[] = { RME96_SMALL_BLOCK_SIZE, RME96_LARGE_BLOCK_SIZE };
diff -Nru a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
--- a/sound/pci/rme9652/hdsp.c	Thu Apr 10 03:28:13 2003
+++ b/sound/pci/rme9652/hdsp.c	Mon Apr 21 00:32:53 2003
@@ -3076,7 +3076,7 @@
 	}
 } 
 
-void snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	hdsp_t *hdsp = (hdsp_t *) dev_id;
 	unsigned int status;
@@ -3094,7 +3094,7 @@
 	midi1 = status & HDSP_midi1IRQPending;
 
 	if (!audio && !midi0 && !midi1) {
-		return;
+		return IRQ_NONE;
 	}
 
 	hdsp_write(hdsp, HDSP_interruptConfirmation, 0);
@@ -3128,6 +3128,7 @@
 	}
 	if (schedule)
 	    tasklet_hi_schedule(&hdsp->midi_tasklet);
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_uframes_t snd_hdsp_hw_pointer(snd_pcm_substream_t *substream)
diff -Nru a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
--- a/sound/pci/rme9652/rme9652.c	Thu Apr 10 03:28:14 2003
+++ b/sound/pci/rme9652/rme9652.c	Mon Apr 21 00:32:53 2003
@@ -1947,12 +1947,12 @@
 	rme9652_set_rate(rme9652, 48000);
 }
 
-void snd_rme9652_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_rme9652_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	rme9652_t *rme9652 = (rme9652_t *) dev_id;
 
 	if (!(rme9652_read(rme9652, RME9652_status_register) & RME9652_IRQ)) {
-		return;
+		return IRQ_NONE;
 	}
 
 	rme9652_write(rme9652, RME9652_irq_clear, 0);
@@ -1964,6 +1964,7 @@
 	if (rme9652->playback_substream) {
 		snd_pcm_period_elapsed(rme9652->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
 	}
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_uframes_t snd_rme9652_hw_pointer(snd_pcm_substream_t *substream)
diff -Nru a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
--- a/sound/pci/sonicvibes.c	Thu Mar 20 08:41:15 2003
+++ b/sound/pci/sonicvibes.c	Thu Apr 24 05:17:35 2003
@@ -596,18 +596,19 @@
 	return result;
 }
 
-static void snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	sonicvibes_t *sonic = snd_magic_cast(sonicvibes_t, dev_id, return);
+	sonicvibes_t *sonic = snd_magic_cast(sonicvibes_t, dev_id,
+						return IRQ_NONE);
 	unsigned char status;
 
 	status = inb(SV_REG(sonic, STATUS));
 	if (!(status & (SV_DMAA_IRQ | SV_DMAC_IRQ | SV_MIDI_IRQ)))
-		return;
+		return IRQ_NONE;
 	if (status == 0xff) {	/* failure */
 		outb(sonic->irqmask = ~0, SV_REG(sonic, IRQMASK));
 		snd_printk("IRQ failure - interrupts disabled!!\n");
-		return;
+		return IRQ_HANDLED;
 	}
 	if (sonic->pcm) {
 		if (status & SV_DMAA_IRQ)
@@ -654,6 +655,8 @@
 		snd_ctl_notify(sonic->card, SNDRV_CTL_EVENT_MASK_VALUE, &sonic->master_mute->id);
 		snd_ctl_notify(sonic->card, SNDRV_CTL_EVENT_MASK_VALUE, &sonic->master_volume->id);
 	}
+
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
--- a/sound/pci/trident/trident_main.c	Thu Apr 10 03:28:14 2003
+++ b/sound/pci/trident/trident_main.c	Thu Apr 24 05:17:35 2003
@@ -48,7 +48,7 @@
 
 static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream);
 static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream);
-static void snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 #ifdef CONFIG_PM
 static int snd_trident_set_power_state(snd_card_t *card, unsigned int power_state);
 #endif
@@ -3683,20 +3683,20 @@
                 the method try & fail so it is possible that it won't
                 work on all computers. [jaroslav]
 
-   Returns:     None.
+   Returns:     Whether IRQ was handled or not.
   
   ---------------------------------------------------------------------------*/
 
-static void snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	trident_t *trident = snd_magic_cast(trident_t, dev_id, return);
+	trident_t *trident = snd_magic_cast(trident_t, dev_id, return IRQ_NONE);
 	unsigned int audio_int, chn_int, stimer, channel, mask, tmp;
 	int delta;
 	snd_trident_voice_t *voice;
 
 	audio_int = inl(TRID_REG(trident, T4D_MISCINT));
 	if ((audio_int & (ADDRESS_IRQ|MPU401_IRQ)) == 0)
-		return;
+		return IRQ_NONE;
 	if (audio_int & ADDRESS_IRQ) {
 		// get interrupt status for all channels
 		spin_lock(&trident->reg_lock);
@@ -3781,6 +3781,8 @@
 		}
 	}
 	// outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT));
+
+	return IRQ_HANDLED;
 }
 
 /*---------------------------------------------------------------------------
diff -Nru a/sound/pci/via82xx.c b/sound/pci/via82xx.c
--- a/sound/pci/via82xx.c	Thu Apr 10 03:28:14 2003
+++ b/sound/pci/via82xx.c	Thu Apr 24 05:17:35 2003
@@ -574,9 +574,9 @@
  *  Interrupt handler
  */
 
-static void snd_via82xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	via82xx_t *chip = snd_magic_cast(via82xx_t, dev_id, return);
+	via82xx_t *chip = snd_magic_cast(via82xx_t, dev_id, return IRQ_NONE);
 	unsigned int status;
 	unsigned int i;
 
@@ -591,8 +591,8 @@
 		spin_unlock(&chip->reg_lock);
 		if (chip->rmidi)
 			/* check mpu401 interrupt */
-			snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
-		return;
+			return snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
+		return IRQ_NONE;
 	}
 // _skip_sgd:
 
@@ -611,6 +611,7 @@
 		outb(c_status, VIADEV_REG(viadev, OFFSET_STATUS)); /* ack */
 	}
 	spin_unlock(&chip->reg_lock);
+	return IRQ_HANDLED;
 }
 
 /*
diff -Nru a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
--- a/sound/pci/ymfpci/ymfpci_main.c	Thu Apr 10 03:28:14 2003
+++ b/sound/pci/ymfpci/ymfpci_main.c	Thu Apr 24 05:17:35 2003
@@ -741,9 +741,9 @@
 	}
 }
 
-static void snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	ymfpci_t *chip = snd_magic_cast(ymfpci_t, dev_id, return);
+	ymfpci_t *chip = snd_magic_cast(ymfpci_t, dev_id, return IRQ_NONE);
 	u32 status, nvoice, mode;
 	ymfpci_voice_t *voice;
 
@@ -787,6 +787,8 @@
 
 	if (chip->rawmidi)
 		snd_mpu401_uart_interrupt(irq, chip->rawmidi->private_data, regs);
+
+	return IRQ_HANDLED;
 }
 
 static snd_pcm_hardware_t snd_ymfpci_playback =
diff -Nru a/sound/ppc/pmac.c b/sound/ppc/pmac.c
--- a/sound/ppc/pmac.c	Thu Apr 10 03:28:14 2003
+++ b/sound/ppc/pmac.c	Mon Apr 21 00:32:53 2003
@@ -693,23 +693,25 @@
 /*
  * interrupt handlers
  */
-static void
+static irqreturn_t
 snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
 	snd_pmac_pcm_update(chip, &chip->playback);
+	return IRQ_HANDLED;
 }
 
 
-static void
+static irqreturn_t
 snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
 	snd_pmac_pcm_update(chip, &chip->capture);
+	return IRQ_HANDLED;
 }
 
 
-static void
+static irqreturn_t
 snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
@@ -728,6 +730,7 @@
 	}
 	/* Writing 1s to the CNTLERR and PORTCHG bits clears them... */
 	out_le32(&chip->awacs->control, ctrl);
+	return IRQ_HANDLED;
 }
 
 
diff -Nru a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
--- a/sound/ppc/tumbler.c	Sun Feb  9 10:47:45 2003
+++ b/sound/ppc/tumbler.c	Mon Apr 21 00:32:53 2003
@@ -785,11 +785,14 @@
 
 
 /* interrupt - headphone plug changed */
-static void headphone_intr(int irq, void *devid, struct pt_regs *regs)
+static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs)
 {
 	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
-	if (chip->update_automute && chip->initialized)
+	if (chip->update_automute && chip->initialized) {
 		chip->update_automute(chip, 1);
+		return IRQ_HANDLED;
+	}
+	return IRQ_NONE;
 }
 
 /* look for audio-gpio device */
diff -Nru a/sound/sound_core.c b/sound/sound_core.c
--- a/sound/sound_core.c	Sat Mar 22 07:38:05 2003
+++ b/sound/sound_core.c	Fri Apr 18 11:59:04 2003
@@ -54,7 +54,7 @@
 	int unit_minor;
 	struct file_operations *unit_fops;
 	struct sound_unit *next;
-	devfs_handle_t de;
+	char name[32];
 };
 
 #ifdef CONFIG_SOUND_MSNDCLAS
@@ -151,30 +151,29 @@
 
 static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode)
 {
+	struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL);
 	int r;
-	struct sound_unit *s=(struct sound_unit *)kmalloc(sizeof(struct sound_unit), GFP_KERNEL);
-	char name_buf[32];
 
-	if(s==NULL)
+	if (!s)
 		return -ENOMEM;
 		
 	spin_lock(&sound_loader_lock);
-	r=__sound_insert_unit(s,list,fops,index,low,top);
+	r = __sound_insert_unit(s, list, fops, index, low, top);
 	spin_unlock(&sound_loader_lock);
 	
-	if(r<0)
-	{
-		kfree(s);
-		return r;
-	}
-	
-	if (r < SOUND_STEP)
-		sprintf (name_buf, "sound/%s", name);
+	if (r < 0)
+		goto fail;
+	else if (r < SOUND_STEP)
+		sprintf(s->name, "sound/%s", name);
 	else
-		sprintf (name_buf, "sound/%s%d", name, r / SOUND_STEP);
-	s->de = devfs_register (NULL, name_buf,
-				DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor,
-				S_IFCHR | mode, fops, NULL);
+		sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
+
+	devfs_register(NULL, s->name, 0, SOUND_MAJOR, s->unit_minor,
+			S_IFCHR | mode, fops, NULL);
+	return r;
+
+ fail:
+	kfree(s);
 	return r;
 }
 
@@ -192,7 +191,7 @@
 	p = __sound_remove_unit(list, unit);
 	spin_unlock(&sound_loader_lock);
 	if (p) {
-		devfs_unregister (p->de);
+		devfs_remove(p->name);
 		kfree(p);
 	}
 }
diff -Nru a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
--- a/sound/sparc/amd7930.c	Mon Nov 18 14:37:24 2002
+++ b/sound/sparc/amd7930.c	Mon Apr 21 10:36:33 2003
@@ -497,7 +497,7 @@
 	__amd7930_write_map(amd);
 }
 
-static void snd_amd7930_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_amd7930_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	amd7930_t *amd = dev_id;
 	unsigned int elapsed;
@@ -536,6 +536,8 @@
 		snd_pcm_period_elapsed(amd->playback_substream);
 	else
 		snd_pcm_period_elapsed(amd->capture_substream);
+
+	return IRQ_HANDLED;
 }
 
 static int snd_amd7930_trigger(amd7930_t *amd, unsigned int flag, int cmd)
diff -Nru a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
--- a/sound/sparc/cs4231.c	Sat Nov 30 10:41:33 2002
+++ b/sound/sparc/cs4231.c	Mon Apr 21 10:36:33 2003
@@ -1228,7 +1228,7 @@
 }
 
 #ifdef SBUS_SUPPORT
-static void snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return);
 	u32 csr;
@@ -1240,12 +1240,14 @@
 		     APC_GENL_INT |
 		     APC_XINT_PEMP |
 		     APC_XINT_CEMP)))
-		return;
+		return IRQ_NONE;
 
 	/* ACK the APC interrupt. */
 	sbus_writel(csr, chip->port + APCCSR);
 
 	snd_cs4231_generic_interrupt(chip);
+
+	return IRQ_HANDLED;
 }
 #endif
 
