]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soundwire: amd: simplify return path in hw_params
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 3 Jul 2024 10:15:53 +0000 (12:15 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 9 Jul 2024 13:42:48 +0000 (19:12 +0530)
Remove unused error path (label+goto) to make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240703-soundwire-cleanup-h-v1-1-24fa0dbb948f@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/amd_manager.c

index 20d94bcfc9b4fbc292139a775a90b0f936a9ddbb..97720900818e5a3facc29b5ea59faf67c1287920 100644 (file)
@@ -624,10 +624,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
 
        /* Port configuration */
        pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL);
-       if (!pconfig) {
-               ret =  -ENOMEM;
-               goto error;
-       }
+       if (!pconfig)
+               return -ENOMEM;
 
        pconfig->num = dai->id;
        pconfig->ch_mask = (1 << ch) - 1;
@@ -637,7 +635,7 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
                dev_err(amd_manager->dev, "add manager to stream failed:%d\n", ret);
 
        kfree(pconfig);
-error:
+
        return ret;
 }