Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp979101pxb; Wed, 6 Apr 2022 05:55:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+yV9rCNqQdMZKNJcx95fWWrGLYR74JND58Cs7UP1W+Aj4nn/GxGUffhip+vUe0mtdgKEL X-Received: by 2002:a17:902:b692:b0:151:5474:d3ee with SMTP id c18-20020a170902b69200b001515474d3eemr8466597pls.139.1649249709232; Wed, 06 Apr 2022 05:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249709; cv=none; d=google.com; s=arc-20160816; b=vSsquFNuFYArtmf5RhO5o+qnWAxtoXLS6ZkrLXD+Q+4MqzLHh7aINm418bF4N/PO82 KuDUw/hNgSvzGPFZWghOriOOB9QOOpbTqSZG98kO8rJvRFwzafCfg6zii8FbqZsIyl0D 0HLoO77SeRAK6DDKV5tYqVVWr7oxBbFJh4aQ0UfNcfysRqRKJBvDflDuA7AXp4D2BIlj OhfG7NcdDWOla+Odmf/BKVSZVerJLAQYode/Q1N8Ql2JG0wUZt/pIEb3UYdCvGPK/9pK wp97O0/960YJISWXG9L6Ux7yPGHWU+V0+fypisnKr7xfTUAG5RtHnqiEYMHw5nLqBFxs IQ9g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dmzwBEcxi0a6VcNFh2shD5fjorl7gI3j1RHvMncQmM8=; b=tXeeV9BCA7B6yxEEJvPZEO/7wT8OkNhhTdRr2iIH7QmmFBPR7rHQ2xe1rq0SMe2Ff1 WNIA1bSiTvuYN5FnQrgDp6ZPJ382HRsUZ89gMzeoQ0Y6VXhrmHKqdwifSAJJnGDmQMTJ nUvT+ad1zLrr8OSbo2Sr5W7cilIkk40vfFQoTGS8Ph/uPPYVXvmenkSYRohBUWYoxl/c tj5cuz8oM2aLgO2kSydr6l3YRzZaD/mbA95o20MjmkwVUS8BPgRmom07vTgVMS1hH6E7 X1CW7TkSyPUZ45chTqVt7HAklgUn0pu7BOFe5+EJAj430zn0Uhvxt1p/1R91EE2swJrb ia9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nElw8v+i; 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=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d21-20020a630e15000000b00382274cbb1bsi15227273pgl.873.2022.04.06.05.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:55:09 -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=@linuxfoundation.org header.s=korg header.b=nElw8v+i; 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=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29F49B1AA9; Wed, 6 Apr 2022 03:01:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579508AbiDEXb2 (ORCPT + 99 others); Tue, 5 Apr 2022 19:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352107AbiDEKDz (ORCPT ); Tue, 5 Apr 2022 06:03:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 605E2AC063; Tue, 5 Apr 2022 02:52:50 -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 934C36165C; Tue, 5 Apr 2022 09:52:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A834AC385A1; Tue, 5 Apr 2022 09:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152370; bh=U5KdjcZpRwnm8d/Y39hurzwu6xnD8BhkqRY0h6mwIEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nElw8v+iPspf/DSifXqPhLJvdH3sa56gPHM5delCFJBRn7o5Pjh1OoY1PsXdd9gB8 BMCXL7Eq+ahjp1YqnPpQNIGs8N1HqXApWTcIThj5RSI66hJN3aomtSp+90KXK5Y+yz g3VVA1wPgtmkuiKyNLurR6Fqnl0QvPytkXoABc3g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.15 753/913] ASoC: soc-core: skip zero num_dai component in searching dai name Date: Tue, 5 Apr 2022 09:30:15 +0200 Message-Id: <20220405070402.404338441@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 80ca260595fd..5da762807824 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3208,7 +3208,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