Unknown symbol camera_common_parse_ports

Hello,

I built a module based on kernel_source/drivers/media/i2c/ov5693.c but when I try to insert it into the TX1 I get unknown symbol errors from camera_common. How do I get those symbols?

Unknown symbol camera_common_parse_ports (err 0)
Unknown symbol camera_common_parse_clocks (err 0)

refer

/kernel/drivers/media/platform/tegra/camera/camera_common.c

i did try module build ov5693.c but fail dependency

Right, i’m including that in the module. But that file doesn’t seem to export its own symbols. Not sure how to get around it.

Did you build it as loader module by modify the Makefile to obj-m ?
Please reference to https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt

— 3.3 Loadable module goals - obj-m

$(obj-m) specifies object files which are built as loadable
kernel modules.

A module may be built from one source file or several source
files. In the case of one source file, the kbuild makefile
simply adds the file to $(obj-m).

Example:
	#drivers/isdn/i4l/Makefile
	obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o

Note: In this example $(CONFIG_ISDN_PPP_BSDCOMP) evaluates to 'm'

If a kernel module is built from several source files, you specify
that you want to build a module in the same way as above; however,
kbuild needs to know which object files you want to build your
module from, so you have to tell it by setting a $(<module_name>-y)
variable.

Example:
	#drivers/isdn/i4l/Makefile
	obj-$(CONFIG_ISDN_I4L) += isdn.o
	isdn-y := isdn_net_lib.o isdn_v110.o isdn_common.o

Yes, I do build it as a module. I believe that’s where the problem is.

According to this: [url]https://www.linux.com/learn/kernel-newbie-corner-kernel-symbols-whats-available-your-module-what-isnt[/url] loadable modules only have access to the symbols that are explicitly exported using “EXPORT_SYMBOL().” Not sure there’s any way around it besides modifying camera_common.c to export those symbols and recompiling the kernel.

I’ll keep messing with it.

The easy way is copy that easy function to this driver. That function only to parser the device tree to get information.