Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5213887ybl; Tue, 27 Aug 2019 00:54:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyga0TU9nJL9O6YHIFOstWiw0yaXRiVukS0zMeOhycQmiiKDZaLu3yAfVozyuFBAPUi98fr X-Received: by 2002:a17:902:8204:: with SMTP id x4mr22886691pln.37.1566892473391; Tue, 27 Aug 2019 00:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566892473; cv=none; d=google.com; s=arc-20160816; b=sjECRfYeTa1chLPgOTv6P+JypgaSP/5lPWXBUZBRx7xq9GGNqYd3Phxd0WqrL1CM12 4wa39kDRtihZDpndt17IwB6GSl84BG9jDMHjG9zJjq0G6Clk8BV8NlItuMOPZmaoYNEg mBQESd5A4xRLJVCDv9b3FQobCwjnEQzVli+lWV/8/l4xXure9NViGB/v6ovnxlpUe63b SZzSrEHqUDpfI8ynWa2UuEarQlvqFyNFuw5TYz/GLABA9FLIq7uQItC+N/H129sbwqXi e3XqwnZk0ScnBTDTDsYcL3w1Xtq9Bt+97Yy7VRjwJ0ma2b3hIjHH98Yu67wL+Y0W0TtL D+8g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0XWLXyZL6CK2CTwplTjEf6+sdHAIEhs3QuakyFfbrYo=; b=nC114p1+h4pURGpRNWFJJjUNkirRMBt6FxvgnQbLTE8NMx6zRdkS3RLJIKWpgs2Xgu ZQvLcBV4cciyX8vPKzmUv1eHgBI/19kMfBpyOdTDuVho/opdQyTLuIsSIU7Hrz4D8Qw0 IcqIwB/WiO5tEr8b9tmvkLLYYryw/DfKOtiMa89jZQ0ebDVHAXZyUq1XaUBVFKEvbWep LYsUhRJwQNVa8UMH6/KtZpWCawZm9U6GUqgTvu71gLq34R+8Y5zKbNNUhn+rn3KiAL+f DBSInIdQvOahQJD8cT0JGdCg1NZ5A+Zyt+5QgIKOXYI+p05HQFm6/lyux3YoieTFTY0o Pr/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Qj3BI/Wb"; 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 r16si11212431pgv.466.2019.08.27.00.54.18; Tue, 27 Aug 2019 00:54:33 -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=@kernel.org header.s=default header.b="Qj3BI/Wb"; 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 S1729247AbfH0HwF (ORCPT + 99 others); Tue, 27 Aug 2019 03:52:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:43266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729017AbfH0HwC (ORCPT ); Tue, 27 Aug 2019 03:52:02 -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 BBF18217F5; Tue, 27 Aug 2019 07:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892321; bh=RWeVlLznSXW9B8GqqqtugqSzpRKZ1E5XKsjMxzuPPhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qj3BI/Wb88visIvsYmv3irlYZXhNmkaTtTb7u0bgp6lkDEOWod+bzUeyvGCqK2i9d F0/8yNpkUwooCC0e/KpVlrlRF5mdX8EhEqaW2VNTjqHDWbzXApiN2aIepVmpmg+OsK r0rrjX7tysLwPDXkaQSDa34CXfBDxa027w/tjvi4= 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.14 08/62] ASoC: Fail card instantiation if DAI format setup fails Date: Tue, 27 Aug 2019 09:50:13 +0200 Message-Id: <20190827072700.729176600@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072659.803647352@linuxfoundation.org> References: <20190827072659.803647352@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 42c2a3065b779..ff5206f5455d9 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1757,8 +1757,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