From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Mon, 23 Sep 2013 10:35:24 +0200 Subject: [U-Boot] [PATCH 3/3] mx35pdk: Fix error handling in board_late_init() In-Reply-To: <1379705450-14684-3-git-send-email-festevam@gmail.com> References: <1379705450-14684-1-git-send-email-festevam@gmail.com> <1379705450-14684-3-git-send-email-festevam@gmail.com> Message-ID: <523FFD4C.8030605@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 20/09/2013 21:30, Fabio Estevam wrote: > From: Fabio Estevam > > If smc911x_initialize() fails we should return the error immediately. > > While at it, also check the error from cpu_eth_init(). > > Signed-off-by: Fabio Estevam > --- > board/freescale/mx35pdk/mx35pdk.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c > index 427c83a..9fabef5 100644 > --- a/board/freescale/mx35pdk/mx35pdk.c > +++ b/board/freescale/mx35pdk/mx35pdk.c > @@ -251,14 +251,12 @@ int board_late_init(void) > > int board_eth_init(bd_t *bis) > { > - int rc = -ENODEV; > #if defined(CONFIG_SMC911X) > - rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); > + int rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); > + if (rc) > + return rc; > #endif > - > - cpu_eth_init(bis); > - > - return rc; > + return cpu_eth_init(bis); > } > > #if defined(CONFIG_FSL_ESDHC) > Acked-by: Stefano Babic Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================