[parisc-linux-cvs] GSC cleanup

Matthew Wilcox willy@debian.org
Tue, 28 Aug 2001 15:00:02 +0100


Delete a lot of unnecessary includes.
Remove CMD_* macros which weren't used.
Split the proc wrangling out into a separate function.

Index: drivers/gsc/gsc.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/gsc.c,v
retrieving revision 1.23
diff -u -p -r1.23 gsc.c
--- gsc.c	2001/07/31 22:08:48	1.23
+++ gsc.c	2001/08/28 03:28:34
@@ -15,48 +15,19 @@
  * 
  */
 
-#include <linux/errno.h>
 #include <linux/config.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/pci.h>
 #include <linux/init.h>
-#include <linux/ioport.h>
 #include <linux/proc_fs.h>
-#include <asm/gsc.h>
-#include <asm/led.h>
 
+#include <asm/led.h>
 #include <asm/io.h>
-#include <asm/delay.h>
-#include <linux/slab.h>
-#include <linux/smp_lock.h>
-#include <linux/interrupt.h>
-
-#include <asm/page.h>
-#include <asm/segment.h>
-#include <asm/system.h>
-#include <asm/smp.h>
-#include <linux/spinlock.h>
-
 #include <asm/irq.h>
-#include <asm/machdep.h>
-
 #include <asm/processor.h>	/* for boot_cpu_data */
-/*
-** Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc}
-*/
+
+/* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */
 struct proc_dir_entry * proc_runway_root = NULL;
 struct proc_dir_entry * proc_gsc_root = NULL;
 
-
-/* values available for io_command: */
-#define	CMD_STOP	0	/* halt any I/O, enable diagnostic access */
-#define	CMD_FLUSH	1	/* abort DMA */
-#define	CMD_CHAIN	2	/* initiate DMA */
-#define	CMD_CLEAR	3	/* clear errors */
-#define	CMD_RESET	5	/* reset any module */
-#define CMD_PORT	32	/* set port bit on bus convertor */
-
 u8 _gsc_readb(void *addr)
 {
 	long flags;
@@ -188,36 +159,8 @@ int gsc_claim_irq(struct gsc_irq *i, int
 	return irq;
 }
 
-
-void __init gsc_init(void)
+static void parisc_proc_mkdir(void)
 {
-#if defined(CONFIG_PCI)
-#if defined(CONFIG_GSC_DINO)
-	extern void dino_init(void);
-#endif
-	/* FIXME: This isn't GSC related.
-	** In fact, these boxes don't have GSC at all.
-	** It's just a convient place to put these
-	** calls for testing pre-release code.
-	*/
-
-#if defined(CONFIG_IOSAPIC)
-	extern void iosapic_init(void);
-#endif
-#if defined(CONFIG_PCI_LBA)
-	extern void lba_init(void);
-#endif
-#if defined(CONFIG_IOMMU_SBA)
-	extern void sba_init(void);
-#endif
-#endif	/* CONFIG_PCI */
-#if defined(CONFIG_IOMMU_CCIO)
-	extern void ccio_init(void);
-#endif
-#ifdef CONFIG_GSC_LASI
-	extern void busdevices_init(void);
-#endif
-
 	/*
 	** Can't call proc_mkdir() until after proc_root_init() has been
 	** called by start_kernel(). In other words, this code can't
@@ -243,21 +186,36 @@ void __init gsc_init(void)
                 }
                 break;
 	}
+}
 
+extern void busdevices_init(void);
+extern void ccio_init(void);
+extern void dino_init(void);
+extern void iosapic_init(void);
+extern void lba_init(void);
+extern void sba_init(void);
 
-#if defined(CONFIG_PCI)
+void __init gsc_init(void)
+{
+	/* FIXME: Much of the code here needs to move to somewhere more
+	 * appropriate.  But it isn't clear where to have pre-pci post-mm
+	 * initialisation hooks.
+	 */
+
+	parisc_proc_mkdir();
+
 #if defined(CONFIG_GSC_DINO)
 	dino_init();
 #endif
 #if defined(CONFIG_IOSAPIC)
 	iosapic_init();
 #endif
+	/* These are in a non-obvious order, will fix when we have an iotree */
 #if defined(CONFIG_PCI_LBA)
 	lba_init();
 #endif
 #if defined(CONFIG_IOMMU_SBA)
 	sba_init();
-#endif
 #endif
 
 #ifdef CONFIG_GSC_LASI
-- 
Revolutions do not require corporate support.