fix(settings): Add missing err handlers on settings_register

This commit is contained in:
Nick 2020-12-02 17:03:28 -06:00 committed by Pete Johanson
parent 2204a5dce4
commit ae63ce5ee7
2 changed files with 12 additions and 2 deletions

View file

@ -142,7 +142,12 @@ static int ext_power_generic_init(const struct device *dev) {
#if IS_ENABLED(CONFIG_SETTINGS) #if IS_ENABLED(CONFIG_SETTINGS)
settings_subsys_init(); settings_subsys_init();
settings_register(&ext_power_conf); int err = settings_register(&ext_power_conf);
if (err) {
LOG_ERR("Failed to register the ext_power settings handler (err %d)", err);
return err;
}
k_delayed_work_init(&ext_power_save_work, ext_power_save_state_work); k_delayed_work_init(&ext_power_save_work, ext_power_save_state_work);
// Set default value (on) if settings isn't set // Set default value (on) if settings isn't set

View file

@ -267,7 +267,12 @@ static int zmk_rgb_underglow_init(const struct device *_arg) {
#if IS_ENABLED(CONFIG_SETTINGS) #if IS_ENABLED(CONFIG_SETTINGS)
settings_subsys_init(); settings_subsys_init();
settings_register(&rgb_conf); int err = settings_register(&rgb_conf);
if (err) {
LOG_ERR("Failed to register the ext_power settings handler (err %d)", err);
return err;
}
k_delayed_work_init(&underglow_save_work, zmk_rgb_underglow_save_state_work); k_delayed_work_init(&underglow_save_work, zmk_rgb_underglow_save_state_work);
settings_load_subtree("rgb/underglow"); settings_load_subtree("rgb/underglow");