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 | 3b36f66b81bc0d69ec7dfa736592224f6ca366b7 (patch) | |
tree | b99bf69c108198d14a0f600a600cf2790ca2be84 /drivers/ide/ide-probe.c | |
parent | e53cd458d593c88247b8a7b2754d0e8055869670 (diff) |
ide: add ide_legacy_device_add() helper
Add ide_legacy_device_add() helper for use by legacy VLB host drivers
(+ convert them to use it).
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 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index c3ecc43b894b..8cad2b4c694f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1633,3 +1633,35 @@ void ide_port_scan(ide_hwif_t *hwif) | |||
1633 | ide_proc_port_register_devices(hwif); | 1633 | ide_proc_port_register_devices(hwif); |
1634 | } | 1634 | } |
1635 | EXPORT_SYMBOL_GPL(ide_port_scan); | 1635 | EXPORT_SYMBOL_GPL(ide_port_scan); |
1636 | |||
1637 | int ide_legacy_device_add(const struct ide_port_info *d) | ||
1638 | { | ||
1639 | ide_hwif_t *hwif, *mate; | ||
1640 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
1641 | hw_regs_t hw[2]; | ||
1642 | |||
1643 | memset(&hw, 0, sizeof(hw)); | ||
1644 | |||
1645 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | ||
1646 | hw[0].irq = 14; | ||
1647 | |||
1648 | ide_std_init_ports(&hw[1], 0x170, 0x376); | ||
1649 | hw[1].irq = 15; | ||
1650 | |||
1651 | hwif = ide_find_port(); | ||
1652 | if (hwif) { | ||
1653 | ide_init_port_hw(hwif, &hw[0]); | ||
1654 | idx[0] = hwif->index; | ||
1655 | } | ||
1656 | |||
1657 | mate = ide_find_port(); | ||
1658 | if (mate) { | ||
1659 | ide_init_port_hw(mate, &hw[1]); | ||
1660 | idx[1] = mate->index; | ||
1661 | } | ||
1662 | |||
1663 | ide_device_add(idx, d); | ||
1664 | |||
1665 | return 0; | ||
1666 | } | ||
1667 | EXPORT_SYMBOL_GPL(ide_legacy_device_add); | ||