diff options
author | Becky Bruce <becky.bruce@freescale.com> | 2008-09-08 05:09:54 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-09-24 17:26:43 -0400 |
commit | 8fae0353247530d2124b2419052fa6120462fa99 (patch) | |
tree | 9690fc84a069869edb282508c40dc7f9a6aa1775 /arch/powerpc | |
parent | 8dd0e95206f7c33bed2aed33ac668335174684e8 (diff) |
powerpc: Drop archdata numa_node
Use the struct device's numa_node instead; use accessor functions
to get/set numa_node.
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/device.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/dma-iommu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/dma.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/of_device.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/vio.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/system-bus.c | 2 |
8 files changed, 10 insertions, 16 deletions
diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h index 228ab2a315b9..dfd504caccc1 100644 --- a/arch/powerpc/include/asm/device.h +++ b/arch/powerpc/include/asm/device.h | |||
@@ -16,9 +16,6 @@ struct dev_archdata { | |||
16 | /* DMA operations on that device */ | 16 | /* DMA operations on that device */ |
17 | struct dma_mapping_ops *dma_ops; | 17 | struct dma_mapping_ops *dma_ops; |
18 | void *dma_data; | 18 | void *dma_data; |
19 | |||
20 | /* NUMA node if applicable */ | ||
21 | int numa_node; | ||
22 | }; | 19 | }; |
23 | 20 | ||
24 | #endif /* _ASM_POWERPC_DEVICE_H */ | 21 | #endif /* _ASM_POWERPC_DEVICE_H */ |
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 01091f1d508c..49248f89ce23 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c | |||
@@ -20,7 +20,7 @@ static void *dma_iommu_alloc_coherent(struct device *dev, size_t size, | |||
20 | { | 20 | { |
21 | return iommu_alloc_coherent(dev, dev->archdata.dma_data, size, | 21 | return iommu_alloc_coherent(dev, dev->archdata.dma_data, size, |
22 | dma_handle, device_to_mask(dev), flag, | 22 | dma_handle, device_to_mask(dev), flag, |
23 | dev->archdata.numa_node); | 23 | dev_to_node(dev)); |
24 | } | 24 | } |
25 | 25 | ||
26 | static void dma_iommu_free_coherent(struct device *dev, size_t size, | 26 | static void dma_iommu_free_coherent(struct device *dev, size_t size, |
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 44e3486419e1..124f86743bde 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c | |||
@@ -29,7 +29,7 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
29 | { | 29 | { |
30 | struct page *page; | 30 | struct page *page; |
31 | void *ret; | 31 | void *ret; |
32 | int node = dev->archdata.numa_node; | 32 | int node = dev_to_node(dev); |
33 | 33 | ||
34 | page = alloc_pages_node(node, flag, get_order(size)); | 34 | page = alloc_pages_node(node, flag, get_order(size)); |
35 | if (page == NULL) | 35 | if (page == NULL) |
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c index e9be908f199b..93ae5b169f41 100644 --- a/arch/powerpc/kernel/of_device.c +++ b/arch/powerpc/kernel/of_device.c | |||
@@ -78,7 +78,7 @@ struct of_device *of_device_alloc(struct device_node *np, | |||
78 | dev->dev.parent = parent; | 78 | dev->dev.parent = parent; |
79 | dev->dev.release = of_release_dev; | 79 | dev->dev.release = of_release_dev; |
80 | dev->dev.archdata.of_node = np; | 80 | dev->dev.archdata.of_node = np; |
81 | dev->dev.archdata.numa_node = of_node_to_nid(np); | 81 | set_dev_node(&dev->dev, of_node_to_nid(np)); |
82 | 82 | ||
83 | if (bus_id) | 83 | if (bus_id) |
84 | strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); | 84 | strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 30eedfc5a566..1f75bf03446f 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -558,11 +558,8 @@ void __devinit pcibios_setup_new_device(struct pci_dev *dev) | |||
558 | sd->of_node ? sd->of_node->full_name : "<none>"); | 558 | sd->of_node ? sd->of_node->full_name : "<none>"); |
559 | 559 | ||
560 | sd->dma_ops = pci_dma_ops; | 560 | sd->dma_ops = pci_dma_ops; |
561 | #ifdef CONFIG_NUMA | 561 | set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); |
562 | sd->numa_node = pcibus_to_node(dev->bus); | 562 | |
563 | #else | ||
564 | sd->numa_node = -1; | ||
565 | #endif | ||
566 | if (ppc_md.pci_dma_dev_setup) | 563 | if (ppc_md.pci_dma_dev_setup) |
567 | ppc_md.pci_dma_dev_setup(dev); | 564 | ppc_md.pci_dma_dev_setup(dev); |
568 | } | 565 | } |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 2750fbab1975..434c92a85c03 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -1232,7 +1232,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) | |||
1232 | else | 1232 | else |
1233 | viodev->dev.archdata.dma_ops = &dma_iommu_ops; | 1233 | viodev->dev.archdata.dma_ops = &dma_iommu_ops; |
1234 | viodev->dev.archdata.dma_data = vio_build_iommu_table(viodev); | 1234 | viodev->dev.archdata.dma_data = vio_build_iommu_table(viodev); |
1235 | viodev->dev.archdata.numa_node = of_node_to_nid(of_node); | 1235 | set_dev_node(&viodev->dev, of_node_to_nid(of_node)); |
1236 | 1236 | ||
1237 | /* init generic 'struct device' fields: */ | 1237 | /* init generic 'struct device' fields: */ |
1238 | viodev->dev.parent = &vio_bus_device.dev; | 1238 | viodev->dev.parent = &vio_bus_device.dev; |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index e06420af5fe9..ef92e7146215 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -556,11 +556,11 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev) | |||
556 | * node's iommu. We -might- do something smarter later though it may | 556 | * node's iommu. We -might- do something smarter later though it may |
557 | * never be necessary | 557 | * never be necessary |
558 | */ | 558 | */ |
559 | iommu = cell_iommu_for_node(archdata->numa_node); | 559 | iommu = cell_iommu_for_node(dev_to_node(dev)); |
560 | if (iommu == NULL || list_empty(&iommu->windows)) { | 560 | if (iommu == NULL || list_empty(&iommu->windows)) { |
561 | printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", | 561 | printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", |
562 | archdata->of_node ? archdata->of_node->full_name : "?", | 562 | archdata->of_node ? archdata->of_node->full_name : "?", |
563 | archdata->numa_node); | 563 | dev_to_node(dev)); |
564 | return NULL; | 564 | return NULL; |
565 | } | 565 | } |
566 | window = list_entry(iommu->windows.next, struct iommu_window, list); | 566 | window = list_entry(iommu->windows.next, struct iommu_window, list); |
@@ -577,7 +577,7 @@ static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, | |||
577 | return iommu_alloc_coherent(dev, cell_get_iommu_table(dev), | 577 | return iommu_alloc_coherent(dev, cell_get_iommu_table(dev), |
578 | size, dma_handle, | 578 | size, dma_handle, |
579 | device_to_mask(dev), flag, | 579 | device_to_mask(dev), flag, |
580 | dev->archdata.numa_node); | 580 | dev_to_node(dev)); |
581 | else | 581 | else |
582 | return dma_direct_ops.alloc_coherent(dev, size, dma_handle, | 582 | return dma_direct_ops.alloc_coherent(dev, size, dma_handle, |
583 | flag); | 583 | flag); |
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 280ee88cb0b0..a789bf58ca8b 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -762,7 +762,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev) | |||
762 | }; | 762 | }; |
763 | 763 | ||
764 | dev->core.archdata.of_node = NULL; | 764 | dev->core.archdata.of_node = NULL; |
765 | dev->core.archdata.numa_node = 0; | 765 | set_dev_node(&dev->core, 0); |
766 | 766 | ||
767 | pr_debug("%s:%d add %s\n", __func__, __LINE__, dev->core.bus_id); | 767 | pr_debug("%s:%d add %s\n", __func__, __LINE__, dev->core.bus_id); |
768 | 768 | ||