From: Rosen Penev <rosenp@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] mtd: rawnand: fsl_ifc: drop unused controller chips array
Date: Tue, 13 Oct 2026 15:41:34 -0700 [thread overview]
Message-ID: <20261013224134.42967-1-rosenp@gmail.com> (raw)
The chips[] array in struct fsl_ifc_nand_ctrl is only ever written to,
never read. Remove the array, the fsl_ifc_chip_remove() function that
cleared it, and its callers in probe and remove.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/mtd/nand/raw/fsl_ifc_nand.c | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index cc75b6a67e07..7f4bf4e2cb78 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -40,7 +40,6 @@ struct fsl_ifc_mtd {
/* overview of the fsl ifc controller */
struct fsl_ifc_nand_ctrl {
struct nand_controller controller;
- struct fsl_ifc_mtd *chips[FSL_IFC_BANK_COUNT];
void __iomem *addr; /* Address of assigned IFC buffer */
unsigned int page; /* Last page written to / read from */
@@ -961,13 +960,6 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
return 0;
}
-static int fsl_ifc_chip_remove(struct fsl_ifc_mtd *priv)
-{
- ifc_nand_ctrl->chips[priv->bank] = NULL;
-
- return 0;
-}
-
static int match_bank(struct fsl_ifc_global __iomem *ifc_global, int bank,
phys_addr_t addr)
{
@@ -1037,7 +1029,6 @@ static int fsl_ifc_nand_probe(struct platform_device *dev)
}
mutex_unlock(&fsl_ifc_nand_mutex);
- ifc_nand_ctrl->chips[bank] = priv;
priv->bank = bank;
priv->ctrl = fsl_ifc_ctrl_dev;
priv->dev = &dev->dev;
@@ -1058,19 +1049,17 @@ static int fsl_ifc_nand_probe(struct platform_device *dev)
mtd = nand_to_mtd(&priv->chip);
mtd->name = devm_kasprintf(priv->dev, GFP_KERNEL, "%llx.flash", (u64)res->start);
- if (!mtd->name) {
- ret = -ENOMEM;
- goto err;
- }
+ if (!mtd->name)
+ return -ENOMEM;
ret = fsl_ifc_chip_init(priv);
if (ret)
- goto err;
+ return ret;
priv->chip.controller->ops = &fsl_ifc_controller_ops;
ret = nand_scan(&priv->chip, 1);
if (ret)
- goto err;
+ return ret;
/* First look for RedBoot table or partitions on the command
* line, these take precedence over device tree information */
@@ -1085,9 +1074,6 @@ static int fsl_ifc_nand_probe(struct platform_device *dev)
cleanup_nand:
nand_cleanup(&priv->chip);
-err:
- fsl_ifc_chip_remove(priv);
-
return ret;
}
@@ -1100,8 +1086,6 @@ static void fsl_ifc_nand_remove(struct platform_device *dev)
ret = mtd_device_unregister(nand_to_mtd(chip));
WARN_ON(ret);
nand_cleanup(chip);
-
- fsl_ifc_chip_remove(priv);
}
static const struct of_device_id fsl_ifc_nand_match[] = {
--
2.56.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
reply other threads:[~2026-10-13 22:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261013224134.42967-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/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