aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ali14xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/ali14xx.c')
-rw-r--r--drivers/ide/legacy/ali14xx.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index bc8b1f8de614..c9536dd268cd 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -199,7 +199,8 @@ static const struct ide_port_info ali14xx_port_info = {
199 199
200static int __init ali14xx_probe(void) 200static int __init ali14xx_probe(void)
201{ 201{
202 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 202 ide_hwif_t *hwif, *mate;
203 static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
203 hw_regs_t hw[2]; 204 hw_regs_t hw[2];
204 205
205 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", 206 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
@@ -219,11 +220,19 @@ static int __init ali14xx_probe(void)
219 ide_std_init_ports(&hw[1], 0x170, 0x376); 220 ide_std_init_ports(&hw[1], 0x170, 0x376);
220 hw[1].irq = 15; 221 hw[1].irq = 15;
221 222
222 ide_init_port_hw(&ide_hwifs[0], &hw[0]); 223 hwif = ide_find_port();
223 ide_init_port_hw(&ide_hwifs[1], &hw[1]); 224 if (hwif) {
225 ide_init_port_hw(hwif, &hw[0]);
226 hwif->set_pio_mode = &ali14xx_set_pio_mode;
227 idx[0] = hwif->index;
228 }
224 229
225 ide_hwifs[0].set_pio_mode = &ali14xx_set_pio_mode; 230 mate = ide_find_port();
226 ide_hwifs[1].set_pio_mode = &ali14xx_set_pio_mode; 231 if (mate) {
232 ide_init_port_hw(mate, &hw[1]);
233 mate->set_pio_mode = &ali14xx_set_pio_mode;
234 idx[1] = mate->index;
235 }
227 236
228 ide_device_add(idx, &ali14xx_port_info); 237 ide_device_add(idx, &ali14xx_port_info);
229 238