[PATCH] ASoC: sdm845: remove unnecessary goto

From: Chetan Kankotiya
Date: Tue Sep 24 2019 - 11:33:32 EST


There is no specific handling in the error path of
sdm845_tdm_snd_hw_params, remove the unnecessary goto and label.
As there is no specific handling in error path return with error code
directly.

Signed-off-by: Chetan Kankotiya <chetankankotiya@xxxxxxxxx>
---
sound/soc/qcom/sdm845.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c
index 28f3cef696e6..e9d6588e61ee 100644
--- a/sound/soc/qcom/sdm845.c
+++ b/sound/soc/qcom/sdm845.c
@@ -61,7 +61,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) {
dev_err(rtd->dev, "%s: failed to set tdm slot, err:%d\n",
__func__, ret);
- goto end;
+ return ret;
}

ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL,
@@ -69,7 +69,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) {
dev_err(rtd->dev, "%s: failed to set channel map, err:%d\n",
__func__, ret);
- goto end;
+ return ret;
}
} else {
ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xf, 0,
@@ -77,7 +77,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) {
dev_err(rtd->dev, "%s: failed to set tdm slot, err:%d\n",
__func__, ret);
- goto end;
+ return ret;
}

ret = snd_soc_dai_set_channel_map(cpu_dai, channels,
@@ -85,7 +85,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) {
dev_err(rtd->dev, "%s: failed to set channel map, err:%d\n",
__func__, ret);
- goto end;
+ return ret;
}
}

@@ -117,8 +117,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream,
}
}

-end:
- return ret;
+ return 0;
}

static int sdm845_snd_hw_params(struct snd_pcm_substream *substream,
--
2.20.1