求助!!急!!EXPORT_SYMBOL_GPL 无效问题!!请各位高手入!!

cityofgod 2010-04-28 10:17:14
问题:移植spidriver时编译内核出现
ERROR: "s3c_gpio_setpull" [drivers/spi/spi_sam.ko] undefined!
ERROR: "s3c_gpio_cfgpin" [drivers/spi/spi_sam.ko] undefined!错误,请问如何解?


平台:s3c6410,Linux version 2.6.27,Android1.5
起因移植Samsung的SPIdriver spi_sam.c 和 spi_sam.h 过来时,将内核Meuconfig的SPIdriver配置成<M>,将要移植的spi_sam.c,spi_sam.h copy到/drivers/spi 下后,并在spi_sam.c 中添加#include <linux/module.h>
进行make
出现如下信息:
root@ubuntu:/usr/src/android-1.5# make
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
CHK include/linux/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 8 modules
ERROR: "s3c_gpio_setpull" [drivers/spi/spi_sam.ko] undefined!
ERROR: "s3c_gpio_cfgpin" [drivers/spi/spi_sam.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

请问以上两个错误是什么原因?

其中s3c_gpio_setpull,s3c_gpio_cfgpin,都在gpio-config.c中定义(编译时生成了.o档),并添加了代码
EXPORT_SYMBOL_GPL(s3c_gpio_setpull);
EXPORT_SYMBOL_GPL(s3c_gpio_cfgpin);
请各位帮忙看看是什么问题,多谢,多谢啦~~

menuconfig:

--- SPI support
  • Debug support for SPI drivers
    *** SPI Master Controller Drivers ***
    {M} Bitbanging SPI master
    <M> Parallel port adapter for AVR Butterfly
  • (DEVELOPMENT)
    <M> Parallel port adapter for LM70 eval board (DEVELOPMENT)
    <M> S3C6410 SPI Driver
    SPI Source Clock (PCLK) --->
    *** SPI Protocol Masters ***
    <M> SPI EEPROMs from most vendors
    <M> User mode SPI device driver support
    <M> Infineon TLE62X0 (for power switching)









...全文
989 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Quietly 2011-07-21
  • 打赏
  • 举报
回复
学习了……
ouyangjinlin 2010-04-29
  • 打赏
  • 举报
回复
在迁移的过程中,比如接口不一致的情况,出现新接口的问题,还有循环include头文件的问题(这是一个关键问题,我用了一种很ugly的办法来解决,就是通过自己定义一个新的头文件比如asm/my_task.h, asm/my_dma.h, asm/my_percpu.h,然后直接调用这个新的头文件来避免循环调用的问题。
cityofgod 2010-04-29
  • 打赏
  • 举报
回复
ralphsage,说的对,EXPORT_SYMBOL_GPL需要#include <linux/module.h>头文件的支持
另外,在驱动中也同样需要添加#include <linux/module.h>(视情况定)
我的问题搞定了多谢ralphsage
ralphsage 2010-04-28
  • 打赏
  • 举报
回复
你看看gpio-config.c中是否有 #include <linus/module.h>
没有这个头文件,EXPORT_SYMBOL_GPL是没有定义的,但是编译不会报错,我前几天修改驱动的时候就是这样的情况
cityofgod 2010-04-28
  • 打赏
  • 举报
回复
是我问题描述的不清楚吗?请高手帮忙!!

4,465

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