From patchwork Thu Apr 25 17:28:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2489451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id AF2273FC64 for ; Thu, 25 Apr 2013 17:39:23 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVQ7A-0006BQ-Tz; Thu, 25 Apr 2013 17:37:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVQ1e-0007NY-AG; Thu, 25 Apr 2013 17:32:06 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVPz7-00077F-JG for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2013 17:29:32 +0000 Received: from wuerfel.lan (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MLOsc-1UVxwT48fK-000aCK; Thu, 25 Apr 2013 19:29:04 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/21] oss/dmabuf: use dma_map_single Date: Thu, 25 Apr 2013 19:28:50 +0200 Message-Id: <1366910944-3033663-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1366910944-3033663-1-git-send-email-arnd@arndb.de> References: <1366910944-3033663-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:+B8FrqSp/bn+S7UH2y09L6MPnzM8BcUZXT+Zh3XMV92 P58zcH9pnEP7rDlcCDxT1pDHXo9/OQs58RcGRyGdh2foTx1tKt lMvpW7XyVac5I1Vy+ua11aIcpk4+SWlMNHxxrqfXbPtp9yXtCZ dWm2yC4/vyYtbvuq2/2BSrcn7VE+2k6/OOngXmIhubr6KJcDUb zws9FcpC53imZzqZhaC/oHPmeQsH3FIb5vsD8D/Iow1ENrm9KH TAB6aoqHBoZI+KTMFTzlxc7RYLPleZnLAfrIJlmnk4QT6x75hQ a0ffYriX/KLjLfvDs+r+QAy4yEh8OxgxsiKl+RZRZ5LnH+q9vv RSMj04kfq6iASNHwGoop1rAq0ikd6czevDcaf5y8x X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130425_132930_549146_EB956D71 X-CRM114-Status: GOOD ( 12.38 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.9 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Jaroslav Kysela X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org --- sound/oss/dmabuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c index bcc3e8e..a59c888 100644 --- a/sound/oss/dmabuf.c +++ b/sound/oss/dmabuf.c @@ -114,7 +114,7 @@ static int sound_alloc_dmap(struct dma_buffparms *dmap) } } dmap->raw_buf = start_addr; - dmap->raw_buf_phys = virt_to_bus(start_addr); + dmap->raw_buf_phys = dma_map_single(NULL, start_addr, dmap->buffsize, DMA_BIDIRECTIONAL); for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++) SetPageReserved(page); @@ -139,6 +139,7 @@ static void sound_free_dmap(struct dma_buffparms *dmap) for (page = virt_to_page(start_addr); page <= virt_to_page(end_addr); page++) ClearPageReserved(page); + dma_unmap_single(NULL, dmap->raw_buf_phys, dmap->buffsize, DMA_BIDIRECTIONAL); free_pages((unsigned long) dmap->raw_buf, sz); dmap->raw_buf = NULL; }