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 8/9] reset: socfpga: error out on failure to request memory
Date: Sat, 30 Oct 2021 19:58:11 +0200	[thread overview]
Message-ID: <20211030175812.2276705-9-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20211030175812.2276705-1-a.fatoum@pengutronix.de>

IOMEM() can't fail, but dev_request_mem_resource() can. Fix the error
check.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/reset/reset-socfpga.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
index fc5c50e13ca9..146cc92eb3ce 100644
--- a/drivers/reset/reset-socfpga.c
+++ b/drivers/reset/reset-socfpga.c
@@ -84,9 +84,10 @@ static int socfpga_reset_probe(struct device_d *dev)
 	data = xzalloc(sizeof(*data));
 
 	res = dev_request_mem_resource(dev, 0);
+	if (IS_ERR(res))
+		return PTR_ERR(res);
+
 	data->membase = IOMEM(res->start);
-	if (IS_ERR(data->membase))
-		return PTR_ERR(data->membase);
 
 	if (of_property_read_u32(np, "altr,modrst-offset", &modrst_offset)) {
 		dev_warn(dev, "missing altr,modrst-offset property, assuming 0x10!\n");
-- 
2.30.2


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


  parent reply	other threads:[~2021-10-30 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-30 17:58 [PATCH 0/9] COMPILE_TEST: fix misc issues Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 1/9] ARM: Rockchip: move ARCH_RK3568_OPTEE into ARCH_ROCKCHIP menu Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 2/9] ARM: i.MX: guf-santaro: fix passing around of uninitialized variable Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 3/9] regulator: fix bitrotted EXPORT_SYMBOL_GPL Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 4/9] aiodev: fix bitrotted EXPORT_SYMBOL Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 5/9] mtd: remove NULLness check for IOMEM() Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 6/9] clocksource: clint: restrict to RISC-V Ahmad Fatoum
2021-10-30 17:58 ` [PATCH 7/9] ddr: fsl: make ARCH_LAYERSCAPE only Ahmad Fatoum
2021-10-30 17:58 ` Ahmad Fatoum [this message]
2021-10-30 17:58 ` [PATCH 9/9] i2c-mux-pca954x: drop duplicate warning message on probe Ahmad Fatoum
2021-11-01 10:33 ` [PATCH 0/9] COMPILE_TEST: fix misc issues 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=20211030175812.2276705-9-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