summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorMiquel Raynal2018-04-22 18:02:30 +0200
committerBoris Brezillon2018-04-29 08:56:46 +0200
commit256c4fc76a80a69a5108069d8a09b3836bbf6542 (patch)
tree499d47adf67b62b2a2fa154c631478971c4aefcb /include/linux/mtd
parentmtd: rawnand: lpc32xx_slc: fix the probe function error path (diff)
downloadkernel-qcow2-linux-256c4fc76a80a69a5108069d8a09b3836bbf6542.tar.gz
kernel-qcow2-linux-256c4fc76a80a69a5108069d8a09b3836bbf6542.tar.xz
kernel-qcow2-linux-256c4fc76a80a69a5108069d8a09b3836bbf6542.zip
mtd: rawnand: add a way to pass an ID table with nand_scan()
As part of the work of migrating all the drivers to nand_scan(), and because nand_scan() does not provide a way to pass an ID table, rename the function nand_scan_with_ids() and add a third parameter to give a flash ID table (like what was done with nand_scan_ident()). Create a nand_scan() helper that is just a wrapper of nand_scan_with_ids(), passing NULL as the ID table. This way a controller drivers can continue using nand_scan() transparently. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/rawnand.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 5dad59b31244..ba8d908f5cc7 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -28,7 +28,14 @@ struct nand_flash_dev;
struct device_node;
/* Scan and identify a NAND device */
-int nand_scan(struct mtd_info *mtd, int max_chips);
+int nand_scan_with_ids(struct mtd_info *mtd, int max_chips,
+ struct nand_flash_dev *ids);
+
+static inline int nand_scan(struct mtd_info *mtd, int max_chips)
+{
+ return nand_scan_with_ids(mtd, max_chips, NULL);
+}
+
/*
* Separate phases of nand_scan(), allowing board driver to intervene
* and override command or ECC setup according to flash type.