1

soundwire: intel_ace2x: simplify return path in hw_params

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-6-24fa0dbb948f@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Krzysztof Kozlowski 2024-07-03 12:15:58 +02:00 committed by Vinod Koul
parent e4fcf153d9
commit 13814ed162

View File

@ -325,11 +325,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
dir = SDW_DATA_DIR_TX; dir = SDW_DATA_DIR_TX;
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) { return -EINVAL;
ret = -EINVAL;
goto error;
}
/* use same definitions for alh_id as previous generations */ /* use same definitions for alh_id as previous generations */
pdi->intel_alh_id = (sdw->instance * 16) + pdi->num + 3; pdi->intel_alh_id = (sdw->instance * 16) + pdi->num + 3;
@ -350,7 +347,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;
@ -361,10 +358,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;
@ -375,7 +370,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;
} }