diff options
Diffstat (limited to 'drivers/ide/ppc')
-rw-r--r-- | drivers/ide/ppc/mpc8xx.c | 28 | ||||
-rw-r--r-- | drivers/ide/ppc/pmac.c | 7 |
2 files changed, 20 insertions, 15 deletions
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c index a82f6efb660b..f0e638dcc3ab 100644 --- a/drivers/ide/ppc/mpc8xx.c +++ b/drivers/ide/ppc/mpc8xx.c | |||
@@ -131,7 +131,7 @@ static int pcmcia_schlvl = PCMCIA_SCHLVL; | |||
131 | #if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) | 131 | #if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) |
132 | static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | 132 | static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) |
133 | { | 133 | { |
134 | unsigned long *p = hw->io_ports; | 134 | unsigned long *p = hw->io_ports_array; |
135 | int i; | 135 | int i; |
136 | 136 | ||
137 | typedef struct { | 137 | typedef struct { |
@@ -314,7 +314,7 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | |||
314 | #if defined(CONFIG_IDE_EXT_DIRECT) | 314 | #if defined(CONFIG_IDE_EXT_DIRECT) |
315 | static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | 315 | static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) |
316 | { | 316 | { |
317 | unsigned long *p = hw->io_ports; | 317 | unsigned long *p = hw->io_ports_array; |
318 | int i; | 318 | int i; |
319 | 319 | ||
320 | u32 ide_phy_base; | 320 | u32 ide_phy_base; |
@@ -811,24 +811,28 @@ static int __init mpc8xx_ide_probe(void) | |||
811 | #ifdef IDE0_BASE_OFFSET | 811 | #ifdef IDE0_BASE_OFFSET |
812 | memset(&hw, 0, sizeof(hw)); | 812 | memset(&hw, 0, sizeof(hw)); |
813 | if (!m8xx_ide_init_ports(&hw, 0)) { | 813 | if (!m8xx_ide_init_ports(&hw, 0)) { |
814 | ide_hwif_t *hwif = &ide_hwifs[0]; | 814 | ide_hwif_t *hwif = ide_find_port(); |
815 | 815 | ||
816 | ide_init_port_hw(hwif, &hw); | 816 | if (hwif) { |
817 | hwif->pio_mask = ATA_PIO4; | 817 | ide_init_port_hw(hwif, &hw); |
818 | hwif->port_ops = &m8xx_port_ops; | 818 | hwif->pio_mask = ATA_PIO4; |
819 | hwif->port_ops = &m8xx_port_ops; | ||
819 | 820 | ||
820 | idx[0] = 0; | 821 | idx[0] = hwif->index; |
822 | } | ||
821 | } | 823 | } |
822 | #ifdef IDE1_BASE_OFFSET | 824 | #ifdef IDE1_BASE_OFFSET |
823 | memset(&hw, 0, sizeof(hw)); | 825 | memset(&hw, 0, sizeof(hw)); |
824 | if (!m8xx_ide_init_ports(&hw, 1)) { | 826 | if (!m8xx_ide_init_ports(&hw, 1)) { |
825 | ide_hwif_t *mate = &ide_hwifs[1]; | 827 | ide_hwif_t *mate = ide_find_port(); |
826 | 828 | ||
827 | ide_init_port_hw(mate, &hw); | 829 | if (mate) { |
828 | mate->pio_mask = ATA_PIO4; | 830 | ide_init_port_hw(mate, &hw); |
829 | mate->port_ops = &m8xx_port_ops; | 831 | mate->pio_mask = ATA_PIO4; |
832 | mate->port_ops = &m8xx_port_ops; | ||
830 | 833 | ||
831 | idx[1] = 1; | 834 | idx[1] = mate->index; |
835 | } | ||
832 | } | 836 | } |
833 | #endif | 837 | #endif |
834 | #endif | 838 | #endif |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 185faa0dce94..3cac6b2790dd 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -417,7 +417,7 @@ static void pmac_ide_kauai_selectproc(ide_drive_t *drive); | |||
417 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | 417 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ |
418 | 418 | ||
419 | #define PMAC_IDE_REG(x) \ | 419 | #define PMAC_IDE_REG(x) \ |
420 | ((void __iomem *)((drive)->hwif->io_ports[IDE_DATA_OFFSET] + (x))) | 420 | ((void __iomem *)((drive)->hwif->io_ports.data_addr + (x))) |
421 | 421 | ||
422 | /* | 422 | /* |
423 | * Apply the timings of the proper unit (master/slave) to the shared | 423 | * Apply the timings of the proper unit (master/slave) to the shared |
@@ -1086,8 +1086,9 @@ static void __devinit pmac_ide_init_ports(hw_regs_t *hw, unsigned long base) | |||
1086 | int i; | 1086 | int i; |
1087 | 1087 | ||
1088 | for (i = 0; i < 8; ++i) | 1088 | for (i = 0; i < 8; ++i) |
1089 | hw->io_ports[i] = base + i * 0x10; | 1089 | hw->io_ports_array[i] = base + i * 0x10; |
1090 | hw->io_ports[8] = base + 0x160; | 1090 | |
1091 | hw->io_ports.ctl_addr = base + 0x160; | ||
1091 | } | 1092 | } |
1092 | 1093 | ||
1093 | /* | 1094 | /* |