[parisc-linux-cvs] 2.4.17-pa7: register_busdevice changes

Matthew Wilcox willy@debian.org
Sat, 12 Jan 2002 19:07:53 +0000


 * Stop calling register_busdevice in dino.c.
 * Remove all references to busdevice from dino, since we really don't
   need it any more.
 * Remove additional argument for register_busdevice that was added for
   dino's benefit.
 * Rename register_busdevice to gsc_common_irqsetup

Index: drivers/gsc/asp.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/asp.c,v
retrieving revision 1.15
diff -u -p -r1.15 asp.c
--- drivers/gsc/asp.c	2001/12/26 21:57:42	1.15
+++ drivers/gsc/asp.c	2002/01/12 18:01:25
@@ -97,7 +97,7 @@ asp_init_chip(struct parisc_device *dev)
 	gsc_writel((1 << (31 - ASP_GSC_IRQ)),VIPER_INT_WORD);
 
 	/* Done init'ing, register this driver */
-	ret = register_busdevice(dev, asp, NULL);
+	ret = gsc_common_irqsetup(dev, asp);
 	if (ret)
 		goto out;
 
Index: drivers/gsc/busdevice.h
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/busdevice.h,v
retrieving revision 1.8
diff -u -p -r1.8 busdevice.h
--- drivers/gsc/busdevice.h	2001/12/26 21:57:42	1.8
+++ drivers/gsc/busdevice.h	2002/01/12 18:01:25
@@ -27,7 +27,7 @@ struct busdevice {
 /* short cut to keep the compiler happy */
 #define BUSDEV_DEV(x)	((struct busdevice *) (x))
 
-int register_busdevice(struct parisc_device *gsc_parent, struct busdevice *busdev_new, struct irq_region *);
+int gsc_common_irqsetup(struct parisc_device *parent, struct busdevice *busdev);
 
 void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs);
 
Index: drivers/gsc/dino.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/dino.c,v
retrieving revision 1.51
diff -u -p -r1.51 dino.c
--- drivers/gsc/dino.c	2002/01/09 00:13:53	1.51
+++ drivers/gsc/dino.c	2002/01/12 18:01:25
@@ -62,8 +62,6 @@
 #include <asm/irq.h>		/* for "gsc" irq functions */
 #include <asm/gsc.h>
 
-#include "busdevice.h"
-
 #undef DINO_DEBUG
 
 #ifdef DINO_DEBUG
