X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/fed27ce228698b4e0420639201209545bc1d0bd8..1d20caee804d28a792dcacbf8424dc23b80c6370:/lincan/src/main.c diff --git a/lincan/src/main.c b/lincan/src/main.c index 2a55355..e114082 100644 --- a/lincan/src/main.c +++ b/lincan/src/main.c @@ -97,7 +97,7 @@ unsigned int irq_specified; unsigned int io_specified; unsigned int clockfreq_specified; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)) /* Module parameters, some must be supplied at module loading time */ MODULE_PARM(major,"1i"); /*MODULE_PARM(minor, "1-" __MODULE_STRING(MAX_TOT_CHIPS)"i");*/ @@ -114,7 +114,7 @@ MODULE_PARM(extmask, "1i"); MODULE_PARM(mo15mask, "1i"); MODULE_PARM(processlocal, "1i"); -#else /* LINUX_VERSION_CODE >= 2,6,0 */ +#else /* LINUX_VERSION_CODE >= 2,6,12 */ module_param(major, int, 0); module_param_array(minor, int, &minor_specified, 0); module_param(extended, int, 0); @@ -128,7 +128,7 @@ module_param(stdmask, int, 0); module_param(extmask, int, 0); module_param(mo15mask, int, 0); module_param(processlocal, int, 0); -#endif /* LINUX_VERSION_CODE >= 2,6,0 */ +#endif /* LINUX_VERSION_CODE >= 2,6,12 */ MODULE_PARM_DESC(major,"can be used to change default major [" __MODULE_STRING(CAN_MAJOR) "]"); MODULE_PARM_DESC(minor,"can be used to change default starting minor for each channel"); @@ -384,11 +384,8 @@ int init_module(void) canqueue_rtl_done(); #endif /*CAN_WITH_RTL*/ - res=unregister_chrdev(major,DEVICE_NAME); - if (res<0) - CANMSG("Error unloading CAN driver, error: %d\n",res); - else - CANMSG("No CAN devices or driver setup error.\n"); + unregister_chrdev(major,DEVICE_NAME); + CANMSG("No CAN devices or driver setup error.\n"); register_error: if ( can_del_mem_list() ) @@ -399,7 +396,7 @@ int init_module(void) void cleanup_module(void) { - int res=0,i=0; + int i=0; #ifdef CONFIG_PROC_FS if (can_delete_procdir()) @@ -439,7 +436,5 @@ void cleanup_module(void) if ( can_del_mem_list() ) CANMSG("Error deallocating memory\n"); - res=unregister_chrdev(major,DEVICE_NAME); - if (res<0) - CANMSG("Error unregistering CAN driver, error: %d\n",res); + unregister_chrdev(major,DEVICE_NAME); }