diff options
author | David Brownell <david-b@pacbell.net> | 2007-05-08 00:33:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:18 -0700 |
commit | cb3a58d2acc042f62cde932add8e1f9ed508368d (patch) | |
tree | a14e0afa950d7b6dd6b6bbd536ef0b128f5078e6 /drivers/rtc/rtc-dev.c | |
parent | 61a7c36acb3da406d64c0da6288eab1c414a65ea (diff) | |
download | linux-cb3a58d2acc042f62cde932add8e1f9ed508368d.tar.gz linux-cb3a58d2acc042f62cde932add8e1f9ed508368d.tar.bz2 linux-cb3a58d2acc042f62cde932add8e1f9ed508368d.zip |
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 <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 2c13433089a0..671b14ec28bb 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); |