From 992b2f0fa1cbb7b1aa4c35ecd058f5a433e7a817 Mon Sep 17 00:00:00 2001 From: Xiaojun Sang Date: Tue, 20 Mar 2018 16:01:41 +0800 Subject: [PATCH] ASoC: codecs: wcd: avoid redundant component unbind Component unbind happens in component_bind_all, if component bind fails. There is no need to call extra component_unbind_all. Change-Id: I4ff2aececc5e10c5c4cfbe71778630c621768349 Signed-off-by: Xiaojun Sang --- asoc/codecs/wcd-dsp-mgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asoc/codecs/wcd-dsp-mgr.c b/asoc/codecs/wcd-dsp-mgr.c index 9bcb6353e8dd..9e65deb473b1 100644 --- a/asoc/codecs/wcd-dsp-mgr.c +++ b/asoc/codecs/wcd-dsp-mgr.c @@ -1059,8 +1059,10 @@ static int wdsp_mgr_bind(struct device *dev) dev_info(dev, "%s: create_ramdump_device failed\n", __func__); ret = component_bind_all(dev, wdsp->ops); - if (ret < 0) + if (ret < 0) { WDSP_ERR(wdsp, "component_bind_all failed %d\n", ret); + return ret; + } /* Make sure all components registered ops */ for (idx = 0; idx < WDSP_CMPNT_TYPE_MAX; idx++) {