mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 01:43:47 -04:00
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>