summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-12 17:47:19 -0500
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-01 04:49:15 -0500
commitfd5cd21d995e67f87b3eb4adf938be85fe83ef4b (patch)
tree4b79b8f29e8ad0c59100019a747681fa508964d2
parentac75779b72fd52741d7446ad27cf6d58c006c643 (diff)
rtc: export rtc_nvmem_register() to drivers
Export rtc_nvmem_register() so it can be called from drivers instead of only the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/rtc/nvmem.c3
-rw-r--r--drivers/rtc/rtc-core.h13
-rw-r--r--include/linux/rtc.h13
3 files changed, 14 insertions, 15 deletions
diff --git a/drivers/rtc/nvmem.c b/drivers/rtc/nvmem.c
index eb8c622cfcf4..17ec4c8d0fad 100644
--- a/drivers/rtc/nvmem.c
+++ b/drivers/rtc/nvmem.c
@@ -14,8 +14,6 @@
14#include <linux/rtc.h> 14#include <linux/rtc.h>
15#include <linux/sysfs.h> 15#include <linux/sysfs.h>
16 16
17#include "rtc-core.h"
18
19/* 17/*
20 * Deprecated ABI compatibility, this should be removed at some point 18 * Deprecated ABI compatibility, this should be removed at some point
21 */ 19 */
@@ -105,6 +103,7 @@ int rtc_nvmem_register(struct rtc_device *rtc,
105 103
106 return 0; 104 return 0;
107} 105}
106EXPORT_SYMBOL_GPL(rtc_nvmem_register);
108 107
109void rtc_nvmem_unregister(struct rtc_device *rtc) 108void rtc_nvmem_unregister(struct rtc_device *rtc)
110{ 109{
diff --git a/drivers/rtc/rtc-core.h b/drivers/rtc/rtc-core.h
index 05a67837fd76..0abf98983e13 100644
--- a/drivers/rtc/rtc-core.h
+++ b/drivers/rtc/rtc-core.h
@@ -46,16 +46,3 @@ static inline const struct attribute_group **rtc_get_dev_attribute_groups(void)
46 return NULL; 46 return NULL;
47} 47}
48#endif 48#endif
49
50#ifdef CONFIG_RTC_NVMEM
51int rtc_nvmem_register(struct rtc_device *rtc,
52 struct nvmem_config *nvmem_config);
53void rtc_nvmem_unregister(struct rtc_device *rtc);
54#else
55static inline int rtc_nvmem_register(struct rtc_device *rtc,
56 struct nvmem_config *nvmem_config)
57{
58 return -ENODEV;
59}
60static inline void rtc_nvmem_unregister(struct rtc_device *rtc) {}
61#endif
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index fc6c90b57be0..fbc92fff7c2e 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -271,4 +271,17 @@ extern int rtc_hctosys_ret;
271#define rtc_hctosys_ret -ENODEV 271#define rtc_hctosys_ret -ENODEV
272#endif 272#endif
273 273
274#ifdef CONFIG_RTC_NVMEM
275int rtc_nvmem_register(struct rtc_device *rtc,
276 struct nvmem_config *nvmem_config);
277void rtc_nvmem_unregister(struct rtc_device *rtc);
278#else
279static inline int rtc_nvmem_register(struct rtc_device *rtc,
280 struct nvmem_config *nvmem_config)
281{
282 return -ENODEV;
283}
284static inline void rtc_nvmem_unregister(struct rtc_device *rtc) {}
285#endif
286
274#endif /* _LINUX_RTC_H_ */ 287#endif /* _LINUX_RTC_H_ */