From e93e809f2f71bc6705818f1978b2d15bddfcae72 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Sun, 6 Sep 2015 11:48:36 +0300 Subject: 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 Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov Acked-by: Igor Grinberg --- board/compulab/common/eeprom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'board/compulab/common/eeprom.c') diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index aaacd2e32e..9f18a3d949 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -105,9 +105,11 @@ void get_board_serial(struct tag_serialnr *serialnr) int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus) { uint offset; + int err; - if (cl_eeprom_setup(eeprom_bus)) - return 0; + err = cl_eeprom_setup(eeprom_bus); + if (err) + return err; offset = (cl_eeprom_layout != LAYOUT_LEGACY) ? MAC_ADDR_OFFSET : MAC_ADDR_OFFSET_LEGACY; -- cgit v1.2.1