Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp209383imj; Thu, 14 Feb 2019 18:45:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IaFhRHIXPOrmgAT3gfyLzyrB0oosKX1qCOfY24z6q6B1ZzGA8HtBoeK3w7pqOR9k1gUm2Mt X-Received: by 2002:a62:1a8c:: with SMTP id a134mr5686475pfa.182.1550198723375; Thu, 14 Feb 2019 18:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198723; cv=none; d=google.com; s=arc-20160816; b=UXZWJuTdhDostfeI0QCjutNEnzASYpFr7+ayUOzH/mg7CictxXz4RsdinNThmBzLj7 aOLy331ix8gDz0E7yjd41FSlu3GR0HS7nz21Vt1dxXKL/5V6OQDUJeq16lzFzb/uLz3h SbO8xvvsdopem0Ilz9DfXwDA2Ya2Z998RPFFR/MyoSsqEu0qejGSJu3ynxTOL8UEJbIV b28nkjguvnZYIYj1/r64lhRHl1WMIuP5K414GVHrUBPwjc3RDIMIq0cYONboVa8D8B+z a0nUEaYVnVoCDOjIilBo0UV35yNJ94a+zcWm05p/yO3rfg5FjAQXDiPMKrykmQYSG+0T h3gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5MMDsIYjduHF7Nqakx9kAN79xqjhuVl56U6CKXDMnD8=; b=PmsLqEIR+APvEVuwIv6A4tvtRt+zoClHrbZTqq7hnzPCq2Icm2Re/0+NNEBb38W6uu A4/p5OjCPM30tj2yeCPzwpvlDCg14N7bYC916HMTICc/o3lXSfgUnmR0Eb8cUYlxmPJM NCLlWgNYpTXiWd+k5bcFA8vSkNu4V1QOwWoyI7ZIVy1YjeiN/JVR36vpOSjkjLiebgB5 48WApmhc2hLPH1Vwi7BNHOv61LiMngDxDetshhktgd5dS/3NzmrBkvEjhyilAuHU/TE3 L1dyqirEoNEPl9lFNBKim96f3dkoxP6/llpCb8vRvmHwzXfZDgLhlGBbyumnlRvTberD 7p9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aj6gTNoD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si4189850pfc.189.2019.02.14.18.45.07; Thu, 14 Feb 2019 18:45:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aj6gTNoD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731511AbfBOCm5 (ORCPT + 99 others); Thu, 14 Feb 2019 21:42:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:49300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731485AbfBOCJG (ORCPT ); Thu, 14 Feb 2019 21:09:06 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DCF2222D9; Fri, 15 Feb 2019 02:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196545; bh=N9Fz3BVOoXVEcEtRYVMw5vIqIDwOANZocd22GITVcYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aj6gTNoDS6lGgehRN74cxqDy9yPGPFuX5hmgwSRzWnNyiMuGsyNwqtjbo3c9o4fZ2 Dje986bZZq9Kz5iKtXrj9FLCLd4nXOng1BZOkiMrdRSkLHm/I6HFBWRkQmnCY9/wYQ qTjxEH/lTYWnELPZx5pDc5rNZvuPHQe6qQF+4G+I= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ajit Pandey , Rohit kumar , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.20 06/77] ASoC: soc-core: defer card probe until all component is added to list Date: Thu, 14 Feb 2019 21:07:44 -0500 Message-Id: <20190215020855.176727-6-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ajit Pandey [ Upstream commit 8780cf1142a59568a3aa77959cbd76b2edb6fd81 ] 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 Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 b29d0f65611e..74b12f90ea9b 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 -- 2.19.1