linux驱动ioctl报[-Werror=incompatible-pointer-types]错

error: initialization of ‘long int (*)(struct file *, unsigned int, long unsigned int)’ from incompatible pointer type ‘int (*)(struct file *, unsigned int, long unsigned int)’ [-Werror=incompatible-pointer-types]
.unlocked_ioctl = sys_led_ioctl,
            ^~~~~~~~~~~~~

 

 

返回值类型错误,将返回值类型改为long int即可

 

posted @ 2021-03-29 14:53  bk街头狂舞  阅读(3516)  评论(0编辑  收藏  举报