Skip to contentSkip to conversation

of: Export of_node_ktype for modular use of of_init_node

PATCH In review Florian Fainelli 2 participants 3 messages Aug 20, 2020 – Aug 21, 2020 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: Export of_node_ktype for modular use of of_init_node

To permit the use of of_init_node() by kernel modules, we must export of_node_ktype which is directly referenced by kobject_init() called from of_init_node() otherwise modules would be getting linking failures.

Fixes 0829f6d1f69e ("of: device_node kobject lifecycle fixes")
---
 drivers/of/kobj.c | 1 +
 1 file changed, 1 insertion(+)
drivers/of/kobj.c +1 -0
index a32e60b024b8..d7bbd156a671 100644
@@ -27,6 +27,7 @@ static void of_node_release(struct kobject *kobj)
 struct kobj_type of_node_ktype = {
 	.release = of_node_release,
 };
+EXPORT_SYMBOL_GPL(of_node_ktype);
 
 static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj,
 				struct bin_attribute *bin_attr, char *buf,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Florian Fainelli

To permit the use of of_init_node() by kernel modules, we must export of_node_ktype which is directly referenced by kobject_init() called from of_init_node() otherwise modules would be getting linking failures.

You mean of_node_init()?

There's not anything in the kernel using this that's a module. It's a low level function that I don't really want to see more users for.

Rob

#2 lore raw
Quoted 7 lines · Rob Herring
Quoted 4 lines · Florian Fainelli

To permit the use of of_init_node() by kernel modules, we must export of_node_ktype which is directly referenced by kobject_init() called from of_init_node() otherwise modules would be getting linking failures.

You mean of_node_init()?

Yes, I kept inverting the two words.

Quoted 3 lines

There's not anything in the kernel using this that's a module. It's a low level function that I don't really want to see more users for.

OK, fair enough, the candidate use I had in mind is probably too ugly to be submitted upstream anyway.

Signature · 1 line
Florian