summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 16:18:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:28:21 -0700
commit3e217b660281bbdf2db7e58725a4934b5635cb46 (patch)
treeb9e9d6d2cb27e947d2fe3f56c7b04685b7311d68 /include/linux
parent51b38c62aa89c8747c350dac2515b8899ff8f4d7 (diff)
rtc: add devm_rtc_device_{register,unregister}()
These functions allow the driver core to automatically clean up any allocation made by rtc drivers. Thus it simplifies the error paths. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/rtc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 580b24c8b8ca..d9557689bb8d 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -133,7 +133,13 @@ extern struct rtc_device *rtc_device_register(const char *name,
struct device *dev,
const struct rtc_class_ops *ops,
struct module *owner);
+extern struct rtc_device *devm_rtc_device_register(const char *name,
+ struct device *dev,
+ const struct rtc_class_ops *ops,
+ struct module *owner);
extern void rtc_device_unregister(struct rtc_device *rtc);
+extern void devm_rtc_device_unregister(struct device *dev,
+ struct rtc_device *rtc);
extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm);
extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm);