X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=env%2Feeprom.c;h=ac2689cc148c43c07c945db22494d0d49a5fe301;hb=e5aee22e4be75e75a854ab64503fc80598bc2004;hp=584379ebd26e3673ffd2d4055640160d24108582;hpb=8197d92843952b376915fdbcbf67c723feab1532;p=oweals%2Fu-boot.git diff --git a/env/eeprom.c b/env/eeprom.c index 584379ebd2..ac2689cc14 100644 --- a/env/eeprom.c +++ b/env/eeprom.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000-2010 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH * Andreas Heppel - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -61,7 +60,10 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned offset, return rcode; } -static int env_eeprom_get_char(int index) +/** Call this function from overridden env_get_char_spec() if you need + * this functionality. + */ +int env_eeprom_get_char(int index) { uchar c; unsigned int off = CONFIG_ENV_OFFSET; @@ -181,9 +183,7 @@ static int env_eeprom_load(void) eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR, off, (uchar *)buf_env, CONFIG_ENV_SIZE); - env_import(buf_env, 1); - - return 0; + return env_import(buf_env, 1); } static int env_eeprom_save(void) @@ -230,7 +230,6 @@ static int env_eeprom_save(void) U_BOOT_ENV_LOCATION(eeprom) = { .location = ENVL_EEPROM, ENV_NAME("EEPROM") - .get_char = env_eeprom_get_char, .load = env_eeprom_load, .save = env_save_ptr(env_eeprom_save), };