ide: fix host drivers depending on ide_generic to probe for interfaces (take 2)
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:06 +0000 (20:13 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:06 +0000 (20:13 +0100)
* Add mpc8xx_ide_probe() to mpc8xx.c and call it from probe_for_hwifs().

* Convert ide_arm, ide-cris, ide-h8300, ide-pnp, buddha, falconide, gayle,
  macide, q40ide, cmd640 and mpc8xx host drivers to use ide_device_add().

  This removes dependency on ide_generic for these drivers so update
  ide/Kconfig accordingly.

v2:
* ide_arm build fix (s/ide_device_idx/ide_device_add/)
  (Thanks to Christoph Lameter <clameter@sgi.com> for reporting the problem).

Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
13 files changed:
drivers/ide/Kconfig
drivers/ide/arm/ide_arm.c
drivers/ide/cris/ide-cris.c
drivers/ide/h8300/ide-h8300.c
drivers/ide/ide-pnp.c
drivers/ide/ide.c
drivers/ide/legacy/buddha.c
drivers/ide/legacy/falconide.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/q40ide.c
drivers/ide/pci/cmd640.c
drivers/ide/ppc/mpc8xx.c

index 2a584b3f181353802203418db8d6fbf02466f325..7c419e87a4a4557a773ec7fa6e7bb428cf3d6c50 100644 (file)
@@ -327,7 +327,6 @@ config BLK_DEV_PLATFORM
 config BLK_DEV_CMD640
        bool "CMD640 chipset bugfix/support"
        depends on X86
 config BLK_DEV_CMD640
        bool "CMD640 chipset bugfix/support"
        depends on X86
-       select IDE_GENERIC
        ---help---
          The CMD-Technologies CMD640 IDE chip is used on many common 486 and
          Pentium motherboards, usually in combination with a "Neptune" or
        ---help---
          The CMD-Technologies CMD640 IDE chip is used on many common 486 and
          Pentium motherboards, usually in combination with a "Neptune" or
@@ -362,7 +361,6 @@ config BLK_DEV_CMD640_ENHANCED
 config BLK_DEV_IDEPNP
        bool "PNP EIDE support"
        depends on PNP
 config BLK_DEV_IDEPNP
        bool "PNP EIDE support"
        depends on PNP
-       select IDE_GENERIC
        help
          If you have a PnP (Plug and Play) compatible EIDE card and
          would like the kernel to automatically detect and activate
        help
          If you have a PnP (Plug and Play) compatible EIDE card and
          would like the kernel to automatically detect and activate
@@ -845,7 +843,6 @@ config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
 
 config IDE_ARM
        def_bool ARM && (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
 
 config IDE_ARM
        def_bool ARM && (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
-       select IDE_GENERIC
 
 config BLK_DEV_IDE_ICSIDE
        tristate "ICS IDE interface support"
 
 config BLK_DEV_IDE_ICSIDE
        tristate "ICS IDE interface support"
@@ -880,7 +877,6 @@ config ETRAX_IDE
        bool "ETRAX IDE support"
        depends on CRIS && BROKEN
        select BLK_DEV_IDEDMA
        bool "ETRAX IDE support"
        depends on CRIS && BROKEN
        select BLK_DEV_IDEDMA
-       select IDE_GENERIC
        help
          Enables the ETRAX IDE driver.
 
        help
          Enables the ETRAX IDE driver.
 
@@ -914,7 +910,6 @@ endchoice
 config IDE_H8300
        bool "H8300 IDE support"
        depends on H8300
 config IDE_H8300
        bool "H8300 IDE support"
        depends on H8300
-       select IDE_GENERIC
        default y
        help
          Enables the H8300 IDE driver.
        default y
        help
          Enables the H8300 IDE driver.
@@ -922,7 +917,6 @@ config IDE_H8300
 config BLK_DEV_GAYLE
        bool "Amiga Gayle IDE interface support"
        depends on AMIGA
 config BLK_DEV_GAYLE
        bool "Amiga Gayle IDE interface support"
        depends on AMIGA
-       select IDE_GENERIC
        help
          This is the IDE driver for the Amiga Gayle IDE interface. It supports
          both the `A1200 style' and `A4000 style' of the Gayle IDE interface,
        help
          This is the IDE driver for the Amiga Gayle IDE interface. It supports
          both the `A1200 style' and `A4000 style' of the Gayle IDE interface,
@@ -954,7 +948,6 @@ config BLK_DEV_IDEDOUBLER
 config BLK_DEV_BUDDHA
        bool "Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)"
        depends on ZORRO && EXPERIMENTAL
 config BLK_DEV_BUDDHA
        bool "Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)"
        depends on ZORRO && EXPERIMENTAL
-       select IDE_GENERIC
        help
          This is the IDE driver for the IDE interfaces on the Buddha, 
          Catweasel and X-Surf expansion boards.  It supports up to two interfaces 
        help
          This is the IDE driver for the IDE interfaces on the Buddha, 
          Catweasel and X-Surf expansion boards.  It supports up to two interfaces 
@@ -967,7 +960,6 @@ config BLK_DEV_BUDDHA
 config BLK_DEV_FALCON_IDE
        bool "Falcon IDE interface support"
        depends on ATARI
 config BLK_DEV_FALCON_IDE
        bool "Falcon IDE interface support"
        depends on ATARI
-       select IDE_GENERIC
        help
          This is the IDE driver for the builtin IDE interface on the Atari
          Falcon. Say Y if you have a Falcon and want to use IDE devices (hard
        help
          This is the IDE driver for the builtin IDE interface on the Atari
          Falcon. Say Y if you have a Falcon and want to use IDE devices (hard
@@ -977,7 +969,6 @@ config BLK_DEV_FALCON_IDE
 config BLK_DEV_MAC_IDE
        bool "Macintosh Quadra/Powerbook IDE interface support"
        depends on MAC
 config BLK_DEV_MAC_IDE
        bool "Macintosh Quadra/Powerbook IDE interface support"
        depends on MAC
-       select IDE_GENERIC
        help
          This is the IDE driver for the builtin IDE interface on some m68k
          Macintosh models. It supports both the `Quadra style' (used in
        help
          This is the IDE driver for the builtin IDE interface on some m68k
          Macintosh models. It supports both the `Quadra style' (used in
@@ -991,7 +982,6 @@ config BLK_DEV_MAC_IDE
 config BLK_DEV_Q40IDE
        bool "Q40/Q60 IDE interface support"
        depends on Q40
 config BLK_DEV_Q40IDE
        bool "Q40/Q60 IDE interface support"
        depends on Q40
-       select IDE_GENERIC
        help
          Enable the on-board IDE controller in the Q40/Q60.  This should
          normally be on; disable it only if you are running a custom hard
        help
          Enable the on-board IDE controller in the Q40/Q60.  This should
          normally be on; disable it only if you are running a custom hard
@@ -1000,7 +990,6 @@ config BLK_DEV_Q40IDE
 config BLK_DEV_MPC8xx_IDE
        bool "MPC8xx IDE support"
        depends on 8xx && (LWMON || IVMS8 || IVML24 || TQM8xxL) && IDE=y && BLK_DEV_IDE=y && !PPC_MERGE
 config BLK_DEV_MPC8xx_IDE
        bool "MPC8xx IDE support"
        depends on 8xx && (LWMON || IVMS8 || IVML24 || TQM8xxL) && IDE=y && BLK_DEV_IDE=y && !PPC_MERGE
-       select IDE_GENERIC
        help
          This option provides support for IDE on Motorola MPC8xx Systems.
          Please see 'Type of MPC8xx IDE interface' for details.
        help
          This option provides support for IDE on Motorola MPC8xx Systems.
          Please see 'Type of MPC8xx IDE interface' for details.
index 21ba6ac2f826ea32fdd14e9921dda64c4b6aa47b..a1b5ddab6a486a8e12f42c60df9a3b0db5196682 100644 (file)
@@ -28,6 +28,7 @@ void __init ide_arm_init(void)
 {
        ide_hwif_t *hwif;
        hw_regs_t hw;
 {
        ide_hwif_t *hwif;
        hw_regs_t hw;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        memset(&hw, 0, sizeof(hw));
        ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
 
        memset(&hw, 0, sizeof(hw));
        ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
@@ -36,5 +37,8 @@ void __init ide_arm_init(void)
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                ide_init_port_hw(hwif, &hw);
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                ide_init_port_hw(hwif, &hw);
+               idx[0] = hwif->index;
+
+               ide_device_add(idx);
        }
 }
        }
 }
index 7e33e2b42e92cfe5ea63afafa1e4bb0530d18cf9..9245362970368925876f45833f1bd9ce6aa2c5f1 100644 (file)
@@ -758,9 +758,8 @@ void __init
 init_e100_ide (void)
 {
        hw_regs_t hw;
 init_e100_ide (void)
 {
        hw_regs_t hw;
-       int ide_offsets[IDE_NR_PORTS];
-       int h;
-       int i;
+       int ide_offsets[IDE_NR_PORTS], h, i;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        printk("ide: ETRAX FS built-in ATA DMA controller\n");
 
 
        printk("ide: ETRAX FS built-in ATA DMA controller\n");
 
@@ -808,6 +807,8 @@ init_e100_ide (void)
                hwif->drives[1].autotune = 1;
                hwif->ultra_mask = cris_ultra_mask;
                hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
                hwif->drives[1].autotune = 1;
                hwif->ultra_mask = cris_ultra_mask;
                hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
+
+               idx[h] = hwif->index;
        }
 
        /* Reset pulse */
        }
 
        /* Reset pulse */
@@ -820,6 +821,8 @@ init_e100_ide (void)
        cris_ide_set_speed(TYPE_PIO, ATA_PIO4_SETUP, ATA_PIO4_STROBE, ATA_PIO4_HOLD);
        cris_ide_set_speed(TYPE_DMA, 0, ATA_DMA2_STROBE, ATA_DMA2_HOLD);
        cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0);
        cris_ide_set_speed(TYPE_PIO, ATA_PIO4_SETUP, ATA_PIO4_STROBE, ATA_PIO4_HOLD);
        cris_ide_set_speed(TYPE_DMA, 0, ATA_DMA2_STROBE, ATA_DMA2_HOLD);
        cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0);
+
+       ide_device_add(idx);
 }
 
 static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16)));
 }
 
 static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16)));
