summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authoranish kumar <yesanishhere@gmail.com>2017-09-20 01:28:34 -0700
committerMark Brown <broonie@kernel.org>2017-09-20 12:38:50 +0100
commit38b8e6f092fd71eee56a064487be335226b0a54d (patch)
treed55772614960396d8c1f2966f4dfb85757cea3d0 /sound/soc/soc-dapm.c
parente5af4f9fb3d405e6145f0d019ce11a97a8930915 (diff)
ASoC: dapm: Refactor the code in snd_soc_dapm_new_pcm
refactor snd_soc_dapm_new_pcm to reduce the size of this function to facilitate further refactoring. Signed-off-by: anish kumar <yesanishhere@gmail.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f51f61340f9c..d55cac655195 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3821,19 +3821,15 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
devm_kasprintf(card->dev, GFP_KERNEL,
"Anonymous Configuration %d",
count);
- if (!w_param_text[count]) {
- ret = -ENOMEM;
- goto outfree_link_name;
- }
} else {
w_param_text[count] = devm_kmemdup(card->dev,
config->stream_name,
strlen(config->stream_name) + 1,
GFP_KERNEL);
- if (!w_param_text[count]) {
- ret = -ENOMEM;
- goto outfree_link_name;
- }
+ }
+ if (!w_param_text[count]) {
+ ret = -ENOMEM;
+ goto outfree_link_name;
}
config++;
}