From patchwork Fri Feb 28 23:41:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 3745481 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@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 960D19F35F for ; Fri, 28 Feb 2014 23:50:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9E2A202E6 for ; Fri, 28 Feb 2014 23:50:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A18BD20260 for ; Fri, 28 Feb 2014 23:50:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BAEA2265E38; Sat, 1 Mar 2014 00:50:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5C3F8265A9C; Sat, 1 Mar 2014 00:43:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 198BF2659C9; Sat, 1 Mar 2014 00:43:20 +0100 (CET) Received: from mail-pb0-f73.google.com (mail-pb0-f73.google.com [209.85.160.73]) by alsa0.perex.cz (Postfix) with ESMTP id B18232659CC for ; Sat, 1 Mar 2014 00:42:52 +0100 (CET) Received: by mail-pb0-f73.google.com with SMTP id rp16so173934pbb.0 for ; Fri, 28 Feb 2014 15:42:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NMqjR1Hep0Pyhw0ws26uIoE7/tovs/ZxiglmBF63QJs=; b=C+3ftqWLhFyAOQw1EEpTMT1PrdYj0FeXNgH3Yqc7FQfFuAfy+Ok1EBCoZ71mY8j7LY Ak3gLe0Tsz8nExwRHOiIPc6les9/iYfhJNGnwBw0TGEoiu/G5cwNl+P8esiUYYEJde7V eBtRel07gGIcabF7u3MWENUPqwVP0DjbMGyqJOTHDonOT9ztqhG+WcmvkoQzakr9YLLW b+p7NKpb3bVGsBtaJfOcFxPYxLTWyzZ1xUctqIDOJQc6M4Rx1td3IoRoWKrgw7HczZcp VKVMJHLoRVDsOUg3+0DInJWzpvFUX1qXXDnKYOUSEh5/X2RVFWvRmcP24yaoh0P/omBa Q1hQ== X-Gm-Message-State: ALoCoQlvHZ5xc0U4AUlZ2N1EVh89C7CugN9CVxUFz2+jGL2kPMvG3UBHWTe2BK/xIKBKt9s34TSWj7odfLYRvm2AmV9lcV+xwlqEVqV/itmuaUxsMl18vEGR5bAExrWQYsqGkysRNr/Guh4l8Xpyh2Ijgf0IQVYEyK2uaDA5QK5ZfDrGR++4VujsmhH9c8Hs1uf92YKPJNqavV2JU0UEM6XF0dZO9rdcLBkW7+izRSjITDAGDprvcOo= X-Received: by 10.66.253.9 with SMTP id zw9mr2806277pac.38.1393630971597; Fri, 28 Feb 2014 15:42:51 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id o7si544245yhj.3.2014.02.28.15.42.51 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Feb 2014 15:42:51 -0800 (PST) Received: from hojo20.mtv.corp.google.com (hojo20.mtv.corp.google.com [172.22.72.28]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 677475A41D9; Fri, 28 Feb 2014 15:42:51 -0800 (PST) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id 25372181B96; Fri, 28 Feb 2014 15:42:51 -0800 (PST) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Fri, 28 Feb 2014 15:41:26 -0800 Message-Id: <1393630893-29010-16-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.8.1.3.605.g02339dd In-Reply-To: <1393630893-29010-1-git-send-email-dgreid@chromium.org> References: <1393630893-29010-1-git-send-email-dgreid@chromium.org> Cc: tiwai@suse.de, Dylan Reid , swarren@wwwdotorg.org Subject: [alsa-devel] [RFCv2 15/22] ALSA: hda - move alloc_cmd_io to hda_controller X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Combining the call to alloc_cmd_io with the allocate pages function removes an extra interface between hda_intel and hda_controller. Signed-off-by: Dylan Reid --- sound/pci/hda/hda_controller.c | 7 ++++++- sound/pci/hda/hda_controller.h | 1 - sound/pci/hda/hda_intel.c | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index ed76f81..a7c5a5d 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -1026,7 +1026,7 @@ EXPORT_SYMBOL_GPL(azx_attach_pcm_stream); /* * CORB / RIRB interface */ -int azx_alloc_cmd_io(struct azx *chip) +static int azx_alloc_cmd_io(struct azx *chip) { int err; @@ -1549,6 +1549,11 @@ int azx_alloc_stream_pages(struct azx *chip) dev_err(card->dev, "cannot allocate posbuf\n"); return -ENOMEM; } + + /* allocate CORB/RIRB */ + err = azx_alloc_cmd_io(chip); + if (err < 0) + return err; return 0; } EXPORT_SYMBOL_GPL(azx_alloc_stream_pages); diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h index fb0cddd..3a3d78e 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h @@ -50,7 +50,6 @@ void azx_free_stream_pages(struct azx *chip); /* * CORB / RIRB interface */ -int azx_alloc_cmd_io(struct azx *chip); void azx_init_cmd_io(struct azx *chip); void azx_free_cmd_io(struct azx *chip); void azx_update_rirb(struct azx *chip); diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index a8af3d4..3d6ccb8 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1809,10 +1809,6 @@ static int azx_first_init(struct azx *chip) err = azx_alloc_stream_pages(chip); if (err < 0) return err; - /* allocate CORB/RIRB */ - err = azx_alloc_cmd_io(chip); - if (err < 0) - return err; /* initialize streams */ azx_init_stream(chip);