summaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel/pci_sabre.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-09 23:54:02 -0700
committerDavid S. Miller <davem@davemloft.net>2008-09-10 23:07:41 -0700
commitd3ae4b5bc7186a53731d35187ad4ba3bca147cf6 (patch)
tree53fbab0e70a170a3f6576e44e0b65fdbffe33258 /arch/sparc64/kernel/pci_sabre.c
parentab138c031f72f6d030afa1a06a3a537e85ae843e (diff)
sparc64: Get rid of pci_controller_info.
It is just used as a parent to encapsulate two PBM objects. But that layout is only really relevant and necessary for psycho PCI controllers, which unlike all the others share a single IOMMU instance between sibling PCI busses. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_sabre.c')
-rw-r--r--arch/sparc64/kernel/pci_sabre.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 707d6d6130f7..8f779b58d65a 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -734,8 +734,8 @@ static int sabre_iommu_init(struct pci_pbm_info *pbm,
return 0;
}
-static void __init sabre_pbm_init(struct pci_controller_info *p,
- struct pci_pbm_info *pbm, struct of_device *op)
+static void __init sabre_pbm_init(struct pci_pbm_info *pbm,
+ struct of_device *op)
{
struct device_node *dp = op->node;
@@ -750,7 +750,6 @@ static void __init sabre_pbm_init(struct pci_controller_info *p,
pbm->index = pci_num_pbms++;
pbm->chip_type = PBM_CHIP_TYPE_SABRE;
- pbm->parent = p;
pbm->prom_node = dp;
pci_get_pbm_props(pbm);
@@ -764,7 +763,6 @@ static int __devinit sabre_probe(struct of_device *op,
{
const struct linux_prom64_registers *pr_regs;
struct device_node *dp = op->node;
- struct pci_controller_info *p;
struct pci_pbm_info *pbm;
u32 upa_portid, dma_mask;
struct iommu *iommu;
@@ -786,26 +784,22 @@ static int __devinit sabre_probe(struct of_device *op,
}
err = -ENOMEM;
- p = kzalloc(sizeof(*p), GFP_ATOMIC);
- if (!p) {
- printk(KERN_ERR PFX "Cannot allocate controller info.\n");
+ pbm = kzalloc(sizeof(*pbm), GFP_KERNEL);
+ if (!pbm) {
+ printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n");
goto out_err;
}
- iommu = kzalloc(sizeof(*iommu), GFP_ATOMIC);
+ iommu = kzalloc(sizeof(*iommu), GFP_KERNEL);
if (!iommu) {
printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n");
goto out_free_controller;
}
- pbm = &p->pbm_A;
pbm->iommu = iommu;
upa_portid = of_getintprop_default(dp, "upa-portid", 0xff);
- pbm->next = pci_pbm_root;
- pci_pbm_root = pbm;
-
pbm->portid = upa_portid;
/*
@@ -840,8 +834,7 @@ static int __devinit sabre_probe(struct of_device *op,
SABRE_PCICTRL_ARBPARK | SABRE_PCICTRL_AEN));
/* Now map in PCI config space for entire SABRE. */
- pbm->config_space =
- (pbm->controller_regs + SABRE_CONFIGSPACE);
+ pbm->config_space = pbm->controller_regs + SABRE_CONFIGSPACE;
vdma = of_get_property(dp, "virtual-dma", NULL);
if (!vdma) {
@@ -876,14 +869,20 @@ static int __devinit sabre_probe(struct of_device *op,
/*
* Look for APB underneath.
*/
- sabre_pbm_init(p, pbm, op);
+ sabre_pbm_init(pbm, op);
+
+ pbm->next = pci_pbm_root;
+ pci_pbm_root = pbm;
+
+ dev_set_drvdata(&op->dev, pbm);
+
return 0;
out_free_iommu:
- kfree(p->pbm_A.iommu);
+ kfree(pbm->iommu);
out_free_controller:
- kfree(p);
+ kfree(pbm);
out_err:
return err;