From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Tue, 22 Jun 2010 12:10:28 -0700 Subject: [U-Boot] [PATCH 2/2] MPC8308ERDB: minimal support for devboard from Freescale In-Reply-To: <20100622181404.C9A1E1524ED@gemini.denx.de> References: <1277055168-18596-1-git-send-email-yanok@emcraft.com> <1277055168-18596-3-git-send-email-yanok@emcraft.com> <20100621074440.E629C1524EE@gemini.denx.de> <4C1F5A54.4050908@emcraft.com> <20100622181404.C9A1E1524ED@gemini.denx.de> Message-ID: <4C210AA4.1020101@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang & Ilya, Sorry for responding to both of you at the same time... On 6/22/2010 11:14 AM, Wolfgang Denk wrote: > Dear Ilya Yanok, > > In message<4C1F5A54.4050908@emcraft.com> you wrote: > >> >>> Entry to MAINTAINERS missing. >>> >> Should I add you as a maintainer or myself? >> > You did the actual work... > > >>>> +int board_eth_init(bd_t *bis) >>>> +{ >>>> + cpu_eth_init(bis); /* Initialize TSECs first */ >>>> >>>> >>> I think it's wrong to ignore the return code here. >>> >> What makes you think so? What can we do with the return code here? Print >> warning? If we return error from board_eth_init() calling code will call >> cpu_eth_init() again which is useless as we have already called it. >> > Yes, print a warning if < 0. As you've noticed, returning -1 wouldn't be good. I'm not aware of a U-boot policy for handling hardware problems other than printf. >>>> + return pci_eth_init(bis); >>>> > My understanding is that pci_eth_init() and board_eth_init() return > the number of NIC's found - should that number not include the number > of successfully initialized TSECs? > > Yes, please. Something like: int board_eth_init(bd_t *bis) { int rc, num_if = 0; if ((rc = cpu_eth_init(bis)) >= 0) { num_if += rc; } else { print error message } if ((rc = pci_eth_init(bis)) >= 0) { num_if += rc; } else { print error message } return num_if; } I'm working on changing net/eth.c to be less kludgy, but am having a hard time setting up my test bed. Hopefully in the next few days. > Best regards, > > Wolfgang Denk > > regards, Ben