index 57d0d4ce8588c13389b01193d5068fea313f4492..9fa78e98d1ba8a280c0c095204aabd46f0e3ab8e 100644 (file)
@@ -89,6 +89,7 @@ void __init h8300_ide_init(void)
        hw_regs_t hw;
        ide_hwif_t *hwif;
        int index;
        hw_regs_t hw;
        ide_hwif_t *hwif;
        int index;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300"))
                goto out_busy;
 
        if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300"))
                goto out_busy;
@@ -111,6 +112,11 @@ void __init h8300_ide_init(void)
        ide_init_port_hw(hwif, &hw);
        hwif_setup(hwif);
        printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
        ide_init_port_hw(hwif, &hw);
        hwif_setup(hwif);
        printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
+
+       idx[0] = index;
+
+       ide_device_add(idx);
+
        return;
 
 out_busy:
        return;
 
 out_busy:
index 664bc489c550ccb8ca29efe434d321ee78026b7a..802efd4d97608eec1ca0c3e21fa8816bec2e575a 100644 (file)
@@ -43,12 +43,16 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                u8 index = hwif->index;
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                u8 index = hwif->index;
+               u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
                ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
                pnp_set_drvdata(dev,hwif);
 
                ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
                pnp_set_drvdata(dev,hwif);
+
+               ide_device_add(idx);
+
                return 0;
        }
 
                return 0;
        }
 
