mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 04/10] kvx: bootm: enforce existence of device tree
Date: Wed, 28 May 2025 12:50:40 +0200	[thread overview]
Message-ID: <20250528105046.3270397-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250528105046.3270397-1-a.fatoum@pengutronix.de>

Later commits will allow users to skip providing a device tree
when an empty file is passed, e.g. /dev/null.

Maintain existing behavior for kvx by translating the NULL return
from bootm_get_devicetree() that indicates this to an error pointer.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/kvx/lib/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/kvx/lib/bootm.c b/arch/kvx/lib/bootm.c
index 33d714e873bc..6eba4054e500 100644
--- a/arch/kvx/lib/bootm.c
+++ b/arch/kvx/lib/bootm.c
@@ -84,6 +84,8 @@ static int do_boot_elf(struct image_data *data, struct elf_image *elf)
 	}
 
 	fdt = bootm_get_devicetree(data);
+	if (!fdt)
+		fdt = ERR_PTR(-EINVAL);
 	if (IS_ERR(fdt)) {
 		printf("Failed to load dtb\n");
 		return PTR_ERR(fdt);
-- 
2.39.5




  parent reply	other threads:[~2025-05-28 12:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 10:50 [PATCH 00/10] ARM32: allow disabling ATAGS and DT fallback Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 01/10] arch: add new HAVE_ARCH_BOOTM_OFTREE symbol Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 02/10] bootm: enable CONFIG_BOOTM_OFTREE by default Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 03/10] ARM: lib32: disable ATAGS support " Ahmad Fatoum
2025-05-28 10:50 ` Ahmad Fatoum [this message]
2025-05-28 10:50 ` [PATCH 05/10] bootm: booti: make device tree optional Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 06/10] filetype: add new file type for 0-sized files Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 07/10] bootm: have bootm_get_devicetree return NULL if passed empty DT Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 08/10] bootm: make fallback to barebox internal tree optional Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 09/10] commands: oftree: add option to return device tree without fixups Ahmad Fatoum
2025-05-28 10:50 ` [PATCH 10/10] of: drop undefined fdt_get_tree declaration Ahmad Fatoum
2025-06-02 11:44 ` [PATCH 00/10] ARM32: allow disabling ATAGS and DT fallback Sascha Hauer

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=20250528105046.3270397-5-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox