From 468a834af046ec37e1d78aab05443d19fe795d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Delawarde?= Date: Wed, 30 Oct 2019 08:09:48 +0100 Subject: [PATCH] settings: fix custom backend example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix example of custom backend implementation Fixes: #20163. Signed-off-by: François Delawarde --- doc/reference/storage/settings/settings.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/reference/storage/settings/settings.rst b/doc/reference/storage/settings/settings.rst index 0a55648df7a..1082fa34713 100644 --- a/doc/reference/storage/settings/settings.rst +++ b/doc/reference/storage/settings/settings.rst @@ -252,15 +252,22 @@ handler (:option:`CONFIG_SETTINGS_CUSTOM`). //... } + /* custom backend interface */ static struct settings_store_itf settings_custom_itf = { .csi_load = settings_custom_load, .csi_save = settings_custom_save, }; + /* custom backend node */ + static struct settings_store settings_custom_store = { + .cs_itf = &settings_custom_itf + } + int settings_backend_init(void) { - settings_dst_register(&settings_custom_itf); - settings_src_register(&settings_custom_itf); + /* register custom backend */ + settings_dst_register(&settings_custom_store); + settings_src_register(&settings_custom_store); return 0; }