aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2022-09-16 13:20:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-24 14:54:37 +0200
commit4a575865c1ea67018d96acda9b43e5d3d25b2366 (patch)
treeeea5d05da2a1bee23e4e6fef3aee618894c2297e /include/linux/mtd
parentnvmem: add driver handling U-Boot environment variables (diff)
downloadlinux-dev-4a575865c1ea67018d96acda9b43e5d3d25b2366.tar.xz
linux-dev-4a575865c1ea67018d96acda9b43e5d3d25b2366.zip
mtd: allow getting MTD device associated with a specific DT node
MTD subsystem API allows interacting with MTD devices (e.g. reading, writing, handling bad blocks). So far a random driver could get MTD device only by its name (get_mtd_device_nm()). This change allows getting them also by a DT node. This API is required for drivers handling DT defined MTD partitions in a specific way (e.g. U-Boot (sub)partition with environment variables). Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220916122100.170016-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/mtd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 955aee14b0f7..6fc841ceef31 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -677,6 +677,7 @@ extern int mtd_device_unregister(struct mtd_info *master);
extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
extern int __get_mtd_device(struct mtd_info *mtd);
extern void __put_mtd_device(struct mtd_info *mtd);
+extern struct mtd_info *of_get_mtd_device_by_node(struct device_node *np);
extern struct mtd_info *get_mtd_device_nm(const char *name);
extern void put_mtd_device(struct mtd_info *mtd);