unregister_chrdev(): ignore the return value
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>
This commit is contained in:
parent
cb00ea3528
commit
68fc4fabca
|
@ -180,9 +180,7 @@ err:
|
||||||
void __exit
|
void __exit
|
||||||
pcf8563_exit(void)
|
pcf8563_exit(void)
|
||||||
{
|
{
|
||||||
if (unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME) < 0) {
|
unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME);
|
||||||
printk(KERN_INFO "%s: Unable to unregister device.\n", PCF8563_NAME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -193,9 +193,7 @@ err:
|
||||||
void __exit
|
void __exit
|
||||||
pcf8563_exit(void)
|
pcf8563_exit(void)
|
||||||
{
|
{
|
||||||
if (unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME) < 0) {
|
unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME);
|
||||||
printk(KERN_INFO "%s: Unable to unregister device.\n", PCF8563_NAME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -199,6 +199,5 @@ int __init init_socksys(void)
|
||||||
|
|
||||||
void __exit cleanup_socksys(void)
|
void __exit cleanup_socksys(void)
|
||||||
{
|
{
|
||||||
if (unregister_chrdev(30, "socksys"))
|
unregister_chrdev(30, "socksys");
|
||||||
printk ("Couldn't unregister socksys character device\n");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,9 +425,7 @@ cleanup_module(void)
|
||||||
printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
|
printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
|
||||||
}
|
}
|
||||||
put_tty_driver(ip2_tty_driver);
|
put_tty_driver(ip2_tty_driver);
|
||||||
if ( ( err = unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) ) {
|
unregister_chrdev(IP2_IPL_MAJOR, pcIpl);
|
||||||
printk(KERN_ERR "IP2: failed to unregister IPL driver (%d)\n", err);
|
|
||||||
}
|
|
||||||
remove_proc_entry("ip2mem", &proc_root);
|
remove_proc_entry("ip2mem", &proc_root);
|
||||||
|
|
||||||
// free memory
|
// free memory
|
||||||
|
|
|
@ -816,12 +816,7 @@ struct cx_drv mbcs_driver = {
|
||||||
|
|
||||||
static void __exit mbcs_exit(void)
|
static void __exit mbcs_exit(void)
|
||||||
{
|
{
|
||||||
int rv;
|
unregister_chrdev(mbcs_major, DEVICE_NAME);
|
||||||
|
|
||||||
rv = unregister_chrdev(mbcs_major, DEVICE_NAME);
|
|
||||||
if (rv < 0)
|
|
||||||
DBG(KERN_ALERT "Error in unregister_chrdev: %d\n", rv);
|
|
||||||
|
|
||||||
cx_driver_unregister(&mbcs_driver);
|
cx_driver_unregister(&mbcs_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4795,7 +4795,6 @@ static void __exit stallion_module_exit(void)
|
||||||
{
|
{
|
||||||
struct stlbrd *brdp;
|
struct stlbrd *brdp;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
int retval;
|
|
||||||
|
|
||||||
pr_debug("cleanup_module()\n");
|
pr_debug("cleanup_module()\n");
|
||||||
|
|
||||||
|
@ -4818,9 +4817,7 @@ static void __exit stallion_module_exit(void)
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
|
class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
|
||||||
if ((retval = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
|
unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
|
||||||
printk("STALLION: failed to un-register serial memory device, "
|
|
||||||
"errno=%d\n", -retval);
|
|
||||||
class_destroy(stallion_class);
|
class_destroy(stallion_class);
|
||||||
|
|
||||||
pci_unregister_driver(&stl_pcidriver);
|
pci_unregister_driver(&stl_pcidriver);
|
||||||
|
|
|
@ -1098,15 +1098,10 @@ static int chg_state(int index, unsigned char new_state, struct file *file)
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
static void __exit viotap_exit(void)
|
static void __exit viotap_exit(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
remove_proc_entry("iSeries/viotape", NULL);
|
remove_proc_entry("iSeries/viotape", NULL);
|
||||||
vio_unregister_driver(&viotape_driver);
|
vio_unregister_driver(&viotape_driver);
|
||||||
class_destroy(tape_class);
|
class_destroy(tape_class);
|
||||||
ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape");
|
unregister_chrdev(VIOTAPE_MAJOR, "viotape");
|
||||||
if (ret < 0)
|
|
||||||
printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n",
|
|
||||||
ret);
|
|
||||||
if (viotape_unitinfo)
|
if (viotape_unitinfo)
|
||||||
dma_free_coherent(iSeries_vio_dev,
|
dma_free_coherent(iSeries_vio_dev,
|
||||||
sizeof(viotape_unitinfo[0]) * VIOTAPE_MAX_TAPE,
|
sizeof(viotape_unitinfo[0]) * VIOTAPE_MAX_TAPE,
|
||||||
|
|
|
@ -2684,8 +2684,7 @@ static void __exit ppp_cleanup(void)
|
||||||
if (atomic_read(&ppp_unit_count) || atomic_read(&channel_count))
|
if (atomic_read(&ppp_unit_count) || atomic_read(&channel_count))
|
||||||
printk(KERN_ERR "PPP: removing module but units remain!\n");
|
printk(KERN_ERR "PPP: removing module but units remain!\n");
|
||||||
cardmap_destroy(&all_ppp_units);
|
cardmap_destroy(&all_ppp_units);
|
||||||
if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
|
unregister_chrdev(PPP_MAJOR, "ppp");
|
||||||
printk(KERN_ERR "PPP: failed to unregister PPP device\n");
|
|
||||||
device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
|
device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
|
||||||
class_destroy(ppp_class);
|
class_destroy(ppp_class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,8 +446,7 @@ static void __exit alsa_sound_exit(void)
|
||||||
{
|
{
|
||||||
snd_info_minor_unregister();
|
snd_info_minor_unregister();
|
||||||
snd_info_done();
|
snd_info_done();
|
||||||
if (unregister_chrdev(major, "alsa") != 0)
|
unregister_chrdev(major, "alsa");
|
||||||
snd_printk(KERN_ERR "unable to unregister major device number %d\n", major);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(alsa_sound_init)
|
module_init(alsa_sound_init)
|
||||||
|
|
Loading…
Reference in New Issue