From patchwork Fri Nov 1 11:48:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 3124561 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7E9559F2D6 for ; Fri, 1 Nov 2013 11:51:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F74920158 for ; Fri, 1 Nov 2013 11:51:47 +0000 (UTC) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95D6C20131 for ; Fri, 1 Nov 2013 11:51:46 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rA1BoawX018418; Fri, 1 Nov 2013 06:50:36 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rA1Boahw013871; Fri, 1 Nov 2013 06:50:36 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Fri, 1 Nov 2013 06:50:35 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id rA1BoZa1003892; Fri, 1 Nov 2013 06:50:35 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id DD04880633; Fri, 1 Nov 2013 05:50:34 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id C7AC48062D for ; Fri, 1 Nov 2013 05:49:18 -0600 (CST) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id rA1BnDel020913 for ; Fri, 1 Nov 2013 06:49:13 -0500 (CDT) Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id rA1BnDiD032083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Nov 2013 06:49:13 -0500 Received: from [216.82.250.51:2109] by server-8.bemta-12.messagelabs.com id 98/39-28352-93593725; Fri, 01 Nov 2013 11:49:13 +0000 X-Env-Sender: B42378@freescale.com X-Msg-Ref: server-16.tower-108.messagelabs.com!1383306551!8329390!1 X-Originating-IP: [216.32.180.12] X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR X-StarScan-Received: X-StarScan-Version: 6.9.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2519 invoked from network); 1 Nov 2013 11:49:12 -0000 Received: from va3ehsobe002.messaging.microsoft.com (HELO va3outboundpool.messaging.microsoft.com) (216.32.180.12) by server-16.tower-108.messagelabs.com with AES128-SHA encrypted SMTP; 1 Nov 2013 11:49:12 -0000 Received: from mail227-va3-R.bigfish.com (10.7.14.234) by VA3EHSOBE009.bigfish.com (10.7.40.29) with Microsoft SMTP Server id 14.1.225.22; Fri, 1 Nov 2013 11:49:11 +0000 Received: from mail227-va3 (localhost [127.0.0.1]) by mail227-va3-R.bigfish.com (Postfix) with ESMTP id 09C26780103; Fri, 1 Nov 2013 11:49:11 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 6 X-BigFish: VS6(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6h1082kz70kz1de098h8275bh1de097hz2dh2a8h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e23h1fe8h1ff5h2218h2216h1155h) Received: from mail227-va3 (localhost.localdomain [127.0.0.1]) by mail227-va3 (MessageSwitch) id 1383306548522308_15956; Fri, 1 Nov 2013 11:49:08 +0000 (UTC) Received: from VA3EHSMHS021.bigfish.com (unknown [10.7.14.245]) by mail227-va3.bigfish.com (Postfix) with ESMTP id 783B9AC0067; Fri, 1 Nov 2013 11:49:08 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS021.bigfish.com (10.7.99.31) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 1 Nov 2013 11:49:01 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.158.2; Fri, 1 Nov 2013 11:49:00 +0000 Received: from rio.ap.freescale.net (rio.ap.freescale.net [10.192.242.9]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id rA1BmFGH005023; Fri, 1 Nov 2013 04:48:54 -0700 From: Nicolin Chen To: , , , , , , , , , , , , , , , , Subject: [PATCH][RESEND 6/8] ALSA: memalloc: use gen_pool_dma_alloc() to allocate iram buffer Date: Fri, 1 Nov 2013 19:48:19 +0800 Message-ID: X-Mailer: git-send-email 1.8.4 In-Reply-To: References: MIME-Version: 1.0 X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% CC: , , , , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since gen_pool_dma_alloc() is introduced, we implement it to simplify code. Signed-off-by: Nicolin Chen Acked-by: Takashi Iwai --- sound/core/memalloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 9d93f02..5e1c7bc 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -184,11 +184,7 @@ static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size) /* Assign the pool into private_data field */ dmab->private_data = pool; - dmab->area = (void *)gen_pool_alloc(pool, size); - if (!dmab->area) - return; - - dmab->addr = gen_pool_virt_to_phys(pool, (unsigned long)dmab->area); + dmab->area = gen_pool_dma_alloc(pool, size, &dmab->addr); } /**