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=unavailable 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 8612AC3A5AA for ; Wed, 4 Sep 2019 18:25:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 566DD20870 for ; Wed, 4 Sep 2019 18:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567621533; bh=NVskeiPKyvwjOZ59iphJ2aRht2gkv7aHxNlQjBu7mic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sCR19IB2JylYORxFfAvXc81wC2xn6YdHgbbm8A5knA8+aINpiOR3AJPH5HQPrPXHW mDHVvk0qtj+yxVinked0XoaO81Px2sreZudb0WicW3Ig0TloEZ1D4y/vD1AgJr6n4p 6pKOG5zf1layJth9GKckjUayANCctmT2otm4Rc1c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387931AbfIDR7y (ORCPT ); Wed, 4 Sep 2019 13:59:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:38872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388288AbfIDR7w (ORCPT ); Wed, 4 Sep 2019 13:59:52 -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 EE6EA21883; Wed, 4 Sep 2019 17:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567619991; bh=NVskeiPKyvwjOZ59iphJ2aRht2gkv7aHxNlQjBu7mic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DnywrzOhfLqgR4FaKHIYNcyLbkyR7umd0+HrXgeMmV0oQgP7JNlN/tjThesPpdjZL C4358FlxH/IsZVgLw7MEFgNZQOtUMmB7e8DLy4NqiAWJKzs/0gkbOSju8ewnI3hiNo 41ghTs6422VhLLCUgV6JLhTPYHkecWovZ8xqYODY= 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 4.9 07/83] ASoC: Fail card instantiation if DAI format setup fails Date: Wed, 4 Sep 2019 19:52:59 +0200 Message-Id: <20190904175304.389271806@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175303.488266791@linuxfoundation.org> References: <20190904175303.488266791@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 168559b5e9f32..d4fb45710eec1 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1632,8 +1632,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