All of lore.kernel.org
 help / color / mirror / Atom feed
From: seanedmond@linux.microsoft.com
To: u-boot@lists.denx.de
Cc: dphadke@linux.microsoft.com, macromorgan@hotmail.com, sjg@chromium.org
Subject: [PATCH 3/3] cmd: kaslrseed: Use common API to fixup FDT
Date: Fri,  4 Aug 2023 16:33:57 -0700	[thread overview]
Message-ID: <20230804233357.65214-4-seanedmond@linux.microsoft.com> (raw)
In-Reply-To: <20230804233357.65214-1-seanedmond@linux.microsoft.com>

From: Sean Edmond <seanedmond@microsoft.com>

Use the newly introduced common API fdt_fixup_kaslr_seed() in the
kaslrseed command.

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
---
 cmd/kaslrseed.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/cmd/kaslrseed.c b/cmd/kaslrseed.c
index 8a1d8120cd..82117bc484 100644
--- a/cmd/kaslrseed.c
+++ b/cmd/kaslrseed.c
@@ -45,21 +45,9 @@ static int do_kaslr_seed(struct cmd_tbl *cmdtp, int flag, int argc, char *const
 		return CMD_RET_FAILURE;
 	}
 
-	ret = fdt_check_header(working_fdt);
-	if (ret < 0) {
-		printf("fdt_chosen: %s\n", fdt_strerror(ret));
-		return CMD_RET_FAILURE;
-	}
-
-	nodeoffset = fdt_find_or_add_subnode(working_fdt, 0, "chosen");
-	if (nodeoffset < 0) {
-		printf("Reading chosen node failed\n");
-		return CMD_RET_FAILURE;
-	}
-
-	ret = fdt_setprop(working_fdt, nodeoffset, "kaslr-seed", buf, sizeof(buf));
-	if (ret < 0) {
-		printf("Unable to set kaslr-seed on chosen node: %s\n", fdt_strerror(ret));
+	ret = fdt_fixup_kaslr_seed(working_fdt, buf, sizeof(buf));
+	if (ret) {
+		printf("ERROR: failed to add kaslr-seed to fdt\n");
 		return CMD_RET_FAILURE;
 	}
 
-- 
2.40.0


      parent reply	other threads:[~2023-08-04 23:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 23:33 [PATCH 0/3] Populate kaslr seed with TPM seanedmond
2023-08-04 23:33 ` [PATCH 1/3] fdt: common API to populate kaslr seed seanedmond
2023-08-09  2:03   ` Simon Glass
2023-08-09 22:35     ` Sean Edmond
2023-08-10  1:49       ` Simon Glass
2023-08-10 18:17         ` Chris Morgan
2023-08-11 17:14         ` Sean Edmond
2023-08-12 13:09           ` Simon Glass
2023-08-14 19:12             ` Sean Edmond
2023-08-15 14:44               ` Simon Glass
2023-08-15 17:46                 ` Sean Edmond
2023-08-17 16:03                   ` Sean Edmond
2023-08-18  3:09                     ` Simon Glass
2023-08-04 23:33 ` [PATCH 2/3] fdt: kaslr seed from tpm entropy seanedmond
2023-08-09  2:03   ` Simon Glass
2023-09-08 16:42   ` Ilias Apalodimas
2023-08-04 23:33 ` seanedmond [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230804233357.65214-4-seanedmond@linux.microsoft.com \
    --to=seanedmond@linux.microsoft.com \
    --cc=dphadke@linux.microsoft.com \
    --cc=macromorgan@hotmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.