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