提交 87a57261 编写于 作者: R Randy Dunlap 提交者: Linus Torvalds

[PATCH] block: handle subsystem_register() init errors

Check and handle init errors.
Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 4d7dd8fd
......@@ -295,10 +295,15 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data)
static int __init genhd_device_init(void)
{
int err;
bdev_map = kobj_map_init(base_probe, &block_subsys_lock);
blk_dev_init();
subsystem_register(&block_subsys);
return 0;
err = subsystem_register(&block_subsys);
if (err < 0)
printk(KERN_WARNING "%s: subsystem_register error: %d\n",
__FUNCTION__, err);
return err;
}
subsys_initcall(genhd_device_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册