[RFC PATCH] mtd: Fix building when CONFIG_DM is not enabled

Michael Trimarchi michael at amarulasolutions.com
Tue Jul 19 21:43:19 CEST 2022


I really don't find any consumer of those functions in uboot. 
You can only verify if you include nand.h it in no-dm build

include/linux/mtd/nand.h: In function 'nanddev_set_ofnode':
+include/linux/mtd/nand.h:426:9: error: implicit declaration of function 'mtd_set_ofnode'; did you mean 'mtd_set_of_node'? [-Werror=implicit-function-declaration]
+  426 |         mtd_set_ofnode(nand->mtd, node);
+      |         ^~~~~~~~~~~~~~
+      |         mtd_set_of_node
+cc1: all warnings being treated as errors

Cc: Simon Glass <sjg at chromium.org>
Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
---
 include/linux/mtd/mtd.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index ff635bd716..6c096ae665 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -343,14 +343,11 @@ static inline const ofnode mtd_get_ofnode(struct mtd_info *mtd)
 	return dev_ofnode(mtd->dev);
 }
 #else
-struct device_node;
-
-static inline void mtd_set_of_node(struct mtd_info *mtd,
-				   const struct device_node *np)
+static inline void mtd_set_ofnode(struct mtd_info *mtd, ofnode node)
 {
 }
 
-static inline const struct device_node *mtd_get_of_node(struct mtd_info *mtd)
+static inline const ofnode *mtd_get_ofnode(struct mtd_info *mtd)
 {
 	return NULL;
 }
-- 
2.34.1



More information about the U-Boot mailing list