]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
unregister_chrdev(): ignore the return value
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 19 Jul 2007 08:47:50 +0000 (01:47 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 17:04:43 +0000 (10:04 -0700)
unregister_chrdev() always returns 0.  There is no need to check the return
value.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/cris/arch-v10/drivers/pcf8563.c
arch/cris/arch-v32/drivers/pcf8563.c
arch/sparc64/solaris/socksys.c
drivers/char/ip2/ip2main.c
drivers/char/mbcs.c
drivers/char/stallion.c
drivers/char/viotape.c
drivers/net/ppp_generic.c
sound/core/sound.c

index d47cfbf98d6e0b1487500ca2292997423f8da2e7..1de0026bb94ef7255d7f693bbb7fec57e3979b43 100644 (file)
@@ -180,9 +180,7 @@ err:
 void __exit
 pcf8563_exit(void)
 {
-       if (unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME) < 0) {
-               printk(KERN_INFO "%s: Unable to unregister device.\n", PCF8563_NAME);
-       }
+       unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME);
 }
 
 /*
index fa8d50007e4c31af2b82f7d987e439bcbb5af7d7..da479a14f8369dc9d9e13750c93ec1c380bdf6ea 100644 (file)
@@ -193,9 +193,7 @@ err:
 void __exit
 pcf8563_exit(void)
 {
-       if (unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME) < 0) {
-               printk(KERN_INFO "%s: Unable to unregister device.\n", PCF8563_NAME);
-       }
+       unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME);
 }
 
 /*
index e94f6e5d94559c1117f3cb74394f16820ade9a2f..7736411f244ff06f760a233ebc94ab8a5bf36bba 100644 (file)
@@ -199,6 +199,5 @@ int __init init_socksys(void)
 
 void __exit cleanup_socksys(void)
 {
-       if (unregister_chrdev(30, "socksys"))
-               printk ("Couldn't unregister socksys character device\n");
+       unregister_chrdev(30, "socksys");
 }
index 83c7258d358067c3d72944494b4ff49a891407e4..6005b52257725ed251a849184b8e56efc5f98133 100644 (file)
@@ -425,9 +425,7 @@ cleanup_module(void)
                printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
        }
        put_tty_driver(ip2_tty_driver);
-       if ( ( err = unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) ) {
-               printk(KERN_ERR "IP2: failed to unregister IPL driver (%d)\n", err);
-       }
+       unregister_chrdev(IP2_IPL_MAJOR, pcIpl);
        remove_proc_entry("ip2mem", &proc_root);
 
        // free memory
index 57f9115a456cfd4b2443195a7fd67d545dd21318..3daf5e0a27e14078e98c2e071dc650e15f6717e4 100644 (file)
@@ -816,12 +816,7 @@ struct cx_drv mbcs_driver = {
 
 static void __exit mbcs_exit(void)
 {
-       int rv;
-
-       rv = unregister_chrdev(mbcs_major, DEVICE_NAME);
-       if (rv < 0)
-               DBG(KERN_ALERT "Error in unregister_chrdev: %d\n", rv);
-
+       unregister_chrdev(mbcs_major, DEVICE_NAME);
        cx_driver_unregister(&mbcs_driver);
 }
 
index 93d0bb8b4c0fadac7cc6a27e94d9675c2e374849..4a80b2f864e0b6e5edc468bc33342b4ffd612c3e 100644 (file)
@@ -4795,7 +4795,6 @@ static void __exit stallion_module_exit(void)
 {
        struct stlbrd *brdp;
        unsigned int i, j;
-       int retval;
 
        pr_debug("cleanup_module()\n");
 
@@ -4818,9 +4817,7 @@ static void __exit stallion_module_exit(void)
 
        for (i = 0; i < 4; i++)
                class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
-       if ((retval = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
-               printk("STALLION: failed to un-register serial memory device, "
-                       "errno=%d\n", -retval);
+       unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
        class_destroy(stallion_class);
 
        pci_unregister_driver(&stl_pcidriver);
index db57277117bb4015b94e280adfab125a5e8870d4..e12275df6ea2d271ec630f9c89945c6753bdf726 100644 (file)
@@ -1098,15 +1098,10 @@ static int chg_state(int index, unsigned char new_state, struct file *file)
 /* Cleanup */
 static void __exit viotap_exit(void)
 {
-       int ret;
-
        remove_proc_entry("iSeries/viotape", NULL);
        vio_unregister_driver(&viotape_driver);
        class_destroy(tape_class);
-       ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape");
-       if (ret < 0)
-               printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n",
-                               ret);
+       unregister_chrdev(VIOTAPE_MAJOR, "viotape");
        if (viotape_unitinfo)
                dma_free_coherent(iSeries_vio_dev,
                                sizeof(viotape_unitinfo[0]) * VIOTAPE_MAX_TAPE,
index 3ef0092dc09cf3f086a7ae367f42d31127bbc729..ef3325b692335312f176aa3a86275ffcc5e6bad7 100644 (file)
@@ -2684,8 +2684,7 @@ static void __exit ppp_cleanup(void)
        if (atomic_read(&ppp_unit_count) || atomic_read(&channel_count))
                printk(KERN_ERR "PPP: removing module but units remain!\n");
        cardmap_destroy(&all_ppp_units);
-       if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
-               printk(KERN_ERR "PPP: failed to unregister PPP device\n");
+       unregister_chrdev(PPP_MAJOR, "ppp");
        device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
        class_destroy(ppp_class);
 }
index 70600df94d62e3ef6d3d38566e9699a92bcfa7f4..8dc7a3b32b98482bc12f1b60aa6cb25352d41bf3 100644 (file)
@@ -446,8 +446,7 @@ static void __exit alsa_sound_exit(void)
 {
        snd_info_minor_unregister();
        snd_info_done();
-       if (unregister_chrdev(major, "alsa") != 0)
-               snd_printk(KERN_ERR "unable to unregister major device number %d\n", major);
+       unregister_chrdev(major, "alsa");
 }
 
 module_init(alsa_sound_init)