unregister_blkdev(): return void
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 17 Jul 2007 11:03:47 +0000 (04:03 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 17 Jul 2007 17:23:03 +0000 (10:23 -0700)
Put WARN_ON and fixed all callers of unregister_blkdev().  Now we can make
unregister_blkdev return void.

Cc: Jens Axboe <jens.axboe@oracle.com>
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>
block/genhd.c
include/linux/fs.h

index 7f71b2c472b836e8df9a6953e4f81058fa800793..3af1e7a378d4162bad38f46825bf055d3e56b38b 100644 (file)
@@ -108,13 +108,11 @@ out:
 
 EXPORT_SYMBOL(register_blkdev);
 
-/* todo: make void - error printk here */
-int unregister_blkdev(unsigned int major, const char *name)
+void unregister_blkdev(unsigned int major, const char *name)
 {
        struct blk_major_name **n;
        struct blk_major_name *p = NULL;
        int index = major_to_index(major);
-       int ret = 0;
 
        mutex_lock(&block_subsys_lock);
        for (n = &major_names[index]; *n; n = &(*n)->next)
@@ -122,15 +120,12 @@ int unregister_blkdev(unsigned int major, const char *name)
                        break;
        if (!*n || strcmp((*n)->name, name)) {
                WARN_ON(1);
-               ret = -EINVAL;
        } else {
                p = *n;
                *n = p->next;
        }
        mutex_unlock(&block_subsys_lock);
        kfree(p);
-
-       return ret;
 }
 
 EXPORT_SYMBOL(unregister_blkdev);
index b3a9f0db9d80d3e349825f2c86457316d9b8693c..aa74f7de9dcded60666b1e158ad3686220289148 100644 (file)
@@ -1527,7 +1527,7 @@ extern void putname(const char *name);
 
 #ifdef CONFIG_BLOCK
 extern int register_blkdev(unsigned int, const char *);
-extern int unregister_blkdev(unsigned int, const char *);
+extern void unregister_blkdev(unsigned int, const char *);
 extern struct block_device *bdget(dev_t);
 extern void bd_set_size(struct block_device *, loff_t size);
 extern void bd_forget(struct inode *inode);