From patchwork Fri Jan 27 23:11:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41715C61DA3 for ; Fri, 27 Jan 2023 15:11:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BEE8193A; Fri, 27 Jan 2023 16:10:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BEE8193A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832298; bh=LvKTiEZRlMazR+r++JvGSgZfrTxuCnGAk8uY0I0iui8=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=aQhLp1goC9n+ZreWXlE49hBt9ZxbQikr70UWm4kj2ChGkthHWy1//NKvLgFKWYm6e on/OvnCWm0lFkBWEcc9+3nXYjmr/DD+ngj5tOAAAEjulO2GMHpQ6bWJclCqBInM5ge mRBu58z0RwAzoneIfu/HoBXWIGDz3S2XJaJ2oRBw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 13029F8007C; Fri, 27 Jan 2023 16:10:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D1FBF804F3; Fri, 27 Jan 2023 16:10:20 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2A196F8007C for ; Fri, 27 Jan 2023 16:10:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2A196F8007C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cgN1xjfp DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832217; x=1706368217; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LvKTiEZRlMazR+r++JvGSgZfrTxuCnGAk8uY0I0iui8=; b=cgN1xjfpNqj3H/WX5qglLZ0HQQ4UNYvMlyckfhu/fzsEiIpzfHKN3KGO aj+G8P4siR5HnPGUDGuPkRIBPk0BVwkgtVsGogMT/RcCS1HAq8aZ6uyGz jmjRPMppzYA4cQWV6BozZ2/2L6GNhoFmZD5ZkR+F1WPkNrDF2tfovN3nF APvmLW1F1q43ABYJSHOmdAj28MOLAv+ZRSvf0X0Ghn6+24vUrEzDAT12q QYeudD15Zoq099VRZtDWNuSsoLx5uDSSomU5lUZ+43gs3sydBBMgk7tIp HbsDi7KjdUFHfXArw6MW+YprGXFORHF72qoh5sV1lng8z2iGXb8agydS8 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795769" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795769" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908708985" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908708985" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:11 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 01/11] ASoC: topology: Properly access value coming from topology file Date: Sat, 28 Jan 2023 00:11:01 +0100 Message-Id: <20230127231111.937721-2-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" When accessing values coming from topology, le32_to_cpu should be used. One of recent commits missed that. Fixes: 86e2d14b6d1a ("ASoC: topology: Add header payload_size verification") Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index c3be24b2fac5..b9addbab2b3d 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2404,7 +2404,7 @@ static int soc_valid_header(struct soc_tplg *tplg, return -EINVAL; } - if (soc_tplg_get_hdr_offset(tplg) + hdr->payload_size >= tplg->fw->size) { + if (soc_tplg_get_hdr_offset(tplg) + le32_to_cpu(hdr->payload_size) >= tplg->fw->size) { dev_err(tplg->dev, "ASoC: invalid header of type %d at offset %ld payload_size %d\n", le32_to_cpu(hdr->type), soc_tplg_get_hdr_offset(tplg), From patchwork Fri Jan 27 23:11:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39541C38142 for ; Fri, 27 Jan 2023 15:12:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F1C2DE7F; Fri, 27 Jan 2023 16:11:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F1C2DE7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832342; bh=jvjOKtTsN2MnG849lqt/rMmBorVqjY0Kh8Xv4nLZE/k=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=CYamopDcZ+zv12y6+eo+wP7gWIw6tHcjBcbQOhHTvgfXolqX9Z9nTPg0Fy4O/8cj5 L/p+cH0rU2EHXRANtWY1HVHko/rSzepwQW6gxl2BTAGKCINQEIpJahJIFsPqH2kOHE 8bibIgM+9kkMwOWSJBtyTo1hg/W2T5skIRd/C8/o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 29A2AF80551; Fri, 27 Jan 2023 16:10:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 121E4F804F3; Fri, 27 Jan 2023 16:10:23 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0DD4FF8007C for ; Fri, 27 Jan 2023 16:10:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0DD4FF8007C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Rb8D69M9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832221; x=1706368221; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jvjOKtTsN2MnG849lqt/rMmBorVqjY0Kh8Xv4nLZE/k=; b=Rb8D69M9Z4mCSRTP/LgTPvvvRPGjOlWR/4q6jP5fMJegOOaJBB+gPS1T ixJTSQ/m8hJgQFOEwcGdX8DiPjh2DNOruFWWh24MTzHZcn9lsDMqWeykK Q1N90oIbFAAyTow6VtBquN7phdXWsSrJqAJiPY6tnOOHfaYFDA+J995y1 K8GV84U+WXGJprLuaY8krLRsS/OQfX0EvprYqfyE69+3d+9pmLKys8A68 BA1Pst2Eozw6qYgN4poF9mugCiBXXHmNTU2dZ4FIfIf7JxihQwDx+GAkG D8388Xdm7aHgprAw0wGzQeJYaQGzSYZEYOnudrHyYGToz6pQYZjTvCTK3 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795780" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795780" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908708992" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908708992" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:13 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 02/11] ASoC: topology: Remove unused SOC_TPLG_PASS_PINS constant Date: Sat, 28 Jan 2023 00:11:02 +0100 Message-Id: <20230127231111.937721-3-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The constant is unused, so it can be safely removed. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index b9addbab2b3d..e9138ec4df8f 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -44,9 +44,8 @@ #define SOC_TPLG_PASS_WIDGET 3 #define SOC_TPLG_PASS_PCM_DAI 4 #define SOC_TPLG_PASS_GRAPH 5 -#define SOC_TPLG_PASS_PINS 6 -#define SOC_TPLG_PASS_BE_DAI 7 -#define SOC_TPLG_PASS_LINK 8 +#define SOC_TPLG_PASS_BE_DAI 6 +#define SOC_TPLG_PASS_LINK 7 #define SOC_TPLG_PASS_START SOC_TPLG_PASS_MANIFEST #define SOC_TPLG_PASS_END SOC_TPLG_PASS_LINK From patchwork Fri Jan 27 23:11:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCC14C54EAA for ; Fri, 27 Jan 2023 15:12:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BCACDE88; Fri, 27 Jan 2023 16:11:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BCACDE88 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832358; bh=NJzb4TQp2I8milYc4b4QcVDRAaAtQxF+qPtBo22cKzc=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=A7V89i8brDevAHR7TVTnBzHJ3w3HmLBe6M5WiEt2MULFf0sV8CclcRLtgPZhrUI0b MtABAweGU86Os3ygr/1hkd7ZRgRL3mBTIqPyVFZ2/BcqbCV046eXb1ZWFjMtMqAO9J RNCXylSL84N0DC8tJsMBSNdlH0jpB1p3I5zjzQq0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E139BF80558; Fri, 27 Jan 2023 16:10:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 020B5F80552; Fri, 27 Jan 2023 16:10:24 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2AAC2F80272 for ; Fri, 27 Jan 2023 16:10:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2AAC2F80272 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=jIAjGFmQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832219; x=1706368219; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NJzb4TQp2I8milYc4b4QcVDRAaAtQxF+qPtBo22cKzc=; b=jIAjGFmQaLSIgh16ODrLgS1gtCRYxj9vNyeWbApUkQwHarf3qjhRKsLo MtjeW2EQ+PTvB72GYOIHKuQfUY88o5spncP+fOf+uRApQyYcAlymNss63 WDp3yD4EIMjtuVl9ywhoj63Rs28/1FiBDCEm5xQIL+RlOXnDzFSV3mpiE jNVTdCOOEyOffvsi2VfGYNGJJK5KpIgEb+731bY8Tc9Y7kogpnCLlIjb6 yhdIjnUcbSid1KzmckWHelgTd+fIC5p1Yz6zeBCy9uSizwfv64npWhA6C QK17zRzKIl+U2hJQgvrCBDdQIvYXyfo0R9JyHmzg3PNsxN6/ylk6QdAkJ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795788" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795788" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908708999" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908708999" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:15 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 03/11] ASoC: topology: Fix typo in functions name Date: Sat, 28 Jan 2023 00:11:03 +0100 Message-Id: <20230127231111.937721-4-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Topology is being abbreviated to "tplg", not "tplc", however, few functions have typo in name, fix it. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index e9138ec4df8f..b9c29effeb60 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -185,7 +185,7 @@ static const struct soc_tplg_map dapm_map[] = { {SND_SOC_TPLG_DAPM_DECODER, snd_soc_dapm_decoder}, }; -static int tplc_chan_get_reg(struct soc_tplg *tplg, +static int tplg_chan_get_reg(struct soc_tplg *tplg, struct snd_soc_tplg_channel *chan, int map) { int i; @@ -198,7 +198,7 @@ static int tplc_chan_get_reg(struct soc_tplg *tplg, return -EINVAL; } -static int tplc_chan_get_shift(struct soc_tplg *tplg, +static int tplg_chan_get_shift(struct soc_tplg *tplg, struct snd_soc_tplg_channel *chan, int map) { int i; @@ -779,10 +779,10 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, size_t size) kc.access = le32_to_cpu(mc->hdr.access); /* we only support FL/FR channel mapping atm */ - sm->reg = tplc_chan_get_reg(tplg, mc->channel, SNDRV_CHMAP_FL); - sm->rreg = tplc_chan_get_reg(tplg, mc->channel, SNDRV_CHMAP_FR); - sm->shift = tplc_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FL); - sm->rshift = tplc_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FR); + sm->reg = tplg_chan_get_reg(tplg, mc->channel, SNDRV_CHMAP_FL); + sm->rreg = tplg_chan_get_reg(tplg, mc->channel, SNDRV_CHMAP_FR); + sm->shift = tplg_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FL); + sm->rshift = tplg_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FR); sm->max = le32_to_cpu(mc->max); sm->min = le32_to_cpu(mc->min); @@ -926,10 +926,10 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, size_t size) kc.iface = SNDRV_CTL_ELEM_IFACE_MIXER; kc.access = le32_to_cpu(ec->hdr.access); - se->reg = tplc_chan_get_reg(tplg, ec->channel, SNDRV_CHMAP_FL); - se->shift_l = tplc_chan_get_shift(tplg, ec->channel, + se->reg = tplg_chan_get_reg(tplg, ec->channel, SNDRV_CHMAP_FL); + se->shift_l = tplg_chan_get_shift(tplg, ec->channel, SNDRV_CHMAP_FL); - se->shift_r = tplc_chan_get_shift(tplg, ec->channel, + se->shift_r = tplg_chan_get_shift(tplg, ec->channel, SNDRV_CHMAP_FL); se->mask = le32_to_cpu(ec->mask); @@ -1160,13 +1160,13 @@ static int soc_tplg_dapm_widget_dmixer_create(struct soc_tplg *tplg, struct snd_ kc->access = le32_to_cpu(mc->hdr.access); /* we only support FL/FR channel mapping atm */ - sm->reg = tplc_chan_get_reg(tplg, mc->channel, + sm->reg = tplg_chan_get_reg(tplg, mc->channel, SNDRV_CHMAP_FL); - sm->rreg = tplc_chan_get_reg(tplg, mc->channel, + sm->rreg = tplg_chan_get_reg(tplg, mc->channel, SNDRV_CHMAP_FR); - sm->shift = tplc_chan_get_shift(tplg, mc->channel, + sm->shift = tplg_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FL); - sm->rshift = tplc_chan_get_shift(tplg, mc->channel, + sm->rshift = tplg_chan_get_shift(tplg, mc->channel, SNDRV_CHMAP_FR); sm->max = le32_to_cpu(mc->max); @@ -1232,10 +1232,10 @@ static int soc_tplg_dapm_widget_denum_create(struct soc_tplg *tplg, struct snd_k kc->access = le32_to_cpu(ec->hdr.access); /* we only support FL/FR channel mapping atm */ - se->reg = tplc_chan_get_reg(tplg, ec->channel, SNDRV_CHMAP_FL); - se->shift_l = tplc_chan_get_shift(tplg, ec->channel, + se->reg = tplg_chan_get_reg(tplg, ec->channel, SNDRV_CHMAP_FL); + se->shift_l = tplg_chan_get_shift(tplg, ec->channel, SNDRV_CHMAP_FL); - se->shift_r = tplc_chan_get_shift(tplg, ec->channel, + se->shift_r = tplg_chan_get_shift(tplg, ec->channel, SNDRV_CHMAP_FR); se->items = le32_to_cpu(ec->items); From patchwork Fri Jan 27 23:11:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5AB7C54EAA for ; Fri, 27 Jan 2023 15:12:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B8FA2E7B; Fri, 27 Jan 2023 16:11:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B8FA2E7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832329; bh=dbqe6oUSGVfYqp5mtGiuqvJApjaK+nBpEujCeUCnT4c=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=aaqOttcRniAfxsjFi6etcOnvBSkqFibatFKVf086ln0W/j3SxaykRNM/KTtHDYSF+ KLiUu5wiVmB4Sv4ekou4PraKRC668107jq76CxbRN1blAU3f1777ykRQ8jombJkbkw o/1FxlRmr3I3ju6ld+z/geC2WzslRpVjLEpmpOGY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7126CF8053D; Fri, 27 Jan 2023 16:10:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 91BF5F804C2; Fri, 27 Jan 2023 16:10:22 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BBAC4F80494 for ; Fri, 27 Jan 2023 16:10:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BBAC4F80494 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SWLhWYt+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832221; x=1706368221; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dbqe6oUSGVfYqp5mtGiuqvJApjaK+nBpEujCeUCnT4c=; b=SWLhWYt+nLblzTa9ct1nycdU/9SZXQ8OAX+8ukFeHh5Uur0ZSWdCQjrt 9vCr/OMowe6sV2UTwrOdJuUKXoXsnNk2PTmtyk8hegT3P1SD1CLzQ3fQf cJYpqudKEY3mDeordqZsDFakRLAoXOItEGq+4Yi6ePBzW1i/Iw+1Ggopn H4h8EVX3PAspX6tiiU1C8+RHeXuefj93+ClZD2DuSFXr859SpQvLwcOnw +taS7ASSMngz1iJ8h7DZGS1FI9Fmp8TAZvICtiUtiRkbOvRsi+CSKn63D j9Xi8/G1/dyEY4Xu799COUcbk7pmXlHmYzGx1bumSw6uzSnfDTQMl6R6T w==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795810" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795810" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709004" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709004" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:17 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 04/11] ASoC: topology: Fix function name Date: Sat, 28 Jan 2023 00:11:04 +0100 Message-Id: <20230127231111.937721-5-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Functions other than soc_valid_header have soc_tplg_ prefix. Rename function to follow convention in file. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index b9c29effeb60..1fe4fa82fa2f 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2389,7 +2389,7 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, } /* validate header magic, size and type */ -static int soc_valid_header(struct soc_tplg *tplg, +static int soc_tplg_valid_header(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) { if (soc_tplg_get_hdr_offset(tplg) >= tplg->fw->size) @@ -2526,7 +2526,7 @@ static int soc_tplg_process_headers(struct soc_tplg *tplg) while (!soc_tplg_is_eof(tplg)) { /* make sure header is valid before loading */ - ret = soc_valid_header(tplg, hdr); + ret = soc_tplg_valid_header(tplg, hdr); if (ret < 0) { dev_err(tplg->dev, "ASoC: topology: invalid header: %d\n", ret); From patchwork Fri Jan 27 23:11:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8217C54EAA for ; Fri, 27 Jan 2023 15:12:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E79F1E89; Fri, 27 Jan 2023 16:12:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E79F1E89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832373; bh=/ZoWQ+I5P6IxwXu7b2P7X88hVoPxXeJl+Ti79/e6frk=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=TTjUeJcNC8pz7UtxqqKFg/W+4m8YfIVap6LVYeBi4aLwmdMQo66fLxHjI0NBEjKiV SXmJYHdSC+j9xYrYRWGre3faSLAqBGHj4+fZAEdL53dWdCsi/u76z+fo88rgAKc6zd 0Hn5/c5vA9r3z8WJZtZvhe/wOE4qNzXEz55I5oQo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BD1F9F80563; Fri, 27 Jan 2023 16:10:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB631F80552; Fri, 27 Jan 2023 16:10:26 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AE4A6F801F7 for ; Fri, 27 Jan 2023 16:10:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AE4A6F801F7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AFG5izhv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832222; x=1706368222; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/ZoWQ+I5P6IxwXu7b2P7X88hVoPxXeJl+Ti79/e6frk=; b=AFG5izhvHDHGuEqUYinIIoRwd1F73ApR9UYqayb/QNYkm6b9qGPEtDUW gy/keigsgg+G8AaULxUTqV/GBg/lF5mSf6DgIf167wiBoHe/YlFSX+95n 4jxthKFAHNjXNTJnnlHcV0RF8Z0l45vBCJF58wm+xRgTIPWah06mMoyAD 98Zka/Pa5be4l2IgxTWd5BGHtxGtzLOysSAiv/a4EfdnxMODCZH/gkduy VCBItw+ZXWUVsMebFIKBsA1Dedj0gBQ9z1kQlPuW7rknSLGbq7zAboUnb yDUl/R3bgnSUwU+foxhaNsWkbXui5Ire9P560JaFtAG+UltL8Sn0yLRKr A==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795819" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795819" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709013" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709013" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:19 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 05/11] ASoC: topology: Rename remove_ handlers Date: Sat, 28 Jan 2023 00:11:05 +0100 Message-Id: <20230127231111.937721-6-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Those are the only functions missing soc_tplg_ prefix, add it for consistency. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 1fe4fa82fa2f..a952f7eaa646 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -354,7 +354,7 @@ static int soc_tplg_add_kcontrol(struct soc_tplg *tplg, } /* remove a mixer kcontrol */ -static void remove_mixer(struct snd_soc_component *comp, +static void soc_tplg_remove_mixer(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { struct snd_card *card = comp->card->snd_card; @@ -370,7 +370,7 @@ static void remove_mixer(struct snd_soc_component *comp, } /* remove an enum kcontrol */ -static void remove_enum(struct snd_soc_component *comp, +static void soc_tplg_remove_enum(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { struct snd_card *card = comp->card->snd_card; @@ -386,7 +386,7 @@ static void remove_enum(struct snd_soc_component *comp, } /* remove a byte kcontrol */ -static void remove_bytes(struct snd_soc_component *comp, +static void soc_tplg_remove_bytes(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { struct snd_card *card = comp->card->snd_card; @@ -402,7 +402,7 @@ static void remove_bytes(struct snd_soc_component *comp, } /* remove a route */ -static void remove_route(struct snd_soc_component *comp, +static void soc_tplg_remove_route(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { if (pass != SOC_TPLG_PASS_GRAPH) @@ -415,7 +415,7 @@ static void remove_route(struct snd_soc_component *comp, } /* remove a widget and it's kcontrols - routes must be removed first */ -static void remove_widget(struct snd_soc_component *comp, +static void soc_tplg_remove_widget(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { struct snd_card *card = comp->card->snd_card; @@ -443,7 +443,7 @@ static void remove_widget(struct snd_soc_component *comp, } /* remove DAI configurations */ -static void remove_dai(struct snd_soc_component *comp, +static void soc_tplg_remove_dai(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { struct snd_soc_dai_driver *dai_drv = @@ -464,7 +464,7 @@ static void remove_dai(struct snd_soc_component *comp, } /* remove link configurations */ -static void remove_link(struct snd_soc_component *comp, +static void soc_tplg_remove_link(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, int pass) { struct snd_soc_dai_link *link = @@ -492,7 +492,7 @@ static void remove_backend_link(struct snd_soc_component *comp, dobj->ops->link_unload(comp, dobj); /* - * We don't free the link here as what remove_link() do since BE + * We don't free the link here as what soc_tplg_remove_link() do since BE * links are not allocated by topology. * We however need to reset the dobj type to its initial values */ @@ -1492,7 +1492,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, return 0; ready_err: - remove_widget(widget->dapm->component, &widget->dobj, SOC_TPLG_PASS_WIDGET); + soc_tplg_remove_widget(widget->dapm->component, &widget->dobj, SOC_TPLG_PASS_WIDGET); snd_soc_dapm_free_widget(widget); hdr_err: kfree(template.sname); @@ -2627,25 +2627,25 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp) switch (dobj->type) { case SND_SOC_DOBJ_MIXER: - remove_mixer(comp, dobj, pass); + soc_tplg_remove_mixer(comp, dobj, pass); break; case SND_SOC_DOBJ_ENUM: - remove_enum(comp, dobj, pass); + soc_tplg_remove_enum(comp, dobj, pass); break; case SND_SOC_DOBJ_BYTES: - remove_bytes(comp, dobj, pass); + soc_tplg_remove_bytes(comp, dobj, pass); break; case SND_SOC_DOBJ_GRAPH: - remove_route(comp, dobj, pass); + soc_tplg_remove_route(comp, dobj, pass); break; case SND_SOC_DOBJ_WIDGET: - remove_widget(comp, dobj, pass); + soc_tplg_remove_widget(comp, dobj, pass); break; case SND_SOC_DOBJ_PCM: - remove_dai(comp, dobj, pass); + soc_tplg_remove_dai(comp, dobj, pass); break; case SND_SOC_DOBJ_DAI_LINK: - remove_link(comp, dobj, pass); + soc_tplg_remove_link(comp, dobj, pass); break; case SND_SOC_DOBJ_BACKEND_LINK: /* From patchwork Fri Jan 27 23:11:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD6D0C54EAA for ; Fri, 27 Jan 2023 15:13:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7E612A4C; Fri, 27 Jan 2023 16:12:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7E612A4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832400; bh=c8ILVtNNmJQWo7vrskMPEAqhtWXqqQZMWAdnFedFvsY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=XRvLXbgQAwAh4J63s1K+vdeahPEX/RjjFVn20Gt//cUayDsfruOIY5AKloViPzZ3m E+xU4w951+MOocA+55tf5oYGrHfFk2BTGTvk4Jw2M26jqHnvd25dCa4EjmwzRFagIc DZ82iXSkyM/5hfX0LRA6l4devCDmdrO7lhTYyTNU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CFC85F80579; Fri, 27 Jan 2023 16:10:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49D9AF80553; Fri, 27 Jan 2023 16:10:28 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D377EF80548 for ; Fri, 27 Jan 2023 16:10:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D377EF80548 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cqardbZU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832225; x=1706368225; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c8ILVtNNmJQWo7vrskMPEAqhtWXqqQZMWAdnFedFvsY=; b=cqardbZU12+H50iWABnptSPEbn2YrnFNWZ6aB0vlVSu2RHjwoIkHdv6N rJJHL51jPly2j+esBfoKEJEogd4hyLPWK4QYvdsW1WaZJCWfQFmxQqCsQ /lnuZ7PTdaVJPcpvxAaNLSyLX8OtsznXma6Ra5qDda03PalmiHGmrUaGJ f4bXFaer63Txqp77BOWJyO8eNP4RRKLr1OuuKFs3aYqzV7aFkdYCMQKCg 70suyMcXrj8cwLwGJ1DkT42vAwqs2i78a/1yUFQGqRALYEHZCHIlZFBSP CK3tR6DDyB2jpgg4OYhc4V/YRvQDD84GVlNMdZQF/a9pNSihRVATcRNHA g==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795825" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795825" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709019" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709019" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:21 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 06/11] ASoC: topology: Remove unnecessary forward declarations Date: Sat, 28 Jan 2023 00:11:06 +0100 Message-Id: <20230127231111.937721-7-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There is no need to forward declare functions if their use is after their definition. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index a952f7eaa646..766de161aa4a 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -76,9 +76,6 @@ struct soc_tplg { struct snd_soc_tplg_ops *ops; }; -static int soc_tplg_process_headers(struct soc_tplg *tplg); -static int soc_tplg_complete(struct soc_tplg *tplg); - /* check we dont overflow the data for this control chunk */ static int soc_tplg_check_elem_count(struct soc_tplg *tplg, size_t elem_size, unsigned int count, size_t bytes, const char *elem_type) From patchwork Fri Jan 27 23:11:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B8DEC54EAA for ; Fri, 27 Jan 2023 15:13:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8F4E6E77; Fri, 27 Jan 2023 16:12:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8F4E6E77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832409; bh=DZxShMeDJdCJ9ZWYAt7p149NTuNjLiDi7dB+qw8x9lE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=n0yTW7DwOydFxC+37GfhOT07YXaLCpvTpolMelFMEP5Jh1xjgwCZfgpdtawE3MP4J b+N2BEDgPpk6rvh9J7lXzf4KFwOVRRdpTbnfqQAwJjeb01cBCwM/OCvY9uvQekJgHw L/BQZkJbeGpc78pp6O3uKAAlUxu6qKqoGwjvMNvg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 71F94F8057A; Fri, 27 Jan 2023 16:10:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 20829F80568; Fri, 27 Jan 2023 16:10:30 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CE58BF80543 for ; Fri, 27 Jan 2023 16:10:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CE58BF80543 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FugZb2xh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832227; x=1706368227; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DZxShMeDJdCJ9ZWYAt7p149NTuNjLiDi7dB+qw8x9lE=; b=FugZb2xhbERBwbC9aBVLtiu9q6l4uZa51v7OR25ksdewblUTjg/Y8ApW 94IFbcHXUmkGSZOkj2ujtyBXfHhlAk9xTqYhL8Dzd5Y2LcmMSeJSfPb7M FNkc1fC15rksqfv70iM52QuUtHYjqRxTq/LHsousXDAMzHd3FFEvzGEGf 3lsOqQDwUXPIu7HYpKmDKQz05IUWBsSML0BMY2cuDCEty0/6vojNEHefF TISmaSV4EvAX/uqcphfgW4f1zOT0pSO0z2nU42Aogk4MgjV5IE8ZZTLkI h5Hs7AtceI/lT3xt3gSkZniCM2+7wMtwFIuwwDSIcR5pSnbV2wjhw9rAs g==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795829" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795829" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709024" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709024" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:23 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 07/11] ASoC: topology: Pass correct pointer instead of casting Date: Sat, 28 Jan 2023 00:11:07 +0100 Message-Id: <20230127231111.937721-8-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Instead of passing address of structure, the containing structure is cast to target structure. While it works - the expected structure is the first field of containing one - it is bad practice, fix this by passing pointer to structure field. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 766de161aa4a..c35c0c53a184 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -721,7 +721,7 @@ static int soc_tplg_dbytes_create(struct soc_tplg *tplg, size_t size) } /* pass control to driver for optional further init */ - ret = soc_tplg_control_load(tplg, &kc, (struct snd_soc_tplg_ctl_hdr *)be); + ret = soc_tplg_control_load(tplg, &kc, &be->hdr); if (ret < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", be->hdr.name); goto err; @@ -805,7 +805,7 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, size_t size) } /* pass control to driver for optional further init */ - ret = soc_tplg_control_load(tplg, &kc, (struct snd_soc_tplg_ctl_hdr *)mc); + ret = soc_tplg_control_load(tplg, &kc, &mc->hdr); if (ret < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", mc->hdr.name); goto err; @@ -973,7 +973,7 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, size_t size) } /* pass control to driver for optional further init */ - ret = soc_tplg_control_load(tplg, &kc, (struct snd_soc_tplg_ctl_hdr *)ec); + ret = soc_tplg_control_load(tplg, &kc, &ec->hdr); if (ret < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", ec->hdr.name); goto err; @@ -1189,7 +1189,7 @@ static int soc_tplg_dapm_widget_dmixer_create(struct soc_tplg *tplg, struct snd_ } /* pass control to driver for optional further init */ - err = soc_tplg_control_load(tplg, kc, (struct snd_soc_tplg_ctl_hdr *)mc); + err = soc_tplg_control_load(tplg, kc, &mc->hdr); if (err < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", mc->hdr.name); @@ -1273,7 +1273,7 @@ static int soc_tplg_dapm_widget_denum_create(struct soc_tplg *tplg, struct snd_k } /* pass control to driver for optional further init */ - err = soc_tplg_control_load(tplg, kc, (struct snd_soc_tplg_ctl_hdr *)ec); + err = soc_tplg_control_load(tplg, kc, &ec->hdr); if (err < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", ec->hdr.name); @@ -1325,7 +1325,7 @@ static int soc_tplg_dapm_widget_dbytes_create(struct soc_tplg *tplg, struct snd_ } /* pass control to driver for optional further init */ - err = soc_tplg_control_load(tplg, kc, (struct snd_soc_tplg_ctl_hdr *)be); + err = soc_tplg_control_load(tplg, kc, &be->hdr); if (err < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", be->hdr.name); From patchwork Fri Jan 27 23:11:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C61E5C38142 for ; Fri, 27 Jan 2023 15:13:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 96C9AE7E; Fri, 27 Jan 2023 16:12:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 96C9AE7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832423; bh=xrYcmvjWf+uFdMitGF3Y74ed18GwxPVNfZPcF6Y6eN4=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=hzz0Tg6Shsn1BMsd2kW9k0KLxb3Y4YC5Lg5lrJGl1qYVZ8xceztoGIHmPiQvLXcNz N0CDMLM8ywnkL/yA2tBn7a6mt6iZQqq6jUqEmh908QdB5tMBsRWZ7zJWaehBrBozQK wOEn+IcX6ufa6njPkrt7GyBK/tCK3XTIHUi+n3Zw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 19F14F8057E; Fri, 27 Jan 2023 16:10:36 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8AE2BF8056F; Fri, 27 Jan 2023 16:10:31 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 87CE7F80552 for ; Fri, 27 Jan 2023 16:10:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87CE7F80552 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=myvq+l1j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832228; x=1706368228; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xrYcmvjWf+uFdMitGF3Y74ed18GwxPVNfZPcF6Y6eN4=; b=myvq+l1jYIJLQamlItHHqzz2n/W0/lTxf2i57fQbCgvStLjOuXEAmOUO lQ64leDhLXfbldN6p6fqklMD7lw39j5oKMsHs1BFeyXa95wi/wCqobPSv L6NabbHgy6xV3lD7O39aHMqe3L801DIZY51TAGkyVPORiP7TQzksYvaG2 mFQzBBmllckmUR5Dd7LRS36wmJ3CebT6mt6PQ9wI27DIIQIDTpEBqDD9V blhq4x2br6C4v5EqMaO1QlROkqo6TtZzgChk1n6gu8+Bruu2IUOE8reEE yyaDHF4d/4iSjQeXyoxF/mDPrDXrQi/9b7N9CeMppApuT95i6RITn5T9d g==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795844" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795844" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709029" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709029" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:25 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 08/11] ASoC: topology: Return an error on complete() failure Date: Sat, 28 Jan 2023 00:11:08 +0100 Message-Id: <20230127231111.937721-9-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Function soc_tplg_dapm_complete() detects an error and logs it, but doesn't return failure to the caller, fix it by returning the error. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index c35c0c53a184..08dd55f94584 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1563,7 +1563,7 @@ static int soc_tplg_dapm_complete(struct soc_tplg *tplg) dev_err(tplg->dev, "ASoC: failed to create new widgets %d\n", ret); - return 0; + return ret; } static int set_stream_info(struct soc_tplg *tplg, struct snd_soc_pcm_stream *stream, From patchwork Fri Jan 27 23:11:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 296CDC38142 for ; Fri, 27 Jan 2023 15:14:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3BA0EE71; Fri, 27 Jan 2023 16:13:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3BA0EE71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832443; bh=qHFv32Sphq3shdPGA48KxW70YX1Wi01oojb+PZVT0JE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=UhlZthxeLccVqTtsN4foCWtD9VevAfElP+OgzVYc67p4Kum/Qe56OmdPe+4qS82Yg kCnn942QjF2uJFrutPM4mUPVNZsOCm2PQBI/fTMw+EwbYGCoh7OtqOJjNaf3ntutqd a4r+hee5Rb4N93vBfse+QIjkzaHhprZ9xVljLU4Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A0DB3F8059F; Fri, 27 Jan 2023 16:10:36 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E9F1CF8057B; Fri, 27 Jan 2023 16:10:32 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5BEBDF80567 for ; Fri, 27 Jan 2023 16:10:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5BEBDF80567 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ElezYAdU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832230; x=1706368230; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qHFv32Sphq3shdPGA48KxW70YX1Wi01oojb+PZVT0JE=; b=ElezYAdUEKySAbcD2nHEkAWD3WFSnPBm7tXmyqiIcaLs3F2NqaPHi+jP ORStIadsceia+0gVBWm37SCDJluxuonp60MRn0c62WDv0Rzp/K4zuZPHo ahEP3qXR3Us7DvmqlBL/orp4bVjhlFXTJUkWpy00wTy8GAqpLze1MPhrS aeBzxHEthvMOEexGX2Fkkvbljf8Z//PYJeJT7D1WxYPmpkuX4vxkfXam8 4fXeSzZ1j+z95Non157niBXN6qdivTTdccXF15mIHjkhH+HigVCMX/y7W gmfOY4Erv58jQujr6pqhT9cRS+47GdL6mYiIC6Lio1Bwg2Gb3f5Ofltfs w==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795855" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795855" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709034" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709034" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:27 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 09/11] ASoC: Topology: Remove unnecessary check for EOF Date: Sat, 28 Jan 2023 00:11:09 +0100 Message-Id: <20230127231111.937721-10-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Caller already checks if hdr_pos is behind EOF, before calling soc_tplg_valid_header(), so there is no need to recheck it again. This also allows to remove behaviour of return 0 - forcing the caller to break out of while loop. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 08dd55f94584..6689cf44464c 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2389,9 +2389,6 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, static int soc_tplg_valid_header(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) { - if (soc_tplg_get_hdr_offset(tplg) >= tplg->fw->size) - return 0; - if (le32_to_cpu(hdr->size) != sizeof(*hdr)) { dev_err(tplg->dev, "ASoC: invalid header size for type %d at offset 0x%lx size 0x%zx.\n", @@ -2442,7 +2439,7 @@ static int soc_tplg_valid_header(struct soc_tplg *tplg, return -EINVAL; } - return 1; + return 0; } /* check header type and call appropriate handler */ @@ -2528,8 +2525,6 @@ static int soc_tplg_process_headers(struct soc_tplg *tplg) dev_err(tplg->dev, "ASoC: topology: invalid header: %d\n", ret); return ret; - } else if (ret == 0) { - break; } /* load the header object */ From patchwork Fri Jan 27 23:11:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 646C3C54EAA for ; Fri, 27 Jan 2023 15:14:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 28286E98; Fri, 27 Jan 2023 16:13:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 28286E98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832461; bh=nD9stkrLrT5BglI11fXrao9wpCwGGGCwogO9XxndKZ4=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=CJE5k7wv5WhR7Q0BbEoG31ALoteNLCUkTanukjs7hy3u6ijFeQ8NhsFIHEU0RRpdm o/DDep4gLnpbRoXdoCHIJZ3KltRRXnt9AI9WkQW7OA92Qv/c5/4F/S1pEhtzpg+T69 aLM1sawg611D7OLVP/iDWKXAeUO+RkG+ReauUbbo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AEF44F805A9; Fri, 27 Jan 2023 16:10:40 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6636BF8057C; Fri, 27 Jan 2023 16:10:35 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D34B0F8057C for ; Fri, 27 Jan 2023 16:10:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D34B0F8057C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=iutlgIm+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832234; x=1706368234; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nD9stkrLrT5BglI11fXrao9wpCwGGGCwogO9XxndKZ4=; b=iutlgIm+k1/X+WhRkzGoT21wDZPPP8Jc22zFsnNNuL1kd9CIMFq94+bi mtHeU95uHZcDpZ6Sgv8Kruy/sa/lSU1nrbjRsE6buWrw7zN7UCf6imRrA t2+GkD66bGumSTooIs6nVNQ0lglODbkNJPwRMUCVn9JkVKk48I9C0TmZT loyfDGhOG+fn0NhyRl8EatsFFQ3I0YKLjdK4lIBbdryfcTmRpX0PKGq0Y ErF2EeNJx9r86JGb6RgfnKGk4/bZ9gUIShJtQ4ZYwnzrVKSrwmKt8nfXG 8mJPVmsyvfoiD/iFrpnyYMBqOm5DyIcauRjfP+A2zwI/vkY8SiR0IXPcQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795867" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795867" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709038" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709038" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:29 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 10/11] ASoC: topology: Unify kcontrol removal code Date: Sat, 28 Jan 2023 00:11:10 +0100 Message-Id: <20230127231111.937721-11-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Functions removing bytes, enum and mixer kcontrols are identical. Unify them under one function and use it to free associated kcontrols. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- sound/soc/soc-topology.c | 48 +++++----------------------------------- 1 file changed, 6 insertions(+), 42 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 6689cf44464c..9f527d9baf1c 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -350,41 +350,9 @@ static int soc_tplg_add_kcontrol(struct soc_tplg *tplg, tplg->dev, k, comp->name_prefix, comp, kcontrol); } -/* remove a mixer kcontrol */ -static void soc_tplg_remove_mixer(struct snd_soc_component *comp, - struct snd_soc_dobj *dobj, int pass) -{ - struct snd_card *card = comp->card->snd_card; - - if (pass != SOC_TPLG_PASS_CONTROL) - return; - - if (dobj->ops && dobj->ops->control_unload) - dobj->ops->control_unload(comp, dobj); - - snd_ctl_remove(card, dobj->control.kcontrol); - list_del(&dobj->list); -} - -/* remove an enum kcontrol */ -static void soc_tplg_remove_enum(struct snd_soc_component *comp, - struct snd_soc_dobj *dobj, int pass) -{ - struct snd_card *card = comp->card->snd_card; - - if (pass != SOC_TPLG_PASS_CONTROL) - return; - - if (dobj->ops && dobj->ops->control_unload) - dobj->ops->control_unload(comp, dobj); - - snd_ctl_remove(card, dobj->control.kcontrol); - list_del(&dobj->list); -} - -/* remove a byte kcontrol */ -static void soc_tplg_remove_bytes(struct snd_soc_component *comp, - struct snd_soc_dobj *dobj, int pass) +/* remove kcontrol */ +static void soc_tplg_remove_kcontrol(struct snd_soc_component *comp, struct snd_soc_dobj *dobj, + int pass) { struct snd_card *card = comp->card->snd_card; @@ -2618,14 +2586,10 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp) list) { switch (dobj->type) { - case SND_SOC_DOBJ_MIXER: - soc_tplg_remove_mixer(comp, dobj, pass); - break; - case SND_SOC_DOBJ_ENUM: - soc_tplg_remove_enum(comp, dobj, pass); - break; case SND_SOC_DOBJ_BYTES: - soc_tplg_remove_bytes(comp, dobj, pass); + case SND_SOC_DOBJ_ENUM: + case SND_SOC_DOBJ_MIXER: + soc_tplg_remove_kcontrol(comp, dobj, pass); break; case SND_SOC_DOBJ_GRAPH: soc_tplg_remove_route(comp, dobj, pass); From patchwork Fri Jan 27 23:11:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 647550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CBB6C54EAA for ; Fri, 27 Jan 2023 15:14:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6579EE83; Fri, 27 Jan 2023 16:13:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6579EE83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674832474; bh=J0eeab6Vdo7hKXtLUsOwjfKjWW5PmfnD+/w56aq5ABU=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Fb8pXXdERkmNLz8V0J8diFgO1foVf0O/iS2MHiHbSI+37hJA2+lTfEX2Ip2U0CITa Q9QbgiXvh6ke+ej75aHxPuHsLYySYF1PKbMSIM8ZLBbdg8xkxGogPK/2tocCNgMWCC HTwGr8tRFnhe5ucHwDCXfqYKap81LtFdScQSXKA8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3FD71F805AD; Fri, 27 Jan 2023 16:10:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4CA3DF805A1; Fri, 27 Jan 2023 16:10:38 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 77898F80580 for ; Fri, 27 Jan 2023 16:10:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 77898F80580 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=OA5cJBlr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674832234; x=1706368234; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J0eeab6Vdo7hKXtLUsOwjfKjWW5PmfnD+/w56aq5ABU=; b=OA5cJBlrsCRfHf0xl0WwA60IxbMjMsyP8v3quR2jnUMCf0bPPJxcWeUU yqVvOALZ2fV5HnwzDScQjpH1muoduCmMMcPvfBTVgSPGXc6L+pBs68z2n hIT4tsmD4J0m56V3lH+81YAakcpgNp3Cp6O7U13WOsn4hLp3bWjo8cbFK JkzvK26GRTvZMiujRFC9Fy5zwEDjDkHGFb6Y8NzqTLhIEyJ3gOt5T08w6 paCYd5lKqu+nzSzCd7txXgRxiGHu6K1emXnJ8nnTIfvReQKv4VQcoa1Yq oF2cxez9/nGBtgACVkZOAFJFi2zSX0vppnNMO1wbnUeZUVlruSyXxiMgp w==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="324795877" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="324795877" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 07:10:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908709042" X-IronPort-AV: E=Sophos;i="5.97,251,1669104000"; d="scan'208";a="908709042" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 07:10:31 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 11/11] ASoC: topology: Use unload() op directly Date: Sat, 28 Jan 2023 00:11:11 +0100 Message-Id: <20230127231111.937721-12-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> References: <20230127231111.937721-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" struct snd_soc_dobj only needs pointer to the unload function, instead however, there is pointer to all topology operations. Change code to use the function pointer instead of pointer to structure containing all operations. Reviewed-by: Cezary Rojewski Reviewed-by: Ranjani Sridharan Signed-off-by: Amadeusz Sławiński --- include/sound/soc-topology.h | 2 +- sound/soc/soc-topology.c | 48 +++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h index b4b896f83b94..f055c6917f6c 100644 --- a/include/sound/soc-topology.h +++ b/include/sound/soc-topology.h @@ -62,7 +62,7 @@ struct snd_soc_dobj { enum snd_soc_dobj_type type; unsigned int index; /* objects can belong in different groups */ struct list_head list; - struct snd_soc_tplg_ops *ops; + int (*unload)(struct snd_soc_component *comp, struct snd_soc_dobj *dobj); union { struct snd_soc_dobj_control control; struct snd_soc_dobj_widget widget; diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 9f527d9baf1c..e66b0d9e387a 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -359,8 +359,8 @@ static void soc_tplg_remove_kcontrol(struct snd_soc_component *comp, struct snd_ if (pass != SOC_TPLG_PASS_CONTROL) return; - if (dobj->ops && dobj->ops->control_unload) - dobj->ops->control_unload(comp, dobj); + if (dobj->unload) + dobj->unload(comp, dobj); snd_ctl_remove(card, dobj->control.kcontrol); list_del(&dobj->list); @@ -373,8 +373,8 @@ static void soc_tplg_remove_route(struct snd_soc_component *comp, if (pass != SOC_TPLG_PASS_GRAPH) return; - if (dobj->ops && dobj->ops->dapm_route_unload) - dobj->ops->dapm_route_unload(comp, dobj); + if (dobj->unload) + dobj->unload(comp, dobj); list_del(&dobj->list); } @@ -391,8 +391,8 @@ static void soc_tplg_remove_widget(struct snd_soc_component *comp, if (pass != SOC_TPLG_PASS_WIDGET) return; - if (dobj->ops && dobj->ops->widget_unload) - dobj->ops->widget_unload(comp, dobj); + if (dobj->unload) + dobj->unload(comp, dobj); if (!w->kcontrols) goto free_news; @@ -418,8 +418,8 @@ static void soc_tplg_remove_dai(struct snd_soc_component *comp, if (pass != SOC_TPLG_PASS_PCM_DAI) return; - if (dobj->ops && dobj->ops->dai_unload) - dobj->ops->dai_unload(comp, dobj); + if (dobj->unload) + dobj->unload(comp, dobj); for_each_component_dais_safe(comp, dai, _dai) if (dai->driver == dai_drv) @@ -438,8 +438,8 @@ static void soc_tplg_remove_link(struct snd_soc_component *comp, if (pass != SOC_TPLG_PASS_PCM_DAI) return; - if (dobj->ops && dobj->ops->link_unload) - dobj->ops->link_unload(comp, dobj); + if (dobj->unload) + dobj->unload(comp, dobj); list_del(&dobj->list); snd_soc_remove_pcm_runtime(comp->card, @@ -453,8 +453,8 @@ static void remove_backend_link(struct snd_soc_component *comp, if (pass != SOC_TPLG_PASS_LINK) return; - if (dobj->ops && dobj->ops->link_unload) - dobj->ops->link_unload(comp, dobj); + if (dobj->unload) + dobj->unload(comp, dobj); /* * We don't free the link here as what soc_tplg_remove_link() do since BE @@ -678,7 +678,8 @@ static int soc_tplg_dbytes_create(struct soc_tplg *tplg, size_t size) sbe->max = le32_to_cpu(be->max); sbe->dobj.type = SND_SOC_DOBJ_BYTES; - sbe->dobj.ops = tplg->ops; + if (tplg->ops) + sbe->dobj.unload = tplg->ops->control_unload; INIT_LIST_HEAD(&sbe->dobj.list); /* map io handlers */ @@ -754,8 +755,9 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, size_t size) sm->invert = le32_to_cpu(mc->invert); sm->platform_max = le32_to_cpu(mc->platform_max); sm->dobj.index = tplg->index; - sm->dobj.ops = tplg->ops; sm->dobj.type = SND_SOC_DOBJ_MIXER; + if (tplg->ops) + sm->dobj.unload = tplg->ops->control_unload; INIT_LIST_HEAD(&sm->dobj.list); /* map io handlers */ @@ -900,7 +902,8 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, size_t size) se->mask = le32_to_cpu(ec->mask); se->dobj.index = tplg->index; se->dobj.type = SND_SOC_DOBJ_ENUM; - se->dobj.ops = tplg->ops; + if (tplg->ops) + se->dobj.unload = tplg->ops->control_unload; INIT_LIST_HEAD(&se->dobj.list); switch (le32_to_cpu(ec->hdr.ops.info)) { @@ -1077,7 +1080,8 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg, /* add route dobj to dobj_list */ route->dobj.type = SND_SOC_DOBJ_GRAPH; - route->dobj.ops = tplg->ops; + if (tplg->ops) + route->dobj.unload = tplg->ops->control_unload; route->dobj.index = tplg->index; list_add(&route->dobj.list, &tplg->comp->dobj_list); @@ -1443,7 +1447,8 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, widget->dobj.type = SND_SOC_DOBJ_WIDGET; widget->dobj.widget.kcontrol_type = kcontrol_type; - widget->dobj.ops = tplg->ops; + if (tplg->ops) + widget->dobj.unload = tplg->ops->widget_unload; widget->dobj.index = tplg->index; list_add(&widget->dobj.list, &tplg->comp->dobj_list); @@ -1621,8 +1626,9 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg, } dai_drv->dobj.index = tplg->index; - dai_drv->dobj.ops = tplg->ops; dai_drv->dobj.type = SND_SOC_DOBJ_PCM; + if (tplg->ops) + dai_drv->dobj.unload = tplg->ops->dai_unload; list_add(&dai_drv->dobj.list, &tplg->comp->dobj_list); /* register the DAI to the component */ @@ -1691,8 +1697,9 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg, link->num_platforms = 1; link->dobj.index = tplg->index; - link->dobj.ops = tplg->ops; link->dobj.type = SND_SOC_DOBJ_DAI_LINK; + if (tplg->ops) + link->dobj.unload = tplg->ops->link_unload; if (strlen(pcm->pcm_name)) { link->name = devm_kstrdup(tplg->dev, pcm->pcm_name, GFP_KERNEL); @@ -2099,8 +2106,9 @@ static int soc_tplg_link_config(struct soc_tplg *tplg, /* for unloading it in snd_soc_tplg_component_remove */ link->dobj.index = tplg->index; - link->dobj.ops = tplg->ops; link->dobj.type = SND_SOC_DOBJ_BACKEND_LINK; + if (tplg->ops) + link->dobj.unload = tplg->ops->link_unload; list_add(&link->dobj.list, &tplg->comp->dobj_list); return 0;