Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123014
b: refs/heads/master
c: c73049f
h: refs/heads/master
v: v3
  • Loading branch information
Mark Nelson authored and Paul Mackerras committed Nov 5, 2008
1 parent b1aca5d commit b7d162f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7eef440a545c7f812ed10b49d4a10a351df9cad6
refs/heads/master: c73049f6aa58ac1d1a9ca8cb2b415ef97240b2d3
36 changes: 5 additions & 31 deletions trunk/arch/powerpc/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ struct dma_mapping_ops {
dma_addr_t *dma_handle, gfp_t flag);
void (*free_coherent)(struct device *dev, size_t size,
void *vaddr, dma_addr_t dma_handle);
dma_addr_t (*map_single)(struct device *dev, void *ptr,
size_t size, enum dma_data_direction direction,
struct dma_attrs *attrs);
void (*unmap_single)(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction direction,
struct dma_attrs *attrs);
int (*map_sg)(struct device *dev, struct scatterlist *sg,
int nents, enum dma_data_direction direction,
struct dma_attrs *attrs);
Expand Down Expand Up @@ -149,10 +143,9 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
}

/*
* TODO: map_/unmap_single will ideally go away, to be completely
* replaced by map/unmap_page. Until then, we allow dma_ops to have
* one or the other, or both by checking to see if the specific
* function requested exists; and if not, falling back on the other set.
* map_/unmap_single actually call through to map/unmap_page now that all the
* dma_mapping_ops have been converted over. We just have to get the page and
* offset to pass through to map_page
*/
static inline dma_addr_t dma_map_single_attrs(struct device *dev,
void *cpu_addr,
Expand All @@ -164,10 +157,6 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev,

BUG_ON(!dma_ops);

if (dma_ops->map_single)
return dma_ops->map_single(dev, cpu_addr, size, direction,
attrs);

return dma_ops->map_page(dev, virt_to_page(cpu_addr),
(unsigned long)cpu_addr % PAGE_SIZE, size,
direction, attrs);
Expand All @@ -183,11 +172,6 @@ static inline void dma_unmap_single_attrs(struct device *dev,

BUG_ON(!dma_ops);

if (dma_ops->unmap_single) {
dma_ops->unmap_single(dev, dma_addr, size, direction, attrs);
return;
}

dma_ops->unmap_page(dev, dma_addr, size, direction, attrs);
}

Expand All @@ -201,12 +185,7 @@ static inline dma_addr_t dma_map_page_attrs(struct device *dev,

BUG_ON(!dma_ops);

if (dma_ops->map_page)
return dma_ops->map_page(dev, page, offset, size, direction,
attrs);

return dma_ops->map_single(dev, page_address(page) + offset, size,
direction, attrs);
return dma_ops->map_page(dev, page, offset, size, direction, attrs);
}

static inline void dma_unmap_page_attrs(struct device *dev,
Expand All @@ -219,12 +198,7 @@ static inline void dma_unmap_page_attrs(struct device *dev,

BUG_ON(!dma_ops);

if (dma_ops->unmap_page) {
dma_ops->unmap_page(dev, dma_address, size, direction, attrs);
return;
}

dma_ops->unmap_single(dev, dma_address, size, direction, attrs);
dma_ops->unmap_page(dev, dma_address, size, direction, attrs);
}

static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
Expand Down

0 comments on commit b7d162f

Please sign in to comment.