]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ASoC: wm9712: fix unused variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 26 Sep 2018 19:37:40 +0000 (21:37 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 18380dcc52cc8965e5144ce33fdfad7e168679a5 ]

The 'ret' variable is now only used in an #ifdef, and causes a
warning if it is declared outside of that block:

sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':
sound/soc/codecs/wm9712.c:641:6: error: unused variable 'ret' [-Werror=unused-variable]

Fixes: 2ed1a8e0ce8d ("ASoC: wm9712: add ac97 new bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/soc/codecs/wm9712.c

index 4f6d1a442bc448e35cf28e365e93071a9270bfc4..c244f2896a744a5ab29dc244eed797647c39d50b 100644 (file)
@@ -638,13 +638,14 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
 {
        struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
        struct regmap *regmap;
-       int ret;
 
        if (wm9712->mfd_pdata) {
                wm9712->ac97 = wm9712->mfd_pdata->ac97;
                regmap = wm9712->mfd_pdata->regmap;
        } else {
 #ifdef CONFIG_SND_SOC_AC97_BUS
+               int ret;
+
                wm9712->ac97 = snd_soc_new_ac97_codec(codec, WM9712_VENDOR_ID,
                                                      WM9712_VENDOR_ID_MASK);
                if (IS_ERR(wm9712->ac97)) {