]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/of/device.c
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / drivers / of / device.c
index da81583920103f288e691d36f5c92f4709afae58..e9127db7b06761b1da4cafe68be72b2719324293 100644 (file)
@@ -93,7 +93,7 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
        bool coherent;
        unsigned long offset;
        const struct iommu_ops *iommu;
-       u64 mask;
+       u64 mask, end;
 
        ret = of_dma_get_range(np, &dma_addr, &paddr, &size);
        if (ret < 0) {
@@ -148,12 +148,13 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
         * Limit coherent and dma mask based on size and default mask
         * set by the driver.
         */
-       mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
+       end = dma_addr + size - 1;
+       mask = DMA_BIT_MASK(ilog2(end) + 1);
        dev->coherent_dma_mask &= mask;
        *dev->dma_mask &= mask;
-       /* ...but only set bus mask if we found valid dma-ranges earlier */
+       /* ...but only set bus limit if we found valid dma-ranges earlier */
        if (!ret)
-               dev->bus_dma_mask = mask;
+               dev->bus_dma_limit = end;
 
        coherent = of_dma_is_coherent(np);
        dev_dbg(dev, "device is%sdma coherent\n",