From: Mike Frysinger Date: Fri, 3 Feb 2012 10:05:41 -0500 Subject: [U-Boot] [PATCH 1/2] da850evm: add support to read mac address from spi flash In-Reply-To: <1328190138-5276-2-git-send-email-manjunath.hadli@ti.com> References: <1328190138-5276-1-git-send-email-manjunath.hadli@ti.com> <1328190138-5276-2-git-send-email-manjunath.hadli@ti.com> Message-ID: <201202031005.43026.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday 02 February 2012 08:42:17 Manjunath Hadli wrote: > --- a/board/davinci/da8xxevm/da850evm.c > +++ b/board/davinci/da8xxevm/da850evm.c > > int misc_init_r(void) > { > dspwake(); > + > +#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH > + uchar buff[8]; > + int ret; > + > + if (!eth_getenv_enetaddr("ethaddr", buff)) { > + ret = get_mac_addr(buff); > + if (ret != 0) > + return -EINVAL; > + > + if (!is_valid_ether_addr(buff)) { > + printf("Invalid MAC address read.\n"); > + return -EINVAL; > + } > + > + eth_setenv_enetaddr("ethaddr", buff); > + } > +#endif i don't think you should return -EINVAL here. just issue the warning and be done with it. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: