diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:35 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:35 -0400 |
commit | dfd87842a97e848cb5d62a5249d3f479c5f92c4b (patch) | |
tree | bb02496c9cd49a7b864642ee9d0186be0c1f85b6 /drivers/ide/legacy/qd65xx.c | |
parent | e4079df0c273719f539aaa7cc19ed17c9a5b0aba (diff) |
ide: init hwif->{io_ports,irq} explicitly in legacy VLB host drivers
Do explicit port setup in legacy VLB host drivers instead of depending
on init_ide_data(). This way hwif->io_ports[] and hwif->irq are always
correctly set regardless of CONFIG_PCI / CONFIG_BLK_DEV_IDEPCI.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/qd65xx.c')
-rw-r--r-- | drivers/ide/legacy/qd65xx.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 2f4f47ad602f..7016bdf4fcc1 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c | |||
@@ -352,9 +352,9 @@ static const struct ide_port_info qd65xx_port_info __initdata = { | |||
352 | static int __init qd_probe(int base) | 352 | static int __init qd_probe(int base) |
353 | { | 353 | { |
354 | ide_hwif_t *hwif; | 354 | ide_hwif_t *hwif; |
355 | u8 config, unit; | ||
355 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 356 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
356 | u8 config; | 357 | hw_regs_t hw[2]; |
357 | u8 unit; | ||
358 | 358 | ||
359 | config = inb(QD_CONFIG_PORT); | 359 | config = inb(QD_CONFIG_PORT); |
360 | 360 | ||
@@ -363,6 +363,14 @@ static int __init qd_probe(int base) | |||
363 | 363 | ||
364 | unit = ! (config & QD_CONFIG_IDE_BASEPORT); | 364 | unit = ! (config & QD_CONFIG_IDE_BASEPORT); |
365 | 365 | ||
366 | memset(&hw, 0, sizeof(hw)); | ||
367 | |||
368 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | ||
369 | hw[0].irq = 14; | ||
370 | |||
371 | ide_std_init_ports(&hw[1], 0x170, 0x376); | ||
372 | hw[1].irq = 15; | ||
373 | |||
366 | if ((config & 0xf0) == QD_CONFIG_QD6500) { | 374 | if ((config & 0xf0) == QD_CONFIG_QD6500) { |
367 | 375 | ||
368 | if (qd_testreg(base)) return 1; /* bad register */ | 376 | if (qd_testreg(base)) return 1; /* bad register */ |
@@ -379,6 +387,8 @@ static int __init qd_probe(int base) | |||
379 | return 1; | 387 | return 1; |
380 | } | 388 | } |
381 | 389 | ||
390 | ide_init_port_hw(hwif, &hw[unit]); | ||
391 | |||
382 | qd_setup(hwif, base, config); | 392 | qd_setup(hwif, base, config); |
383 | 393 | ||
384 | hwif->port_init_devs = qd6500_port_init_devs; | 394 | hwif->port_init_devs = qd6500_port_init_devs; |
@@ -416,6 +426,8 @@ static int __init qd_probe(int base) | |||
416 | printk(KERN_INFO "%s: qd6580: single IDE board\n", | 426 | printk(KERN_INFO "%s: qd6580: single IDE board\n", |
417 | hwif->name); | 427 | hwif->name); |
418 | 428 | ||
429 | ide_init_port_hw(hwif, &hw[unit]); | ||
430 | |||
419 | qd_setup(hwif, base, config | (control << 8)); | 431 | qd_setup(hwif, base, config | (control << 8)); |
420 | 432 | ||
421 | hwif->port_init_devs = qd6580_port_init_devs; | 433 | hwif->port_init_devs = qd6580_port_init_devs; |
@@ -435,6 +447,9 @@ static int __init qd_probe(int base) | |||
435 | printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n", | 447 | printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n", |
436 | hwif->name, mate->name); | 448 | hwif->name, mate->name); |
437 | 449 | ||
450 | ide_init_port_hw(hwif, &hw[0]); | ||
451 | ide_init_port_hw(mate, &hw[1]); | ||
452 | |||
438 | qd_setup(hwif, base, config | (control << 8)); | 453 | qd_setup(hwif, base, config | (control << 8)); |
439 | 454 | ||
440 | hwif->port_init_devs = qd6580_port_init_devs; | 455 | hwif->port_init_devs = qd6580_port_init_devs; |