powerpc: Drop archdata numa_node
authorBecky Bruce <becky.bruce@freescale.com>
Mon, 8 Sep 2008 09:09:54 +0000 (09:09 +0000)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 24 Sep 2008 21:26:43 +0000 (16:26 -0500)
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>
arch/powerpc/include/asm/device.h
arch/powerpc/kernel/dma-iommu.c
arch/powerpc/kernel/dma.c
arch/powerpc/kernel/of_device.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/vio.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/ps3/system-bus.c

index 228ab2a315b9cd1354004bb96a77419574c52af8..dfd504caccc1c711216adc077b351eb5710f32ca 100644 (file)
@@ -16,9 +16,6 @@ struct dev_archdata {
        /* DMA operations on that device */
        struct dma_mapping_ops  *dma_ops;
        void                    *dma_data;
-
-       /* NUMA node if applicable */
-       int                     numa_node;
 };
 
 #endif /* _ASM_POWERPC_DEVICE_H */
index 01091f1d508cb4e3dc8e85ef87baa94dec8ab828..49248f89ce23b19c6b57a04c32e6c36d8ac31e9d 100644 (file)
@@ -20,7 +20,7 @@ static void *dma_iommu_alloc_coherent(struct device *dev, size_t size,
 {
        return iommu_alloc_coherent(dev, dev->archdata.dma_data, size,
                                    dma_handle, device_to_mask(dev), flag,
-                                   dev->archdata.numa_node);
+                                   dev_to_node(dev));
 }
 
 static void dma_iommu_free_coherent(struct device *dev, size_t size,
index 44e3486419e17ff1998dc47a8ecdbf4048cb94a7..124f86743bdef1baa22c61f2a33a81534424d418 100644 (file)
@@ -29,7 +29,7 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
 {
        struct page *page;
        void *ret;
-       int node = dev->archdata.numa_node;
+       int node = dev_to_node(dev);
 
        page = alloc_pages_node(node, flag, get_order(size));
        if (page == NULL)
index e9be908f199b6fa46ee4ec2226316db2ad1702c6..93ae5b169f418b59e9fd7dadc1f5b89890a9d6fc 100644 (file)
@@ -78,7 +78,7 @@ struct of_device *of_device_alloc(struct device_node *np,
        dev->dev.parent = parent;
        dev->dev.release = of_release_dev;
        dev->dev.archdata.of_node = np;
-       dev->dev.archdata.numa_node = of_node_to_nid(np);
+       set_dev_node(&dev->dev, of_node_to_nid(np));
 
        if (bus_id)
                strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
index 30eedfc5a566d4411caf634f564d5af0225d0ef5..1f75bf03446f953f0ffa8fcca065b3dab5193ae4 100644 (file)
@@ -558,11 +558,8 @@ void __devinit pcibios_setup_new_device(struct pci_dev *dev)
            sd->of_node ? sd->of_node->full_name : "<none>");
 
        sd->dma_ops = pci_dma_ops;
-#ifdef CONFIG_NUMA
-       sd->numa_node = pcibus_to_node(dev->bus);
-#else
-       sd->numa_node = -1;
-#endif
+       set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
+
        if (ppc_md.pci_dma_dev_setup)
                ppc_md.pci_dma_dev_setup(dev);
 }
index 2750fbab1975b2e7e4c84d48a67589385aeb9e40..434c92a85c037431512e96f16b4e9ea49265a6c6 100644 (file)
@@ -1232,7 +1232,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
        else
                viodev->dev.archdata.dma_ops = &dma_iommu_ops;
        viodev->dev.archdata.dma_data = vio_build_iommu_table(viodev);
-       viodev->dev.archdata.numa_node = of_node_to_nid(of_node);
+       set_dev_node(&viodev->dev, of_node_to_nid(of_node));
 
        /* init generic 'struct device' fields: */
        viodev->dev.parent = &vio_bus_device.dev;
index e06420af5fe9116cd007645594ee6cd0a962a6ea..ef92e71462151efc9e97c26c0c7442ad7a8c4caf 100644 (file)
@@ -556,11 +556,11 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev)
         * node's iommu. We -might- do something smarter later though it may
         * never be necessary
         */
-       iommu = cell_iommu_for_node(archdata->numa_node);
+       iommu = cell_iommu_for_node(dev_to_node(dev));
        if (iommu == NULL || list_empty(&iommu->windows)) {
                printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
                       archdata->of_node ? archdata->of_node->full_name : "?",
-                      archdata->numa_node);
+                      dev_to_node(dev));
                return NULL;
        }
        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,
                return iommu_alloc_coherent(dev, cell_get_iommu_table(dev),
                                            size, dma_handle,
                                            device_to_mask(dev), flag,
-                                           dev->archdata.numa_node);
+                                           dev_to_node(dev));
        else
                return dma_direct_ops.alloc_coherent(dev, size, dma_handle,
                                                     flag);
index 280ee88cb0b001c21449c18694d498a9c58e6de0..a789bf58ca8b83bb60b98de3d2641cab5b52705c 100644 (file)
@@ -762,7 +762,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
        };
 
        dev->core.archdata.of_node = NULL;
-       dev->core.archdata.numa_node = 0;
+       set_dev_node(&dev->core, 0);
 
        pr_debug("%s:%d add %s\n", __func__, __LINE__, dev->core.bus_id);