【驱动】——错误: 初始值设定项里有未知的字段‘ioctl’

这个错误网上搜索发现3.0.0.15版本内核 file_operation结构体已经删除了ioctl函数,取代的是:

long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);

long (*compat_ioctl) (struct file *, unsigned int, unsigned long);

file_operation结构体在 /usr/src/linux-3.0.0.15/include/linux/fs.h定义。

在file_operation 赋值处修改:

.unlocked_ioctl = xxx_ioctl

原文地址:https://www.cnblogs.com/ngnetboy/p/4216440.html