From patchwork Tue Dec 1 10:39:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7735311 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4F1E89F1C2 for ; Tue, 1 Dec 2015 10:40:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7515E2069A for ; Tue, 1 Dec 2015 10:40:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D794C2063B for ; Tue, 1 Dec 2015 10:40:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7E208265ACF; Tue, 1 Dec 2015 11:40:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8D356265A89; Tue, 1 Dec 2015 11:40:11 +0100 (CET) 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 57A4E265A8C; Tue, 1 Dec 2015 11:40:10 +0100 (CET) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by alsa0.perex.cz (Postfix) with ESMTP id 0CFB2265A43 for ; Tue, 1 Dec 2015 11:40:03 +0100 (CET) Received: by padhx2 with SMTP id hx2so1714823pad.1 for ; Tue, 01 Dec 2015 02:40:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=oiSSA24g6dOXzSX2gw1QRUp4NRH7mmy0pU32MQ2qcT4=; b=RaAkNGMeMLCw/lxZ1ioW4Lp9n/Qw4O9s29tjMGVaHAnbYQPsvoSRH0Vb064ft0sFTG t/Asa1OKj4wcfpZbxN8yqFZjnQX0Owa/k32tHB4GEqtmT7RnBQlQ7EIIoVc2CCcjV5mP AwTelLQzHoLfZMz2ZB/PgPqbusXtzrS/MpdmGLzYmJ6vVYlo+nMRCLMjkNeGIKaatrZD lL/6aBtpNszV5in9KOS4HK795TTaBDE7dGK8WzMPqTb7cMlaOZI0ecZr0Qas9YsbtfRv caDUjpeSokF6S07dgtFybTPEZLBrQebKWc+trlRJ2A4jsmppEaO0ouvTgJhAJH0dq5Vn +Fzw== X-Received: by 10.66.102.70 with SMTP id fm6mr44112532pab.80.1448966401390; Tue, 01 Dec 2015 02:40:01 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([122.169.145.251]) by smtp.gmail.com with ESMTPSA id n75sm57050094pfa.16.2015.12.01.02.39.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Dec 2015 02:40:00 -0800 (PST) From: Sudip Mukherjee To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Stephen Warren , Thierry Reding , Alexandre Courbot Date: Tue, 1 Dec 2015 16:09:51 +0530 Message-Id: <1448966391-13996-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: linux-tegra@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH] ASoC: tegra_alc5632: check return value 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 We have been returning success even if snd_soc_card_jack_new() fails. Lets check the return value and return error if it fails. Fixes: 12cc6d1dca4d ("ASoC: tegra_alc5632: Register jacks at the card level") Signed-off-by: Sudip Mukherjee --- sound/soc/tegra/tegra_alc5632.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c index ba272e2..deb597f 100644 --- a/sound/soc/tegra/tegra_alc5632.c +++ b/sound/soc/tegra/tegra_alc5632.c @@ -101,12 +101,16 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = { static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd) { + int ret; struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card); - snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET, - &tegra_alc5632_hs_jack, - tegra_alc5632_hs_jack_pins, - ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); + ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", + SND_JACK_HEADSET, + &tegra_alc5632_hs_jack, + tegra_alc5632_hs_jack_pins, + ARRAY_SIZE(tegra_alc5632_hs_jack_pins)); + if (ret) + return ret; if (gpio_is_valid(machine->gpio_hp_det)) { tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det;