Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm
[cascardo/linux.git] / drivers / of / platform.c
index f6dcde2..404d1da 100644 (file)
@@ -215,6 +215,8 @@ static struct platform_device *of_platform_device_create_pdata(
        dev->archdata.dma_mask = 0xffffffffUL;
 #endif
        dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+       if (!dev->dev.dma_mask)
+               dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
        dev->dev.bus = &platform_bus_type;
        dev->dev.platform_data = platform_data;
 
@@ -280,9 +282,6 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
        else
                of_device_make_bus_id(&dev->dev);
 
-       /* setup amba-specific device info */
-       dev->dma_mask = ~0;
-
        /* Allow the HW Peripheral ID to be overridden */
        prop = of_get_property(node, "arm,primecell-periphid", NULL);
        if (prop)