index 77af743425e813cd695dd17f92a209ee5bc5c162..6f99f5c9006220ba6c670e647ade5aa8f44e1c5b 100644 (file)
@@ -1555,6 +1555,7 @@ done:
 extern void __init pnpide_init(void);
 extern void __exit pnpide_exit(void);
 extern void __init h8300_ide_init(void);
 extern void __init pnpide_init(void);
 extern void __exit pnpide_exit(void);
 extern void __init h8300_ide_init(void);
+extern void __init mpc8xx_ide_probe(void);
 
 /*
  * probe_for_hwifs() finds/initializes "known" IDE interfaces
 
 /*
  * probe_for_hwifs() finds/initializes "known" IDE interfaces
@@ -1619,6 +1620,9 @@ static void __init probe_for_hwifs (void)
 #ifdef CONFIG_H8300
        h8300_ide_init();
 #endif
 #ifdef CONFIG_H8300
        h8300_ide_init();
 #endif
+#ifdef BLK_DEV_MPC8xx_IDE
+       mpc8xx_ide_probe();
+#endif
 }
 
 /*
 }
 
 /*
index 8b9cb39c961e085869dafc43344fd3f781bd2969..ba64c4b9f91871c75d1fdc2c89c43b25103576b4 100644 (file)
@@ -156,6 +156,8 @@ void __init buddha_init(void)
 
        while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
                unsigned long board;
 
        while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
                unsigned long board;
+               u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+
                if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
                        buddha_num_hwifs = BUDDHA_NUM_HWIFS;
                        type=BOARD_BUDDHA;
                if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
                        buddha_num_hwifs = BUDDHA_NUM_HWIFS;
                        type=BOARD_BUDDHA;
@@ -233,8 +235,12 @@ fail_base2:
                                        printk("X-Surf");
                                        break;
                                }
                                        printk("X-Surf");
                                        break;
                                }
-                               printk(" IDE interface\n");         
-                       }                     
+                               printk(" IDE interface\n");
+
+                               idx[i] = index;
+                       }
                }
                }
+
+               ide_device_add(idx);
        }
 }
        }
 }
index b861cfe259006e266fb21c6acf14616f0bfe3938..c1a84540beb1e860718a65d2beb6ee491ca0a09c 100644 (file)
@@ -75,10 +75,13 @@ void __init falconide_init(void)
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                u8 index = hwif->index;
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                u8 index = hwif->index;
+               u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
                ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                printk("ide%d: Falcon IDE interface\n", index);
 
                ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                printk("ide%d: Falcon IDE interface\n", index);
+
+               ide_device_add(idx);
        }
 }
        }
 }
index 705d0b8a3f5d20d5a28c385413dbde52a2602303..ec53dc9b483c43efd36b2de000e7afc738e60ee4 100644 (file)
@@ -113,6 +113,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
 void __init gayle_init(void)
 {
     int a4000, i;
 void __init gayle_init(void)
 {
     int a4000, i;
+    u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
     if (!MACH_IS_AMIGA)
        return;
 
     if (!MACH_IS_AMIGA)
        return;
@@ -183,7 +184,11 @@ found:
                    break;
 #endif /* CONFIG_BLK_DEV_IDEDOUBLER */
            }
                    break;
 #endif /* CONFIG_BLK_DEV_IDEDOUBLER */
            }
