From: Teh Kok How Date: Fri, 12 Feb 2010 14:57:10 +0800 Subject: [U-Boot] [PATCH] net/eth.c: bug-fix In-Reply-To: <4B74ECDA.3020309@gmail.com> References: <07A6D2B84CB942DD8FC96FB7E3CD9CC2@smartbridges.com> <4B74ECDA.3020309@gmail.com> Message-ID: <3B276C2ADDF447CEB8039F3668A2BC6A@smartbridges.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de No, it is a bug. Board_eth_init() calls pci_eth_init() (include/netdev.h) and if ethernet is soc, CONFIG_PCI is not defined, pci_eth_init() returns 0. This patch allows cpu_eth_init() to be called. -----Original Message----- From: Ben Warren [mailto:biggerbadderben at gmail.com] Sent: Friday, February 12, 2010 1:54 PM To: Teh Kok How Cc: u-boot at lists.denx.de Subject: Re: [U-Boot] [PATCH] net/eth.c: bug-fix On 2/11/2010 8:08 PM, Teh Kok How wrote: > --- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000 +0800 > > +++ u-boot-2009.11.1/net/eth.c 2010-02-12 11:18:23.558229895 +0800 > > @@ -199,7 +199,7 @@ > > #endif > > /* Try board-specific initialization first. If it fails or isn't > > * present, try the cpu-specific initialization */ > > - if (board_eth_init(bis)< 0) > > + if (board_eth_init(bis)<= 0) > > cpu_eth_init(bis); > > That's not a bug. The check is meant to indicate whether the weak board_eth_init() function has been overridden, not whether there was an error. I have a clarification patch that hasn't been submitted yet. regards, Ben