Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309539
b: refs/heads/master
c: 87e677c
h: refs/heads/master
i:
  309537: efac410
  309535: 5fe74cb
v: v3
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed May 28, 2012
1 parent f9830d6 commit 005e22c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 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: 556626adf1dc1ee88183b7ba267912b87b063a57
refs/heads/master: 87e677c4122e732dd1f7142ba7b2d4823576a199
9 changes: 7 additions & 2 deletions trunk/arch/sparc/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ extern int dma_supported(struct device *dev, u64 mask);
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)

extern struct dma_map_ops *dma_ops, pci32_dma_ops;
extern struct dma_map_ops *dma_ops;
extern struct dma_map_ops *leon_dma_ops;
extern struct dma_map_ops pci32_dma_ops;

extern struct bus_type pci_bus_type;

static inline struct dma_map_ops *get_dma_ops(struct device *dev)
{
#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
if (dev->bus == &pci_bus_type)
if (sparc_cpu_model == sparc_leon)
return leon_dma_ops;
else if (dev->bus == &pci_bus_type)
return &pci32_dma_ops;
#endif
return dma_ops;
Expand Down
11 changes: 2 additions & 9 deletions trunk/arch/sparc/kernel/ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,6 @@ arch_initcall(sparc_register_ioport);
#endif /* CONFIG_SBUS */


/* LEON reuses PCI DMA ops */
#if defined(CONFIG_PCI) || defined(CONFIG_SPARC_LEON)

/* Allocate and map kernel buffer using consistent mode DMA for a device.
* hwdev should be valid struct pci_dev pointer for PCI devices.
*/
Expand Down Expand Up @@ -657,13 +654,9 @@ struct dma_map_ops pci32_dma_ops = {
};
EXPORT_SYMBOL(pci32_dma_ops);

#endif /* CONFIG_PCI || CONFIG_SPARC_LEON */

#ifdef CONFIG_SPARC_LEON
struct dma_map_ops *dma_ops = &pci32_dma_ops;
#elif defined(CONFIG_SBUS)
/* leon re-uses pci32_dma_ops */
struct dma_map_ops *leon_dma_ops = &pci32_dma_ops;
struct dma_map_ops *dma_ops = &sbus_dma_ops;
#endif

EXPORT_SYMBOL(dma_ops);

Expand Down

0 comments on commit 005e22c

Please sign in to comment.