+
+           idx[i] = index;
        } else
            release_mem_region(res_start, res_n);
     }
        } else
            release_mem_region(res_start, res_n);
     }
+
+    ide_device_add(idx);
 }
 }
index 1840fede5216e5c458dd05a98d743875393e7c80..c1b7881c280aa42b7dddec62511db0119370452f 100644 (file)
@@ -112,6 +112,7 @@ void __init macide_init(void)
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                u8 index = hwif->index;
        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
                u8 index = hwif->index;
+               u8 idx[4] = { index, 0xff, 0xff, 0xff };
 
                ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
 
                ide_init_port_data(hwif, index);
                ide_init_port_hw(hwif, &hw);
@@ -135,5 +136,7 @@ void __init macide_init(void)
                        printk(KERN_INFO "ide%d: Macintosh Powerbook Baboon IDE interface\n", index);
                else
                        printk(KERN_INFO "ide%d: Unknown Macintosh IDE interface\n", index);
                        printk(KERN_INFO "ide%d: Macintosh Powerbook Baboon IDE interface\n", index);
                else
                        printk(KERN_INFO "ide%d: Unknown Macintosh IDE interface\n", index);
+
+               ide_device_add(idx);
        }
 }
        }
 }
index 31e54ffdfee4c8604683fa881441ea49e780b65e..2082e9c6efd9859dfe297eccd9407480ef83cc5b 100644 (file)
@@ -116,6 +116,7 @@ void __init q40ide_init(void)
     int i;
     ide_hwif_t *hwif;
     const char *name;
     int i;
     ide_hwif_t *hwif;
     const char *name;
