From patchwork Wed Jun 17 05:50:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 6621871 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 111E79F1C1 for ; Wed, 17 Jun 2015 05:49:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3324E2080E for ; Wed, 17 Jun 2015 05:49:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E62EB20812 for ; Wed, 17 Jun 2015 05:49:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F0588265B03; Wed, 17 Jun 2015 07:49:23 +0200 (CEST) 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 376B2265AC9; Wed, 17 Jun 2015 07:48:58 +0200 (CEST) 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 86594265AB2; Wed, 17 Jun 2015 07:48:54 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id B4A53265A58 for ; Wed, 17 Jun 2015 07:48:48 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 16 Jun 2015 22:48:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,630,1427785200"; d="scan'208";a="728971204" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.34]) by fmsmga001.fm.intel.com with ESMTP; 16 Jun 2015 22:48:45 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Wed, 17 Jun 2015 11:20:17 +0530 Message-Id: <1434520218-14556-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434520218-14556-1-git-send-email-vinod.koul@intel.com> References: <1434520218-14556-1-git-send-email-vinod.koul@intel.com> Cc: tiwai@suse.de, patches.audio@intel.com, liam.r.girdwood@linux.intel.com, Vinod Koul , broonie@kernel.org, Jeeja KP Subject: [alsa-devel] [PATCH 2/3] ALSA: HDA: add hda link cleanup routine 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 In HDA extended bus the HDA link objects are created when multilink capabilities are parsed. We need a routine which free up these link objects for a bus. So add snd_hdac_link_free_all routine Signed-off-by: Jeeja KP Signed-off-by: Vinod Koul --- include/sound/hdaudio_ext.h | 1 + sound/hda/ext/hdac_ext_controller.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h index 877661629322..0f89df1511dc 100644 --- a/include/sound/hdaudio_ext.h +++ b/include/sound/hdaudio_ext.h @@ -90,6 +90,7 @@ void snd_hdac_ext_stream_init(struct hdac_ext_bus *bus, int snd_hdac_ext_stream_init_all(struct hdac_ext_bus *ebus, int start_idx, int num_stream, int dir); void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus); +void snd_hdac_link_free_all(struct hdac_ext_bus *ebus); struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_ext_bus *bus, struct snd_pcm_substream *substream, int type); diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c index adffc89541c9..b2da19b60f4e 100644 --- a/sound/hda/ext/hdac_ext_controller.c +++ b/sound/hda/ext/hdac_ext_controller.c @@ -194,6 +194,24 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus) EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_ml_capabilities); /** + * snd_hdac_link_free_all- free hdac extended link objects + * + * @ebus: HD-audio ext core bus + */ + +void snd_hdac_link_free_all(struct hdac_ext_bus *ebus) +{ + struct hdac_ext_link *l; + + while (!list_empty(&ebus->hlink_list)) { + l = list_first_entry(&ebus->hlink_list, struct hdac_ext_link, list); + list_del(&l->list); + kfree(l); + } +} +EXPORT_SYMBOL_GPL(snd_hdac_link_free_all); + +/** * snd_hdac_ext_bus_get_link_index - get link based on codec name * @ebus: HD-audio extended core bus * @codec_name: codec name