From patchwork Sat Oct 14 20:14:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 10006635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3358D601E9 for ; Sat, 14 Oct 2017 20:14:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26A2129054 for ; Sat, 14 Oct 2017 20:14:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B3C3290EC; Sat, 14 Oct 2017 20:14:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 383AB29054 for ; Sat, 14 Oct 2017 20:14:39 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D879626705A; Sat, 14 Oct 2017 22:14:36 +0200 (CEST) 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 61EB426705D; Sat, 14 Oct 2017 22:14:35 +0200 (CEST) Received: from smtp.smtpout.orange.fr (smtp13.smtpout.orange.fr [80.12.242.135]) by alsa0.perex.cz (Postfix) with ESMTP id 8D9A7266EAF for ; Sat, 14 Oct 2017 22:14:31 +0200 (CEST) Received: from belgarion.home ([90.55.206.157]) by mwinf5d71 with ME id MYEF1w00A3QH74y03YER5h; Sat, 14 Oct 2017 22:14:30 +0200 X-ME-Helo: belgarion.home X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Sat, 14 Oct 2017 22:14:30 +0200 X-ME-IP: 90.55.206.157 From: Robert Jarzmik To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Charles Keepax , Robert Jarzmik , Lars-Peter Clausen , Marek Vasut , Chen-Yu Tsai Date: Sat, 14 Oct 2017 22:14:02 +0200 Message-Id: <20171014201409.9008-1-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.11.0 Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: wm97xx: fix compilation corner case 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 When the old AC97 is not used, CONFIG_SND_SOC_AC97_BUS is not defined. As a consequence, in the error path, snd_soc_free_ac97_codec() is not defined and triggers a compilation error. Fix it for wm9705 and wm9712, as wm9713 is correctly written. Signed-off-by: Robert Jarzmik Acked-by: Charles Keepax --- sound/soc/codecs/wm9705.c | 8 ++------ sound/soc/codecs/wm9712.c | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index 68c204e3599f..2c09f71fe433 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c @@ -321,7 +321,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) { struct wm9705_priv *wm9705 = snd_soc_codec_get_drvdata(codec); struct regmap *regmap; - int ret; if (wm9705->mfd_pdata) { wm9705->ac97 = wm9705->mfd_pdata->ac97; @@ -337,8 +336,8 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) regmap = regmap_init_ac97(wm9705->ac97, &wm9705_regmap_config); if (IS_ERR(regmap)) { - ret = PTR_ERR(regmap); - goto err_free_ac97_codec; + snd_soc_free_ac97_codec(wm9705->ac97); + return PTR_ERR(regmap); } #endif } @@ -347,9 +346,6 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) snd_soc_codec_init_regmap(codec, regmap); return 0; -err_free_ac97_codec: - snd_soc_free_ac97_codec(wm9705->ac97); - return ret; } static int wm9705_soc_remove(struct snd_soc_codec *codec) diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 9db5c7783de5..4f6d1a442bc4 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c @@ -656,8 +656,8 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) regmap = regmap_init_ac97(wm9712->ac97, &wm9712_regmap_config); if (IS_ERR(regmap)) { - ret = PTR_ERR(regmap); - goto err_free_ac97_codec; + snd_soc_free_ac97_codec(wm9712->ac97); + return PTR_ERR(regmap); } #endif } @@ -668,9 +668,6 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) snd_soc_update_bits(codec, AC97_VIDEO, 0x3000, 0x3000); return 0; -err_free_ac97_codec: - snd_soc_free_ac97_codec(wm9712->ac97); - return ret; } static int wm9712_soc_remove(struct snd_soc_codec *codec)