Correction for 2.6.23-git kernel - unregister_chrdev() does not return value.
authorppisa <ppisa>
Sun, 19 Aug 2007 19:03:05 +0000 (19:03 +0000)
committerppisa <ppisa>
Sun, 19 Aug 2007 19:03:05 +0000 (19:03 +0000)
lincan/src/main.c

index 274d573..e114082 100644 (file)
@@ -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);
 }