Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2238136pxb; Wed, 30 Mar 2022 20:19:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOF3euQo4XC/Z822GgsY5LK8wkkDbEC2eFpZuprEf2Zm+DsgrV3qB45PHi1qeCp1wPuyhm X-Received: by 2002:a63:1b5c:0:b0:382:76f4:c76b with SMTP id b28-20020a631b5c000000b0038276f4c76bmr8974116pgm.424.1648696762535; Wed, 30 Mar 2022 20:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648696762; cv=none; d=google.com; s=arc-20160816; b=IHheAfad6lZDnBJRINL1IrC1vDQjJ1DLvEVNYpJWhYSdh8ZWnPVdWNp3GN6IYuL6Y3 qvSCo2BBKsgZ4L29qU99nxyMHzeG53ttNeSkki4gXVRTXFm/My4m41TTcD9JAdWWlm1x VhI3dzAvJ/gn3/gYxZhzrvo8DnN2PPMIK+YpN0Gy/V8haoB+qF8VukU0fUBDB7V1sHxk cKuuRqk6w/QF8t7VydQyWeP2U32A05y2hmh3HARGUFtzWKSwORmJe4Sb8kFbEBNzSDM8 0egVnWpUsXSemIWXNDpOprKzhH2aZ8QRKX3klxQer7Vr4CYZqZJ85FoymutO9GQ5LJiI LAdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Jt6LolljfLrkORdUwhQfKteeVbGASICv1G6Fh1ZPko0=; b=MmdwO0Z63ME0ouGtvRYNW6J2bTiAzqh0JVANW7p4OV9R50+6f/5KQ6kjsEyfQac8KE VGKSm+mr1QPaYUOPOumM3W6OHZGk/rrgWoZvztWxw8eC6uWSoIF/EDqBdk6kpkg2qvm+ CdRRlYrJCdn6yPVzvIHgHpCRS9yMP6IFWdnK5KIQuwRLVDlKlL+Ka6kuyKUq4o7b5NHT +P3WBqZvTdjCtf5VJiGi5m0hFRh17jNLRShkW7WhcqbxJAXxWFottRk0orNWgra24TJD vt5SCZDMqaYS7QoKqqWOsPufcTn/V3r8dXKGJB5fRaO0a0/oXbG5dlyTKfYp3ruWDLae x1+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PpJBLaa+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 6-20020a630006000000b003816043eeb4si21709479pga.169.2022.03.30.20.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:19:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PpJBLaa+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4F2061066FC; Wed, 30 Mar 2022 19:50:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237879AbiC3L7v (ORCPT + 99 others); Wed, 30 Mar 2022 07:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344679AbiC3LxY (ORCPT ); Wed, 30 Mar 2022 07:53:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1812026C2FB; Wed, 30 Mar 2022 04:49:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id 50FAFB81BBA; Wed, 30 Mar 2022 11:49:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 008ACC36AE2; Wed, 30 Mar 2022 11:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640965; bh=111nFQNGUUvNUOoM3silLV8vcRp4KOZ0W6kSv0vS8KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PpJBLaa+Uwe1zfO+WCdDUtfwYUuaYT9L9egJO1h9ndya9Ea+kv972q8P1VTt63dWK W+6loJ9KMCoqnUjuuYKpY+s/NtR+AlE13kaqcz5wR0lfOnpQFcv2I8rcxp+KFcoTpo 4y8kADuc8z4r3Yjzky66pgsPGOkjQqKnoM502Pr64Gn+HCrnc9nKzKJPBWCQ1fWJbg FmJ1leDcduLw62AtCv+WZdZbmfWRD3YQdZkMPK2XJvgp7j91ag/dvxPfSFcW6arIXi KINIt7MfGKwc7Ty7RnSYE1FXaFkNbMxISVrElo8tWbM2HJY6oSiUJmNdSn2UMggnr9 OeECLRTF6snxg== 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.16 34/59] ASoC: soc-core: skip zero num_dai component in searching dai name Date: Wed, 30 Mar 2022 07:48:06 -0400 Message-Id: <20220330114831.1670235-34-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 dcf6be4c4aaa..0dc89f568407 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3184,7 +3184,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