aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/dma-mapping.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-05-20 18:54:22 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-20 18:55:23 -0400
commit88a984ba0795f14a3847edbd7fabe652289ea89b (patch)
treecf82c612f595bf8296892ca5bfb0672d6d6f6f0f /drivers/base/dma-mapping.c
parent77f2ea2f8d0833f9e976368481fb9a0775acf9e7 (diff)
DMA-API: Change dma_declare_coherent_memory() CPU address to phys_addr_t
dma_declare_coherent_memory() takes two addresses for a region of memory: a "bus_addr" and a "device_addr". I think the intent is that "bus_addr" is the physical address a *CPU* would use to access the region, and "device_addr" is the bus address the *device* would use to address the region. Rename "bus_addr" to "phys_addr" and change its type to phys_addr_t. Most callers already supply a phys_addr_t for this argument. The others supply a 32-bit integer (a constant, unsigned int, or __u32) and need no change. Use "unsigned long", not phys_addr_t, to hold PFNs. No functional change (this could theoretically fix a truncation in a config with 32-bit dma_addr_t and 64-bit phys_addr_t, but I don't think there are any such cases involving this code). Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: James Bottomley <jbottomley@Parallels.com> Acked-by: Randy Dunlap <rdunlap@infradead.org>
Diffstat (limited to 'drivers/base/dma-mapping.c')
-rw-r--r--drivers/base/dma-mapping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c
index 0ce39a33b3c2..6cd08e145bfa 100644
--- a/drivers/base/dma-mapping.c
+++ b/drivers/base/dma-mapping.c
@@ -175,7 +175,7 @@ static void dmam_coherent_decl_release(struct device *dev, void *res)
175/** 175/**
176 * dmam_declare_coherent_memory - Managed dma_declare_coherent_memory() 176 * dmam_declare_coherent_memory - Managed dma_declare_coherent_memory()
177 * @dev: Device to declare coherent memory for 177 * @dev: Device to declare coherent memory for
178 * @bus_addr: Bus address of coherent memory to be declared 178 * @phys_addr: Physical address of coherent memory to be declared
179 * @device_addr: Device address of coherent memory to be declared 179 * @device_addr: Device address of coherent memory to be declared
180 * @size: Size of coherent memory to be declared 180 * @size: Size of coherent memory to be declared
181 * @flags: Flags 181 * @flags: Flags
@@ -185,7 +185,7 @@ static void dmam_coherent_decl_release(struct device *dev, void *res)
185 * RETURNS: 185 * RETURNS:
186 * 0 on success, -errno on failure. 186 * 0 on success, -errno on failure.
187 */ 187 */
188int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, 188int dmam_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
189 dma_addr_t device_addr, size_t size, int flags) 189 dma_addr_t device_addr, size_t size, int flags)
190{ 190{
191 void *res; 191 void *res;
@@ -195,7 +195,7 @@ int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
195 if (!res) 195 if (!res)
196 return -ENOMEM; 196 return -ENOMEM;
197 197
198 rc = dma_declare_coherent_memory(dev, bus_addr, device_addr, size, 198 rc = dma_declare_coherent_memory(dev, phys_addr, device_addr, size,
199 flags); 199 flags);
200 if (rc == 0) 200 if (rc == 0)
201 devres_add(dev, res); 201 devres_add(dev, res);