aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:37 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:37 -0500
commit7f92b11c1cc0e865fc64f3148eda87fff74920e1 (patch)
tree6cc52b4abfab5c66efb6fd679a0a915f6dd6108b /drivers/ide/ide-probe.c
parente2984c628c924442132304ae662da433f41c05c9 (diff)
ide: move legacy ISA/VLB ports handling to ide-legacy.c (v2)
* Move legacy ISA/VLB ports handling from ide-probe.c to ide-legacy.c. * Add CONFIG_IDE_LEGACY config option to be selected by host drivers needing ide-legacy.c. v2: Fix CONFIG_IDE_LEGACY not being defined in Kconfig. (from Takashi Iwai <tiwai@suse.de>) 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.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 6d11f180bd1f..2333a5a83519 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1755,59 +1755,3 @@ void ide_port_scan(ide_hwif_t *hwif)
1755 ide_proc_port_register_devices(hwif); 1755 ide_proc_port_register_devices(hwif);
1756} 1756}
1757EXPORT_SYMBOL_GPL(ide_port_scan); 1757EXPORT_SYMBOL_GPL(ide_port_scan);
1758
1759static void ide_legacy_init_one(hw_regs_t **hws, hw_regs_t *hw,
1760 u8 port_no, const struct ide_port_info *d,
1761 unsigned long config)
1762{
1763 unsigned long base, ctl;
1764 int irq;
1765
1766 if (port_no == 0) {
1767 base = 0x1f0;
1768 ctl = 0x3f6;
1769 irq = 14;
1770 } else {
1771 base = 0x170;
1772 ctl = 0x376;
1773 irq = 15;
1774 }
1775
1776 if (!request_region(base, 8, d->name)) {
1777 printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
1778 d->name, base, base + 7);
1779 return;
1780 }
1781
1782 if (!request_region(ctl, 1, d->name)) {
1783 printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
1784 d->name, ctl);
1785 release_region(base, 8);
1786 return;
1787 }
1788
1789 ide_std_init_ports(hw, base, ctl);
1790 hw->irq = irq;
1791 hw->chipset = d->chipset;
1792 hw->config = config;
1793
1794 hws[port_no] = hw;
1795}
1796
1797int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
1798{
1799 hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
1800
1801 memset(&hw, 0, sizeof(hw));
1802
1803 if ((d->host_flags & IDE_HFLAG_QD_2ND_PORT) == 0)
1804 ide_legacy_init_one(hws, &hw[0], 0, d, config);
1805 ide_legacy_init_one(hws, &hw[1], 1, d, config);
1806
1807 if (hws[0] == NULL && hws[1] == NULL &&
1808 (d->host_flags & IDE_HFLAG_SINGLE))
1809 return -ENOENT;
1810
1811 return ide_host_add(d, hws, NULL);
1812}
1813EXPORT_SYMBOL_GPL(ide_legacy_device_add);