ASoC: soc_pcm_open: Add missing bailout tag

The codec_dai needs to be shutdown should the machine startup fails.
This patch adds another bailout tag for that case and rename the tag
for configuration failures.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by Jassi Brar and committed by Mark Brown bb1c0478 a0b62329

+9 -5
+9 -5
sound/soc/soc-core.c
··· 427 if (!runtime->hw.rates) { 428 printk(KERN_ERR "asoc: %s <-> %s No matching rates\n", 429 codec_dai->name, cpu_dai->name); 430 - goto machine_err; 431 } 432 if (!runtime->hw.formats) { 433 printk(KERN_ERR "asoc: %s <-> %s No matching formats\n", 434 codec_dai->name, cpu_dai->name); 435 - goto machine_err; 436 } 437 if (!runtime->hw.channels_min || !runtime->hw.channels_max) { 438 printk(KERN_ERR "asoc: %s <-> %s No matching channels\n", 439 codec_dai->name, cpu_dai->name); 440 - goto machine_err; 441 } 442 443 /* Symmetry only applies if we've already got an active stream. */ 444 if (cpu_dai->active || codec_dai->active) { 445 ret = soc_pcm_apply_symmetry(substream); 446 if (ret != 0) 447 - goto machine_err; 448 } 449 450 pr_debug("asoc: %s <-> %s info:\n", codec_dai->name, cpu_dai->name); ··· 464 mutex_unlock(&pcm_mutex); 465 return 0; 466 467 - machine_err: 468 if (machine->ops && machine->ops->shutdown) 469 machine->ops->shutdown(substream); 470 471 codec_dai_err: 472 if (platform->pcm_ops->close)
··· 427 if (!runtime->hw.rates) { 428 printk(KERN_ERR "asoc: %s <-> %s No matching rates\n", 429 codec_dai->name, cpu_dai->name); 430 + goto config_err; 431 } 432 if (!runtime->hw.formats) { 433 printk(KERN_ERR "asoc: %s <-> %s No matching formats\n", 434 codec_dai->name, cpu_dai->name); 435 + goto config_err; 436 } 437 if (!runtime->hw.channels_min || !runtime->hw.channels_max) { 438 printk(KERN_ERR "asoc: %s <-> %s No matching channels\n", 439 codec_dai->name, cpu_dai->name); 440 + goto config_err; 441 } 442 443 /* Symmetry only applies if we've already got an active stream. */ 444 if (cpu_dai->active || codec_dai->active) { 445 ret = soc_pcm_apply_symmetry(substream); 446 if (ret != 0) 447 + goto config_err; 448 } 449 450 pr_debug("asoc: %s <-> %s info:\n", codec_dai->name, cpu_dai->name); ··· 464 mutex_unlock(&pcm_mutex); 465 return 0; 466 467 + config_err: 468 if (machine->ops && machine->ops->shutdown) 469 machine->ops->shutdown(substream); 470 + 471 + machine_err: 472 + if (codec_dai->ops->shutdown) 473 + codec_dai->ops->shutdown(substream, codec_dai); 474 475 codec_dai_err: 476 if (platform->pcm_ops->close)