Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp207665imj; Thu, 14 Feb 2019 18:42:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IaaUXWz1HDdptf78IQQi3ymu+KAVQn1zOy64POySywgJVAAcqXgPQ/5yc80BBZv4U0os0bz X-Received: by 2002:a63:4346:: with SMTP id q67mr3026471pga.92.1550198569871; Thu, 14 Feb 2019 18:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198569; cv=none; d=google.com; s=arc-20160816; b=qd0K+ft6S40NG2PvzbmpCUTzm3RGoL/VEY62N/8BiCull+kO1FfVNCVweTa3Qz2E3i 3Q7NPls1NJDFlmtlMWLqLsw/RHcIal1VBsPnthtNhkEQo318HoeU+1ODh1fQ2+U8UjFH XfcrhUgREe+xT+0dsKfCgu5V45/uuhbRP/LXi9SRWyUPERpTPBLKKNZbfFI6C+3xFMr2 C1TMi7x2hmz9uWQT+7euBLgszlPV1USPkOy+ddpd66iXU0Wbj0Yw4mKyMr90IQaX/d3f nghli/W1XKylcqgTP50xL1E39FjkvAsd4srMxujjI4+jXIDeQVZjq5jkc3ALuGNPevFe 5SUg== 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=f0ECzyVc7r/dTbpQ+YyzKDMuN5Bt3O8xdbF8a+noKk8=; b=nrMLp91h/72iKX7HsJSpOndGvzPRlNoklHsQjJssBe5U7ybuieRZN8UZkN3HM6YPJk TrceIDeooOv4CEDgpr23ujzla+GVSLmO4QAh/ijoq4YAFLXURWet4rdVwn4+rvHvfiYn YvvF1QjeiY1EqNGjHHuQSDh5n9hVQmGkbeLyQ7Nx8dUUERhtY3dGuWGwcZE60lLCCuFL YX2/0VKgbFzkA0ShRpGi7yB9MWj8UtE7lf5qR8v04UAoeK92xTCgxCo8Prn91Mh2Ug0Q Gq/Vsbll9Bwfk5qMlAPOTXx3sgtJ148IUEsQ776yca28zEjuyTKWv38g6YR7Lnt3jPlJ 601w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Tm8aa5sM; 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 l27si3920033pgm.456.2019.02.14.18.42.34; Thu, 14 Feb 2019 18:42:49 -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=Tm8aa5sM; 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 S1731784AbfBOClh (ORCPT + 99 others); Thu, 14 Feb 2019 21:41:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:49770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388279AbfBOCJf (ORCPT ); Thu, 14 Feb 2019 21:09:35 -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 BB4BC206BA; Fri, 15 Feb 2019 02:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196575; bh=vgAZTghB/jhMIJxUcevslnE0uTi2u6sWioi6BD5T28M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tm8aa5sMtnnHhS5oD82YzNhWhkGRsSyl/VI2rYUgyQ9vLjAFJ7Fw0teHNNieK7Nas wqOVcBX84KKLp9/xVcOFoGvp6EEYXUH9PjvHcOhafmJ8+jJQTQRqWvBKLQRAdWvLwF 4EiIek1aF7c5u4yllJQELX0J7j3Fsf5XyYnh5LCU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Matthias Reichl , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.20 22/77] ASoC: core: Don't defer probe on optional, NULL components Date: Thu, 14 Feb 2019 21:08:00 -0500 Message-Id: <20190215020855.176727-22-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: Matthias Reichl [ Upstream commit 2833548ecbb385a289124077ab4d812258a867d5 ] cpu and platform are optional components in DAI links. For example codec-codec links usually have no platform set. Call snd_soc_find_component only if the name or of_node of a cpu or platform is set. Otherwise it will return NULL and soc_init_dai_link bails out immediately with -EPROBE_DEFER, meaning registering a card with NULL cpu or platform in DAI links can never succeed. Fixes: 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list") Signed-off-by: Matthias Reichl Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e4da6656f65f..0324729001e5 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1135,7 +1135,8 @@ static int soc_init_dai_link(struct snd_soc_card *card, * Defer card registartion if platform dai component is not added to * component list. */ - if (!soc_find_component(link->platform->of_node, link->platform->name)) + if ((link->platform->of_node || link->platform->name) && + !soc_find_component(link->platform->of_node, link->platform->name)) return -EPROBE_DEFER; /* @@ -1154,7 +1155,8 @@ static int soc_init_dai_link(struct snd_soc_card *card, * Defer card registartion if cpu dai component is not added to * component list. */ - if (!soc_find_component(link->cpu_of_node, link->cpu_name)) + if ((link->cpu_of_node || link->cpu_name) && + !soc_find_component(link->cpu_of_node, link->cpu_name)) return -EPROBE_DEFER; /* -- 2.19.1