summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-05-08 09:33:46 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 20:15:18 +0200
commitcb3a58d2acc042f62cde932add8e1f9ed508368d (patch)
treea14e0afa950d7b6dd6b6bbd536ef0b128f5078e6 /drivers/rtc/class.c
parentRTC: replace some newly-introduced macros with inlines (diff)
downloadlinux-cb3a58d2acc042f62cde932add8e1f9ed508368d.tar.xz
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/class.c')
-rw-r--r--drivers/rtc/class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 587d251be454..8b3cd31d6a61 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;