Skip to content

Commit

Permalink
treewide: Consolidate set_dma_ops() implementations
Browse files Browse the repository at this point in the history
Now that all set_dma_ops() implementations are identical (ignoring
BUG_ON() statements), remove the architecture specific definitions
and add a definition in <linux/dma-mapping.h>.

Signed-off-by: Bart Van Assche <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Paul Mackerras <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
Bart Van Assche authored and dledford committed Jan 24, 2017
1 parent 5657933 commit ca6e8e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
6 changes: 0 additions & 6 deletions arch/arm/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
return __generic_dma_ops(dev);
}

static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
{
BUG_ON(!dev);
dev->dma_ops = ops;
}

#define HAVE_ARCH_DMA_SUPPORTED 1
extern int dma_supported(struct device *dev, u64 mask);

Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
return dev->dma_ops;
}

static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
{
dev->dma_ops = ops;
}

/*
* get_dma_offset()
*
Expand Down
5 changes: 0 additions & 5 deletions arch/tile/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)

static inline void dma_mark_clean(void *addr, size_t size) {}

static inline void set_dma_ops(struct device *dev, const struct dma_map_ops *ops)
{
dev->dma_ops = ops;
}

static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
{
if (!dev->dma_mask)
Expand Down
5 changes: 5 additions & 0 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,

#ifdef CONFIG_HAS_DMA
#include <asm/dma-mapping.h>
static inline void set_dma_ops(struct device *dev,
const struct dma_map_ops *dma_ops)
{
dev->dma_ops = dma_ops;
}
#else
/*
* Define the dma api to allow compilation but not linking of
Expand Down

0 comments on commit ca6e8e1

Please sign in to comment.