[PATCH] rtc: remove superfluous call to call to cdev_del()
authorRolf Eike Beer <eike-kernel@sf-tec.de>
Sun, 1 Oct 2006 06:27:48 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 1 Oct 2006 07:39:22 +0000 (00:39 -0700)
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>
drivers/rtc/rtc-dev.c

index 61a58259c93fe04ed5a502435763a921f3d57cc5..062c0ab3fe35535b9f33c2fb0b5c5e4e5b231c9b 100644 (file)
@@ -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);