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>
This commit is contained in:
anish kumar 2017-09-20 01:28:34 -07:00 committed by Mark Brown
parent e5af4f9fb3
commit 38b8e6f092
1 changed files with 4 additions and 8 deletions

View File

@ -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++;
}