From patchwork Thu Oct 18 11:18:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 10647031 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 9DD1717D4 for ; Thu, 18 Oct 2018 11:19:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90D6D285E2 for ; Thu, 18 Oct 2018 11:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 853A028607; Thu, 18 Oct 2018 11:19:34 +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.9 required=2.0 tests=BAYES_00,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 DBD8B285E2 for ; Thu, 18 Oct 2018 11:19:33 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 59E582678E9; Thu, 18 Oct 2018 13:19:32 +0200 (CEST) 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 AB9A9267928; Thu, 18 Oct 2018 13:19:29 +0200 (CEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by alsa0.perex.cz (Postfix) with ESMTP id 8ADB02675B5 for ; Thu, 18 Oct 2018 13:19:25 +0200 (CEST) Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPA (Nemesis) id 0M7rHi-1fQn5j1qbI-00vO1p; Thu, 18 Oct 2018 13:18:47 +0200 Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPA (Nemesis) id 0M7rHi-1fQn5j1qbI-00vO1p; Thu, 18 Oct 2018 13:18:47 +0200 From: Marcel Ziswiler To: alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 18 Oct 2018 13:18:29 +0200 Message-Id: <20181018111829.27056-4-marcel@ziswiler.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181018111829.27056-1-marcel@ziswiler.com> References: <20181018111829.27056-1-marcel@ziswiler.com> X-Provags-ID: V03:K1:bJFLJ1BoDeEzEjC4mY7val9u3COLszVjxtmu6vKtlDs5pneUr6K QNlA7qSR9qp4V9U/cMWu3Jzkj6EZE9GdzkdHn+w09YwLtG5IGVIKFEiP+byJtTATVlJkNEW UOyH1tOs0CBqNPCpGW9pJY0Q4BguAqk2aUb4vH+p38cpzeWGSzIcf7MkO/HXkGbzQPbMq/s dMdSHbkBegza9UQtfOFEw== X-UI-Out-Filterresults: notjunk:1;V01:K0:D7mZHb7CjNo=:otoxnfwzhliN2YwBRYFb1/ b72tsv8XZb+djVyUHcWIYqmHqiBQljgEERLIyZMx/+JsFuFpQazL22Vo7uL18c+UEXtATKuMM KOAI/EVKIHkR4MMn0Y6igTNkIONB3gwUW/LWl/ExbaZezdwdAtysXdjx4SJr9G9pZZtMda1/d 92Pg+Ndmuvgd6aSTTm6bhwWWRbM/DtSAJmHYxBAeFN3kgLsv0SIev4/iSyJevnpQjpzvCxcSH uekajYKqMxeBZhrXMf8OcksFESGJPSLNufwS5ZlsXa/C/tjNDwkqm6kLqMQbxhPYqtI6bT7qH Wx6ImwIVXP6+R8ekMtn5cTNkKIiZIGlzybSpABE5hbdWZt8LscNC0d8MuVlw/TOLV9hc5HAKh MKDuKUTQFny0DTjogIEGmIODOkq54ohrDThlKelFZEA2lay+Yk1inXfnU6iY5cbOJxQTBot+K sNnF29zeto/goGrBnWUS0L7Y/I1OS+pW1xw5vs7Cy6nyaFvJdHV6f4OFUcs42wqiHNkaAMXS7 bB22HBJnztshj7i3fEHqpqaM5vlYttYOZAN1v0gcVQ8Tbd0flD+PxyCv9G3OZTZ1iN4NASgk0 14JvIPtHUtjYxfqiSgT6mvAM91clvtEhBv1jU2ZWS0x4I9LkpTJrPgHgM2F02L16vSLlUBdsu he/N7C2+QV3ekOHo/xoO/lM1L6s0NgUMpojLGmBfyF6u6E7tt8ZwGwuXso4i94IyIAA4= Cc: Kuninori Morimoto , Marcel Ziswiler , Liam Girdwood , Takashi Iwai , Mark Brown Subject: [alsa-devel] [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement 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: Marcel Ziswiler This fixes the following error as seen post commit daecf46ee0e5 ("ASoC: soc-core: use snd_soc_dai_link_component for platform") on Apalis TK1 after initial probe deferral: tegra-snd-sgtl5000 sound: ASoC: Both platform name/of_node are set for sgtl5000 tegra-snd-sgtl5000 sound: ASoC: failed to init link sgtl5000 tegra-snd-sgtl5000 sound: snd_soc_register_card failed (-22) tegra-snd-sgtl5000: probe of sound failed with error -22 Signed-off-by: Marcel Ziswiler --- Changes in v1: - Split from the Tegra series as suggested by Mark. - Fix issue in soc-core rather than working around it in tegra_sgtl5000. sound/soc/soc-core.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6ddcf12bc030..b97624005976 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2733,7 +2733,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card) int snd_soc_register_card(struct snd_soc_card *card) { int i, ret; - struct snd_soc_dai_link *link; + struct snd_soc_dai_link *link = NULL; if (!card->name || !card->dev) return -EINVAL; @@ -2744,7 +2744,7 @@ int snd_soc_register_card(struct snd_soc_card *card) if (ret) { dev_err(card->dev, "ASoC: failed to init link %s\n", link->name); - return ret; + goto err; } } @@ -2763,7 +2763,17 @@ int snd_soc_register_card(struct snd_soc_card *card) mutex_init(&card->mutex); mutex_init(&card->dapm_mutex); - return snd_soc_bind_card(card); + ret = snd_soc_bind_card(card); + if (ret) + goto err; + + return 0; + +err: + if (link && link->platform) + link->platform = NULL; + + return ret; } EXPORT_SYMBOL_GPL(snd_soc_register_card);