From patchwork Thu Jun 27 12:13:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 11019571 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 6D8A91580 for ; Thu, 27 Jun 2019 12:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E00328B06 for ; Thu, 27 Jun 2019 12:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5285528B17; Thu, 27 Jun 2019 12:14:07 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D4F128B13 for ; Thu, 27 Jun 2019 12:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X9p2SEwLWH+C/cCLaj2X2Ju7hNI/9Pu2lEKXqNPeS6s=; b=bXGpov1B/B35Go GyTatHs4XjNFyzv6wIWVfF5eSUSLDi40ULhm5aGbZGUTY3wwurI24L5DEq/Zx3OpPqJDWFmUfeu+K giJAayuPbpigeUNfyMih0Yu5NIjWMavTTDL++wZNORv42D6meVmsQC11MMBQWhBsbD5TdoMirZSYz tUyJv7jRRQgh7XhTQw5CriRKxMWaUq92OIsGzFKccGsKTICay7P2GvKehNsQIGt0fBKxnHZX3Lnti 5v5vB3aQZyD4lI1eWkNFWcCmEbQvabXrT6uE1ZLJW//tL5ImirNYtJHXdMh3Q1sLkQyaCRrgcuVAm u0rrU5OjoOD/v2dV8EsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgTHy-0004C7-7F; Thu, 27 Jun 2019 12:14:06 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgTHu-00049p-HS for linux-amlogic@lists.infradead.org; Thu, 27 Jun 2019 12:14:03 +0000 Received: by mail-wm1-x344.google.com with SMTP id c66so5506614wmf.0 for ; Thu, 27 Jun 2019 05:14:01 -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=6dZUNh41e54wloGbD976gFDh/dh9Od8QCAeDEWTqPi0=; b=OngWCzsC9ReioQ2dB+3Si543jtwEMKbYjq/B6YLYPcItr0MZED1V2Dnrf1ipky90Xm 2iqnk1Q9oOnzku0hLU6IbIPk+Egc8yDD67sNL0VmwMMzUU6CWjk9wYoUOhtUyro6kaA2 x/kegG5rlAwYjSM9O5eUH2HiLieh6BIsN7bTxHpA+O0W4ef+8mzhbLP8T45X3vwagZ3Y 2zeBk3oPb43DvoPr30KaBrp0CTr4oLPqlx9RgjuNGnVfvlC2yVMbWuuALVF0uTIrL/Jy QcGya6qoe436hbQ2EZ06QZ3VYz3D6/Hnha2mc6zl9JCmqKAXP/jm6XI7aGTMuHjMXqrN FN5w== 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=6dZUNh41e54wloGbD976gFDh/dh9Od8QCAeDEWTqPi0=; b=BuMi4qmohj5o3SErRAXveOPS6oSFvU/Rnq6DMfq0aUlDDBdvn6RXXacnfGy5/mkRrB +xoFhLjma2mG9ahuvMAMdgfpItJlyo3OcfbZ1csTG21fQOjwnMWWaFflnlsu5Pc8XTEd yTfrZ6/gecunKPDBOtGnZxwHUIG3R64MAQwvp52PU+W5LbC5P4V8sc39Hi4xybl4HdBj 4uoq0alN8WR4zEMyVXQXfzIYO6EgUymQINSwr2egU0KmLkfJZwJ8UksuZ7wTqmwgOm/t Hi+vmwcr572/OKYe/r1a/GY7LXe/Kk4J/+BblZQorNoOwXYItG273i4xqmLZ8mD0iC7/ YxIw== X-Gm-Message-State: APjAAAV10v7DHozW5fyqPqwT6XSceV52xvt7s29JBy/I+3qaMDvhK4UB in+lubCnIS2EB8AVYkU06//5UA== X-Google-Smtp-Source: APXvYqza+Hvs5MtThW6KOFfdj04i4mvr0iJ5DAtXO9FQIkHVfLWq3VCCfUzX1vZSCuDoDWFEcBd7aA== X-Received: by 2002:a1c:c109:: with SMTP id r9mr3255675wmf.143.1561637640165; Thu, 27 Jun 2019 05:14:00 -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 i11sm6160594wmi.33.2019.06.27.05.13.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 05:13:59 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood , Kevin Hilman Subject: [PATCH v2 1/2] ASoC: soc-core: defer card registration if codec component is missing Date: Thu, 27 Jun 2019 14:13:49 +0200 Message-Id: <20190627121350.21027-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190627121350.21027-1-jbrunet@baylibre.com> References: <20190627121350.21027-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_051402_576208_BE10884F X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Jerome Brunet Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 358f1fbf9a30..0ec1d7a59b24 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 registration if codec component is not added to + * component list. + */ + if (!soc_find_component(codec)) + return -EPROBE_DEFER; } /*