diff options
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); |