mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 12:13:00 -04:00
cmc_pu2: fix misc_init_r prototype
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
53158aea99
commit
176c4a982c
@ -66,7 +66,7 @@ int i2c_read (unsigned char chip, unsigned int addr, int alen,
|
|||||||
* Internal structure: see struct definition
|
* Internal structure: see struct definition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void misc_init_r(void)
|
int misc_init_r(void)
|
||||||
{
|
{
|
||||||
struct manufacturer_data data;
|
struct manufacturer_data data;
|
||||||
char serial [9];
|
char serial [9];
|
||||||
@ -80,7 +80,7 @@ void misc_init_r(void)
|
|||||||
if (i2c_read(I2C_CHIP, I2C_OFFSET, I2C_ALEN, (unsigned char *)&data,
|
if (i2c_read(I2C_CHIP, I2C_OFFSET, I2C_ALEN, (unsigned char *)&data,
|
||||||
sizeof(data)) != 0) {
|
sizeof(data)) != 0) {
|
||||||
puts ("Error reading manufacturer data from EEPROM\n");
|
puts ("Error reading manufacturer data from EEPROM\n");
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if manufacturer data block is valid */
|
/* check if manufacturer data block is valid */
|
||||||
@ -93,7 +93,7 @@ void misc_init_r(void)
|
|||||||
|
|
||||||
if (chksum != data.chksum) {
|
if (chksum != data.chksum) {
|
||||||
puts ("Error: manufacturer data block has invalid checksum\n");
|
puts ("Error: manufacturer data block has invalid checksum\n");
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy serial number */
|
/* copy serial number */
|
||||||
@ -107,4 +107,6 @@ void misc_init_r(void)
|
|||||||
if (getenv("ethaddr") == NULL) {
|
if (getenv("ethaddr") == NULL) {
|
||||||
eth_setenv_enetaddr("ethaddr", data.macadr);
|
eth_setenv_enetaddr("ethaddr", data.macadr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user