]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: mchp-spdiftx: return directly ret
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Mon, 25 Jul 2022 13:09:24 +0000 (16:09 +0300)
committerMark Brown <broonie@kernel.org>
Tue, 26 Jul 2022 10:46:52 +0000 (11:46 +0100)
Avoid having patterns like:

int ret;

// ...
ret = 0;
// ...

ret = call_function();
if (ret)
return ret;

return 0;

and return directly ret for all cases.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220725130925.1781791-5-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/atmel/mchp-spdiftx.c

index d24380046435296cd83a78e54fb0d055ef5d01ab..51699328079210b0d0e2a94af1b49fa3a75d312d 100644 (file)
@@ -341,12 +341,10 @@ static int mchp_spdiftx_trigger(struct snd_pcm_substream *substream, int cmd,
 
        ret = regmap_write(dev->regmap, SPDIFTX_MR, mr);
        spin_unlock(&ctrl->lock);
-       if (ret) {
+       if (ret)
                dev_err(dev->dev, "unable to disable TX: %d\n", ret);
-               return ret;
-       }
 
-       return 0;
+       return ret;
 }
 
 static int mchp_spdiftx_hw_params(struct snd_pcm_substream *substream,
@@ -847,12 +845,10 @@ static int mchp_spdiftx_probe(struct platform_device *pdev)
        err = devm_snd_soc_register_component(&pdev->dev,
                                              &mchp_spdiftx_component,
                                              &mchp_spdiftx_dai, 1);
-       if (err) {
+       if (err)
                dev_err(&pdev->dev, "failed to register component: %d\n", err);
-               return err;
-       }
 
-       return 0;
+       return err;
 }
 
 static struct platform_driver mchp_spdiftx_driver = {