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 3/9] ARM: Rockchip: init: propagate error in init function
Date: Mon,  8 Nov 2021 08:52:03 +0100	[thread overview]
Message-ID: <20211108075209.2366770-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20211108075209.2366770-1-a.fatoum@pengutronix.de>

The SoC init functions return an error code when run on a SoC without
support compiled in. Propagate error codes, so this is reported to the
user.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-rockchip/rockchip.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index f0b2484c687b..c185b0cc2b65 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -6,14 +6,13 @@
 static int rockchip_init(void)
 {
 	if (of_machine_is_compatible("rockchip,rk3188"))
-		rk3188_init();
-	else if (of_machine_is_compatible("rockchip,rk3288"))
-		rk3288_init();
-	else if (of_machine_is_compatible("rockchip,rk3568"))
-		rk3568_init();
-	else
-		pr_err("Unknown rockchip SoC\n");
+		return rk3188_init();
+	if (of_machine_is_compatible("rockchip,rk3288"))
+		return rk3288_init();
+	if (of_machine_is_compatible("rockchip,rk3568"))
+		return rk3568_init();
 
-	return 0;
+	pr_err("Unknown rockchip SoC\n");
+	return -ENODEV;
 }
 postcore_initcall(rockchip_init);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2021-11-08  7:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  7:52 [PATCH 1/9] fixup! scripts/common: Add write_full() and read_full() Ahmad Fatoum
2021-11-08  7:52 ` [PATCH 2/9] fixup! scripts: Add rk-usb-loader tool Ahmad Fatoum
2021-11-08  7:52 ` Ahmad Fatoum [this message]
2021-11-08  7:52 ` [PATCH 4/9] ARM: Rockchip: rk3568: make rk3568_lowlevel_init void Ahmad Fatoum
2021-11-08  7:52 ` [PATCH 5/9] ARM64: <asm/barebox-arm-head.h>: mark prologue location Ahmad Fatoum
2021-11-08  8:14   ` Ahmad Fatoum
2021-11-08  7:52 ` [PATCH 6/9] pinctrl: Rockchip: abort probe on lack of aliases Ahmad Fatoum
2021-11-08  7:52 ` [PATCH 7/9] clk: handle CLK_OF_DECLARE in deep probe Ahmad Fatoum
2021-11-08  7:52 ` [PATCH 8/9] ARM: Rockchip: make rk3568's atf_load_bl31 reusable Ahmad Fatoum
2021-11-08  7:52 ` [PATCH 9/9] ARM: Rockchip: add delimiter between boards and board features Ahmad Fatoum

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=20211108075209.2366770-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH 3/9] ARM: Rockchip: init: propagate error in init function' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox