[PATCH] fixup! state: add fixup to copy state from barebox to kernel device tree
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Sat May 16 03:15:27 PDT 2015
of_unregister_fixup must also be called in the release function.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
This depends on the patch "of: add a function to remove an of_fixup" I
just sent to the list
---
common/state.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/common/state.c b/common/state.c
index fb13ae272db9..bd9c5a712aac 100644
--- a/common/state.c
+++ b/common/state.c
@@ -435,13 +435,6 @@ static struct state *state_new(const char *name)
return state;
}
-void state_release(struct state *state)
-{
- list_del(&state->list);
- unregister_device(&state->dev);
- free(state);
-}
-
static struct state_variable *state_find_var(struct state *state,
const char *name)
{
@@ -760,6 +753,14 @@ static int of_state_fixup(struct device_node *root, void *ctx)
return ret;
}
+void state_release(struct state *state)
+{
+ of_unregister_fixup(of_state_fixup, state);
+ list_del(&state->list);
+ unregister_device(&state->dev);
+ free(state);
+}
+
/*
* state_new_from_node - create a new state instance from a device_node
*
--
2.1.4
More information about the barebox
mailing list