From: Rolf Eike Beer Date: Sun, 1 Oct 2006 06:27:48 +0000 (-0700) Subject: [PATCH] rtc: remove superfluous call to call to cdev_del() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=328a338f6f9943a0a77292315a25628b22f79fed;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [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: Rolf Eike Beer Cc: Alessandro Zummo Cc: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 61a58259c93f..062c0ab3fe35 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c @@ -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);