From 328a338f6f9943a0a77292315a25628b22f79fed Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 30 Sep 2006 23:27:48 -0700 Subject: [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 --- drivers/rtc/rtc-dev.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/rtc/rtc-dev.c') diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 61a58259c93..062c0ab3fe3 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); -- cgit v1.2.3 From 818a8674b0388d90e33a5d1b13946b40dda7032a Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sat, 30 Sep 2006 23:28:15 -0700 Subject: [PATCH] RTC class uses subsys_init This makes RTC core components use "subsys_init" instead of "module_init", as appropriate for subsystem infrastructure. This is mostly useful for statically linking drivers in other parts of the tree that may provide an RTC interface as a secondary functionality (e.g. part of a multifunction chip); they won't need to worry so much about drivers/Makefile link order. Signed-off-by: David Brownell Cc: Alessandro Zummo Acked-by: Oleg Verych Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/rtc/rtc-dev.c') diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 062c0ab3fe3..629d47cc7e8 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c @@ -495,7 +495,7 @@ static void __exit rtc_dev_exit(void) unregister_chrdev_region(rtc_devt, RTC_DEV_MAX); } -module_init(rtc_dev_init); +subsys_initcall(rtc_dev_init); module_exit(rtc_dev_exit); MODULE_AUTHOR("Alessandro Zummo "); -- cgit v1.2.3 From ff8371ac9a5a55c956991fed8e5f58640c7a32f3 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sat, 30 Sep 2006 23:28:17 -0700 Subject: [PATCH] constify rtc_class_ops: update drivers Update RTC framework so that drivers can constify their method tables, moving them from ".data" to ".rodata". Then update the drivers. Signed-off-by: David Brownell Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/rtc/rtc-dev.c') diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 629d47cc7e8..583789c66cd 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c @@ -24,7 +24,7 @@ static int rtc_dev_open(struct inode *inode, struct file *file) int err; struct rtc_device *rtc = container_of(inode->i_cdev, struct rtc_device, char_dev); - struct rtc_class_ops *ops = rtc->ops; + const struct rtc_class_ops *ops = rtc->ops; /* We keep the lock as long as the device is in use * and return immediately if busy @@ -209,7 +209,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file, int err = 0; struct class_device *class_dev = file->private_data; struct rtc_device *rtc = to_rtc_device(class_dev); - struct rtc_class_ops *ops = rtc->ops; + const struct rtc_class_ops *ops = rtc->ops; struct rtc_time tm; struct rtc_wkalrm alarm; void __user *uarg = (void __user *) arg; -- cgit v1.2.3