From patchwork Wed Mar 1 04:08:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?VHJldm9yIFd1ICjlkLPmlofoia8p?= X-Patchwork-Id: 62759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3429250wrd; Tue, 28 Feb 2023 20:39:13 -0800 (PST) X-Google-Smtp-Source: AK7set/YhLdUBqX0pgSXDuzIocxhTyc3T/HkGOj233yaiaILLwaY3GrWfyy0mhNAgDfevSlNUEDJ X-Received: by 2002:a17:906:9f19:b0:8b1:7eb4:6bea with SMTP id fy25-20020a1709069f1900b008b17eb46beamr7788925ejc.38.1677645553483; Tue, 28 Feb 2023 20:39:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677645553; cv=none; d=google.com; s=arc-20160816; b=UksatdSbHUR+UzuSpDvcUBRyYVQR3z2EoCEvtu6yfsA9vQW62uE0KZPzqU+qyJUbNI 7UZv3DjaKcvNMfLYeHBD49amHDAZRLvaxWbmFUQPzT3JPRHSW7GDRqem/lRGyId4xBNl QdpLKvew0qjUQ+MF1kljcoiSd2cNGOrKXRnri6r8BbkV6cWSe7mSx4SpiIEpsFHWmoaE gn3oy416bp2fnTkCXC+Aa8SW9Wnt+N0pfd6NQJhdB2FUefmf+dW2hI+JHoSzs/XBpdeM MWYlQJ0q7edTJL5zIbyc5ZIDs9OqdM78qpkmjKFZoUIffHF+VICpG5nViPFcQVNTdw6E Ft8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=xb3SkvGVmzd3yzT6owf7WEvRStA93vi0UuCcvQH8/l4=; b=nOytTj5DwANTD3KKDpfZ/Ck90+VPRIEeNbP4ssfQD3TVCTAiEQQNXJb0oSkTGCUGzd acNXyPhjIabWq0J6AoCNT1SFebK8AHtj4On76YX6JcrxTFqjACGX4pg92Z25I/IqyzVV uvKmh4l83fvlIl9j8RCHx+g6IrPhzoEL/9kTUfXFK9c0pA9rhAsTYQn4rI6AFHW2fVFM fOU4j+8kBfZGLDiZbbCN+/0bGYow3E0d5Es0I49fwoKVwr/WxzUILBUTBTA6Ai9K0oLf OcGbeqq1qGdJXLoLB9FPAfvwMqsIdXZZ1SpehQG7VypBpGXpArJjm82l4ey9sLRDpTlE g7KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=sVUSENsc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a170906038f00b008b24caebd73si13233776eja.225.2023.02.28.20.38.50; Tue, 28 Feb 2023 20:39:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=sVUSENsc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbjCAEIs (ORCPT + 99 others); Tue, 28 Feb 2023 23:08:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbjCAEIq (ORCPT ); Tue, 28 Feb 2023 23:08:46 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A250113D for ; Tue, 28 Feb 2023 20:08:40 -0800 (PST) X-UUID: be4ce7b6b7e611eda06fc9ecc4dadd91-20230301 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=xb3SkvGVmzd3yzT6owf7WEvRStA93vi0UuCcvQH8/l4=; b=sVUSENsc3VZ0kMe3+EippHA08bvo1h33DIow/TQ8o8VQ3KNRCIYxjtza0xH+0Ysfu4n1cDQa6Y+M79sKKfC0jS+32DySRH0q5Z7arf9BsKWD6vGcYwi5jSHEKu8Nk7qKc6Vd9JQQwkp6wk6+twD257qkUq02yk2WM6W8kWmUgqc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:7be0c588-3004-4e32-aba0-d3ec730eb252,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:25b5999,CLOUDID:ebdfef26-564d-42d9-9875-7c868ee415ec,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: be4ce7b6b7e611eda06fc9ecc4dadd91-20230301 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1407312854; Wed, 01 Mar 2023 12:08:38 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 1 Mar 2023 12:08:36 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 1 Mar 2023 12:08:36 +0800 From: Trevor Wu To: , , , , CC: , , , , , Subject: [PATCH] ASoC: mediatek: add missing initialization Date: Wed, 1 Mar 2023 12:08:35 +0800 Message-ID: <20230301040835.6322-1-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759138864060099263?= X-GMAIL-MSGID: =?utf-8?q?1759138864060099263?= In etdm dai driver, dai_etdm_parse_of() function is used to parse dts properties to get parameters. There are two for-loops which are sepearately for all etdm and etdm input only cases. In etdm in only loop, dai_id is not initialized, so it keeps the value intiliazed in another loop. In the patch, add the missing initialization to fix the unexpected parsing problem. Signed-off-by: Trevor Wu --- sound/soc/mediatek/mt8188/mt8188-dai-etdm.c | 3 +++ sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c b/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c index 1c53d4cb19bb..7a37752d4244 100644 --- a/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c +++ b/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c @@ -2498,6 +2498,9 @@ static void mt8188_dai_etdm_parse_of(struct mtk_base_afe *afe) /* etdm in only */ for (i = 0; i < 2; i++) { + dai_id = ETDM_TO_DAI_ID(i); + etdm_data = afe_priv->dai_priv[dai_id]; + snprintf(prop, sizeof(prop), "mediatek,%s-chn-disabled", of_afe_etdms[i].name); diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c index c2e268054773..f2c9a1fdbe0d 100644 --- a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c +++ b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c @@ -2567,6 +2567,9 @@ static void mt8195_dai_etdm_parse_of(struct mtk_base_afe *afe) /* etdm in only */ for (i = 0; i < 2; i++) { + dai_id = ETDM_TO_DAI_ID(i); + etdm_data = afe_priv->dai_priv[dai_id]; + ret = snprintf(prop, sizeof(prop), "mediatek,%s-chn-disabled", of_afe_etdms[i].name);