]> err.no Git - linux-2.6/blobdiff - drivers/ide/legacy/q40ide.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[linux-2.6] / drivers / ide / legacy / q40ide.c
index e628a983ce3395706cdf905c52a37eab15abc9d9..f5329730df99d17bbd3abe5b2f05485c8e4d3db6 100644 (file)
@@ -89,9 +89,8 @@ void q40_ide_setup_ports ( hw_regs_t *hw,
                else
                        hw->io_ports[i] = Q40_ISA_IO_B(base + offsets[i]);
        }
-       
+
        hw->irq = irq;
-       hw->dma = NO_DMA;
        hw->ack_intr = ack_intr;
 /*
  *     hw->iops = iops;
@@ -102,7 +101,7 @@ void q40_ide_setup_ports ( hw_regs_t *hw,
 
 /* 
  * the static array is needed to have the name reported in /proc/ioports,
- * hwif->name unfortunately isnยดt available yet
+ * hwif->name unfortunately isn't available yet
  */
 static const char *q40_ide_names[Q40IDE_NUM_HWIFS]={
        "ide0", "ide1"
@@ -112,15 +111,17 @@ static const char *q40_ide_names[Q40IDE_NUM_HWIFS]={
  *  Probe for Q40 IDE interfaces
  */
 
-void q40ide_init(void)
+static int __init q40ide_init(void)
 {
     int i;
     ide_hwif_t *hwif;
-    int index;
     const char *name;
+    u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
     if (!MACH_IS_Q40)
-      return ;
+      return -ENODEV;
+
+    printk(KERN_INFO "ide: Q40 IDE controller\n");
 
     for (i = 0; i < Q40IDE_NUM_HWIFS; i++) {
        hw_regs_t hw;
@@ -142,10 +143,20 @@ void q40ide_init(void)
                        0, NULL,
 //                     m68kide_iops,
                        q40ide_default_irq(pcide_bases[i]));
-       index = ide_register_hw(&hw, 1, &hwif);
-       // **FIXME**
-       if (index != -1)
+
+       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       if (hwif) {
+               ide_init_port_data(hwif, hwif->index);
+               ide_init_port_hw(hwif, &hw);
                hwif->mmio = 1;
+
+               idx[i] = hwif->index;
+       }
     }
+
+    ide_device_add(idx);
+
+    return 0;
 }
 
+module_init(q40ide_init);