[U-Boot] [PATCH 1/2] da850evm: add support to read mac address from spi flash

Mike Frysinger vapier at gentoo.org
Fri Feb 3 16:05:41 CET 2012


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: <http://lists.denx.de/pipermail/u-boot/attachments/20120203/8bb956c9/attachment.pgp>


More information about the U-Boot mailing list