From: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Date: Tue, 28 Nov 2017 04:41:14 +0000 (+0530)
Subject: driver: fsl-mc: MC object cleanup when DPL not loaded
X-Git-Tag: v2025.01-rc5-pxa1908~5265^2~1
X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/static/gitweb.css?a=commitdiff_plain;h=73fa206aefe0d27f71929da0c35dbce879205f20;p=u-boot.git

driver: fsl-mc: MC object cleanup when DPL not loaded

For case when MC is loaded but DPL is not deployed perform MC
object [DPBP, DPIO, DPNI and DPRC] cleanup.

Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
---

diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index bf9949b1dd..f36fe06269 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -1436,12 +1436,13 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
 	 */
 	if (bd && mc_boot_status && !is_dpl_apply_status) {
 		printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
-		return 0;
+		goto mc_obj_cleanup;
 	}
 
 	if (bd && mc_boot_status && is_dpl_apply_status)
 		return 0;
 
+mc_obj_cleanup:
 	err = dpbp_exit();
 	if (err < 0) {
 		printf("dpbp_exit() failed: %d\n", err);