Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34063
b: refs/heads/master
c: 5d33eeb
h: refs/heads/master
i:
  34061: 69c296e
  34059: ff576aa
  34055: 0115ce4
  34047: 2c5286a
v: v3
  • Loading branch information
Jeremy Kerr authored and Paul Mackerras committed Jul 31, 2006
1 parent e9a61e1 commit 914e3f4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 38 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: 931b261f442e779b0656d9b04c7ffe4939ef8c0a
refs/heads/master: 5d33eebee83784f5f03bc3861fa92ee5cd831922
65 changes: 28 additions & 37 deletions trunk/arch/powerpc/kernel/dma_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ int dma_supported(struct device *dev, u64 mask)
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
return dma_ops->dma_supported(dev, mask);
BUG();
return 0;
BUG_ON(!dma_ops);

return dma_ops->dma_supported(dev, mask);
}
EXPORT_SYMBOL(dma_supported);

Expand Down Expand Up @@ -66,10 +65,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
BUG();
return NULL;
BUG_ON(!dma_ops);

return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
}
EXPORT_SYMBOL(dma_alloc_coherent);

Expand All @@ -78,10 +76,9 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
else
BUG();
BUG_ON(!dma_ops);

dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
}
EXPORT_SYMBOL(dma_free_coherent);

Expand All @@ -90,10 +87,9 @@ dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
return dma_ops->map_single(dev, cpu_addr, size, direction);
BUG();
return (dma_addr_t)0;
BUG_ON(!dma_ops);

return dma_ops->map_single(dev, cpu_addr, size, direction);
}
EXPORT_SYMBOL(dma_map_single);

Expand All @@ -102,10 +98,9 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
dma_ops->unmap_single(dev, dma_addr, size, direction);
else
BUG();
BUG_ON(!dma_ops);

dma_ops->unmap_single(dev, dma_addr, size, direction);
}
EXPORT_SYMBOL(dma_unmap_single);

Expand All @@ -115,11 +110,10 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
return dma_ops->map_single(dev,
(page_address(page) + offset), size, direction);
BUG();
return (dma_addr_t)0;
BUG_ON(!dma_ops);

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

Expand All @@ -128,10 +122,9 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
dma_ops->unmap_single(dev, dma_address, size, direction);
else
BUG();
BUG_ON(!dma_ops);

dma_ops->unmap_single(dev, dma_address, size, direction);
}
EXPORT_SYMBOL(dma_unmap_page);

Expand All @@ -140,10 +133,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
return dma_ops->map_sg(dev, sg, nents, direction);
BUG();
return 0;
BUG_ON(!dma_ops);

return dma_ops->map_sg(dev, sg, nents, direction);
}
EXPORT_SYMBOL(dma_map_sg);

Expand All @@ -152,9 +144,8 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
{
struct dma_mapping_ops *dma_ops = get_dma_ops(dev);

if (dma_ops)
dma_ops->unmap_sg(dev, sg, nhwentries, direction);
else
BUG();
BUG_ON(!dma_ops);

dma_ops->unmap_sg(dev, sg, nhwentries, direction);
}
EXPORT_SYMBOL(dma_unmap_sg);

0 comments on commit 914e3f4

Please sign in to comment.