From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8AD8C3A5A3 for ; Tue, 27 Aug 2019 08:00:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F8A920828 for ; Tue, 27 Aug 2019 08:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892855; bh=IVvF1kC37EiJl65NwWg90BUjo+GxN24k6vovexdIHVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oY/FXl1ka+8qVFlAu4zU4cCY68hkdDj60yOQq18eUDF59InQucXN7s3fG4eBW0LjH bxoP0ar2aPk4FVgDYInUBiLk4GvL4VlBVN2fyDMAhyffP2NaZMUsDEd0Rw4xl7JMIL vH4uxDboGB6xjCmCtr3duuqFflE1kzga4yRLlz1Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731610AbfH0IAy (ORCPT ); Tue, 27 Aug 2019 04:00:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:56194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727578AbfH0IAt (ORCPT ); Tue, 27 Aug 2019 04:00:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 480E320828; Tue, 27 Aug 2019 08:00:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892848; bh=IVvF1kC37EiJl65NwWg90BUjo+GxN24k6vovexdIHVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lYkg9VYFu0mVsAF+GRz3H2UKK/748snk3+vQ05Rlkuik3Jeuvg90i0d24LaiqOo3j 7yOJUiQh8vMMzvOjHklsXTlRXoGleSSBkdFvI0jnfc44LiixFrD2JR8b49nmxCZF/O VnjJQv1cyYfQJ3RE8tBDYABsVJ7Yy+anXEtS97Go= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ricard Wanderlof , Mark Brown , Sasha Levin Subject: [PATCH 5.2 035/162] ASoC: Fail card instantiation if DAI format setup fails Date: Tue, 27 Aug 2019 09:49:23 +0200 Message-Id: <20190827072739.501841981@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072738.093683223@linuxfoundation.org> References: <20190827072738.093683223@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 40aa5383e393d72f6aa3943a4e7b1aae25a1e43b ] If the DAI format setup fails, there is no valid communication format between CPU and CODEC, so fail card instantiation, rather than continue with a card that will most likely not function properly. Signed-off-by: Ricard Wanderlof Link: https://lore.kernel.org/r/alpine.DEB.2.20.1907241132350.6338@lnxricardw1.se.axis.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6aeba0d66ec50..dd0f43a1c5e14 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1605,8 +1605,11 @@ static int soc_probe_link_dais(struct snd_soc_card *card, } } - if (dai_link->dai_fmt) - snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + if (dai_link->dai_fmt) { + ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + if (ret) + return ret; + } ret = soc_post_component_init(rtd, dai_link->name); if (ret) -- 2.20.1