From patchwork Wed Jun 26 13:36:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 167804 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp961101ilk; Wed, 26 Jun 2019 06:36:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKa66+tTumb8TFgI7crZKL1keWR2p5oN4qNrC/NIPMwbBZ71y60W60JtvKVUDErMTqbFQZ X-Received: by 2002:a63:190d:: with SMTP id z13mr3044321pgl.191.1561556200528; Wed, 26 Jun 2019 06:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561556200; cv=none; d=google.com; s=arc-20160816; b=IsPkY0McIlmeDe331jh2bzPLacAUrATSPDpMwIT97ItiJbtQTpgSaRPbi8/C/58tmq b8WUh9JJ6QhPSkZJv38hiDQGbT162TJZZYo/TAM79tfAFNDIokNcL6eHF4PfcJuzLVa8 wtNodS+oXnnf7uysm02Wssb3xaB+okLWLDBD2agQlDZ39NPXNRmquOmGCM/dSYvYO3uV QinhKZN/kP3HPhaEHcPj3QIHOrsrjqv0R0VvFKp6IxhPkroZcb2q8CJYmWFzulVNuNSj GY7/k4Evs31yviKc6Wn0iAZBx4/9mWQA5iOHHOvm39qUm1Elk2ntE4p/qVrB5msgxqkv iS1A== 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=gnbXfzzoDtydJ87Q5fD6teACNHZuePi08QBtGx5OaUc=; b=bAwMhrtUgQqBZIGZVqcSw/Ht8cdTfXb5ApomhL0Bu4xLagXQS7zgbJ5nZLiAv6OLdm 4Afx8RWCYuYQlCVcBQJlOWxSvGIIuDGp04NUebWO2hVS7fcWRewy2tilwBqo+d3eIWnk mMeYbfoZFGnIfi1hnAUx2Vy2W4vMT7D+xS8dSMELbsaZzvo+VevUyLVlqCgpzrt76Xw/ WWTOHdodh8NvZM1wqDhAmalIyXeyWVpRdhDCk0kvpBSSoUBlsPfVotFLv9UB7YzEQWko CQr/2EoRjAPsTwAHQoZ9jk7+B9CI2KZBKF3fT9E4TFvpULNxbRDs8yCgAN769gPhNXb1 xQKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=blN2Wv4W; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si3292313pll.162.2019.06.26.06.36.40; Wed, 26 Jun 2019 06:36:40 -0700 (PDT) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=blN2Wv4W; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727731AbfFZNgj (ORCPT + 30 others); Wed, 26 Jun 2019 09:36:39 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42117 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbfFZNgh (ORCPT ); Wed, 26 Jun 2019 09:36:37 -0400 Received: by mail-wr1-f68.google.com with SMTP id x17so2762932wrl.9 for ; Wed, 26 Jun 2019 06:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gnbXfzzoDtydJ87Q5fD6teACNHZuePi08QBtGx5OaUc=; b=blN2Wv4WVam0hiUqSylbBjtVDmRMsW53HOX2psNbZKAxgOV2/z/PkOMtPkvN/ugaMZ Sg4t47aCwoKzFiHw5nHazKAzbtIIT1w5Cg3nv+jk5gdLshoApig4CdNMpdMnYHjq9tnk CedAXDygrR2Ry2XQZjRO9kNtKX+IT1NbJk0z0dwj9Lpr0DgIjdw6g0Z9+faU+mkx7mrF CTbKNYE6FmB6gqFUzdzYfA74pNkEU/94kdqZgl9dh8fj7D+Yhwb2d2/+4XhXJeLiYfEa RHU/dazcHlX1nB+mtKcX232onWixjioT9LUKx+Rkgfh1Q3bg1P6IAwWw0fNvYbujtGBk gw+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gnbXfzzoDtydJ87Q5fD6teACNHZuePi08QBtGx5OaUc=; b=AVigiNn+o5mJEt+/FN5W8WguzmIFFeHl5Ig21zNPpKL5LDcJuQMLFjDy3Zv0DAYwpb LEXL28gKAQeyxzKdpSR7dB2x8JP+LloRlzScFSgTOYQ4gzFCuMNJAY+3DHORHDzdFK9V 4+C91EfAV1aUXdPTDkcXxSG+a2O0gmxRGDyBN5deGHPcLnh8o0l1tgxi9Cj+7DGwJiTx XnxgpALEGuNPhN1BaI/t13vJCkZnyyzIOrrIrtbq63SI3blB26IFhZFO1bZ43CbOydBS 2bHMWHUmFwWvGXrDP6/Prx+D841b9EY6pMLRS3GfekxpGvG1KT+Xyt2EOKFj0uh3qJA6 z/hQ== X-Gm-Message-State: APjAAAXAc67ZFG99l6hGAtTJW66QSiavXDyRuZ3kagGyrWJX29h8MoC/ NfhTlXeyfRySs6VMRs0Endu63RoqffSvBg== X-Received: by 2002:a5d:67cd:: with SMTP id n13mr2478127wrw.138.1561556195567; Wed, 26 Jun 2019 06:36:35 -0700 (PDT) Received: from starbuck.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id w185sm2877880wma.39.2019.06.26.06.36.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 06:36:35 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood , Kevin Hilman Cc: Jerome Brunet , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 1/2] ASoC: soc-core: defer card registration if codec component is missing Date: Wed, 26 Jun 2019 15:36:16 +0200 Message-Id: <20190626133617.25959-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626133617.25959-1-jbrunet@baylibre.com> References: <20190626133617.25959-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like cpus and platforms, defer sound card initialization if the codec component is missing when initializing the dai_link Signed-off-by: Jerome Brunet --- sound/soc/soc-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.21.0 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 358f1fbf9a30..002ddbf4e5a3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1064,12 +1064,20 @@ static int soc_init_dai_link(struct snd_soc_card *card, link->name); return -EINVAL; } + /* Codec DAI name must be specified */ if (!codec->dai_name) { dev_err(card->dev, "ASoC: codec_dai_name not set for %s\n", link->name); return -EINVAL; } + + /* + * Defer card registartion if codec component is not added to + * component list. + */ + if (!soc_find_component(codec)) + return -EPROBE_DEFER; } /*