From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 5/9] mtd: remove NULLness check for IOMEM()
Date: Sat, 30 Oct 2021 19:58:08 +0200 [thread overview]
Message-ID: <20211030175812.2276705-6-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20211030175812.2276705-1-a.fatoum@pengutronix.de>
While ioremap can fail, IOMEM() in our identity-mapped barebox can't.
Thus remove the never entered error branches.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/mtd/nand/atmel_nand.c | 8 --------
drivers/mtd/spi-nor/cadence-quadspi.c | 10 ----------
2 files changed, 18 deletions(-)
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 6bb41854e06b..cbd03e581b93 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -853,10 +853,6 @@ static int __init atmel_pmecc_nand_init_params(struct device_d *dev,
if (IS_ERR(iores))
return PTR_ERR(iores);
host->ecc = IOMEM(iores->start);
- if (IS_ERR(host->ecc)) {
- dev_err(host->dev, "ioremap failed\n");
- return -EIO;
- }
iores = dev_request_mem_resource(dev, 2);
if (IS_ERR(iores)) {
@@ -1210,10 +1206,6 @@ static int atmel_hw_nand_init_params(struct device_d *dev,
if (IS_ERR(iores))
return PTR_ERR(iores);
host->ecc = IOMEM(iores->start);
- if (IS_ERR(host->ecc)) {
- dev_err(host->dev, "ioremap failed\n");
- return -EIO;
- }
/* ECC is calculated for the whole page (1 step) */
nand_chip->ecc.size = mtd->writesize;
diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c
index 72d1f4e7cec4..11423421692b 100644
--- a/drivers/mtd/spi-nor/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/cadence-quadspi.c
@@ -1192,21 +1192,11 @@ static int cqspi_probe(struct device_d *dev)
if (IS_ERR(iores))
return PTR_ERR(iores);
cqspi->iobase = IOMEM(iores->start);
- if (IS_ERR(cqspi->iobase)) {
- dev_err(dev, "dev_request_mem_region 0 failed\n");
- ret = PTR_ERR(cqspi->iobase);
- goto probe_failed;
- }
iores = dev_request_mem_resource(dev, 1);
if (IS_ERR(iores))
return PTR_ERR(iores);
cqspi->ahb_base = IOMEM(iores->start);
- if (IS_ERR(cqspi->ahb_base)) {
- dev_err(dev, "dev_request_mem_region 0 failed\n");
- ret = PTR_ERR(cqspi->ahb_base);
- goto probe_failed;
- }
cqspi_wait_idle(cqspi);
cqspi_controller_init(cqspi);
--
2.30.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-10-30 18:00 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 ` Ahmad Fatoum [this message]
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 ` [PATCH 8/9] reset: socfpga: error out on failure to request memory Ahmad Fatoum
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-6-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