diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-30 01:42:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-30 01:42:34 -0400 |
commit | ae05f87ee2f403228bca6d28fef29d6be0bfbedc (patch) | |
tree | 141c399c8ec29bea82b2b803d8df19664a792021 /arch/sparc64/kernel/pci.c | |
parent | e21e245bcd9d5244735799387d14421789b20557 (diff) |
sparc64: Propagate PCI device archdata into OF device tree for EBUS.
In order to convert EBUS drivers doing DMA into pure OF drivers,
we need the of_device->dev.archdata setup properly.
EBUS instances that can provide DMA for device nodes sit on PCI,
so detect and propagate the information there.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 9bb4b8cbcacb..71d423a1c17a 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -337,6 +337,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
337 | struct pci_bus *bus, int devfn) | 337 | struct pci_bus *bus, int devfn) |
338 | { | 338 | { |
339 | struct dev_archdata *sd; | 339 | struct dev_archdata *sd; |
340 | struct of_device *op; | ||
340 | struct pci_dev *dev; | 341 | struct pci_dev *dev; |
341 | const char *type; | 342 | const char *type; |
342 | u32 class; | 343 | u32 class; |
@@ -350,14 +351,17 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
350 | sd->stc = &pbm->stc; | 351 | sd->stc = &pbm->stc; |
351 | sd->host_controller = pbm; | 352 | sd->host_controller = pbm; |
352 | sd->prom_node = node; | 353 | sd->prom_node = node; |
353 | sd->op = of_find_device_by_node(node); | 354 | sd->op = op = of_find_device_by_node(node); |
354 | sd->numa_node = pbm->numa_node; | 355 | sd->numa_node = pbm->numa_node; |
355 | 356 | ||
356 | sd = &sd->op->dev.archdata; | 357 | sd = &op->dev.archdata; |
357 | sd->iommu = pbm->iommu; | 358 | sd->iommu = pbm->iommu; |
358 | sd->stc = &pbm->stc; | 359 | sd->stc = &pbm->stc; |
359 | sd->numa_node = pbm->numa_node; | 360 | sd->numa_node = pbm->numa_node; |
360 | 361 | ||
362 | if (!strcmp(node->name, "ebus")) | ||
363 | of_propagate_archdata(op); | ||
364 | |||
361 | type = of_get_property(node, "device_type", NULL); | 365 | type = of_get_property(node, "device_type", NULL); |
362 | if (type == NULL) | 366 | if (type == NULL) |
363 | type = ""; | 367 | type = ""; |