diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2007-07-17 07:03:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:03 -0400 |
commit | f4480240f700587c15507b7815e75989b16825b2 (patch) | |
tree | 96eac4ec200cf49cb1cbbdf185befca34d83b629 /block/genhd.c | |
parent | c6d4d63489f2e3ce38c80e7073952f0c58d4c2bc (diff) |
unregister_blkdev(): return void
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>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/block/genhd.c b/block/genhd.c index 7f71b2c472b8..3af1e7a378d4 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -108,13 +108,11 @@ out: | |||
108 | 108 | ||
109 | EXPORT_SYMBOL(register_blkdev); | 109 | EXPORT_SYMBOL(register_blkdev); |
110 | 110 | ||
111 | /* todo: make void - error printk here */ | 111 | void unregister_blkdev(unsigned int major, const char *name) |
112 | int unregister_blkdev(unsigned int major, const char *name) | ||
113 | { | 112 | { |
114 | struct blk_major_name **n; | 113 | struct blk_major_name **n; |
115 | struct blk_major_name *p = NULL; | 114 | struct blk_major_name *p = NULL; |
116 | int index = major_to_index(major); | 115 | int index = major_to_index(major); |
117 | int ret = 0; | ||
118 | 116 | ||
119 | mutex_lock(&block_subsys_lock); | 117 | mutex_lock(&block_subsys_lock); |
120 | for (n = &major_names[index]; *n; n = &(*n)->next) | 118 | for (n = &major_names[index]; *n; n = &(*n)->next) |
@@ -122,15 +120,12 @@ int unregister_blkdev(unsigned int major, const char *name) | |||
122 | break; | 120 | break; |
123 | if (!*n || strcmp((*n)->name, name)) { | 121 | if (!*n || strcmp((*n)->name, name)) { |
124 | WARN_ON(1); | 122 | WARN_ON(1); |
125 | ret = -EINVAL; | ||
126 | } else { | 123 | } else { |
127 | p = *n; | 124 | p = *n; |
128 | *n = p->next; | 125 | *n = p->next; |
129 | } | 126 | } |
130 | mutex_unlock(&block_subsys_lock); | 127 | mutex_unlock(&block_subsys_lock); |
131 | kfree(p); | 128 | kfree(p); |
132 | |||
133 | return ret; | ||
134 | } | 129 | } |
135 | 130 | ||
136 | EXPORT_SYMBOL(unregister_blkdev); | 131 | EXPORT_SYMBOL(unregister_blkdev); |