diff mbox

[Resend,2/4] ASoC: dapm: Refactor the code in snd_soc_dapm_new_pcm

Message ID 1505896116-43310-3-git-send-email-yesanishhere@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Anish Kumar Sept. 20, 2017, 8:28 a.m. UTC
From: anish kumar <yesanishhere@gmail.com>

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>
---
 sound/soc/soc-dapm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Charles Keepax Sept. 20, 2017, 11:02 a.m. UTC | #1
On Wed, Sep 20, 2017 at 01:28:34AM -0700, yesanishhere@gmail.com wrote:
> From: anish kumar <yesanishhere@gmail.com>
> 
> 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>

Thanks,
Charles
diff mbox

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f51f613..d55cac6 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++;
 	}