arch/powerpc: Move dma_mask from of_device into pdev_archdata
authorGrant Likely <grant.likely@secretlab.ca>
Tue, 13 Apr 2010 23:12:59 +0000 (16:12 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Sat, 22 May 2010 06:10:40 +0000 (00:10 -0600)
By moving dma_mask into pdev_archdata, and adding archdata to
struct of_device, it makes it possible to substitute of_device
with struct platform_device, which is a stepping stone to
removing the of_platform bus entirely.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
arch/powerpc/include/asm/device.h
arch/powerpc/include/asm/of_device.h
arch/powerpc/kernel/of_device.c
arch/powerpc/kernel/of_platform.c
drivers/macintosh/macio_asic.c
sound/aoa/soundbus/i2sbus/core.c

index f23f8d8bd68d3246756c90da87dd0f9376f08804..a3954e4fcbe2edbc5466e8d2ff4bffb16ca57312 100644 (file)
@@ -28,6 +28,7 @@ struct dev_archdata {
 };
 
 struct pdev_archdata {
+       u64 dma_mask;
 };
 
 #endif /* _ASM_POWERPC_DEVICE_H */
index 8b26f96b9f9ec6ec51f0a7e8a406c5f9acfe47d0..444e97e2982ea54cef41240b2ff2ea85ee1db761 100644 (file)
@@ -12,8 +12,8 @@
  */
 struct of_device
 {
-       u64                     dma_mask;       /* DMA mask */
        struct device           dev;            /* Generic device interface */
+       struct pdev_archdata    archdata;
 };
 
 extern struct of_device *of_device_alloc(struct device_node *np,
index 20b3474b6f6baf0f14109d4d3fe4641997c3aa98..df78e0236a02b808fe9c863f8721d92c164c0f97 100644 (file)
@@ -70,7 +70,7 @@ struct of_device *of_device_alloc(struct device_node *np,
                return NULL;
 
        dev->dev.of_node = of_node_get(np);
-       dev->dev.dma_mask = &dev->dma_mask;
+       dev->dev.dma_mask = &dev->archdata.dma_mask;
        dev->dev.parent = parent;
        dev->dev.release = of_release_dev;
 
index 1c747c474415a4aeb13b189ed5bd7cc41f903584..218853466510bd1c72d3ad64191df5f447afa867 100644 (file)
@@ -74,7 +74,7 @@ struct of_device* of_platform_device_create(struct device_node *np,
        if (!dev)
                return NULL;
 
-       dev->dma_mask = 0xffffffffUL;
+       dev->archdata.dma_mask = 0xffffffffUL;
        dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
        dev->dev.bus = &of_platform_bus_type;
index 67fe13ffe90b3555445f6b1bd89cd06596fccb63..48a5f040686543f73337c2257e90df0761094f80 100644 (file)
@@ -374,8 +374,8 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
        dev->bus = &chip->lbus;
        dev->media_bay = in_bay;
        dev->ofdev.dev.of_node = np;
-       dev->ofdev.dma_mask = 0xffffffffUL;
-       dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask;
+       dev->ofdev.archdata.dma_mask = 0xffffffffUL;
+       dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
        dev->ofdev.dev.parent = parent;
        dev->ofdev.dev.bus = &macio_bus_type;
        dev->ofdev.dev.release = macio_release_dev;
index 7672b4d145ae94dd5f85640722fe5eb1dcdb3aee..67893372173581601fbcd5c71ca9c30cab0b5a7a 100644 (file)
@@ -221,9 +221,9 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 
        mutex_init(&dev->lock);
        spin_lock_init(&dev->low_lock);
-       dev->sound.ofdev.dma_mask = macio->ofdev.dma_mask;
+       dev->sound.ofdev.archdata.dma_mask = macio->ofdev.archdata.dma_mask;
        dev->sound.ofdev.dev.of_node = np;
-       dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.dma_mask;
+       dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.archdata.dma_mask;
        dev->sound.ofdev.dev.parent = &macio->ofdev.dev;
        dev->sound.ofdev.dev.release = i2sbus_release_dev;
        dev->sound.attach_codec = i2sbus_attach_codec;