From patchwork Fri Feb 28 06:35:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 3738961 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 854049F2ED for ; Fri, 28 Feb 2014 06:45:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B085820266 for ; Fri, 28 Feb 2014 06:45:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 74CCA20125 for ; Fri, 28 Feb 2014 06:45:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6D473265AFD; Fri, 28 Feb 2014 07:45:24 +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 9194D2650D1; Fri, 28 Feb 2014 07:38: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 0E369265931; Fri, 28 Feb 2014 07:38:16 +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 041462650BC for ; Fri, 28 Feb 2014 07:37:13 +0100 (CET) Received: by mail-pb0-f73.google.com with SMTP id rp16so34667pbb.0 for ; Thu, 27 Feb 2014 22:37:12 -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=fjNGDHu/BbazWu9vDlEqIjix1Y3k3KnTV2Y2Hy3ralM=; b=jfMQ7PvfVJNAb6yDUrVh/Rvvj+TVbRCqBskGu2lZp7vubSsvCANMsmrxWtGk+Kb8Ty a75jAuic30UELhUheBhkyDDL1ZICvf2yO6w2GfONgshAtQIyty91Q6ncvoDBOcEx0Z+B p/t7GEHTjj1MZ2zua++gEqHE+N8YfoHGvMkeQTgmaUYu/pad0gGNPZG99xhIQofdJTmq ajsIyQClBvN3A9+BEb9yyRn5m3wRNv/GtQlO+HIQwf6afPBUrbrI2RTghflmfpPgGekF RM8wTOBrrkTwpiNixNptqUGalJhu8PYt7xIISlxgTxZ0g5E+bqT9u0gqaFWrftBQ3Zzf Gz4g== X-Gm-Message-State: ALoCoQl886hZ3vvAA5RMQ2c0oToEIGhVdSllP8VJLYHGY0MnegJOTcS6ODjsfTxnbCfLE2zFbEQtRDfF8LpqX+UTUf9pSnyNYFcPGGqglAuVsQTKWDZTdzETAe7zRQXeCF1E0nUln757hAPEaYEUtt0cayRU4puXU5M+OBKJ0buGpPdP375333YqI23PgVyS2jCOu5gDXXl9D092Kcw+BV0X+7d+LFyRzWHj3ogeDzafjkvPGfCDhag= X-Received: by 10.66.66.196 with SMTP id h4mr479407pat.22.1393569432642; Thu, 27 Feb 2014 22:37:12 -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 u30si115279yhk.1.2014.02.27.22.37.12 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Feb 2014 22:37:12 -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 629095A4319; Thu, 27 Feb 2014 22:37:12 -0800 (PST) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id 11C7A18104E; Thu, 27 Feb 2014 22:37:12 -0800 (PST) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Thu, 27 Feb 2014 22:35:53 -0800 Message-Id: <1393569362-27285-11-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.8.1.3.605.g02339dd In-Reply-To: <1393569362-27285-1-git-send-email-dgreid@chromium.org> References: <1393569362-27285-1-git-send-email-dgreid@chromium.org> Cc: tiwai@suse.de, Dylan Reid , swarren@wwwdotorg.org Subject: [alsa-devel] [RFC 10/19] ALSA: hda - move alloc_cmd_io to hda_shared. 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_shared. Signed-off-by: Dylan Reid --- sound/pci/hda/hda_intel.c | 4 ---- sound/pci/hda/hda_shared.c | 7 ++++++- sound/pci/hda/hda_shared.h | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2b00e88..ab3c015 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1777,10 +1777,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); diff --git a/sound/pci/hda/hda_shared.c b/sound/pci/hda/hda_shared.c index 0b2115e..1f307a8 100644 --- a/sound/pci/hda/hda_shared.c +++ b/sound/pci/hda/hda_shared.c @@ -1120,7 +1120,7 @@ int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) /* * CORB / RIRB interface */ -int azx_alloc_cmd_io(struct azx *chip) +static int azx_alloc_cmd_io(struct azx *chip) { int err; @@ -1622,6 +1622,11 @@ int azx_alloc_stream_pages(struct azx *chip) return -ENOMEM; } mark_pages_wc(chip, &chip->posbuf, true); + + /* 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_shared.h b/sound/pci/hda/hda_shared.h index e0f8e3d..8fed6ea 100644 --- a/sound/pci/hda/hda_shared.h +++ b/sound/pci/hda/hda_shared.h @@ -54,6 +54,5 @@ unsigned int azx_get_response(struct hda_bus *bus, void azx_init_cmd_io(struct azx *chip); void azx_free_cmd_io(struct azx *chip); void azx_update_rirb(struct azx *chip); -int azx_alloc_cmd_io(struct azx *chip); #endif /* __SOUND_HDA_SHARED_H */