Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2821703pxb; Thu, 10 Feb 2022 06:22:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpW+FBbyqMdQsPBgBGQDIvGCwhMJ4+8/EzaZ4+3jvn4R77JF6hj9R/6ZS8k2YMoz7iEo4y X-Received: by 2002:a50:ab16:: with SMTP id s22mr6940929edc.287.1644502928266; Thu, 10 Feb 2022 06:22:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644502928; cv=none; d=google.com; s=arc-20160816; b=XoSt14kMmmOZVtKcueg6RdEqNnuu/j7IUkzgT5mrNxCz1qJiA9lwppwY1D1AbWMUX4 guAEmRagS96iMdSbG6qMvWf3JivK73qTj8IjqhjO1xEZEMKSBZY4nMqB8rARXZfHrpHy gNFBKLW50GjJ52jnmPqDTn7w4RIM+BzvysfVNrxVflH1Jr8u/KQGlgTZMV/K6v/yMC25 0ezkSlHqQFubtlKivPmuIgmdy3OZ3f8LI+ATcIBS77gacybg+I2sCXfM+6DWU0PpDbm6 5O0X3W609uIZUiqiX11HkEvArov0OeK43WNzJZztBQHN8XeGlXd29u7YNWgDwU+mEaMR Bdew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=U/KOS04slr8Yt571J99DbSBwdSQjcQBU321rHS2CMTI=; b=j+Y9sSEbzzr41L+7H+ujHWr+mLJJVg1Ynd3SJmS1GpBJoLxIoHBLn05FdngwLdJzLA fCONq9ESHFB90JkCh2LA6tRR3AFLee0Hl2eFolHkyEhW/oz3KZPj7eTPGd+q3uBetuLc Yo2HQmDXrNb3gnN26XR5T4Vpb1r4S7cKJqVA3E2ybDhdJ6iWHqC8MFdVHKP3DEiFVnJW rf7bXqsIRh13xfdTHPEhU+0SLloT3jgF+PjWIBHsF/Ss22WamSbcZBYoXi7d5chFIxGg 6RBg2PrVrV19CdBBulA7Tj8vORPkgyTfWUpfMLTYu5UXKlqbMF5xJVzq2Mox0guc6GFh 5zsA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd8si8693063ejc.314.2022.02.10.06.21.42; Thu, 10 Feb 2022 06:22:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237552AbiBJL5t (ORCPT + 99 others); Thu, 10 Feb 2022 06:57:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236127AbiBJL5q (ORCPT ); Thu, 10 Feb 2022 06:57:46 -0500 X-Greylist: delayed 419 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 10 Feb 2022 03:57:45 PST Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5561262D for ; Thu, 10 Feb 2022 03:57:45 -0800 (PST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 846C61A00ED; Thu, 10 Feb 2022 12:50:45 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4D53C1A0073; Thu, 10 Feb 2022 12:50:45 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 1BB73183AC72; Thu, 10 Feb 2022 19:50:44 +0800 (+08) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: soc-core: skip zero num_dai component in searching dai name Date: Thu, 10 Feb 2022 19:19:12 +0800 Message-Id: <1644491952-7457-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 --- 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.17.1