Skip to content

Commit

Permalink
[PATCH] rtc: remove superfluous call to call to cdev_del()
Browse files Browse the repository at this point in the history
If cdev_add() fails there is no good reason to call cdev_del().

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Rolf Eike Beer authored and Linus Torvalds committed Oct 1, 2006
1 parent cc088d1 commit 328a338
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/rtc/rtc-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ static int rtc_dev_add_device(struct class_device *class_dev,
rtc->char_dev.owner = rtc->owner;

if (cdev_add(&rtc->char_dev, MKDEV(MAJOR(rtc_devt), rtc->id), 1)) {
cdev_del(&rtc->char_dev);
dev_err(class_dev->dev,
"failed to add char device %d:%d\n",
MAJOR(rtc_devt), rtc->id);
Expand Down

0 comments on commit 328a338

Please sign in to comment.