aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 84a89561ec0f..17a104b95d54 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1677,6 +1677,24 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1677} 1677}
1678EXPORT_SYMBOL_GPL(ide_host_register); 1678EXPORT_SYMBOL_GPL(ide_host_register);
1679 1679
1680int ide_host_add(const struct ide_port_info *d, hw_regs_t **hws,
1681 struct ide_host **hostp)
1682{
1683 struct ide_host *host;
1684
1685 host = ide_host_alloc(d, hws);
1686 if (host == NULL)
1687 return -ENOMEM;
1688
1689 ide_host_register(host, d, hws);
1690
1691 if (hostp)
1692 *hostp = host;
1693
1694 return 0;
1695}
1696EXPORT_SYMBOL_GPL(ide_host_add);
1697
1680void ide_host_remove(struct ide_host *host) 1698void ide_host_remove(struct ide_host *host)
1681{ 1699{
1682 int i; 1700 int i;
@@ -1749,7 +1767,6 @@ static void ide_legacy_init_one(hw_regs_t **hws, hw_regs_t *hw,
1749 1767
1750int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config) 1768int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
1751{ 1769{
1752 struct ide_host *host;
1753 hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL }; 1770 hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
1754 1771
1755 memset(&hw, 0, sizeof(hw)); 1772 memset(&hw, 0, sizeof(hw));
@@ -1762,12 +1779,6 @@ int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
1762 (d->host_flags & IDE_HFLAG_SINGLE)) 1779 (d->host_flags & IDE_HFLAG_SINGLE))
1763 return -ENOENT; 1780 return -ENOENT;
1764 1781
1765 host = ide_host_alloc(d, hws); 1782 return ide_host_add(d, hws, NULL);
1766 if (host == NULL)
1767 return -ENOMEM;
1768
1769 ide_host_register(host, d, hws);
1770
1771 return 0;
1772} 1783}
1773EXPORT_SYMBOL_GPL(ide_legacy_device_add); 1784EXPORT_SYMBOL_GPL(ide_legacy_device_add);