From patchwork Wed Jan 9 08:47:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Kumar X-Patchwork-Id: 10753725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A583114E5 for ; Wed, 9 Jan 2019 09:28:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9303928D96 for ; Wed, 9 Jan 2019 09:28:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8721828E53; Wed, 9 Jan 2019 09:28:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB39F28D96 for ; Wed, 9 Jan 2019 09:28:08 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 63E75266829; Wed, 9 Jan 2019 10:28:07 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CF51E2670CD; Wed, 9 Jan 2019 10:28:04 +0100 (CET) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id 447222665E5 for ; Wed, 9 Jan 2019 10:28:01 +0100 (CET) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id F06206063A; Wed, 9 Jan 2019 08:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547023681; bh=49ZmOkJlqAD88GfcBWboINxEulavztigu4Y+9LtQoHQ=; h=From:To:Cc:Subject:Date:From; b=Pahit59cEC8Yqmt6HQq4f35qkfgwxdS+MBVma124tkCno8qsKF5cu+7kPA7KUCXPj ZB1LSITgmb/6GkVj7jdADz50ydC19CGahPH1p87uF+eP67HXHQ9dMZYQ5cim82GmiH AsvHSjUYF8Rq87H8U9vJAJ+x+oM2oyDZlAt09V8g= Received: from rohkumar-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rohitkr@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0233060132; Wed, 9 Jan 2019 08:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547023680; bh=49ZmOkJlqAD88GfcBWboINxEulavztigu4Y+9LtQoHQ=; h=From:To:Cc:Subject:Date:From; b=ogR4syilfBlUchHqJ6xT+2p3EuEwK8pz6FZShgPiw8uXYjN4ScMmcGMQNqRLcdyie zKiRwJyJPx45auqngMrZPVHP2aD9cjCIZyZqI0Qxb2DeYIqCIVjya/dMJK5Q2AgYyB 6J9BJd12sgyqwD1Fcbet0IYtOrLm83bBZBd5Sa8M= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0233060132 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rohitkr@codeaurora.org From: Rohit kumar To: plai@codeaurora.org, bgoswami@codeaurora.org, asishb@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com, srinivas.kandagatla@linaro.org, vinod.koul@linaro.org Date: Wed, 9 Jan 2019 14:17:07 +0530 Message-Id: <1547023627-30312-1-git-send-email-rohitkr@codeaurora.org> X-Mailer: git-send-email 1.9.1 Cc: Rohit kumar , Ajit Pandey Subject: [alsa-devel] [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ajit Pandey DAI component probe is not called if it is not present in component list during sound card registration. Check if component is available in component list for platform and cpu dai before soundcard registration. Signed-off-by: Ajit Pandey Signed-off-by: Rohit kumar --- Changes since v1: Moved component find logic to soc-core instead of machine driver as suggested by Mark. sound/soc/soc-core.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0462b3e..eec92f1 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1027,7 +1027,6 @@ static int snd_soc_init_platform(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { struct snd_soc_dai_link_component *platform = dai_link->platform; - /* * FIXME * @@ -1129,6 +1128,14 @@ static int soc_init_dai_link(struct snd_soc_card *card, link->name); return -EINVAL; } + + /* + * Defer card registartion if platform dai component is not added to + * component list. + */ + if (!soc_find_component(link->platform->of_node, link->platform->name)) + return -EPROBE_DEFER; + /* * CPU device may be specified by either name or OF node, but * can be left unspecified, and will be matched based on DAI @@ -1140,6 +1147,14 @@ static int soc_init_dai_link(struct snd_soc_card *card, link->name); return -EINVAL; } + + /* + * Defer card registartion if cpu dai component is not added to + * component list. + */ + if (!soc_find_component(link->cpu_of_node, link->cpu_name)) + return -EPROBE_DEFER; + /* * At least one of CPU DAI name or CPU device name/node must be * specified