aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/dmabuf.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-25 13:28:50 -0400
committerTakashi Iwai <tiwai@suse.de>2013-04-26 01:36:38 -0400
commit4b417cf01657c8dcd03abb0aa49f3825fede6539 (patch)
tree6bdac66637163f3165b37867672a9c9d3a7ba130 /sound/oss/dmabuf.c
parent7603935838ae3a85b56f0b5662ab785518d68d39 (diff)
sound: oss/dmabuf: use dma_map_single
The virt_to_bus/bus_to_virt functions have been deprecated for as long as I can remember, and they are used in very few remaining instances, usually in obscure ISA device drivers. The OSS sound drivers are the only ones that are still used on the ARM architecture, and only on some of the earliest StrongARM machines. The problem for converting the OSS subsystem to use dma_map_single instead is that the caller of virt_to_bus does not have a device pointer, since the subsystem has never been ported to use the common device infrastructure. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/oss/dmabuf.c')
-rw-r--r--sound/oss/dmabuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
index bcc3e8e07122..a59c88818f48 100644
--- a/sound/oss/dmabuf.c
+++ b/sound/oss/dmabuf.c
@@ -114,7 +114,7 @@ static int sound_alloc_dmap(struct dma_buffparms *dmap)
114 } 114 }
115 } 115 }
116 dmap->raw_buf = start_addr; 116 dmap->raw_buf = start_addr;
117 dmap->raw_buf_phys = virt_to_bus(start_addr); 117 dmap->raw_buf_phys = dma_map_single(NULL, start_addr, dmap->buffsize, DMA_BIDIRECTIONAL);
118 118
119 for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++) 119 for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++)
120 SetPageReserved(page); 120 SetPageReserved(page);
@@ -139,6 +139,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap)
139 for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++) 139 for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++)
140 ClearPageReserved(page); 140 ClearPageReserved(page);
141 141
142 dma_unmap_single(NULL, dmap->raw_buf_phys, dmap->buffsize, DMA_BIDIRECTIONAL);
142 free_pages((unsigned long) dmap->raw_buf, sz); 143 free_pages((unsigned long) dmap->raw_buf, sz);
143 dmap->raw_buf = NULL; 144 dmap->raw_buf = NULL;
144} 145}