From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E116DC001DB for ; Fri, 4 Aug 2023 23:34:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8DDB986366; Sat, 5 Aug 2023 01:34:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="UfHvFKM2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FEC286672; Sat, 5 Aug 2023 01:34:07 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id EA81986264 for ; Sat, 5 Aug 2023 01:34:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanedmond@linux.microsoft.com Received: from ovlvm106.redmond.corp.microsoft.com (unknown [131.107.147.185]) by linux.microsoft.com (Postfix) with ESMTPSA id D435220861F0; Fri, 4 Aug 2023 16:34:03 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D435220861F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1691192043; bh=LaxlDxLANiIvz/4eCvRvdy8Ix1/AaMl5VYVWU0NdHYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UfHvFKM2OnWYqAFmVkazdn7eB/ZgWO3TksbHCu3PhhxiCRoegiJyPvg/CqckDaMj7 9HOD+Ba+mdQl4StICXN3CspQvp+wbs6EyMyGkwmchTllMIJ/BR108Wu8II1JVtC8Gk Q3kAbYYl6RcqYcYG+nq4OztokPa+mVdbhIsF4l04= 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 Message-Id: <20230804233357.65214-4-seanedmond@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230804233357.65214-1-seanedmond@linux.microsoft.com> References: <20230804233357.65214-1-seanedmond@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Sean Edmond Use the newly introduced common API fdt_fixup_kaslr_seed() in the kaslrseed command. Signed-off-by: Sean Edmond --- 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