]> err.no Git - linux-2.6/blobdiff - drivers/ide/ppc/mpc8xx.c
Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap...
[linux-2.6] / drivers / ide / ppc / mpc8xx.c
index 6d62adefd97642bacd38edb55705053c3d5209f2..236f9c38e5198d33614beeb61d22311ae70c733e 100644 (file)
@@ -131,7 +131,7 @@ static int pcmcia_schlvl = PCMCIA_SCHLVL;
 #if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT)
 static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
 {
-       unsigned long *p = hw->io_ports;
+       unsigned long *p = hw->io_ports_array;
        int i;
 
        typedef struct {
@@ -303,6 +303,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
        pcmp->pcmc_per = 0x100000 >> (16 * _slot_);
 #endif /* CONFIG_IDE_8xx_PCCARD */
 
+       hw->chipset = ide_generic;
+
        return 0;
 }
 #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */
@@ -314,7 +316,7 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
 #if defined(CONFIG_IDE_EXT_DIRECT)
 static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
 {
-       unsigned long *p = hw->io_ports;
+       unsigned long *p = hw->io_ports_array;
        int i;
 
        u32 ide_phy_base;
@@ -377,6 +379,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
        ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |=
                        (0x80000000 >> ioport_dsc[data_port].irq);
 
+       hw->chipset = ide_generic;
+
        return 0;
 }
 #endif /* CONFIG_IDE_8xx_DIRECT */
@@ -438,7 +442,7 @@ static void m8xx_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
 #elif defined(CONFIG_IDE_EXT_DIRECT)
 
        printk("%s[%d] %s: not implemented yet!\n",
-               __FILE__,__LINE__,__FUNCTION__);
+               __FILE__, __LINE__, __func__);
 #endif /* defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_PCMCIA */
 }
 
@@ -811,24 +815,28 @@ static int __init mpc8xx_ide_probe(void)
 #ifdef IDE0_BASE_OFFSET
        memset(&hw, 0, sizeof(hw));
        if (!m8xx_ide_init_ports(&hw, 0)) {
-               ide_hwif_t *hwif = &ide_hwifs[0];
+               ide_hwif_t *hwif = ide_find_port();
 
-               ide_init_port_hw(hwif, &hw);
-               hwif->pio_mask = ATA_PIO4;
-               hwif->port_ops = &m8xx_port_ops;
+               if (hwif) {
+                       ide_init_port_hw(hwif, &hw);
+                       hwif->pio_mask = ATA_PIO4;
+                       hwif->port_ops = &m8xx_port_ops;
 
-               idx[0] = 0;
+                       idx[0] = hwif->index;
+               }
        }
 #ifdef IDE1_BASE_OFFSET
        memset(&hw, 0, sizeof(hw));
        if (!m8xx_ide_init_ports(&hw, 1)) {
-               ide_hwif_t *mate = &ide_hwifs[1];
+               ide_hwif_t *mate = ide_find_port();
 
-               ide_init_port_hw(mate, &hw);
-               mate->pio_mask = ATA_PIO4;
-               mate->port_ops = &m8xx_port_ops;
+               if (mate) {
+                       ide_init_port_hw(mate, &hw);
+                       mate->pio_mask = ATA_PIO4;
+                       mate->port_ops = &m8xx_port_ops;
 
-               idx[1] = 1;
+                       idx[1] = mate->index;
+               }
        }
 #endif
 #endif