Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soundwire: intel: simplify return path in hw_params

Remove unused error path (label+goto) to make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240703-soundwire-cleanup-h-v1-4-24fa0dbb948f@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
ba874a8c 1f93cb22

+6 -10
+6 -10
drivers/soundwire/intel.c
··· 743 743 744 744 pdi = sdw_cdns_alloc_pdi(cdns, &cdns->pcm, ch, dir, dai->id); 745 745 746 - if (!pdi) { 747 - ret = -EINVAL; 748 - goto error; 749 - } 746 + if (!pdi) 747 + return -EINVAL; 750 748 751 749 /* do run-time configurations for SHIM, ALH and PDI/PORT */ 752 750 intel_pdi_shim_configure(sdw, pdi); ··· 761 763 sdw->instance, 762 764 pdi->intel_alh_id); 763 765 if (ret) 764 - goto error; 766 + return ret; 765 767 766 768 sconfig.direction = dir; 767 769 sconfig.ch_count = ch; ··· 772 774 773 775 /* Port configuration */ 774 776 pconfig = kzalloc(sizeof(*pconfig), GFP_KERNEL); 775 - if (!pconfig) { 776 - ret = -ENOMEM; 777 - goto error; 778 - } 777 + if (!pconfig) 778 + return -ENOMEM; 779 779 780 780 pconfig->num = pdi->num; 781 781 pconfig->ch_mask = (1 << ch) - 1; ··· 784 788 dev_err(cdns->dev, "add master to stream failed:%d\n", ret); 785 789 786 790 kfree(pconfig); 787 - error: 791 + 788 792 return ret; 789 793 } 790 794