aboutsummaryrefslogtreecommitdiff
path: root/board/keymile/common
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2008-10-17 16:11:52 +0200
committerWolfgang Denk <wd@denx.de>2008-10-18 21:54:04 +0200
commit6250f0f6297c5ba9aecdea6290799a95c5d4b1da (patch)
treea8cec03a6351825215f647e0919d311344779c3e /board/keymile/common
parent9e299192ca9850cf725456388042a5aa5a6f3ec7 (diff)
mgcoge, mgsuvd: extract more common code
in ft_blob_update () for both boards was an unneccessary repetition of code, which this patch moves in a common function for this boards. Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'board/keymile/common')
-rw-r--r--board/keymile/common/common.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index e47928d0f..a4cf24cf7 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -495,3 +495,29 @@ void i2c_init_board(void)
#endif
}
#endif
+
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+int fdt_set_node_and_value (void *blob,
+ char *nodename,
+ char *regname,
+ void *var,
+ int size)
+{
+ int ret = 0;
+ int nodeoffset = 0;
+
+ nodeoffset = fdt_path_offset (blob, nodename);
+ if (nodeoffset >= 0) {
+ ret = fdt_setprop (blob, nodeoffset, regname, var,
+ size);
+ if (ret < 0)
+ printf("ft_blob_update(): cannot set %s/%s "
+ "property err:%s\n", nodename, regname,
+ fdt_strerror (ret));
+ } else {
+ printf("ft_blob_update(): cannot find %s node "
+ "err:%s\n", nodename, fdt_strerror (nodeoffset));
+ }
+ return ret;
+}
+#endif