summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-06-17 19:11:35 -0700
committerKeith Packard <keithp@keithp.com>2012-06-17 19:11:35 -0700
commit611f37607fadcdc9908d67456f844a452ad4a87a (patch)
treebe13207f8928f0117c002a9ccf405643337ef95b /src
parentae3662c56effda9f0516c7d6ffd2d5f56b859593 (diff)
altos: Make sure ao_storage_config is set before reading config block
ao_storage_read does in fact call ao_storage_setup, but we need the value of ao_storage_config *before* calling ao_storage_read, so call ao_storage_setup first. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/ao_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/ao_config.c b/src/core/ao_config.c
index a4877b06..cc580d66 100644
--- a/src/core/ao_config.c
+++ b/src/core/ao_config.c
@@ -81,6 +81,11 @@ _ao_config_get(void)
if (ao_config_loaded)
return;
#if HAS_EEPROM
+ /* Yes, I know ao_storage_read calls ao_storage_setup,
+ * but ao_storage_setup *also* sets ao_storage_config, which we
+ * need before calling ao_storage_read here
+ */
+ ao_storage_setup();
ao_storage_read(ao_storage_config, &ao_config, sizeof (ao_config));
#endif
if (ao_config.major != AO_CONFIG_MAJOR) {