|
我自己写的一个电机控制的驱动程序,在arm-linux下的,
编译时出现了这个警告,但我不知道为什么原因,请指教.
还有那个警告是什么意思阿.
motor.c:384: warning: initialization from incompatible pointer type
这是384行:
line 384: module_init(motor_init);
那个motor_init ()函数是这样定义的,请人指教上面那个警告是什么意思阿.
static void __init motor_init (void)
{
int ret;
motor_tag = 0; //未指示任何一个电机
motorA_hardware_init();
motorB_hardware_init();
motorC_hardware_init();
AT91_SYS->PIOA_PER |= MOTORA_IRQ|MOTORB_IRQ|MOTORC_IRQ;
AT91_SYS->PIOA_ODR |= MOTORA_IRQ|MOTORB_IRQ|MOTORC_IRQ;
AT91_SYS->PIOA_IER |= MOTORA_IRQ|MOTORB_IRQ|MOTORC_IRQ;
//在此处添加零位传感器的IRQ中断注册代码
ret = request_irq(AT91C_ID_IRQ1, motor_interrupt, 0,"motor", NULL);
if( ret !=0 ){
printk(KERN_ERR "Request Interrupt %d failed: error = %d\n", AT91C_ID_IRQ1, ret);
goto fail_request_irq;
}
if(register_chrdev(MOTOR_MAJOR, "motor", &motor_fops)){
DBG_MOTOR("register_chrdev for motor error\n");
goto fail_register_chrdev;
}
printk(KERN_INFO __FILE__ ": MOTOR_IRQ for AT91RM9200, Using IRQ %d\n", AT91C_ID_IRQ1);
return;
fail_register_chrdev:
free_irq(AT91C_ID_IRQ1, NULL);
fail_request_irq:
return;
} |
|