From ae63ce5ee70ed898a07b6eade10c2d5ee13c496d Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 2 Dec 2020 17:03:28 -0600 Subject: [PATCH] fix(settings): Add missing err handlers on settings_register --- app/src/ext_power_generic.c | 7 ++++++- app/src/rgb_underglow.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/ext_power_generic.c b/app/src/ext_power_generic.c index 9ab18c49..7e42d495 100644 --- a/app/src/ext_power_generic.c +++ b/app/src/ext_power_generic.c @@ -142,7 +142,12 @@ static int ext_power_generic_init(const struct device *dev) { #if IS_ENABLED(CONFIG_SETTINGS) 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); // Set default value (on) if settings isn't set diff --git a/app/src/rgb_underglow.c b/app/src/rgb_underglow.c index 1603e348..73a5c5e9 100644 --- a/app/src/rgb_underglow.c +++ b/app/src/rgb_underglow.c @@ -267,7 +267,12 @@ static int zmk_rgb_underglow_init(const struct device *_arg) { #if IS_ENABLED(CONFIG_SETTINGS) 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); settings_load_subtree("rgb/underglow");