Commit 89cc1354 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Vinod Koul

soundwire: amd: simplify return path in hw_params

Remove unused error path (label+goto) to make the code a bit simpler.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240703-soundwire-cleanup-h-v1-1-24fa0dbb948f@linaro.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent c3263561
...@@ -624,10 +624,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream, ...@@ -624,10 +624,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
/* Port configuration */ /* Port configuration */
pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL); pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL);
if (!pconfig) { if (!pconfig)
ret = -ENOMEM; return -ENOMEM;
goto error;
}
pconfig->num = dai->id; pconfig->num = dai->id;
pconfig->ch_mask = (1 << ch) - 1; pconfig->ch_mask = (1 << ch) - 1;
...@@ -637,7 +635,7 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream, ...@@ -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); dev_err(amd_manager->dev, "add manager to stream failed:%d\n", ret);
kfree(pconfig); kfree(pconfig);
error:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment