aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ppc
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:57 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:57 -0400
commit48c3c1072651922ed153bcf0a33ea82cf20df390 (patch)
tree92ad23e3869e70731eca99394c08a3bf06b8753e /drivers/ide/ppc
parent374e042c3e767ac2e5a40b78529220e0b3de793c (diff)
ide: add struct ide_host (take 3)
* Add struct ide_host which keeps pointers to host's ports. * Add ide_host_alloc[_all]() and ide_host_remove() helpers. * Pass 'struct ide_host *host' instead of 'u8 *idx' to ide_device_add[_all]() and rename it to ide_host_register[_all](). * Convert host drivers and core code to use struct ide_host. * Remove no longer needed ide_find_port(). * Make ide_find_port_slot() static. * Unexport ide_unregister(). v2: * Add missing 'struct ide_host *host' to macide.c. v3: * Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/) (Noticed by Stephen Rothwell). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ppc')
-rw-r--r--drivers/ide/ppc/pmac.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index ee557d10a764..ecd2f28da1ba 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1039,9 +1039,9 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
1039{ 1039{
1040 struct device_node *np = pmif->node; 1040 struct device_node *np = pmif->node;
1041 const int *bidp; 1041 const int *bidp;
1042 struct ide_host *host;
1042 ide_hwif_t *hwif; 1043 ide_hwif_t *hwif;
1043 hw_regs_t *hws[] = { hw, NULL, NULL, NULL }; 1044 hw_regs_t *hws[] = { hw, NULL, NULL, NULL };
1044 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
1045 struct ide_port_info d = pmac_port_info; 1045 struct ide_port_info d = pmac_port_info;
1046 1046
1047 pmif->broken_dma = pmif->broken_dma_warn = 0; 1047 pmif->broken_dma = pmif->broken_dma_warn = 0;
@@ -1118,13 +1118,13 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
1118 pmif->mdev ? "macio" : "PCI", pmif->aapl_bus_id, 1118 pmif->mdev ? "macio" : "PCI", pmif->aapl_bus_id,
1119 pmif->mediabay ? " (mediabay)" : "", hw->irq); 1119 pmif->mediabay ? " (mediabay)" : "", hw->irq);
1120 1120
1121 hwif = ide_find_port_slot(&d); 1121 host = ide_host_alloc(&d, hws);
1122 if (hwif == NULL) 1122 if (host == NULL)
1123 return -ENOENT; 1123 return -ENOENT;
1124 1124
1125 idx[0] = hwif->index; 1125 ide_host_register(host, &d, hws);
1126 1126
1127 ide_device_add(idx, &d, hws); 1127 hwif = host->ports[0];
1128 1128
1129 return 0; 1129 return 0;
1130} 1130}