Merge branches 'release', 'asus', 'sony-laptop' and 'thinkpad' into release
[pandora-kernel.git] / drivers / ide / arm / bast-ide.c
index f7449d0..0e7574c 100644 (file)
@@ -1,5 +1,4 @@
-/* linux/drivers/ide/arm/bast-ide.c
- *
+/*
  * Copyright (c) 2003-2004 Simtec Electronics
  *  Ben Dooks <ben@simtec.co.uk>
  *
@@ -29,8 +28,10 @@ static int __init
 bastide_register(unsigned int base, unsigned int aux, int irq,
                 ide_hwif_t **hwif)
 {
+       ide_hwif_t *hwif;
        hw_regs_t hw;
        int i;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        memset(&hw, 0, sizeof(hw));
 
@@ -45,8 +46,24 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
        hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
        hw.irq = irq;
 
-       ide_register_hw(&hw, 0, hwif);
+       hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       if (hwif == NULL)
+               goto out;
+
+       i = hwif->index;
+
+       if (hwif->present)
+               ide_unregister(i, 0, 0);
+       else if (!hwif->hold)
+               ide_init_port_data(hwif, i);
+
+       ide_init_port_hw(hwif, &hw);
+       hwif->quirkproc = NULL;
+
+       idx[0] = i;
 
+       ide_device_add(idx, NULL);
+out:
        return 0;
 }