Commit ba874a8c authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Vinod Koul

soundwire: intel: 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-4-24fa0dbb948f@linaro.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 1f93cb22
...@@ -743,10 +743,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream, ...@@ -743,10 +743,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
pdi = sdw_cdns_alloc_pdi(cdns, &cdns->pcm, ch, dir, dai->id); pdi = sdw_cdns_alloc_pdi(cdns, &cdns->pcm, ch, dir, dai->id);
if (!pdi) { if (!pdi)
ret = -EINVAL; return -EINVAL;
goto error;
}
/* do run-time configurations for SHIM, ALH and PDI/PORT */ /* do run-time configurations for SHIM, ALH and PDI/PORT */
intel_pdi_shim_configure(sdw, pdi); intel_pdi_shim_configure(sdw, pdi);
...@@ -763,7 +761,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, ...@@ -763,7 +761,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
sdw->instance, sdw->instance,
pdi->intel_alh_id); pdi->intel_alh_id);
if (ret) if (ret)
goto error; return ret;
sconfig.direction = dir; sconfig.direction = dir;
sconfig.ch_count = ch; sconfig.ch_count = ch;
...@@ -774,10 +772,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream, ...@@ -774,10 +772,8 @@ static int intel_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 = pdi->num; pconfig->num = pdi->num;
pconfig->ch_mask = (1 << ch) - 1; pconfig->ch_mask = (1 << ch) - 1;
...@@ -788,7 +784,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, ...@@ -788,7 +784,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
dev_err(cdns->dev, "add master to stream failed:%d\n", ret); dev_err(cdns->dev, "add master 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