summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2014-02-24 18:37:40 +0800
committerBrian Norris <computersforpeace@gmail.com>2014-04-14 11:22:58 -0700
commit0d8c11c01274bde227d368daa8954911dd324a9f (patch)
tree74a5cea5d6cbe628aba708aa2117d344ca6475c1 /include/linux/mtd
parent03e296f613affcc2671c1e86d8c25ecad867204e (diff)
downloadop-kernel-dev-0d8c11c01274bde227d368daa8954911dd324a9f.zip
op-kernel-dev-0d8c11c01274bde227d368daa8954911dd324a9f.tar.gz
mtd: spi-nor: add a helper to find the spi_device_id
Add the spi_nor_match_id() to find the proper spi_device_id with the NOR flash's name in the spi_nor_ids table. Signed-off-by: Huang Shijie <b32955@freescale.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/spi-nor.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index 16d8409..41dae78 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -182,4 +182,16 @@ int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id,
enum read_mode mode);
extern const struct spi_device_id spi_nor_ids[];
+/**
+ * spi_nor_match_id() - find the spi_device_id by the name
+ * @name: the name of the spi_device_id
+ *
+ * The drivers use this function to find the spi_device_id
+ * specified by the @name.
+ *
+ * Return: returns the right spi_device_id pointer on success,
+ * and returns NULL on failure.
+ */
+const struct spi_device_id *spi_nor_match_id(char *name);
+
#endif
OpenPOWER on IntegriCloud