ASoC: AMD: Fix build warning
authorAkshu Agrawal <akshu.agrawal@amd.com>
Thu, 26 Jul 2018 06:04:08 +0000 (14:04 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 26 Jul 2018 13:07:55 +0000 (14:07 +0100)
Fixes
sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_probe':
sound/soc/amd/acp-da7219-max98357a.c:367:3: warning: 'ret' may
be used uninitialized in this function [-Wmaybe-uninitialized]
   dev_err(&pdev->dev, "Failed to register regulator: %d\n",
ret);

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp-da7219-max98357a.c

index cd3cf6e691a928ebd0c3d9113f32ed9f2df12910..8e3275a96a82102be7da0d4d2dc6b694c01571fd 100644 (file)
@@ -365,7 +365,7 @@ static int cz_probe(struct platform_device *pdev)
                                       &acp_da7219_cfg);
        if (IS_ERR(rdev)) {
                dev_err(&pdev->dev, "Failed to register regulator: %d\n",
-                       ret);
+                       (int)PTR_ERR(rdev));
                return -EINVAL;
        }