Skip to contentSkip to conversation

mtd: use dev_of_node helper in mtd_get_of_node

PATCH In review Rafał Miłecki 3 participants 3 messages Mar 31, 2017 – Apr 19, 2017 1 message not in the archive Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: use dev_of_node helper in mtd_get_of_node

From: Rafał Miłecki <[email protected]>

This allows better compile-time optimizations with CONFIG_OF disabled.

---
 include/linux/mtd/mtd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mtd/mtd.h +1 -1
index eebdc63cf6af..f8db5b2e4028 100644
@@ -393,7 +393,7 @@ static inline void mtd_set_of_node(struct mtd_info *mtd,
 
 static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
 {
-	return mtd->dev.of_node;
+	return dev_of_node(&mtd->dev);
 }
 
 static inline int mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170331091148.19816-1-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 5 lines · On Fri, 31 Mar 2017 11:11:48 +0200 Rafał Miłecki…

From: Rafał Miłecki <[email protected]>

This allows better compile-time optimizations with CONFIG_OF disabled.

Not sure we care about such micro-optimizations, but it shouldn't hurst so,

Quoted 9 lines
---
 include/linux/mtd/mtd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mtd/mtd.h +0 -0
index eebdc63cf6af..f8db5b2e4028 100644

include/linux/mtd/mtd.h static inline void mtd_set_of_node(struct mtd_info *mtd, · line 399

Quoted 8 lines
include/linux/mtd/mtd.h +1 -1
@@ -393,7 +393,7 @@ static inline void mtd_set_of_node(struct mtd_info *mtd,
 
 static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
 {
-	return mtd->dev.of_node;
+	return dev_of_node(&mtd->dev);
 }
 
 static inline int mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 5 lines · Boris Brezillon
Quoted 2 lines · On Fri, 31 Mar 2017 11:11:48 +0200 Rafał Miłecki…

From: Rafał Miłecki <[email protected]>

Quoted 8 lines
Quoted 3 lines

This allows better compile-time optimizations with CONFIG_OF disabled.

Not sure we care about such micro-optimizations, but it shouldn't hurst so,

Applied
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html