aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:30 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:30 -0400
commit16019c35283e99b4b95b8a0757845bc2d0696b20 (patch)
treee18a34147f70180cd761848d70e880e63895b139 /drivers/ide
parent1dbfeb4bc8fd0276750e5d1d454420f6c2da80e3 (diff)
mpc8xx-ide: use ide_find_port()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ppc/mpc8xx.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c
index a82f6efb660b..828896f927cc 100644
--- a/drivers/ide/ppc/mpc8xx.c
+++ b/drivers/ide/ppc/mpc8xx.c
@@ -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