@@ -708,21 +697,9 @@ dino_common_init(struct parisc_device *d
 	u32 eim;
 	struct gsc_irq gsc_irq;
 	struct resource *res;
-	struct busdevice *dino_busdevice;
 
 	int ret;
 
-	/* Support the serial port which is sometimes attached on built-in
-	 * Dino / Cujo chips.
-	 */
-
-	dino_busdevice = kmalloc(sizeof(struct busdevice), GFP_KERNEL);
-	if (!dino_busdevice)
-		return -ENOMEM;
-
-	dino_busdevice->name = "Dino";
-	dino_busdevice->hpa = dev->hpa;
-	
 	pcibios_register_hba(&dino_dev->hba);
 
 	pci_bios = &dino_bios_ops;   /* used by pci_scan_bus() */
@@ -761,7 +738,7 @@ dino_common_init(struct parisc_device *d
 	** Tell generic interrupt support we have 11 bits which need
 	** be checked in the interrupt handler.
 	*/
-	dino_dev->dino_region = alloc_irq_region( DINO_IRQS, &dino_irq_ops,
+	dino_dev->dino_region = alloc_irq_region(DINO_IRQS, &dino_irq_ops,
 						"dino", dino_dev);
 
 	if (NULL == dino_dev->dino_region) {
@@ -770,18 +747,11 @@ dino_common_init(struct parisc_device *d
 		return 1;
 	}
 
-	/* Register busdevice for the serial port */
-
-	dino_busdevice->parent_irq = gsc_irq.irq;
-	dino_busdevice->eim = ((u32) gsc_irq.txn_addr) | gsc_irq.txn_data;
-
-	ret = register_busdevice(dev, dino_busdevice, dino_dev->dino_region);
-	if (ret) {
-		kfree(dino_busdevice);
-		return ret;
-	}
+	/* Support the serial port which is sometimes attached on built-in
+	 * Dino / Cujo chips.
+	 */
 
-	fixup_child_irqs(dev, dino_busdevice->busdev_region->data.irqbase,
+	fixup_child_irqs(dev, dino_dev->dino_region->data.irqbase,
 			dino_choose_irq);
 
 	/*
Index: drivers/gsc/gsc.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/gsc.c,v
retrieving revision 1.29
diff -u -p -r1.29 gsc.c
--- drivers/gsc/gsc.c	2001/12/26 21:57:42	1.29
+++ drivers/gsc/gsc.c	2002/01/12 18:01:26
@@ -74,8 +74,8 @@ int gsc_claim_irq(struct gsc_irq *i, int
 
 
 /* IRQ bits must be numbered from Most Significant Bit */
-#define BUSDEV_FIX_IRQ(x)	(31-(x))
-#define BUSDEV_MASK_IRQ(x)	(1<<(BUSDEV_FIX_IRQ(x)))
+#define GSC_FIX_IRQ(x)	(31-(x))
+#define GSC_MASK_IRQ(x)	(1<<(GSC_FIX_IRQ(x)))
 
 /* Common interrupt demultiplexer used by Asp, Lasi & Wax.  */
 void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs)
@@ -96,7 +96,7 @@ void busdev_barked(int busdev_irq, void 
 	} 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 );
+		    irq, GSC_FIX_IRQ(ffs(irq))+1 );
 
 		do_irq_mask(irq, busdev->busdev_region, regs);
 	}
@@ -107,7 +107,7 @@ busdev_disable_irq(void *irq_dev, int ir
 {
 	/* Disable the IRQ line by clearing the bit in the IMR */
 	u32 imr = gsc_readl(BUSDEV_DEV(irq_dev)->hpa+OFFSET_IMR);
-	imr &= ~(BUSDEV_MASK_IRQ(irq));
+	imr &= ~(GSC_MASK_IRQ(irq));
 
 	DEBPRINTK( KERN_WARNING "%s(%p, %d) %s: IMR 0x%x\n", 
 		    __FUNCTION__, irq_dev, irq, BUSDEV_DEV(irq_dev)->name, imr);
@@ -122,7 +122,7 @@ busdev_enable_irq(void *irq_dev, int irq
 	/* Enable the IRQ line by setting the bit in the IMR */
 	unsigned long addr = BUSDEV_DEV(irq_dev)->hpa + OFFSET_IMR;
 	u32 imr = gsc_readl(addr);
-	imr |= BUSDEV_MASK_IRQ(irq);
+	imr |= GSC_MASK_IRQ(irq);
 
 	DEBPRINTK (KERN_WARNING "%s(%p, %d) %s: IMR 0x%x\n", 
 		    __FUNCTION__, irq_dev, irq, BUSDEV_DEV(irq_dev)->name, imr);
@@ -158,21 +158,17 @@ struct irq_region_ops busdev_irq_ops = {
 };
 
 
-int register_busdevice(struct parisc_device *gsc_parent, 
-			struct busdevice *busdev, struct irq_region *irqregion)
+int gsc_common_irqsetup(struct parisc_device *parent, struct busdevice *busdev)
 {
 	struct resource *res;
 
-	busdev->gsc = gsc_parent;
+	busdev->gsc = parent;
 
-	if (irqregion == NULL) {
-		/* the IRQs we simulate */
-		busdev->busdev_region = alloc_irq_region(32, &busdev_irq_ops,
-							 busdev->name, busdev);
-		if (!busdev->busdev_region)
-			return -ENOMEM;
-	} else
-		busdev->busdev_region = irqregion;
+	/* the IRQs we simulate */
+	busdev->busdev_region = alloc_irq_region(32, &busdev_irq_ops,
+						 busdev->name, busdev);
+	if (!busdev->busdev_region)
+		return -ENOMEM;
 
 	/* allocate resource region */
 	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
Index: drivers/gsc/lasi.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/lasi.c,v
retrieving revision 1.34
diff -u -p -r1.34 lasi.c
--- drivers/gsc/lasi.c	2001/12/26 21:57:42	1.34
+++ drivers/gsc/lasi.c	2002/01/12 18:01:26
@@ -212,7 +212,7 @@ lasi_init_chip(struct parisc_device *dev
 	gsc_writel(lasi->eim, lasi->hpa + OFFSET_IAR);
 
 	/* Done init'ing, register this driver */
-	ret = register_busdevice(dev, lasi, NULL);
+	ret = gsc_common_irqsetup(dev, lasi);
 	if (ret) {
 		kfree(lasi);
 		return ret;
Index: drivers/gsc/wax.c
===================================================================
RCS file: /var/cvs/linux/drivers/gsc/wax.c,v
retrieving revision 1.17
diff -u -p -r1.17 wax.c
--- drivers/gsc/wax.c	2001/12/26 21:57:42	1.17
+++ drivers/gsc/wax.c	2002/01/12 18:01:26
@@ -119,7 +119,7 @@ wax_init_chip(struct parisc_device *dev)
 //	gsc_writel(wax->eim, wax->hpa + OFFSET_IAR);
 
 	/* Done init'ing, register this driver */
-	ret = register_busdevice(dev, wax, NULL);
+	ret = gsc_common_irqsetup(dev, wax);
 	if (ret) {
 		kfree(wax);
 		return ret;

-- 
Revolutions do not require corporate support.