From d894d964ff7ddf5a81a5b150fee46caf99619f26 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 13 May 2012 13:57:05 -0700 Subject: sparc32: Convert mmu_* interfaces from btfixup to method ops. This set of changes displays one major danger of btfixup, interface signatures are not always type checked fully. As seen here the iounit variant of the map_dma_area routine had an incorrect type for one of it's arguments. It turns out to be harmless in this case, but just imagine trying to debug something involving this kind of problem. No thanks. Signed-off-by: David S. Miller --- arch/sparc/kernel/ioport.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'arch/sparc/kernel/ioport.c') diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 1720fc294f5e..a2846f5e32d8 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -50,6 +50,8 @@ #include #include +const struct sparc32_dma_ops *sparc32_dma_ops; + /* This function must make sure that caches and memory are coherent after DMA * On LEON systems without cache snooping it flushes the entire D-CACHE. */ @@ -292,13 +294,13 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len, goto err_nova; } - // XXX The mmu_map_dma_area does this for us below, see comments. + // XXX The sbus_map_dma_area does this for us below, see comments. // srmmu_mapiorange(0, virt_to_phys(va), res->start, len_total); /* * XXX That's where sdev would be used. Currently we load * all iommu tables with the same translations. */ - if (mmu_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) + if (sbus_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) goto err_noiommu; res->name = op->dev.of_node->name; @@ -343,7 +345,7 @@ static void sbus_free_coherent(struct device *dev, size_t n, void *p, kfree(res); pgv = virt_to_page(p); - mmu_unmap_dma_area(dev, ba, n); + sbus_unmap_dma_area(dev, ba, n); __free_pages(pgv, get_order(n)); } -- cgit v1.2.3