summaryrefslogtreecommitdiffstats
path: root/include/state.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/state.h')
-rw-r--r--include/state.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/include/state.h b/include/state.h
index 4e995a19ef..d98b781c20 100644
--- a/include/state.h
+++ b/include/state.h
@@ -5,17 +5,13 @@
struct state;
-int state_backend_dtb_file(struct state *state, const char *of_path,
- const char *path);
-int state_backend_raw_file(struct state *state, const char *of_path,
- const char *path, off_t offset, size_t size);
+#if IS_ENABLED(CONFIG_STATE)
struct state *state_new_from_node(struct device_node *node, bool readonly);
void state_release(struct state *state);
struct state *state_by_name(const char *name);
struct state *state_by_node(const struct device_node *node);
-int state_get_name(const struct state *state, char const **name);
int state_load_no_auth(struct state *state);
int state_load(struct state *state);
@@ -24,4 +20,39 @@ void state_info(void);
int state_read_mac(struct state *state, const char *name, u8 *buf);
+#else /* #if IS_ENABLED(CONFIG_STATE) */
+
+static inline struct state *state_new_from_node(struct device_node *node,
+ bool readonly)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+static inline struct state *state_by_name(const char *name)
+{
+ return NULL;
+}
+
+static inline struct state *state_by_node(const struct device_node *node)
+{
+ return NULL;
+};
+
+static inline int state_load(struct state *state)
+{
+ return -ENOSYS;
+}
+
+static inline int state_save(struct state *state)
+{
+ return -ENOSYS;
+}
+
+static inline int state_read_mac(struct state *state, const char *name, u8 *buf)
+{
+ return -ENOSYS;
+}
+
+#endif /* #if IS_ENABLED(CONFIG_STATE) / #else */
+
#endif /* __STATE_H */