Skip to content

Commit

Permalink
unregister_blkdev() delete redundant messages in callers
Browse files Browse the repository at this point in the history
No need to warn unregister_blkdev() failure by the callers.  (The previous
patch makes unregister_blkdev() print error message in error case)

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Jul 17, 2007
1 parent 294462a commit 00d5940
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
3 changes: 1 addition & 2 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,8 +1568,7 @@ static void __exit loop_exit(void)
loop_del_one(lo);

blk_unregister_region(MKDEV(LOOP_MAJOR, 0), range);
if (unregister_blkdev(LOOP_MAJOR, "loop"))
printk(KERN_WARNING "loop: cannot unregister blkdev\n");
unregister_blkdev(LOOP_MAJOR, "loop");
}

module_init(loop_init);
Expand Down
4 changes: 1 addition & 3 deletions drivers/block/z2ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,7 @@ static void __exit z2_exit(void)
{
int i, j;
blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), 256);
if ( unregister_blkdev( Z2RAM_MAJOR, DEVICE_NAME ) != 0 )
printk( KERN_ERR DEVICE_NAME ": unregister of device failed\n");

unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
del_gendisk(z2ram_gendisk);
put_disk(z2ram_gendisk);
blk_cleanup_queue(z2_queue);
Expand Down
4 changes: 1 addition & 3 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ static void local_exit(void)
{
kmem_cache_destroy(_tio_cache);
kmem_cache_destroy(_io_cache);

if (unregister_blkdev(_major, _name) < 0)
DMERR("unregister_blkdev failed");
unregister_blkdev(_major, _name);

_major = 0;

Expand Down
7 changes: 1 addition & 6 deletions drivers/s390/block/dcssblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,14 +747,9 @@ dcssblk_check_params(void)
static void __exit
dcssblk_exit(void)
{
int rc;

PRINT_DEBUG("DCSSBLOCK EXIT...\n");
s390_root_dev_unregister(dcssblk_root_dev);
rc = unregister_blkdev(dcssblk_major, DCSSBLK_NAME);
if (rc) {
PRINT_ERR("unregister_blkdev() failed!\n");
}
unregister_blkdev(dcssblk_major, DCSSBLK_NAME);
PRINT_DEBUG("...finished!\n");
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/sbus/char/jsflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,7 @@ static void __exit jsflash_cleanup_module(void)
jsf0.busy = 0;

misc_deregister(&jsf_dev);
if (unregister_blkdev(JSFD_MAJOR, "jsfd") != 0)
printk("jsfd: cleanup_module failed\n");
unregister_blkdev(JSFD_MAJOR, "jsfd");
blk_cleanup_queue(jsf_queue);
}

Expand Down

0 comments on commit 00d5940

Please sign in to comment.