Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5609687ybl; Tue, 27 Aug 2019 07:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfUR0ybxVek8fCicWjp4JFmfj57puiDy9GvMBIgRw4P2CEsRh1pj4Rln0zIs4oU0FjKs/L X-Received: by 2002:a63:6f41:: with SMTP id k62mr8263188pgc.32.1566915275140; Tue, 27 Aug 2019 07:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566915275; cv=none; d=google.com; s=arc-20160816; b=e5q1gcG+Wg3r7AcNOHkxFxvBjljSmxr4itEPkQC2pX5Ia7wNNkKm6OJa0wqQyqT8JB ftGBMFJ9G7gElpzMeTWEVqytUNcdNzH3lDTCdZy98Mw/QphkxgWJO6AVY9QiXBzBUPZq X6UM4y4iimxiDRz7nFEGCCLScUcVbm4SFiq+7vp6e5+7NvOfmH1WIgQ2qJGin2QNCUtZ 30hiHoeOGoVUq7+X9sbwbNvFmCryzU/UQHE367pAd6WnP9PYEuXgMoNe+atixViIAS3M JPJRw5zzZouQMPQGHq6DUx5L0afRu/lIEqETeI1RHgwabXVYBw/M1rMRtizJRZOM9z+m 4X4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DVotD+xTTEi25Xi1AoZi051RYx8r7MQ2z19yAULe0Qk=; b=MTpykCSLQk/Nn7KjHg5XX3O8HhovhaD/yFc2YGGx29OxgIG8SVynnCbCKAfDzbos9P 0lV86G/l1xq+5lGr4I3sQ886ghWaiGE4Bs4+BjwzlzzO5/sDzxyZ2wl+gRz18Pa4+nDm jjEDedUY8NR0lvLNx6jrE/I+kjuVUeLVW7JC6usf+ML6le2ri2+rYLVAbbC2bM0JG2jc ss6rUaHmNJolrYqq1DdxRwGJEuuLpz+sn7qRXfTOKfqbapXbgWES7fAKqf4PXhHCzrgr 0pUDfiMvHr0ffGo8VqBRs/om4Byc+7fLVHhulxgM578A55ciirwEpYgOc52cZY2s9JW9 aJlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q67si12055464pgq.83.2019.08.27.07.14.19; Tue, 27 Aug 2019 07:14:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730038AbfH0ONI (ORCPT + 99 others); Tue, 27 Aug 2019 10:13:08 -0400 Received: from mga12.intel.com ([192.55.52.136]:10800 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729931AbfH0ONG (ORCPT ); Tue, 27 Aug 2019 10:13:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 07:13:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,437,1559545200"; d="scan'208";a="264282475" Received: from xxx.igk.intel.com ([10.237.93.170]) by orsmga001.jf.intel.com with ESMTP; 27 Aug 2019 07:13:03 -0700 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Pierre-Louis Bossart , Jie Yang , Cezary Rojewski , linux-kernel@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Subject: [PATCH 5/6] ASoC: Intel: Skylake: Release topology when we are done with it Date: Tue, 27 Aug 2019 16:17:11 +0200 Message-Id: <20190827141712.21015-6-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190827141712.21015-1-amadeuszx.slawinski@linux.intel.com> References: <20190827141712.21015-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently topology is kept in memory while driver is running. It's unnecessary, as it's only needed during parsing. Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/skylake/skl-topology.c | 20 ++++++++++---------- sound/soc/intel/skylake/skl.h | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index ae5c75d03fdc..69cd7a81bf2a 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -3579,23 +3579,25 @@ int skl_tplg_init(struct snd_soc_component *component, struct hdac_bus *bus) * The complete tplg for SKL is loaded as index 0, we don't use * any other index */ - ret = snd_soc_tplg_component_load(component, - &skl_tplg_ops, fw, 0); + ret = snd_soc_tplg_component_load(component, &skl_tplg_ops, fw, 0); if (ret < 0) { dev_err(bus->dev, "tplg component load failed%d\n", ret); - release_firmware(fw); - return -EINVAL; + goto err; } - skl->tplg = fw; ret = skl_tplg_create_pipe_widget_list(component); - if (ret < 0) - return ret; + if (ret < 0) { + dev_err(bus->dev, "tplg create pipe widget list failed%d\n", + ret); + goto err; + } list_for_each_entry(ppl, &skl->ppl_list, node) skl_tplg_set_pipe_type(skl, ppl->pipe); - return 0; +err: + release_firmware(fw); + return ret; } void skl_tplg_exit(struct snd_soc_component *component, struct hdac_bus *bus) @@ -3609,6 +3611,4 @@ void skl_tplg_exit(struct snd_soc_component *component, struct hdac_bus *bus) /* clean up topology */ snd_soc_tplg_component_remove(component, SND_SOC_TPLG_INDEX_ALL); - - release_firmware(skl->tplg); } diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index f8c714153610..2bfbf59277c4 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h @@ -75,7 +75,6 @@ struct skl_dev { const char *fw_name; char tplg_name[64]; unsigned short pci_id; - const struct firmware *tplg; int supend_active; -- 2.17.1