aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:40 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:40 -0400
commitc56c5648a3bd15ff14c50f284b261140cd5b5472 (patch)
tree94cdc14616143b5a51e5dc16901c4f431bacf83f
parent63b51c6d1d63276fd320615c042f1ff5d94ebab8 (diff)
ide: set hwif->dev in ide_init_port_hw() (take 2)
* Add 'parent' field to hw_regs_t for optional parent device pointer (needed by macio PMAC IDE controllers) and set hwif->dev in ide_init_port_hw(). * Update au1xxx-ide.c, sgiioc4.c, pmac.c and setup-pci.c accordingly. v2: * Update scc_pata.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide.c3
-rw-r--r--drivers/ide/mips/au1xxx-ide.c2
-rw-r--r--drivers/ide/pci/scc_pata.c1
-rw-r--r--drivers/ide/pci/sgiioc4.c2
-rw-r--r--drivers/ide/ppc/pmac.c6
-rw-r--r--drivers/ide/setup-pci.c2
-rw-r--r--include/linux/ide.h2
7 files changed, 5 insertions, 13 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index b7855a13f0ef..9240888e5efd 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -297,7 +297,8 @@ void ide_init_port_hw(ide_hwif_t *hwif, hw_regs_t *hw)
297 memcpy(&hwif->io_ports, &hw->io_ports, sizeof(hwif->io_ports)); 297 memcpy(&hwif->io_ports, &hw->io_ports, sizeof(hwif->io_ports));
298 hwif->irq = hw->irq; 298 hwif->irq = hw->irq;
299 hwif->chipset = hw->chipset; 299 hwif->chipset = hw->chipset;
300 hwif->gendev.parent = hw->dev; 300 hwif->dev = hw->dev;
301 hwif->gendev.parent = hw->parent ? hw->parent : hw->dev;
301 hwif->ack_intr = hw->ack_intr; 302 hwif->ack_intr = hw->ack_intr;
302} 303}
303EXPORT_SYMBOL_GPL(ide_init_port_hw); 304EXPORT_SYMBOL_GPL(ide_init_port_hw);
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 1a6c27b32498..08c46c36b7e7 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -600,8 +600,6 @@ static int au_ide_probe(struct device *dev)
600 600
601 ide_init_port_hw(hwif, &hw); 601 ide_init_port_hw(hwif, &hw);
602 602
603 hwif->dev = dev;
604
605 /* If the user has selected DDMA assisted copies, 603 /* If the user has selected DDMA assisted copies,
606 then set up a few local I/O function entry points 604 then set up a few local I/O function entry points
607 */ 605 */
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index 1584ebb6a185..71bff3131b96 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -572,7 +572,6 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
572 hw.dev = &dev->dev; 572 hw.dev = &dev->dev;
573 hw.chipset = ide_pci; 573 hw.chipset = ide_pci;
574 ide_init_port_hw(hwif, &hw); 574 ide_init_port_hw(hwif, &hw);
575 hwif->dev = &dev->dev;
576 575
577 idx[0] = hwif->index; 576 idx[0] = hwif->index;
578 577
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 24513e3dcd6b..af91cc525789 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -625,8 +625,6 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
625 hw.dev = &dev->dev; 625 hw.dev = &dev->dev;
626 ide_init_port_hw(hwif, &hw); 626 ide_init_port_hw(hwif, &hw);
627 627
628 hwif->dev = &dev->dev;
629
630 /* The IOC4 uses MMIO rather than Port IO. */ 628 /* The IOC4 uses MMIO rather than Port IO. */
631 default_hwif_mmiops(hwif); 629 default_hwif_mmiops(hwif);
632 630
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index cfa103a51b31..93fb9067c043 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1148,8 +1148,6 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
1148 base = ioremap(macio_resource_start(mdev, 0), 0x400); 1148 base = ioremap(macio_resource_start(mdev, 0), 0x400);
1149 regbase = (unsigned long) base; 1149 regbase = (unsigned long) base;
1150 1150
1151 hwif->dev = &mdev->bus->pdev->dev;
1152
1153 pmif->mdev = mdev; 1151 pmif->mdev = mdev;
1154 pmif->node = mdev->ofdev.node; 1152 pmif->node = mdev->ofdev.node;
1155 pmif->regbase = regbase; 1153 pmif->regbase = regbase;
@@ -1171,7 +1169,8 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
1171 memset(&hw, 0, sizeof(hw)); 1169 memset(&hw, 0, sizeof(hw));
1172 pmac_ide_init_ports(&hw, pmif->regbase); 1170 pmac_ide_init_ports(&hw, pmif->regbase);
1173 hw.irq = irq; 1171 hw.irq = irq;
1174 hw.dev = &mdev->ofdev.dev; 1172 hw.dev = &mdev->bus->pdev->dev;
1173 hw.parent = &mdev->ofdev.dev;
1175 1174
1176 rc = pmac_ide_setup_device(pmif, hwif, &hw); 1175 rc = pmac_ide_setup_device(pmif, hwif, &hw);
1177 if (rc != 0) { 1176 if (rc != 0) {
@@ -1271,7 +1270,6 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1271 goto out_free_pmif; 1270 goto out_free_pmif;
1272 } 1271 }
1273 1272
1274 hwif->dev = &pdev->dev;
1275 pmif->mdev = NULL; 1273 pmif->mdev = NULL;
1276 pmif->node = np; 1274 pmif->node = np;
1277 1275
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index abcfb1739d4d..3dea5a59626e 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -346,8 +346,6 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev,
346 346
347 ide_init_port_hw(hwif, &hw); 347 ide_init_port_hw(hwif, &hw);
348 348
349 hwif->dev = &dev->dev;
350
351 return hwif; 349 return hwif;
352} 350}
353 351
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 15d5668198a6..a6a2eccb6526 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -171,7 +171,7 @@ typedef struct hw_regs_s {
171 int irq; /* our irq number */ 171 int irq; /* our irq number */
172 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 172 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
173 hwif_chipset_t chipset; 173 hwif_chipset_t chipset;
174 struct device *dev; 174 struct device *dev, *parent;
175} hw_regs_t; 175} hw_regs_t;
176 176
177void ide_init_port_data(struct hwif_s *, unsigned int); 177void ide_init_port_data(struct hwif_s *, unsigned int);