diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:16 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:16 -0400 |
commit | 0bfeee7d4190938291a76536c7f6cd8f4e2dc30c (patch) | |
tree | 94d8a02a4f184852836ae1e1ef5cbb8415238127 /drivers/ide/ide-probe.c | |
parent | 3b36f66b81bc0d69ec7dfa736592224f6ca366b7 (diff) |
ide: use ide_legacy_device_add() for qd65xx (take 2)
* Add 'unsigned long config' argument to ide_legacy_device_add()
for setting hwif->config_data.
* Use ide_find_port_slot() instead of ide_find_port() in
ide_legacy_device_add().
* Handle IDE_HFLAG_QD_2ND_PORT and IDE_HFLAG_SINGLE host flags in
ide_legacy_device_add().
* Convert qd65xx host driver to use ide_legacy_device_add().
v2:
* Update ali14xx, dtc2278, ht6560b and umc8672 host drivers.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 8cad2b4c694f..ba16ade15c8c 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1634,7 +1634,7 @@ void ide_port_scan(ide_hwif_t *hwif) | |||
1634 | } | 1634 | } |
1635 | EXPORT_SYMBOL_GPL(ide_port_scan); | 1635 | EXPORT_SYMBOL_GPL(ide_port_scan); |
1636 | 1636 | ||
1637 | int ide_legacy_device_add(const struct ide_port_info *d) | 1637 | int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config) |
1638 | { | 1638 | { |
1639 | ide_hwif_t *hwif, *mate; | 1639 | ide_hwif_t *hwif, *mate; |
1640 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 1640 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
@@ -1648,15 +1648,24 @@ int ide_legacy_device_add(const struct ide_port_info *d) | |||
1648 | ide_std_init_ports(&hw[1], 0x170, 0x376); | 1648 | ide_std_init_ports(&hw[1], 0x170, 0x376); |
1649 | hw[1].irq = 15; | 1649 | hw[1].irq = 15; |
1650 | 1650 | ||
1651 | hwif = ide_find_port(); | 1651 | hwif = ide_find_port_slot(d); |
1652 | if (hwif) { | 1652 | if (hwif) { |
1653 | ide_init_port_hw(hwif, &hw[0]); | 1653 | u8 j = (d->host_flags & IDE_HFLAG_QD_2ND_PORT) ? 1 : 0; |
1654 | idx[0] = hwif->index; | 1654 | |
1655 | ide_init_port_hw(hwif, &hw[j]); | ||
1656 | if (config) | ||
1657 | hwif->config_data = config; | ||
1658 | idx[j] = hwif->index; | ||
1655 | } | 1659 | } |
1656 | 1660 | ||
1657 | mate = ide_find_port(); | 1661 | if (hwif == NULL && (d->host_flags & IDE_HFLAG_SINGLE)) |
1662 | return -ENOENT; | ||
1663 | |||
1664 | mate = ide_find_port_slot(d); | ||
1658 | if (mate) { | 1665 | if (mate) { |
1659 | ide_init_port_hw(mate, &hw[1]); | 1666 | ide_init_port_hw(mate, &hw[1]); |
1667 | if (config) | ||
1668 | mate->config_data = config; | ||
1660 | idx[1] = mate->index; | 1669 | idx[1] = mate->index; |
1661 | } | 1670 | } |
1662 | 1671 | ||