powerpc/macio: Ensure all dma routines get copied over
authorNishanth Aravamudan <nacc@us.ibm.com>
Tue, 26 Oct 2010 17:35:11 +0000 (17:35 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 29 Nov 2010 04:48:21 +0000 (15:48 +1100)
Also add a comment to dev_archdata, indicating that changes there need
to be verified against the driver code.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/device.h
drivers/macintosh/macio_asic.c

index a3954e4..16d25c0 100644 (file)
@@ -9,6 +9,12 @@
 struct dma_map_ops;
 struct device_node;
 
+/*
+ * Arch extensions to struct device.
+ *
+ * When adding fields, consider macio_add_one_device in
+ * drivers/macintosh/macio_asic.c
+ */
 struct dev_archdata {
        /* DMA operations on that device */
        struct dma_map_ops      *dma_ops;
index b6e7ddc..4daf9e5 100644 (file)
@@ -387,11 +387,10 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
        /* Set the DMA ops to the ones from the PCI device, this could be
         * fishy if we didn't know that on PowerMac it's always direct ops
         * or iommu ops that will work fine
+        *
+        * To get all the fields, copy all archdata
         */
-       dev->ofdev.dev.archdata.dma_ops =
-               chip->lbus.pdev->dev.archdata.dma_ops;
-       dev->ofdev.dev.archdata.dma_data =
-               chip->lbus.pdev->dev.archdata.dma_data;
+       dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
 #endif /* CONFIG_PCI */
 
 #ifdef DEBUG