diff options
-rw-r--r-- | sound/soc/soc-dapm.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ac8897ecd72e..21ecf9a37d00 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -3242,11 +3242,11 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card, | |||
3242 | struct snd_soc_dapm_widget *source, | 3242 | struct snd_soc_dapm_widget *source, |
3243 | struct snd_soc_dapm_widget *sink) | 3243 | struct snd_soc_dapm_widget *sink) |
3244 | { | 3244 | { |
3245 | struct snd_soc_dapm_route routes[2]; | ||
3246 | struct snd_soc_dapm_widget template; | 3245 | struct snd_soc_dapm_widget template; |
3247 | struct snd_soc_dapm_widget *w; | 3246 | struct snd_soc_dapm_widget *w; |
3248 | size_t len; | 3247 | size_t len; |
3249 | char *link_name; | 3248 | char *link_name; |
3249 | int ret; | ||
3250 | 3250 | ||
3251 | len = strlen(source->name) + strlen(sink->name) + 2; | 3251 | len = strlen(source->name) + strlen(sink->name) + 2; |
3252 | link_name = devm_kzalloc(card->dev, len, GFP_KERNEL); | 3252 | link_name = devm_kzalloc(card->dev, len, GFP_KERNEL); |
@@ -3273,15 +3273,10 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card, | |||
3273 | 3273 | ||
3274 | w->params = params; | 3274 | w->params = params; |
3275 | 3275 | ||
3276 | memset(&routes, 0, sizeof(routes)); | 3276 | ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL); |
3277 | 3277 | if (ret) | |
3278 | routes[0].source = source->name; | 3278 | return ret; |
3279 | routes[0].sink = link_name; | 3279 | return snd_soc_dapm_add_path(&card->dapm, w, sink, NULL, NULL); |
3280 | routes[1].source = link_name; | ||
3281 | routes[1].sink = sink->name; | ||
3282 | |||
3283 | return snd_soc_dapm_add_routes(&card->dapm, routes, | ||
3284 | ARRAY_SIZE(routes)); | ||
3285 | } | 3280 | } |
3286 | 3281 | ||
3287 | int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, | 3282 | int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, |