Build Linux Kernel module with warning i2c_register_board_info undefined

流过昼夜 提交于 2019-12-12 10:26:34

问题


I follow an example in kernel.org to write an i2c driver but unfortunately when i compile i got this warning

WARNING: "i2c_register_board_info" [/home/pi/builddriver/samplei2c/pn535.ko] undefined!

Although compile with 1 warning and no error, I cannot insmod module. this is error when insmod

insmod: ERROR: could not insert module pn535.ko: Invalid module format

My question is how to solve the warning above?, I think it make .ko file to be invalid. Here is my source code on pastebin

thank for your help!


回答1:


That is not possible in a kernel module simply because the function i2c_register_board_info is not exported from the kernel source tree to the kernel modules (built using obj-m targets). You can achieve this by building your driver within the kernel source tree using (obj-y targets).



来源:https://stackoverflow.com/questions/42945663/build-linux-kernel-module-with-warning-i2c-register-board-info-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!