projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mmc: Drop unnecessary case for mmc_probe()
[oweals/u-boot.git]
/
env
/
eeprom.c
diff --git
a/env/eeprom.c
b/env/eeprom.c
index 08ef6307fc5c672ed7a814757cd7bef090b97361..63842d6ff3ee92adc737b15b53924cd327ff9511 100644
(file)
--- a/
env/eeprom.c
+++ b/
env/eeprom.c
@@
-61,7
+61,10
@@
static int eeprom_bus_write(unsigned dev_addr, unsigned offset,
return rcode;
}
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;
{
uchar c;
unsigned int off = CONFIG_ENV_OFFSET;
@@
-122,7
+125,7
@@
static int env_eeprom_load(void)
if (!crc_ok[0] && !crc_ok[1]) {
gd->env_addr = 0;
if (!crc_ok[0] && !crc_ok[1]) {
gd->env_addr = 0;
- gd->env_valid
= 0
;
+ gd->env_valid
= ENV_INVALID
;
} else if (crc_ok[0] && !crc_ok[1]) {
gd->env_valid = ENV_VALID;
} else if (!crc_ok[0] && crc_ok[1]) {
} else if (crc_ok[0] && !crc_ok[1]) {
gd->env_valid = ENV_VALID;
} else if (!crc_ok[0] && crc_ok[1]) {
@@
-166,9
+169,9
@@
static int env_eeprom_load(void)
}
if (crc == new) {
}
if (crc == new) {
- gd->env_valid
= ENV_VALID;
+ gd->env_valid = ENV_VALID;
} else {
} else {
- gd->env_valid
= 0
;
+ gd->env_valid
= ENV_INVALID
;
}
#endif /* CONFIG_ENV_OFFSET_REDUND */
}
#endif /* CONFIG_ENV_OFFSET_REDUND */
@@
-181,9
+184,7
@@
static int env_eeprom_load(void)
eeprom_bus_read(CONFIG_SYS_DEF_EEPROM_ADDR,
off, (uchar *)buf_env, CONFIG_ENV_SIZE);
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)
}
static int env_eeprom_save(void)
@@
-230,7
+231,6
@@
static int env_eeprom_save(void)
U_BOOT_ENV_LOCATION(eeprom) = {
.location = ENVL_EEPROM,
ENV_NAME("EEPROM")
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),
};
.load = env_eeprom_load,
.save = env_save_ptr(env_eeprom_save),
};