mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
of: kobj: export of_node_ktype for use by modules
of_node_init() is a static inline that references of_node_ktype when CONFIG_OF_KOBJ=y. Any module that calls of_node_init() will therefore have an unresolved reference to of_node_ktype at load time, because the symbol is defined in drivers/of/kobj.c but was never exported. This causes a modpost build error when CONFIG_OF_KOBJ=y and CONFIG_DRIVER_PE_KUNIT_TEST=m: ERROR: modpost: "of_node_ktype" [drivers/base/test/property-entry-test.ko] undefined! Add EXPORT_SYMBOL_IF_KUNIT(of_node_ktype) so that modules such as the KUnit property-entry test can call of_node_init() without hitting this linker error. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202607181651.RnUuV8n6-lkp@intel.com/ Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/oe-kbuild-all/202607181651.RnUuV8n6-lkp@intel.com/ Link: https://patch.msgid.link/20260721105448.2109894-2-xu.yang_2@oss.nxp.com [ Add empty line before the kunit include. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
committed by
Danilo Krummrich
parent
01899cb7b9
commit
08bc149837
@@ -2,6 +2,8 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <kunit/visibility.h>
|
||||
|
||||
#include "of_private.h"
|
||||
|
||||
/* true when node is initialized */
|
||||
@@ -27,6 +29,7 @@ static void of_node_release(struct kobject *kobj)
|
||||
const struct kobj_type of_node_ktype = {
|
||||
.release = of_node_release,
|
||||
};
|
||||
EXPORT_SYMBOL_IF_KUNIT(of_node_ktype);
|
||||
|
||||
static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj,
|
||||
const struct bin_attribute *bin_attr, char *buf,
|
||||
|
||||
Reference in New Issue
Block a user