mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
compulab: eeprom: propagate error value in read_mac_addr()
cl_eeprom_read_mac_addr() doesn't differentiate between success case and inability to access eeprom. Fix this by propagating the return value of cl_eeprom_setup(). Cc: Stefano Babic <sbabic@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
This commit is contained in:
parent
72898ac7b8
commit
e93e809f2f
1 changed files with 4 additions and 2 deletions
|
@ -105,9 +105,11 @@ void get_board_serial(struct tag_serialnr *serialnr)
|
||||||
int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
|
int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
|
||||||
{
|
{
|
||||||
uint offset;
|
uint offset;
|
||||||
|
int err;
|
||||||
|
|
||||||
if (cl_eeprom_setup(eeprom_bus))
|
err = cl_eeprom_setup(eeprom_bus);
|
||||||
return 0;
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
offset = (cl_eeprom_layout != LAYOUT_LEGACY) ?
|
offset = (cl_eeprom_layout != LAYOUT_LEGACY) ?
|
||||||
MAC_ADDR_OFFSET : MAC_ADDR_OFFSET_LEGACY;
|
MAC_ADDR_OFFSET : MAC_ADDR_OFFSET_LEGACY;
|
||||||
|
|
Loading…
Add table
Reference in a new issue