Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 328a338f authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Linus Torvalds
Browse files

[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: default avatarRolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent cc088d10
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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);