Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cb3a58d2acc042f62cde932add8e1f9ed508368d
Commit:     cb3a58d2acc042f62cde932add8e1f9ed508368d
Parent:     61a7c36acb3da406d64c0da6288eab1c414a65ea
Author:     David Brownell <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:33:46 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:18 2007 -0700

    rtc: update to class device removal patches
    
    Fix a goof in the revised classdev support for RTCs: make sure the /dev
    node info is ready before the device is registered, not after.  Otherwise
    the /sys/class/rtc/rtcN/dev attribute won't be created and then udev won't
    have the information it needs to create the /dev/rtcN node.
    
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Cc: Alessandro Zummo <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/rtc/class.c    |    2 ++
 drivers/rtc/rtc-core.h |    5 +++++
 drivers/rtc/rtc-dev.c  |    5 ++++-
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 587d251..8b3cd31 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -156,6 +156,8 @@ struct rtc_device *rtc_device_register(const char *name, 
struct device *dev,
        strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE);
        snprintf(rtc->dev.bus_id, BUS_ID_SIZE, "rtc%d", id);
 
+       rtc_dev_prepare(rtc);
+
        err = device_register(&rtc->dev);
        if (err)
                goto exit_kfree;
diff --git a/drivers/rtc/rtc-core.h b/drivers/rtc/rtc-core.h
index d81a278..5f9df74 100644
--- a/drivers/rtc/rtc-core.h
+++ b/drivers/rtc/rtc-core.h
@@ -2,6 +2,7 @@
 
 extern void __init rtc_dev_init(void);
 extern void __exit rtc_dev_exit(void);
+extern void rtc_dev_prepare(struct rtc_device *rtc);
 extern void rtc_dev_add_device(struct rtc_device *rtc);
 extern void rtc_dev_del_device(struct rtc_device *rtc);
 
@@ -15,6 +16,10 @@ static inline void rtc_dev_exit(void)
 {
 }
 
+static inline void rtc_dev_prepare(struct rtc_device *rtc)
+{
+}
+
 static inline void rtc_dev_add_device(struct rtc_device *rtc)
 {
 }
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 2c13433..671b14e 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -396,7 +396,7 @@ static const struct file_operations rtc_dev_fops = {
 
 /* insertion/removal hooks */
 
-void rtc_dev_add_device(struct rtc_device *rtc)
+void rtc_dev_prepare(struct rtc_device *rtc)
 {
        if (!rtc_devt)
                return;
@@ -418,7 +418,10 @@ void rtc_dev_add_device(struct rtc_device *rtc)
 
        cdev_init(&rtc->char_dev, &rtc_dev_fops);
        rtc->char_dev.owner = rtc->owner;
+}
 
+void rtc_dev_add_device(struct rtc_device *rtc)
+{
        if (cdev_add(&rtc->char_dev, rtc->dev.devt, 1))
                printk(KERN_WARNING "%s: failed to add char device %d:%d\n",
                        rtc->name, MAJOR(rtc_devt), rtc->id);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to