Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1032763ybe; Wed, 4 Sep 2019 11:27:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg4l87khLJke+hAWMr9EDHeAgMm5WUpp9XrXGa8U3UeNpLwaIz012XbSAaTdQm4vw/021E X-Received: by 2002:a17:902:7449:: with SMTP id e9mr40943541plt.242.1567621640159; Wed, 04 Sep 2019 11:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621640; cv=none; d=google.com; s=arc-20160816; b=Mzukhm0j6p8yT0rOa2AKwp0hSrNyI2qcR1+f9F6BQluEvErWgqmuvic4apHhvG3cyt wDdfTiZXRDL0Z6rfQTtA5yPmhFm8RBmIn2svit827aGFCwhmz0zI0mpG0YidGr5DjkBz MpTN9JiT+qHsj2YUAHaNtLgBsEo59fFAAAmb2z2NgwmGtaIYMpOP77YEoFSMFLQ6vLKt u/ApbZgvnMATOB84LB65KkP7Ty/Qo4c1/0aT3wxpTs7t92LCSqTv3RYB7Ho4k/nevzSl +u6U/r6+cnlWo7RK3Pb6L0SAgAiUD5Hv1JC+Ug/uxNWskcuJpxNnlUjQhHz99iaiHpkZ pDcg== 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=YNRjqWpYkJ+qAIPRmw200N6+FF9Inx86s7bqv9FcWZw=; b=UcUJyll+It3Tfm4iGGxmg0S6yqlz2u4LlTH+Bk9+9Id1RBowoFS0XB6O+6GF3hBk+i JMzC8fsU7hVhzypyWkju33j2aTY/vEHK8XySGg1Et1seCTI34yBz1gA+feRj/0K0XvNA Gs1xGiAY2h73v5wYlHs5aBzO2zPbVfx6+l3xWbCli/Oed+Kl3CjFt9OeOfC4uhFlpMF8 HgoyfnLUZRaD6ps7PVi/thSpuGzgt36ojggXHf31mhualS6CagADedsO9QAsri365kcQ DPXm/wyOomGDSsQpXxbvbtLxI54aVdPch+tOzEb9D2LILlwoJYv0oBCMNurPYnNeiPUN FnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DnywrzOh; 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 z22si17073287pgv.551.2019.09.04.11.27.03; Wed, 04 Sep 2019 11:27:20 -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=DnywrzOh; 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 S2388306AbfIDR7z (ORCPT + 99 others); Wed, 4 Sep 2019 13:59:55 -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: 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 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