summaryrefslogtreecommitdiff
path: root/drivers/ide/legacy/ht6560b.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 19:36:36 +0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 19:36:36 +0400
commite277f91fef8a0ff7726ad33eb79c6f0d0c6229a8 (patch)
treed275b5e0c720c5db73efa446c86a2437fd93dca2 /drivers/ide/legacy/ht6560b.c
parentfe80b937c9917887e4fbfaaf52f498b5ac3a6999 (diff)
downloadlinux-e277f91fef8a0ff7726ad33eb79c6f0d0c6229a8.tar.xz
ide: use ide_find_port() in legacy VLB host drivers (take 2)
* Add IDE_HFLAG_QD_2ND_PORT host flag to indicate the need of skipping first ide_hwifs[] slot for the second port of QD65xx controller. * Handle this new host flag in ide_find_port_slot(). * Convert legacy VLB host drivers to use ide_find_port(). While at it: * Fix couple of printk()-s in qd65xx host driver to not use hwif->name. v2: * Fix qd65xx. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r--drivers/ide/legacy/ht6560b.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index fd21209025e1..60f52f5158c9 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -340,15 +340,12 @@ static const struct ide_port_info ht6560b_port_info __initdata = {
static int __init ht6560b_init(void)
{
ide_hwif_t *hwif, *mate;
- static u8 idx[4] = { 0, 1, 0xff, 0xff };
+ static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw[2];
if (probe_ht6560b == 0)
return -ENODEV;
- hwif = &ide_hwifs[0];
- mate = &ide_hwifs[1];
-
if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) {
printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
__FUNCTION__);
@@ -368,17 +365,23 @@ static int __init ht6560b_init(void)
ide_std_init_ports(&hw[1], 0x170, 0x376);
hw[1].irq = 15;
- ide_init_port_hw(hwif, &hw[0]);
- ide_init_port_hw(mate, &hw[1]);
-
- hwif->selectproc = &ht6560b_selectproc;
- hwif->set_pio_mode = &ht6560b_set_pio_mode;
-
- mate->selectproc = &ht6560b_selectproc;
- mate->set_pio_mode = &ht6560b_set_pio_mode;
+ hwif = ide_find_port();
+ if (hwif) {
+ ide_init_port_hw(hwif, &hw[0]);
+ hwif->selectproc = ht6560b_selectproc;
+ hwif->set_pio_mode = ht6560b_set_pio_mode;
+ hwif->port_init_devs = ht6560b_port_init_devs;
+ idx[0] = hwif->index;
+ }
- hwif->port_init_devs = ht6560b_port_init_devs;
- mate->port_init_devs = ht6560b_port_init_devs;
+ mate = ide_find_port();
+ if (mate) {
+ ide_init_port_hw(mate, &hw[1]);
+ mate->selectproc = ht6560b_selectproc;
+ mate->set_pio_mode = ht6560b_set_pio_mode;
+ mate->port_init_devs = ht6560b_port_init_devs;
+ idx[1] = mate->index;
+ }
ide_device_add(idx, &ht6560b_port_info);