summaryrefslogtreecommitdiff
path: root/tools/image-host.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-05-07 06:11:56 +0000
committerTom Rini <trini@ti.com>2013-05-14 15:37:25 -0400
commitb7260910dca95b8a608d3721e0584484e887d756 (patch)
tree311515140e87afb68a0966431532d190e61de998 /tools/image-host.c
parent94e5fa46a0d1516ee441a394aa2141db663322f6 (diff)
downloadu-boot-imx-b7260910dca95b8a608d3721e0584484e887d756.zip
u-boot-imx-b7260910dca95b8a608d3721e0584484e887d756.tar.gz
u-boot-imx-b7260910dca95b8a608d3721e0584484e887d756.tar.bz2
image: Convert fit_image_hash_set_value() to static, and rename
This function doesn't need to be exported, and with verification we want to use it for setting the 'value' property in any node, so rename it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'tools/image-host.c')
-rw-r--r--tools/image-host.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/tools/image-host.c b/tools/image-host.c
index 6648215..a6b4f6b 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -79,6 +79,36 @@ int fit_set_hashes(void *fit)
}
/**
+ * fit_set_hash_value - set hash value in requested has node
+ * @fit: pointer to the FIT format image header
+ * @noffset: hash node offset
+ * @value: hash value to be set
+ * @value_len: hash value length
+ *
+ * fit_set_hash_value() attempts to set hash value in a node at offset
+ * given and returns operation status to the caller.
+ *
+ * returns
+ * 0, on success
+ * -1, on failure
+ */
+static int fit_set_hash_value(void *fit, int noffset, uint8_t *value,
+ int value_len)
+{
+ int ret;
+
+ ret = fdt_setprop(fit, noffset, FIT_VALUE_PROP, value, value_len);
+ if (ret) {
+ printf("Can't set hash '%s' property for '%s' node(%s)\n",
+ FIT_VALUE_PROP, fit_get_name(fit, noffset, NULL),
+ fdt_strerror(ret));
+ return -1;
+ }
+
+ return 0;
+}
+
+/**
* fit_image_process_hash - Process a single subnode of the images/ node
*
* Check each subnode and process accordingly. For hash nodes we generate
@@ -119,7 +149,7 @@ static int fit_image_process_hash(void *fit, const char *image_name,
return -1;
}
- if (fit_image_hash_set_value(fit, noffset, value, value_len)) {
+ if (fit_set_hash_value(fit, noffset, value, value_len)) {
printf("Can't set hash value for '%s' hash node in '%s' image node\n",
fit_get_name(fit, noffset, NULL), image_name);
return -1;
@@ -187,33 +217,3 @@ int fit_image_set_hashes(void *fit, int image_noffset)
return 0;
}
-
-/**
- * fit_image_hash_set_value - set hash value in requested has node
- * @fit: pointer to the FIT format image header
- * @noffset: hash node offset
- * @value: hash value to be set
- * @value_len: hash value length
- *
- * fit_image_hash_set_value() attempts to set hash value in a node at offset
- * given and returns operation status to the caller.
- *
- * returns
- * 0, on success
- * -1, on failure
- */
-int fit_image_hash_set_value(void *fit, int noffset, uint8_t *value,
- int value_len)
-{
- int ret;
-
- ret = fdt_setprop(fit, noffset, FIT_VALUE_PROP, value, value_len);
- if (ret) {
- printf("Can't set hash '%s' property for '%s' node(%s)\n",
- FIT_VALUE_PROP, fit_get_name(fit, noffset, NULL),
- fdt_strerror(ret));
- return -1;
- }
-
- return 0;
-}