[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1249872797-1314-7-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Date: Mon, 10 Aug 2009 11:53:15 +0900
From: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To: mingo@...e.hu
Cc: davem@...emloft.net, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org, tony.luck@...el.com,
fenghua.yu@...el.com,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Subject: [PATCH 6/8] sparc: replace sbus_map_single and sbus_unmap_single with sbus_map_page and sbus_unmap_page
This is a preparation for using asm-generic/pci-dma-compat.h; SPARC32
has two dma_map_ops structures for pci and sbus (removing
arch/sparc/kernel/dma.c, PCI and SBUS DMA accessor).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Tested-by: Robert Reif <reif@...thlink.net>
Acked-by: David S. Miller <davem@...emloft.net>
---
arch/sparc/kernel/dma.c | 5 ++---
arch/sparc/kernel/dma.h | 6 +++---
arch/sparc/kernel/ioport.c | 7 +++++--
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/arch/sparc/kernel/dma.c b/arch/sparc/kernel/dma.c
index 15820a9..a5d50da 100644
--- a/arch/sparc/kernel/dma.c
+++ b/arch/sparc/kernel/dma.c
@@ -68,8 +68,7 @@ static dma_addr_t dma32_map_page(struct device *dev, struct page *page,
return pci_map_page(to_pci_dev(dev), page, offset,
size, (int)direction);
#endif
- return sbus_map_single(dev, page_address(page) + offset,
- size, (int)direction);
+ return sbus_map_page(dev, page, offset, size, (int)direction);
}
static void dma32_unmap_page(struct device *dev, dma_addr_t dma_address,
@@ -83,7 +82,7 @@ static void dma32_unmap_page(struct device *dev, dma_addr_t dma_address,
return;
}
#endif
- sbus_unmap_single(dev, dma_address, size, (int)direction);
+ sbus_unmap_page(dev, dma_address, size, (int)direction);
}
static int dma32_map_sg(struct device *dev, struct scatterlist *sg,
diff --git a/arch/sparc/kernel/dma.h b/arch/sparc/kernel/dma.h
index f8d8951..680351e 100644
--- a/arch/sparc/kernel/dma.h
+++ b/arch/sparc/kernel/dma.h
@@ -1,8 +1,8 @@
void *sbus_alloc_consistent(struct device *dev, long len, u32 *dma_addrp);
void sbus_free_consistent(struct device *dev, long n, void *p, u32 ba);
-dma_addr_t sbus_map_single(struct device *dev, void *va,
- size_t len, int direction);
-void sbus_unmap_single(struct device *dev, dma_addr_t ba,
+dma_addr_t sbus_map_page(struct device *dev, struct page *page,
+ unsigned long offset, size_t len, int direction);
+void sbus_unmap_page(struct device *dev, dma_addr_t ba,
size_t n, int direction);
int sbus_map_sg(struct device *dev, struct scatterlist *sg,
int n, int direction);
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 87ea0d0..39ff1e0 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -337,8 +337,11 @@ void sbus_free_consistent(struct device *dev, long n, void *p, u32 ba)
* CPU view of this memory may be inconsistent with
* a device view and explicit flushing is necessary.
*/
-dma_addr_t sbus_map_single(struct device *dev, void *va, size_t len, int direction)
+dma_addr_t sbus_map_page(struct device *dev, struct page *page,
+ unsigned long offset, size_t len, int direction)
{
+ void *va = page_address(page) + offset;
+
/* XXX why are some lengths signed, others unsigned? */
if (len <= 0) {
return 0;
@@ -350,7 +353,7 @@ dma_addr_t sbus_map_single(struct device *dev, void *va, size_t len, int directi
return mmu_get_scsi_one(dev, va, len);
}
-void sbus_unmap_single(struct device *dev, dma_addr_t ba, size_t n, int direction)
+void sbus_unmap_page(struct device *dev, dma_addr_t ba, size_t n, int direction)
{
mmu_release_scsi_one(dev, ba, n);
}
--
1.6.0.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists