diff options
author | Simon Glass | 2022-10-11 09:47:16 -0600 |
---|---|---|
committer | Simon Glass | 2022-10-17 21:17:13 -0600 |
commit | 87c97cb1f9a45567488edd260539467b7b1a869a (patch) | |
tree | 5163130fbdb9a91c034e3f478a30eb19bb44a507 /boot | |
parent | 33ba72700b586babfad7f5ef1e408b6b399fe0ec (diff) |
boot: Tidy up logging and naming in vbe_simple
Make sure the log_msg_ret() values are unique so that the log trace is
unambiguous with LOG_ERROR_RETURN. Also avoid reusing the 'node' variable
for two different nodes in bootmeth_vbe_simple_ft_fixup(), since this is
confusing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/vbe_simple.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c index 61b6322ebe2..076b650c25a 100644 --- a/boot/vbe_simple.c +++ b/boot/vbe_simple.c @@ -6,6 +6,8 @@ * Written by Simon Glass <sjg@chromium.org> */ +#define LOG_CATEGORY LOGC_BOOT + #include <common.h> #include <log.h> #include <memalign.h> @@ -199,17 +201,17 @@ int vbe_simple_fixup_node(ofnode node, struct simple_state *state) version = strdup(state->fw_version); if (!version) - return log_msg_ret("ver", -ENOMEM); + return log_msg_ret("dup", -ENOMEM); ret = ofnode_write_string(node, "cur-version", version); if (ret) return log_msg_ret("ver", ret); ret = ofnode_write_u32(node, "cur-vernum", state->fw_vernum); if (ret) - return log_msg_ret("ver", ret); + return log_msg_ret("num", ret); ret = ofnode_write_string(node, "bootloader-version", version_string); if (ret) - return log_msg_ret("fix", ret); + return log_msg_ret("bl", ret); return 0; } @@ -233,7 +235,7 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) */ for (vbe_find_first_device(&dev); dev; vbe_find_next_device(&dev)) { struct simple_state state; - ofnode node; + ofnode node, subnode; int ret; if (strcmp("vbe_simple", dev->driver->name)) @@ -243,8 +245,8 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) node = oftree_path(tree, "/chosen/fwupd"); if (!ofnode_valid(node)) continue; - node = ofnode_find_subnode(node, dev->name); - if (!ofnode_valid(node)) + subnode = ofnode_find_subnode(node, dev->name); + if (!ofnode_valid(subnode)) continue; log_debug("Fixing up: %s\n", dev->name); @@ -255,7 +257,7 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) if (ret) return log_msg_ret("read", ret); - ret = vbe_simple_fixup_node(node, &state); + ret = vbe_simple_fixup_node(subnode, &state); if (ret) return log_msg_ret("fix", ret); } |