diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:36 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:36 -0400 |
commit | e277f91fef8a0ff7726ad33eb79c6f0d0c6229a8 (patch) | |
tree | d275b5e0c720c5db73efa446c86a2437fd93dca2 /drivers/ide/legacy/ht6560b.c | |
parent | fe80b937c9917887e4fbfaaf52f498b5ac3a6999 (diff) |
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.c | 31 |
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 = { | |||
340 | static int __init ht6560b_init(void) | 340 | static int __init ht6560b_init(void) |
341 | { | 341 | { |
342 | ide_hwif_t *hwif, *mate; | 342 | ide_hwif_t *hwif, *mate; |
343 | static u8 idx[4] = { 0, 1, 0xff, 0xff }; | 343 | static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
344 | hw_regs_t hw[2]; | 344 | hw_regs_t hw[2]; |
345 | 345 | ||
346 | if (probe_ht6560b == 0) | 346 | if (probe_ht6560b == 0) |
347 | return -ENODEV; | 347 | return -ENODEV; |
348 | 348 | ||
349 | hwif = &ide_hwifs[0]; | ||
350 | mate = &ide_hwifs[1]; | ||
351 | |||
352 | if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) { | 349 | if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) { |
353 | printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", | 350 | printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", |
354 | __FUNCTION__); | 351 | __FUNCTION__); |
@@ -368,17 +365,23 @@ static int __init ht6560b_init(void) | |||
368 | ide_std_init_ports(&hw[1], 0x170, 0x376); | 365 | ide_std_init_ports(&hw[1], 0x170, 0x376); |
369 | hw[1].irq = 15; | 366 | hw[1].irq = 15; |
370 | 367 | ||
371 | ide_init_port_hw(hwif, &hw[0]); | 368 | hwif = ide_find_port(); |
372 | ide_init_port_hw(mate, &hw[1]); | 369 | if (hwif) { |
373 | 370 | ide_init_port_hw(hwif, &hw[0]); | |
374 | hwif->selectproc = &ht6560b_selectproc; | 371 | hwif->selectproc = ht6560b_selectproc; |
375 | hwif->set_pio_mode = &ht6560b_set_pio_mode; | 372 | hwif->set_pio_mode = ht6560b_set_pio_mode; |
376 | 373 | hwif->port_init_devs = ht6560b_port_init_devs; | |
377 | mate->selectproc = &ht6560b_selectproc; | 374 | idx[0] = hwif->index; |
378 | mate->set_pio_mode = &ht6560b_set_pio_mode; | 375 | } |
379 | 376 | ||
380 | hwif->port_init_devs = ht6560b_port_init_devs; | 377 | mate = ide_find_port(); |
381 | mate->port_init_devs = ht6560b_port_init_devs; | 378 | if (mate) { |
379 | ide_init_port_hw(mate, &hw[1]); | ||
380 | mate->selectproc = ht6560b_selectproc; | ||
381 | mate->set_pio_mode = ht6560b_set_pio_mode; | ||
382 | mate->port_init_devs = ht6560b_port_init_devs; | ||
383 | idx[1] = mate->index; | ||
384 | } | ||
382 | 385 | ||
383 | ide_device_add(idx, &ht6560b_port_info); | 386 | ide_device_add(idx, &ht6560b_port_info); |
384 | 387 | ||