Commit 7f0fee24 authored by Christoph Hellwig's avatar Christoph Hellwig

dma-mapping: merge dma_unmap_page_attrs and dma_unmap_single_attrs

The two functions are exactly the same, so don't bother implementing
them twice.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Tested-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Tested-by: default avatarTony Luck <tony.luck@intel.com>
parent 8d59b5f2
...@@ -253,6 +253,12 @@ static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr, ...@@ -253,6 +253,12 @@ static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
debug_dma_unmap_page(dev, addr, size, dir, true); debug_dma_unmap_page(dev, addr, size, dir, true);
} }
static inline void dma_unmap_page_attrs(struct device *dev, dma_addr_t addr,
size_t size, enum dma_data_direction dir, unsigned long attrs)
{
return dma_unmap_single_attrs(dev, addr, size, dir, attrs);
}
/* /*
* dma_maps_sg_attrs returns 0 on error and > 0 on success. * dma_maps_sg_attrs returns 0 on error and > 0 on success.
* It should never return a value < 0. * It should never return a value < 0.
...@@ -300,19 +306,6 @@ static inline dma_addr_t dma_map_page_attrs(struct device *dev, ...@@ -300,19 +306,6 @@ static inline dma_addr_t dma_map_page_attrs(struct device *dev,
return addr; return addr;
} }
static inline void dma_unmap_page_attrs(struct device *dev,
dma_addr_t addr, size_t size,
enum dma_data_direction dir,
unsigned long attrs)
{
const struct dma_map_ops *ops = get_dma_ops(dev);
BUG_ON(!valid_dma_direction(dir));
if (ops->unmap_page)
ops->unmap_page(dev, addr, size, dir, attrs);
debug_dma_unmap_page(dev, addr, size, dir, false);
}
static inline dma_addr_t dma_map_resource(struct device *dev, static inline dma_addr_t dma_map_resource(struct device *dev,
phys_addr_t phys_addr, phys_addr_t phys_addr,
size_t size, size_t size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment