* Internal structure: see struct definition
*/
-void misc_init_r(void)
+int misc_init_r(void)
{
struct manufacturer_data data;
char serial [9];
if (i2c_read(I2C_CHIP, I2C_OFFSET, I2C_ALEN, (unsigned char *)&data,
sizeof(data)) != 0) {
puts ("Error reading manufacturer data from EEPROM\n");
- return;
+ return -1;
}
/* check if manufacturer data block is valid */
if (chksum != data.chksum) {
puts ("Error: manufacturer data block has invalid checksum\n");
- return;
+ return -1;
}
/* copy serial number */
if (getenv("ethaddr") == NULL) {
eth_setenv_enetaddr("ethaddr", data.macadr);
}
+
+ return 0;
}