diff options
| author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
| commit | bc95f3669f5e6f63cf0b84fe4922c3c6dd4aa775 (patch) | |
| tree | 427fcf2a7287c16d4b5aa6cbf494d59579a6a8b1 /drivers/rtc/class.c | |
| parent | 3d29cdff999c37b3876082278a8134a0642a02cd (diff) | |
| parent | dc87c3985e9b442c60994308a96f887579addc39 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/usb/input/Makefile
drivers/usb/input/gtco.c
Diffstat (limited to 'drivers/rtc/class.c')
| -rw-r--r-- | drivers/rtc/class.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 7a0d8ee2de9c..04aaa6347234 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
| @@ -113,10 +113,16 @@ EXPORT_SYMBOL_GPL(rtc_device_register); | |||
| 113 | */ | 113 | */ |
| 114 | void rtc_device_unregister(struct rtc_device *rtc) | 114 | void rtc_device_unregister(struct rtc_device *rtc) |
| 115 | { | 115 | { |
| 116 | mutex_lock(&rtc->ops_lock); | 116 | if (class_device_get(&rtc->class_dev) != NULL) { |
| 117 | rtc->ops = NULL; | 117 | mutex_lock(&rtc->ops_lock); |
| 118 | mutex_unlock(&rtc->ops_lock); | 118 | /* remove innards of this RTC, then disable it, before |
| 119 | class_device_unregister(&rtc->class_dev); | 119 | * letting any rtc_class_open() users access it again |
| 120 | */ | ||
| 121 | class_device_unregister(&rtc->class_dev); | ||
| 122 | rtc->ops = NULL; | ||
| 123 | mutex_unlock(&rtc->ops_lock); | ||
| 124 | class_device_put(&rtc->class_dev); | ||
| 125 | } | ||
| 120 | } | 126 | } |
| 121 | EXPORT_SYMBOL_GPL(rtc_device_unregister); | 127 | EXPORT_SYMBOL_GPL(rtc_device_unregister); |
| 122 | 128 | ||
