[parisc-linux-cvs] busdevice changes

Matthew Wilcox willy@debian.org
Mon, 29 Oct 2001 18:40:21 +0000


Index: arch/parisc/kernel/drivers.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/drivers.c,v
retrieving revision 1.32
diff -u -p -r1.32 drivers.c
--- arch/parisc/kernel/drivers.c	2001/10/23 21:02:53	1.32
+++ arch/parisc/kernel/drivers.c	2001/10/29 17:59:28
@@ -106,8 +106,8 @@ int register_parisc_driver(struct parisc
 
 	if (driver->next) {
 		printk(KERN_WARNING 
-		       "BUG: Skipping previously registered driver: %s %s\n",
-		       driver->name, driver->version);
+		       "BUG: Skipping previously registered driver: %s\n",
+		       driver->name);
 		return 1;
 	}
 
Index: arch/parisc/kernel/superio.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/superio.c,v
retrieving revision 1.10
diff -u -p -r1.10 superio.c
--- arch/parisc/kernel/superio.c	2001/10/25 07:20:03	1.10
+++ arch/parisc/kernel/superio.c	2001/10/29 17:59:28
@@ -324,8 +324,7 @@ static unsigned short expected_device[3]
 };
 #endif
 
-extern int
-superio_fixup_irq(struct pci_dev *pcidev)
+int superio_fixup_irq(struct pci_dev *pcidev)
 {
 	int local_irq;
 
Index: drivers/char/hilkbd.c
===================================================================
RCS file: /var/cvs/linux/drivers/char/hilkbd.c,v
retrieving revision 1.12
diff -u -p -r1.12 hilkbd.c
--- drivers/char/hilkbd.c	2001/08/28 01:16:14	1.12
+++ drivers/char/hilkbd.c	2001/10/29 17:59:30
@@ -29,11 +29,9 @@
 #include <asm/gsc.h>
 #include <asm/hardware.h>
 
-#include "../gsc/busdevice.h"
-
 #if defined(CONFIG_PARISC)
 
-#include <asm/hil.h>		/* HP712/715 (PA-RISC) */
+#include <asm/hil.h>
 #include <asm/keyboard.h>
 
 unsigned int hil_base;	/* HPA for the HIL device */
@@ -437,15 +435,13 @@ int __init hil_keyb_init(void)
 static int __init
 hil_init_chip(struct parisc_device *dev)
 {
-	int irq = busdevice_alloc_irq(dev); 
-
-	if (!irq) {
+	if (!dev->irq) {
 		printk(__FILE__ ": IRQ not found for HIL at 0x%lx\n", dev->hpa);
 		return -ENODEV;
 	}
 
 	hil_base = dev->hpa;
-	hil_irq  = irq;
+	hil_irq  = dev->irq;
 	
 	printk(KERN_INFO "Found HIL at 0x%x, IRQ %d\n", hil_base, hil_irq);
 
Index: drivers/char/hp_psaux.c
===================================================================
RCS file: /var/cvs/linux/drivers/char/hp_psaux.c,v
retrieving revision 1.15
diff -u -p -r1.15 hp_psaux.c
--- drivers/char/hp_psaux.c	2001/09/18 18:57:23	1.15
+++ drivers/char/hp_psaux.c	2001/10/29 17:59:30
@@ -507,7 +507,6 @@ static int __init
 lasi_ps2_register(struct parisc_device *dev)
 {
 	unsigned long hpa = dev->hpa;
-	unsigned int irq;
 	char *name;
 	int device_found = 0;
 	u8 id;
@@ -532,10 +531,10 @@ lasi_ps2_register(struct parisc_device *
 	lasi_ps2_reset(hpa);
 
 	/* allocate the irq and memory region for that device */
-	if (!(irq = busdevice_alloc_irq(dev)))
+	if (!dev->irq)
 		return -ENODEV;
 		    
-	if (request_irq(irq, lasikbd_interrupt, 0, name, (void *)hpa))
+	if (request_irq(dev->irq, lasikbd_interrupt, 0, name, (void *)hpa))
 		return -ENODEV;
 	
 	if (!request_mem_region(hpa, LASI_STATUS + 4, name))
@@ -571,7 +570,7 @@ lasi_ps2_register(struct parisc_device *
 	
 	printk(KERN_INFO "PS/2 %s port at 0x%08lx (irq %d) found, "
 			 "%sdevice attached.\n",
-			name, hpa, irq, device_found ? "":"no ");
+			name, hpa, dev->irq, device_found ? "":"no ");
 
 	return 0;
 }
Index: drivers/gsc/busdevice.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/busdevice.c,v
retrieving revision 1.29
diff -u -p -r1.29 busdevice.c
--- drivers/gsc/busdevice.c	2001/10/23 21:02:54	1.29
+++ drivers/gsc/busdevice.c	2001/10/29 17:59:30
@@ -43,27 +43,10 @@
 #define BUSDEV_FIX_IRQ(x)	(31-(x))
 #define BUSDEV_MASK_IRQ(x)	(1<<(BUSDEV_FIX_IRQ(x)))
 
-
-static struct busdevice *busdev_list = NULL;
-
-
-int busdevice_alloc_irq(struct parisc_device *dev)
-{
-	if (dev->irq)
-		return dev->irq;
-	printk("Awooga!  Awooga!  No IRQ assigned to device %s %p\n",
-		dev->name, dev->hpa);
-	return 0;
-}
-
-
-/*
- *	Deliver interrupts
- */
- 
+/* Common interrupt demultiplexer used by Asp, Lasi & Wax.  */
 void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs)
 {
-	u32 irq;
+	unsigned long irq;
 	struct busdevice *busdev = (struct busdevice *) dev;
 
 	/* 
@@ -74,14 +57,14 @@ void busdev_barked(int busdev_irq, void 
 	*/
 
 	irq = gsc_readl(busdev->hpa+OFFSET_IRR);
-	if(irq==0)
+	if (irq == 0) {
 		printk(KERN_ERR "%s: barking without apparent reason.\n", busdev->name);
-	else {
+	} else {
 		DEBPRINTK ("%s (0x%x) barked, mask=0x%x, irq=%d\n", 
 		    busdev->name, busdev->busdev_region->data.irqbase, 
 		    irq, BUSDEV_FIX_IRQ(ffs(irq))+1 );
 
-		do_irq_mask((unsigned long) irq, busdev->busdev_region, regs);
+		do_irq_mask(irq, busdev->busdev_region, regs);
 	}
 }
 
@@ -155,13 +138,12 @@ int register_busdevice(struct parisc_dev
 {
 	struct resource *res;
 
-	busdev->spinlock = SPIN_LOCK_UNLOCKED;
-	busdev->gsc  = gsc_parent;
+	busdev->gsc = gsc_parent;
 
 	/* the IRQs we simulate */
 	busdev->busdev_region = alloc_irq_region(32, &busdev_irq_ops,
 			    IRQ_REG_MASK|IRQ_REG_DIS, busdev->name, busdev);
-	if(!busdev->busdev_region)
+	if (!busdev->busdev_region)
 		return (-ENOMEM);
 
 	/* allocate resource region */
@@ -180,9 +162,6 @@ int register_busdevice(struct parisc_dev
 	DEBUG_BUSDEVICE( busdev );
 #endif
 
-	busdev->next = busdev_list;
-	busdev_list  = busdev;
-	
 	return 0;
 }
 
Index: drivers/gsc/busdevice.h
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/busdevice.h,v
retrieving revision 1.6
diff -u -p -r1.6 busdevice.h
--- drivers/gsc/busdevice.h	2001/10/23 21:02:54	1.6
+++ drivers/gsc/busdevice.h	2001/10/29 17:59:30
@@ -14,7 +14,6 @@
 
 
 struct busdevice {
-	struct busdevice *next;
 	struct parisc_device *gsc;
 	unsigned long hpa;
 	char *name;
@@ -23,7 +22,6 @@ struct busdevice {
 	int parent_irq;
 	int eim;
 	struct irq_region *busdev_region;
-	spinlock_t spinlock;
 };
 
 /* short cut to keep the compiler happy */
@@ -31,12 +29,6 @@ struct busdevice {
 
 int register_busdevice(struct parisc_device *gsc_parent, struct busdevice *busdev_new);
 
-/* returns a virtual irq for device at dev->hpa (works for all LASI/ASP/WAX) */
-int busdevice_alloc_irq(struct parisc_device *dev);
-
 void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs);
-
-extern unsigned int hil_base;	/* BASE of HIL-Port */
-extern unsigned int hil_irq;	/* IRQ  of HIL-Port */
 
 #endif /* BUSDEVICE_H */
Index: drivers/gsc/eisa.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/eisa.c,v
retrieving revision 1.7
diff -u -p -r1.7 eisa.c
--- drivers/gsc/eisa.c	2001/10/23 21:02:54	1.7
+++ drivers/gsc/eisa.c	2001/10/29 17:59:30
@@ -132,7 +132,7 @@ static void eisa_irq(int _, void *intr_d
 
 static int __devinit eisa_probe(struct parisc_device *dev)
 {
-	int result, irq;
+	int result;
 	char *name = is_mongoose(dev) ? "Mongoose" : "Wax";
 
 	printk("%s EISA Adapter found at 0x%08lx\n", name, dev->hpa);
@@ -157,13 +157,12 @@ static int __devinit eisa_probe(struct p
 	}
 	pcibios_register_hba(&eisa_dev.hba);
 
-	irq = busdevice_alloc_irq(dev);
-	if (!irq) {
+	if (!dev->irq) {
 		printk(KERN_ERR "EISA: failed to claim IRQ\n");
 		return -ENODEV;
 	}
 
-	result = request_irq(irq, eisa_irq, 0, "EISA", NULL);
+	result = request_irq(dev->irq, eisa_irq, 0, "EISA", NULL);
 	if (result) {
 		printk(KERN_ERR "EISA: request_irq failed!\n");
 		return result;
Index: drivers/gsc/lasi.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/lasi.c,v
retrieving revision 1.31
diff -u -p -r1.31 lasi.c
--- drivers/gsc/lasi.c	2001/10/23 21:02:54	1.31
+++ drivers/gsc/lasi.c	2001/10/29 17:59:30
@@ -171,7 +171,6 @@ int __init
 lasi_init_chip(struct parisc_device *dev)
 {
 	struct busdevice *lasi;
-	struct parisc_device *child;
 	struct gsc_irq gsc_irq;
 	int irq, ret;
 
Index: drivers/gsc/serial.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/serial.c,v
retrieving revision 1.22
diff -u -p -r1.22 serial.c
--- drivers/gsc/serial.c	2001/10/17 20:02:29	1.22
+++ drivers/gsc/serial.c	2001/10/29 17:59:30
@@ -38,10 +38,8 @@ static int __init 
 serial_init_chip(struct parisc_device *dev)
 {
 	struct serial_struct *serial;
-	int irq;
 
-	irq = busdevice_alloc_irq(dev);
-	if (!irq) {
+	if (!dev->irq) {
 #ifndef CONFIG_GSC_WAX
 		if (serial_line_nr == 1) {
 			printk(KERN_INFO "This kernel was compiled without WAX support, but apparently you will need to\n"
@@ -66,7 +64,7 @@ serial_init_chip(struct parisc_device *d
 	serial->line = serial_line_nr;
 	serial->iomem_base = ioremap(dev->hpa + 0x800, 0x80);
 
-	serial->irq = irq; 
+	serial->irq = dev->irq; 
 	serial->io_type = SERIAL_IO_MEM;	/* define access method */
 	serial->flags = 0;
 	serial->xmit_fifo_size = 16;
Index: drivers/net/lasi_82596.c
===================================================================
RCS file: /var/cvs/linux/drivers/net/lasi_82596.c,v
retrieving revision 1.25
diff -u -p -r1.25 lasi_82596.c
--- drivers/net/lasi_82596.c	2001/10/22 05:10:03	1.25
+++ drivers/net/lasi_82596.c	2001/10/29 17:59:32
@@ -96,8 +96,6 @@
 #include <asm/gsc.h>
 #include <asm/cache.h>
 
-#include "../gsc/busdevice.h" /* XXX */
-
 static char version[] __devinitdata =
 	"82596.c $Revision: 1.25 $\n";
 
@@ -1512,7 +1510,7 @@ static int __devinit
 lan_init_chip(struct parisc_device *dev)
 {
 	struct	net_device *netdevice;
-	int	retval, irq;
+	int	retval;
 
 	if (num_drivers >= MAX_DRIVERS) {
 		/* max count of possible i82596 drivers reached */
@@ -1520,22 +1518,20 @@ lan_init_chip(struct parisc_device *dev)
 	}
 	
 	fake_pci_dev = ccio_get_fake(dev);
-	irq = busdevice_alloc_irq(dev); 
-
 
-	if (!irq) {
+	if (!dev->irq) {
 		printk(KERN_ERR __FILE__ ": IRQ not found for i82596 at 0x%lx\n", dev->hpa);
 		return -ENODEV;
 	}
 
-	printk(KERN_INFO "Found i82596 at 0x%lx, IRQ %d\n", dev->hpa, irq);
+	printk(KERN_INFO "Found i82596 at 0x%lx, IRQ %d\n", dev->hpa, dev->irq);
 
 	netdevice = alloc_etherdev(0);
 	if (!netdevice)
 		return -ENOMEM;
 
 	netdevice->base_addr = dev->hpa;
-	netdevice->irq = irq;
+	netdevice->irq = dev->irq;
 	netdevice->init = i82596_probe;
 
 	retval = register_netdev(netdevice);
Index: drivers/parport/parport_gsc.c
===================================================================
RCS file: /var/cvs/linux/drivers/parport/parport_gsc.c,v
retrieving revision 1.18
diff -u -p -r1.18 parport_gsc.c
--- drivers/parport/parport_gsc.c	2001/10/17 20:35:28	1.18
+++ drivers/parport/parport_gsc.c	2001/10/29 17:59:33
@@ -465,11 +465,8 @@ static int __initdata parport_count;
 static int __devinit parport_init_chip(struct parisc_device *dev)
 {
 	unsigned long port;
-	int irq;
 
-	irq = busdevice_alloc_irq(dev);
-
-	if (!irq) {
+	if (!dev->irq) {
 		printk("IRQ not found for parallel device at 0x%lx\n", dev->hpa);
 		return -ENODEV;
 	}
@@ -489,7 +486,7 @@ static int __devinit parport_init_chip(s
 		printk("%s: enhanced parport-modes not supported.\n", __FUNCTION__);
 	}
 	
-	if (parport_gsc_probe_port(port, 0, irq,
+	if (parport_gsc_probe_port(port, 0, dev->irq,
 			/* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL))
 		parport_count++;
 
Index: drivers/scsi/lasi700.c
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/lasi700.c,v
retrieving revision 1.3
diff -u -p -r1.3 lasi700.c
--- drivers/scsi/lasi700.c	2001/10/22 05:10:04	1.3
+++ drivers/scsi/lasi700.c	2001/10/29 17:59:34
@@ -136,7 +136,6 @@ static int __init
 lasi700_driver_callback(struct parisc_device *dev)
 {
 	unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET;
-	int irq = busdevice_alloc_irq(dev);
 	char *driver_name;
 	struct Scsi_Host *host;
 	struct NCR_700_Host_Parameters *hostdata =
@@ -176,9 +175,9 @@ lasi700_driver_callback(struct parisc_de
 		release_mem_region(host->base, 64);
 		return 1;
 	}
-	host->irq = irq;
-	if(request_irq(irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) {
-		printk(KERN_ERR "%s: irq problem, detatching\n",
+	host->irq = dev->irq;
+	if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) {
+		printk(KERN_ERR "%s: irq problem, detaching\n",
 		       driver_name);
 		scsi_unregister(host);
 		NCR_700_release(host);
Index: drivers/scsi/lasi7xx.c
===================================================================
RCS file: /var/cvs/linux/drivers/scsi/lasi7xx.c,v
retrieving revision 1.19
diff -u -p -r1.19 lasi7xx.c
--- drivers/scsi/lasi7xx.c	2001/08/16 20:57:19	1.19
+++ drivers/scsi/lasi7xx.c	2001/10/29 17:59:34
@@ -56,12 +56,10 @@ lasi_scsi_callback(struct parisc_device 
 {
 	if (dev->id.sversion == 0x00071) {
 		hosts_used = sim700_init_host(hosts_tptr, 700, 
-			dev->hpa + LASI_SCSI_CORE_OFFSET,
-			busdevice_alloc_irq(dev), OPT_NCR_LE);
+			dev->hpa + LASI_SCSI_CORE_OFFSET, dev->irq, OPT_NCR_LE);
 	} else {
 		hosts_used = sim700_init_host(hosts_tptr, 710, 
-			dev->hpa + LASI_SCSI_CORE_OFFSET,
-			busdevice_alloc_irq(dev), 0);
+			dev->hpa + LASI_SCSI_CORE_OFFSET, dev->irq, 0);
 	}
 
 	return (hosts_used == 0);
Index: drivers/sound/harmony.c
===================================================================
RCS file: /var/cvs/linux/drivers/sound/harmony.c,v
retrieving revision 1.13
diff -u -p -r1.13 harmony.c
--- drivers/sound/harmony.c	2001/08/19 15:21:11	1.13
+++ drivers/sound/harmony.c	2001/10/29 17:59:36
@@ -1177,11 +1177,9 @@ harmony_driver_callback(struct parisc_de
 	/* Set the HPA of harmony */
 	harmony.hpa = (struct harmony_hpa *)dev->hpa;
 
-	/* Grab an IRQ from Lasi */
-	harmony.irq = busdevice_alloc_irq(dev);
+	harmony.irq = dev->irq;
 	if (!harmony.irq) {
-		printk(KERN_ERR "%s: problem getting irq\n", 
-				__FUNCTION__);
+		printk(KERN_ERR "%s: problem getting irq\n", __FUNCTION__);
 		return -ENODEV;
 	}
 
Index: include/asm-parisc/gsc.h
===================================================================
RCS file: /var/cvs/linux/include/asm-parisc/gsc.h,v
retrieving revision 1.11
diff -u -p -r1.11 gsc.h
--- include/asm-parisc/gsc.h	2001/08/28 00:58:35	1.11
+++ include/asm-parisc/gsc.h	2001/10/29 17:59:39
@@ -54,8 +54,5 @@ extern int gsc_claim_irq(struct gsc_irq 
 
 extern void probe_serial_gsc(void);
 
-/* returns a virtual irq for device at dev->hpa (works for all LASI/ASP/WAX) */
-extern int busdevice_alloc_irq(struct parisc_device *dev );
-
 #endif /* __KERNEL__ */
 #endif /* LINUX_GSC_H */
Index: include/asm-parisc/hardware.h
===================================================================
RCS file: /var/cvs/linux/include/asm-parisc/hardware.h,v
retrieving revision 1.29
diff -u -p -r1.29 hardware.h
--- include/asm-parisc/hardware.h	2001/10/27 09:12:21	1.29
+++ include/asm-parisc/hardware.h	2001/10/29 17:59:39
@@ -69,7 +69,6 @@ struct parisc_driver {
 	struct parisc_driver *next;
 	char *name; 
 	const struct parisc_device_id *id_table;
-	char *version; 
 	int (*probe) (struct parisc_device *dev); /* New device discovered */
 };
 

-- 
Revolutions do not require corporate support.