--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
-@@ -1274,6 +1274,44 @@ out_unlock:
+@@ -1302,6 +1302,44 @@ out_unlock:
}
EXPORT_SYMBOL_GPL(get_mtd_device_nm);
mutex_lock(&mtd_table_mutex);
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
-@@ -703,6 +703,8 @@ extern struct mtd_info *get_mtd_device(s
- extern int __get_mtd_device(struct mtd_info *mtd);
+@@ -704,6 +704,8 @@ extern int __get_mtd_device(struct mtd_i
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 struct mtd_info *get_mtd_device_by_node(
+ const struct device_node *of_node);