+    u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
     if (!MACH_IS_Q40)
       return ;
 
     if (!MACH_IS_Q40)
       return ;
@@ -146,7 +147,11 @@ void __init q40ide_init(void)
                ide_init_port_data(hwif, hwif->index);
                ide_init_port_hw(hwif, &hw);
                hwif->mmio = 1;
                ide_init_port_data(hwif, hwif->index);
                ide_init_port_hw(hwif, &hw);
                hwif->mmio = 1;
+
+               idx[i] = hwif->index;
        }
     }
        }
     }
+
+    ide_device_add(idx);
 }
 
 }
 
index 4aa48104e0c1c5cb3e7d787efa2983ccd4e4899f..5096e059ac5a470735a9e95f124031e694f63bde 100644 (file)
@@ -717,6 +717,7 @@ int __init ide_probe_for_cmd640x (void)
        const char *bus_type, *port2;
        unsigned int index;
        u8 b, cfr;
        const char *bus_type, *port2;
        unsigned int index;
        u8 b, cfr;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        if (cmd640_vlb && probe_for_cmd640_vlb()) {
                bus_type = "VLB";
 
        if (cmd640_vlb && probe_for_cmd640_vlb()) {
                bus_type = "VLB";
@@ -769,6 +770,8 @@ int __init ide_probe_for_cmd640x (void)
        cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
 
        cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
 
+       idx[0] = cmd_hwif0->index;
+
        /*
         * Ensure compatibility by always using the slowest timings
         * for access to the drive's command register block,
        /*
         * Ensure compatibility by always using the slowest timings
         * for access to the drive's command register block,
@@ -826,6 +829,8 @@ int __init ide_probe_for_cmd640x (void)
                cmd_hwif1->pio_mask = ATA_PIO5;
                cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
                cmd_hwif1->pio_mask = ATA_PIO5;
                cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
 #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
+
+               idx[1] = cmd_hwif1->index;
        }
        printk(KERN_INFO "%s: %sserialized, secondary interface %s\n", cmd_hwif1->name,
                cmd_hwif0->serialized ? "" : "not ", port2);
        }
        printk(KERN_INFO "%s: %sserialized, secondary interface %s\n", cmd_hwif1->name,
                cmd_hwif0->serialized ? "" : "not ", port2);
@@ -872,6 +877,9 @@ int __init ide_probe_for_cmd640x (void)
 #ifdef CMD640_DUMP_REGS
        cmd640_dump_regs();
 #endif
 #ifdef CMD640_DUMP_REGS
        cmd640_dump_regs();
 #endif
+
+       ide_device_add(idx);
+
        return 1;
 }
 
        return 1;
 }
 
index 5f0da35ab5ad0a3ef977ab67c8145c0733f47245..8172e813b034a583e785f855c2c802c939c4c53c 100644 (file)
@@ -838,3 +838,17 @@ void m8xx_ide_init(void)
        ppc_ide_md.default_io_base      = m8xx_ide_default_io_base;
        ppc_ide_md.ide_init_hwif        = m8xx_ide_init_hwif_ports;
 }
        ppc_ide_md.default_io_base      = m8xx_ide_default_io_base;
        ppc_ide_md.ide_init_hwif        = m8xx_ide_init_hwif_ports;
 }
+
+void __init mpc8xx_ide_probe(void)
+{
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+
+#ifdef IDE0_BASE_OFFSET
+       idx[0] = 0;
+#ifdef IDE1_BASE_OFFSET
+       idx[1] = 1;
+#endif
+#endif
+
+       ide_device_add(idx);
+}