aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-05-05 23:37:30 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-05-26 10:43:33 +0200
commit4dd7ef970bee8a93e1817ec028a7e26aef046d0d (patch)
tree1fa396740c13120e15efb19578f292528cb46795 /drivers/mtd
parentmtd: rawnand: Add a helper to clarify the interface configuration (diff)
downloadlinux-dev-4dd7ef970bee8a93e1817ec028a7e26aef046d0d.tar.xz
linux-dev-4dd7ef970bee8a93e1817ec028a7e26aef046d0d.zip
mtd: rawnand: arasan: Check the proposed data interface is supported
Check the data interface is supported in ->setup_interface() before acknowledging the timings. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-3-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/arasan-nand-controller.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/arasan-nand-controller.c b/drivers/mtd/nand/raw/arasan-nand-controller.c
index 549aac00228e..65a52bb2731e 100644
--- a/drivers/mtd/nand/raw/arasan-nand-controller.c
+++ b/drivers/mtd/nand/raw/arasan-nand-controller.c
@@ -861,6 +861,11 @@ static int anfc_setup_interface(struct nand_chip *chip, int target,
struct anand *anand = to_anand(chip);
struct arasan_nfc *nfc = to_anfc(chip->controller);
struct device_node *np = nfc->dev->of_node;
+ const struct nand_sdr_timings *sdr;
+
+ sdr = nand_get_sdr_timings(conf);
+ if (IS_ERR(sdr))
+ return PTR_ERR(sdr);
if (target < 0)
return 0;