ASoC: Intel: bytcr_rt565: fix missing assignment to ret_val
authorColin Ian King <colin.king@canonical.com>
Wed, 2 May 2018 14:29:45 +0000 (15:29 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 3 May 2018 01:23:54 +0000 (10:23 +0900)
Currently, the check that ret_val is not -ENOENT is always true and
the quirk bit BYT_RY5651_MCLK_EN is never being cleared because ret_val
is always zero at this point from a previous assignment earlier on.
I believe that ret_val should actually be assigned to the return from
devm_clk_get() as this can return -ENOENT (from a deeper call to
clk_get_sys) and that was the original intention to check this.

Detected by CoverityScan, CID#1460228 ("Logically dead code")

Fixes: 02c0a3b3047f ("ASoC: Intel: bytcr_rt5651: add MCLK, quirks and cleanups")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcr_rt5651.c

index 1b1997f1d60c843bb6b7abb7a86d6bdc09138ca1..bf59c7caf1d970cf5f7a6318bbbbd8399bbae5ff 100644 (file)
@@ -856,9 +856,10 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
        if (byt_rt5651_quirk & BYT_RT5651_MCLK_EN) {
                priv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
                if (IS_ERR(priv->mclk)) {
+                       ret_val = PTR_ERR(priv->mclk);
                        dev_err(&pdev->dev,
-                               "Failed to get MCLK from pmc_plt_clk_3: %ld\n",
-                               PTR_ERR(priv->mclk));
+                               "Failed to get MCLK from pmc_plt_clk_3: %d\n",
+                               ret_val);
                        /*
                         * Fall back to bit clock usage for -ENOENT (clock not
                         * available likely due to missing dependencies), bail