编写一段模拟驱动的程序编译后出现的问题
在arm_linux环境中
编写一段驱动模块程序,使用file_operations定义demo_fops结构体
但在编译中产生如下错误
demo.c:73: unknown field `release' specified in initializer
demo.c:73: warning: excess elements in struct initializer
demo.c:73: warning: (near initialization for `demo_fops')
demo.c:68: storage size of `demo_fops' isn't known
make: *** [demo.o] Error 1
告诉我在file_operations结构体中的read,realease等定义都有问题,可是这些定义都是一本参考书上抄下来的,我的demo_fops是这样定义的
static struct file_operations demo_fops = {
// owner: THIS_MODULE,
read: demo_read,
ioctl: demo_ioctl,
open: demo_open,
release: demo_close,
};
在linux/fs.h头文件里有对file_operations结构体的定义
不知道哪里出现了问题吧,请大侠指教
发表时间:2006年3月14日18:32:12