提交 328a338f 编写于 作者: R Rolf Eike Beer 提交者: Linus Torvalds

[PATCH] rtc: remove superfluous call to call to cdev_del()

If cdev_add() fails there is no good reason to call cdev_del().
Signed-off-by: NRolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 cc088d10
...@@ -406,7 +406,6 @@ static int rtc_dev_add_device(struct class_device *class_dev, ...@@ -406,7 +406,6 @@ static int rtc_dev_add_device(struct class_device *class_dev,
rtc->char_dev.owner = rtc->owner; rtc->char_dev.owner = rtc->owner;
if (cdev_add(&rtc->char_dev, MKDEV(MAJOR(rtc_devt), rtc->id), 1)) { if (cdev_add(&rtc->char_dev, MKDEV(MAJOR(rtc_devt), rtc->id), 1)) {
cdev_del(&rtc->char_dev);
dev_err(class_dev->dev, dev_err(class_dev->dev,
"failed to add char device %d:%d\n", "failed to add char device %d:%d\n",
MAJOR(rtc_devt), rtc->id); MAJOR(rtc_devt), rtc->id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册