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 master 2/3] ARM: i.MX8M: scratch: fix initcall return code on request_barebox_region error
Date: Mon, 22 Jul 2024 19:06:05 +0200	[thread overview]
Message-ID: <20240722170606.3866957-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240722170606.3866957-1-a.fatoum@pengutronix.de>

request_barebox_region returns NULL on error, so adjust the initcall
accordingly.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/scratch.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/scratch.c b/arch/arm/mach-imx/scratch.c
index 002b499fab3a..b7280ff60952 100644
--- a/arch/arm/mach-imx/scratch.c
+++ b/arch/arm/mach-imx/scratch.c
@@ -95,8 +95,8 @@ const struct optee_header *imx_scratch_get_optee_hdr(void)
 
 static int imx8m_reserve_scratch_area(void)
 {
-	return PTR_ERR_OR_ZERO(request_barebox_region("scratch area",
-				    (ulong)arm_mem_scratch_get(),
-				    sizeof(struct imx_scratch_space)));
+	return request_barebox_region("scratch area",
+				      (ulong)arm_mem_scratch_get(),
+				      sizeof(struct imx_scratch_space)) ? 0 : -EINVAL;
 }
 device_initcall(imx8m_reserve_scratch_area);
-- 
2.39.2




  reply	other threads:[~2024-07-22 17:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 17:06 [PATCH master 1/3] resource: return NULL for error in request_barebox_region Ahmad Fatoum
2024-07-22 17:06 ` Ahmad Fatoum [this message]
2024-07-22 17:06 ` [PATCH master 3/3] RISC-V: cpu: fix initcall return code on request_barebox_region error Ahmad Fatoum
2024-07-22 17:49 ` [PATCH master 1/3] resource: return NULL for error in request_barebox_region Marco Felsch
2024-07-23  6:07   ` Ahmad Fatoum
2024-07-24  8:08 ` 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=20240722170606.3866957-2-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