[parisc-linux-cvs] clean up combination of CONFIG_SUPERIO and CONFIG_IDE
Helge Deller
deller@gmx.de
Fri, 24 Aug 2001 15:08:59 +0200
Index: linux/arch/parisc/kernel/superio.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/superio.c,v
retrieving revision 1.6
diff -u -r1.6 superio.c
--- superio.c 2001/07/15 20:02:04 1.6
+++ superio.c 2001/08/24 12:58:54
@@ -56,21 +56,15 @@
#include <linux/errno.h>
#include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
+#include <linux/module.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
-#include <linux/timex.h>
-#include <linux/slab.h>
-#include <linux/random.h>
#include <linux/serial.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/parport.h>
#include <linux/parport_pc.h>
-#include <asm/serial.h>
#include <linux/serial_reg.h>
#include <asm/io.h>
#include <asm/hardware.h>
@@ -94,12 +88,6 @@
sio_dev.iosapic_irq = irq;
}
-int
-superio_get_ide_irq(void)
-{
- return sio_dev.irq_region->data.irqbase + IDE_IRQ;
-}
-
extern void do_irq(struct irqaction *a, int i, struct pt_regs *p);
static void
@@ -431,7 +419,9 @@
printk(KERN_WARNING "SuperIO: Register Serial #1 failed.\n");
}
+
#ifdef CONFIG_PARPORT_PC
+
void __init
superio_parport_init(void)
{
@@ -449,4 +439,19 @@
printk(KERN_WARNING "SuperIO: Probing parallel port failed.\n");
}
-#endif
+
+EXPORT_SYMBOL(superio_parport_init);
+
+#endif /* CONFIG_PARPORT_PC */
+
+
+int
+superio_get_ide_irq(void)
+{
+ if (sio_dev.irq_region)
+ return sio_dev.irq_region->data.irqbase + IDE_IRQ;
+ else
+ return 0;
+}
+
+EXPORT_SYMBOL(superio_get_ide_irq);
Index: linux/include/asm-parisc/ide.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/ide.h,v
retrieving revision 1.3
diff -u -r1.3 ide.h
--- ide.h 2001/07/15 20:02:07 1.3
+++ ide.h 2001/08/24 12:58:54
@@ -29,14 +29,7 @@
case 0x1f0:
case 0x170:
return superio_get_ide_irq();
-#else
- /* FIXME: non-superio is not yet supported, these were the defaults
- * for other architectures, which are unlikely to work on
- * PA-RISC */
- case 0x1f0: return 14;
- case 0x170: return 15;
-#endif
-
+#endif /* CONFIG_SUPERIO */
default:
return 0;
}
@@ -45,8 +38,10 @@
static __inline__ ide_ioreg_t ide_default_io_base(int index)
{
switch (index) {
- case 0: return 0x1f0;
- case 1: return 0x170;
+#ifdef CONFIG_SUPERIO
+ case 0: return (superio_get_ide_irq() ? 0x1f0 : 0);
+ case 1: return (superio_get_ide_irq() ? 0x170 : 0);
+#endif /* CONFIG_SUPERIO */
default:
return 0;
}