arch/microblaze: Move dma_mask from of_device into pdev_archdata
authorGrant Likely <grant.likely@secretlab.ca>
Tue, 13 Apr 2010 23:13:00 +0000 (16:13 -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/microblaze/include/asm/device.h
arch/microblaze/include/asm/of_device.h
arch/microblaze/kernel/of_device.c
arch/microblaze/kernel/of_platform.c

index 15b0058aa7ffa3108eee796ca866ae4b8cf7d855..123b2fe72d01f93a82076a87548e1050bead7d07 100644 (file)
@@ -18,6 +18,7 @@ struct dev_archdata {
 };
 
 struct pdev_archdata {
+       u64 dma_mask;
 };
 
 #endif /* _ASM_MICROBLAZE_DEVICE_H */
index ab25a40b481c69c3121995a3dba20386e8f340bb..73cb98040982434f87c4761616186b3c004bd51d 100644 (file)
@@ -21,8 +21,8 @@
  * probed using OF properties.
  */
 struct of_device {
-       u64                     dma_mask; /* DMA mask */
        struct device           dev; /* Generic device interface */
+       struct pdev_archdata    archdata;
 };
 
 extern ssize_t of_device_get_modalias(struct of_device *ofdev,
index ac7e6e10d0abc7cf7b950b3e5b756735e79cc5c2..b372787886ed5b5df23beeb663e4ea9067d9b7b1 100644 (file)
@@ -50,7 +50,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 46a1e105a6bd3daafed2b83ca94c5acc53344957..ccf6f4257f4b83b24893818ad393b251f3f7b5e7 100644 (file)
@@ -47,7 +47,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.bus = &of_platform_bus_type;
 
        /* We do not fill the DMA ops for platform devices by default.