aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/qd65xx.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:31 -0400
commit8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d (patch)
tree358aa3ca6b0657623b84e7c6278f90fc95a32879 /drivers/ide/legacy/qd65xx.c
parentfd9bb53942a7ca3398a63f2c238afd8fbed3ec0e (diff)
ide: add ide_device_add()
* Add ide_device_add() helper and convert host drivers to use it instead of open-coded variants. * Make ide_pci_setup_ports() and do_ide_setup_pci_device() take 'u8 *idx' argument instead of 'ata_index_t *index'. * Remove no longer needed ata_index_t. * Unexport probe_hwif_init() and make it static. * Unexport ide_proc_register_port(). There should be no functionality changes caused by this patch (sgiioc4.c: ide_proc_register_port() requires hwif->present to be set and it won't be set if probe_hwif_init() fails). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/qd65xx.c')
-rw-r--r--drivers/ide/legacy/qd65xx.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 0c81d2d0b941..85104bc79a1d 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -389,6 +389,7 @@ static void __exit qd_unsetup(ide_hwif_t *hwif)
389static int __init qd_probe(int base) 389static int __init qd_probe(int base)
390{ 390{
391 ide_hwif_t *hwif; 391 ide_hwif_t *hwif;
392 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
392 u8 config; 393 u8 config;
393 u8 unit; 394 u8 unit;
394 395
@@ -419,9 +420,9 @@ static int __init qd_probe(int base)
419 420
420 hwif->set_pio_mode = &qd6500_set_pio_mode; 421 hwif->set_pio_mode = &qd6500_set_pio_mode;
421 422
422 probe_hwif_init(hwif); 423 idx[0] = unit;
423 424
424 ide_proc_register_port(hwif); 425 ide_device_add(idx);
425 426
426 return 1; 427 return 1;
427 } 428 }
@@ -453,11 +454,11 @@ static int __init qd_probe(int base)
453 454
454 hwif->set_pio_mode = &qd6580_set_pio_mode; 455 hwif->set_pio_mode = &qd6580_set_pio_mode;
455 456
456 probe_hwif_init(hwif); 457 idx[0] = unit;
457 458
458 qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); 459 ide_device_add(idx);
459 460
460 ide_proc_register_port(hwif); 461 qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);
461 462
462 return 1; 463 return 1;
463 } else { 464 } else {
@@ -474,19 +475,17 @@ static int __init qd_probe(int base)
474 475
475 hwif->set_pio_mode = &qd6580_set_pio_mode; 476 hwif->set_pio_mode = &qd6580_set_pio_mode;
476 477
477 probe_hwif_init(hwif);
478
479 qd_setup(mate, base, config | (control << 8), 478 qd_setup(mate, base, config | (control << 8),
480 QD6580_DEF_DATA2, QD6580_DEF_DATA2); 479 QD6580_DEF_DATA2, QD6580_DEF_DATA2);
481 480
482 mate->set_pio_mode = &qd6580_set_pio_mode; 481 mate->set_pio_mode = &qd6580_set_pio_mode;
483 482
484 probe_hwif_init(mate); 483 idx[0] = 0;
484 idx[1] = 1;
485 485
486 qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); 486 ide_device_add(idx);
487 487
488 ide_proc_register_port(hwif); 488 qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);
489 ide_proc_register_port(mate);
490 489
491 return 0; /* no other qd65xx possible */ 490 return 0; /* no other qd65xx possible */
492 } 491 }