From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA77FC433FE for ; Wed, 30 Mar 2022 11:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243509AbiC3Lv2 (ORCPT ); Wed, 30 Mar 2022 07:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343982AbiC3LuQ (ORCPT ); Wed, 30 Mar 2022 07:50:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E2A426E768; Wed, 30 Mar 2022 04:47:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 748FF615B7; Wed, 30 Mar 2022 11:47:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01E54C34111; Wed, 30 Mar 2022 11:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640858; bh=kDKQLtxdtubo8cbSoy0C0473dnGZFJuLtrEEafSBCiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pMEJT1KLoh8zPaDlHJsR6dqkCaxpUBaN6fLjTr5VW9yhFgv/VtQJrzenG/W7WxR/9 Z8m7EZIJ+p8EItpX4fKjrRnaUkf55vpginzMfkb576BStHBUqNEQvGX1eRMn5w+rYR 5QLlyaDIBDCUxWEVgPmyS85foU4qFOTYwRXckeqZXveujGfsgxmmEJZipncS+718NJ A6OEbQqXe9gOMQgEpuUTK1ogpJh9eoXbKJoEVrBJnWyypB9WVWuS5sBn2VsTbSZwgb 63uPA0MBdkXACkekhW5NSZ3nnoZHHhom3HOKbm2RvQmFEyCHtCBozwbbqLaObSORmL 9HdRP1+i7a54w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shengjiu Wang , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.17 34/66] ASoC: soc-core: skip zero num_dai component in searching dai name Date: Wed, 30 Mar 2022 07:46:13 -0400 Message-Id: <20220330114646.1669334-34-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114646.1669334-1-sashal@kernel.org> References: <20220330114646.1669334-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shengjiu Wang [ Upstream commit f7d344a2bd5ec81fbd1ce76928fd059e57ec9bea ] In the case like dmaengine which's not a dai but as a component, the num_dai is zero, dmaengine component has the same component_of_node as cpu dai, when cpu dai component is not ready, but dmaengine component is ready, try to get cpu dai name, the snd_soc_get_dai_name() return -EINVAL, not -EPROBE_DEFER, that cause below error: asoc-simple-card : parse error -22 asoc-simple-card: probe of failed with error -22 The sound card failed to probe. So this patch fixes the issue above by skipping the zero num_dai component in searching dai name. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1644491952-7457-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 434e61b46983..a088bc9f7dd7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3233,7 +3233,7 @@ int snd_soc_get_dai_name(const struct of_phandle_args *args, for_each_component(pos) { struct device_node *component_of_node = soc_component_to_node(pos); - if (component_of_node != args->np) + if (component_of_node != args->np || !pos->num_dai) continue; ret = snd_soc_component_of_xlate_dai_name(pos, args, dai_name); -- 2.34.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 91BA7C433FE for ; Wed, 30 Mar 2022 11:50:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DA67917F0; Wed, 30 Mar 2022 13:49:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DA67917F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648641012; bh=kDKQLtxdtubo8cbSoy0C0473dnGZFJuLtrEEafSBCiw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O3B4n/XGwY07qmOuGNhPJ9+rqSmCIEwPqBSV4g6OcDasvZGKiCIJlb+g0fsSiF5hQ UFooLDp9Vw0VRAylUU3wxpqLzWg6bELBbBjl399/+NvAt+Fx5RAVxrbqkwn1jSzyF2 bhytj9zy0RyUuzhV/MB5D5XqRwK7lWm3nCq6qTX4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6B9ABF80536; Wed, 30 Mar 2022 13:47:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9B9F1F80537; Wed, 30 Mar 2022 13:47:48 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6111FF80528 for ; Wed, 30 Mar 2022 13:47:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6111FF80528 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pMEJT1KL" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 145716162C; Wed, 30 Mar 2022 11:47:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01E54C34111; Wed, 30 Mar 2022 11:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640858; bh=kDKQLtxdtubo8cbSoy0C0473dnGZFJuLtrEEafSBCiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pMEJT1KLoh8zPaDlHJsR6dqkCaxpUBaN6fLjTr5VW9yhFgv/VtQJrzenG/W7WxR/9 Z8m7EZIJ+p8EItpX4fKjrRnaUkf55vpginzMfkb576BStHBUqNEQvGX1eRMn5w+rYR 5QLlyaDIBDCUxWEVgPmyS85foU4qFOTYwRXckeqZXveujGfsgxmmEJZipncS+718NJ A6OEbQqXe9gOMQgEpuUTK1ogpJh9eoXbKJoEVrBJnWyypB9WVWuS5sBn2VsTbSZwgb 63uPA0MBdkXACkekhW5NSZ3nnoZHHhom3HOKbm2RvQmFEyCHtCBozwbbqLaObSORmL 9HdRP1+i7a54w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 34/66] ASoC: soc-core: skip zero num_dai component in searching dai name Date: Wed, 30 Mar 2022 07:46:13 -0400 Message-Id: <20220330114646.1669334-34-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114646.1669334-1-sashal@kernel.org> References: <20220330114646.1669334-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, Shengjiu Wang , tiwai@suse.com, lgirdwood@gmail.com, Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Shengjiu Wang [ Upstream commit f7d344a2bd5ec81fbd1ce76928fd059e57ec9bea ] In the case like dmaengine which's not a dai but as a component, the num_dai is zero, dmaengine component has the same component_of_node as cpu dai, when cpu dai component is not ready, but dmaengine component is ready, try to get cpu dai name, the snd_soc_get_dai_name() return -EINVAL, not -EPROBE_DEFER, that cause below error: asoc-simple-card : parse error -22 asoc-simple-card: probe of failed with error -22 The sound card failed to probe. So this patch fixes the issue above by skipping the zero num_dai component in searching dai name. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1644491952-7457-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 434e61b46983..a088bc9f7dd7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3233,7 +3233,7 @@ int snd_soc_get_dai_name(const struct of_phandle_args *args, for_each_component(pos) { struct device_node *component_of_node = soc_component_to_node(pos); - if (component_of_node != args->np) + if (component_of_node != args->np || !pos->num_dai) continue; ret = snd_soc_component_of_xlate_dai_name(pos, args, dai_name); -- 2.34.1