aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:43 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:43 -0400
commita36223b0dc14606b5c80aacbbe6288133693a841 (patch)
tree6ff55ad65a4c1a20763e5f694a5c4e810be7da73 /drivers/ide/ide-probe.c
parentcf4049103be931fca133f66b3181490284a521c6 (diff)
ide: remove ide_host_alloc_all()
* Remove no longer used ide_host_alloc_all(). * Add MAX_HOST_PORTS define and use it instead of MAX_HWIFS as the maximum number of host ports possible. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 242cfd09e16b..3269cbf0e56d 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1544,8 +1544,7 @@ static void ide_free_port_slot(int idx)
1544 mutex_unlock(&ide_cfg_mtx); 1544 mutex_unlock(&ide_cfg_mtx);
1545} 1545}
1546 1546
1547struct ide_host *ide_host_alloc_all(const struct ide_port_info *d, 1547struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
1548 hw_regs_t **hws)
1549{ 1548{
1550 struct ide_host *host; 1549 struct ide_host *host;
1551 int i; 1550 int i;
@@ -1554,7 +1553,7 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d,
1554 if (host == NULL) 1553 if (host == NULL)
1555 return NULL; 1554 return NULL;
1556 1555
1557 for (i = 0; i < MAX_HWIFS; i++) { 1556 for (i = 0; i < MAX_HOST_PORTS; i++) {
1558 ide_hwif_t *hwif; 1557 ide_hwif_t *hwif;
1559 int idx; 1558 int idx;
1560 1559
@@ -1596,18 +1595,6 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d,
1596 1595
1597 return host; 1596 return host;
1598} 1597}
1599EXPORT_SYMBOL_GPL(ide_host_alloc_all);
1600
1601struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
1602{
1603 hw_regs_t *hws_all[MAX_HWIFS];
1604 int i;
1605
1606 for (i = 0; i < MAX_HWIFS; i++)
1607 hws_all[i] = (i < 4) ? hws[i] : NULL;
1608
1609 return ide_host_alloc_all(d, hws_all);
1610}
1611EXPORT_SYMBOL_GPL(ide_host_alloc); 1598EXPORT_SYMBOL_GPL(ide_host_alloc);
1612 1599
1613int ide_host_register(struct ide_host *host, const struct ide_port_info *d, 1600int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
@@ -1616,7 +1603,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1616 ide_hwif_t *hwif, *mate = NULL; 1603 ide_hwif_t *hwif, *mate = NULL;
1617 int i, j = 0; 1604 int i, j = 0;
1618 1605
1619 for (i = 0; i < MAX_HWIFS; i++) { 1606 for (i = 0; i < MAX_HOST_PORTS; i++) {
1620 hwif = host->ports[i]; 1607 hwif = host->ports[i];
1621 1608
1622 if (hwif == NULL) { 1609 if (hwif == NULL) {
@@ -1644,7 +1631,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1644 ide_port_init_devices(hwif); 1631 ide_port_init_devices(hwif);
1645 } 1632 }
1646 1633
1647 for (i = 0; i < MAX_HWIFS; i++) { 1634 for (i = 0; i < MAX_HOST_PORTS; i++) {
1648 hwif = host->ports[i]; 1635 hwif = host->ports[i];
1649 1636
1650 if (hwif == NULL) 1637 if (hwif == NULL)
@@ -1661,7 +1648,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1661 ide_port_tune_devices(hwif); 1648 ide_port_tune_devices(hwif);
1662 } 1649 }
1663 1650
1664 for (i = 0; i < MAX_HWIFS; i++) { 1651 for (i = 0; i < MAX_HOST_PORTS; i++) {
1665 hwif = host->ports[i]; 1652 hwif = host->ports[i];
1666 1653
1667 if (hwif == NULL) 1654 if (hwif == NULL)
@@ -1685,7 +1672,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1685 ide_acpi_port_init_devices(hwif); 1672 ide_acpi_port_init_devices(hwif);
1686 } 1673 }
1687 1674
1688 for (i = 0; i < MAX_HWIFS; i++) { 1675 for (i = 0; i < MAX_HOST_PORTS; i++) {
1689 hwif = host->ports[i]; 1676 hwif = host->ports[i];
1690 1677
1691 if (hwif == NULL) 1678 if (hwif == NULL)
@@ -1698,7 +1685,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1698 hwif_register_devices(hwif); 1685 hwif_register_devices(hwif);
1699 } 1686 }
1700 1687
1701 for (i = 0; i < MAX_HWIFS; i++) { 1688 for (i = 0; i < MAX_HOST_PORTS; i++) {
1702 hwif = host->ports[i]; 1689 hwif = host->ports[i];
1703 1690
1704 if (hwif == NULL) 1691 if (hwif == NULL)
@@ -1743,7 +1730,7 @@ void ide_host_free(struct ide_host *host)
1743 ide_hwif_t *hwif; 1730 ide_hwif_t *hwif;
1744 int i; 1731 int i;
1745 1732
1746 for (i = 0; i < MAX_HWIFS; i++) { 1733 for (i = 0; i < MAX_HOST_PORTS; i++) {
1747 hwif = host->ports[i]; 1734 hwif = host->ports[i];
1748 1735
1749 if (hwif == NULL) 1736 if (hwif == NULL)
@@ -1761,7 +1748,7 @@ void ide_host_remove(struct ide_host *host)
1761{ 1748{
1762 int i; 1749 int i;
1763 1750
1764 for (i = 0; i < MAX_HWIFS; i++) { 1751 for (i = 0; i < MAX_HOST_PORTS; i++) {
1765 if (host->ports[i]) 1752 if (host->ports[i])
1766 ide_unregister(host->ports[i]); 1753 ide_unregister(host->ports[i]);
1767 } 1754 }