diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-07-06 11:42:02 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-07-07 13:14:14 +0200 |
commit | 697e5a47aa12cdab6f2a8b284cc923cdf704eafc (patch) | |
tree | 3c2a9a02d436c6499896b7c9800a91c2e8185891 /drivers/rtc/class.c | |
parent | 735ae2056b3c7296bb188d079c020f606a679c4a (diff) | |
download | blackbird-op-linux-697e5a47aa12cdab6f2a8b284cc923cdf704eafc.tar.gz blackbird-op-linux-697e5a47aa12cdab6f2a8b284cc923cdf704eafc.zip |
rtc: add generic nvmem support
Many RTCs have an on board non volatile storage. It can be battery backed
RAM or an EEPROM. Use the nvmem subsystem to export it to both userspace
and in-kernel consumers.
This stays compatible with the previous (non documented) ABI that was using
/sys/class/rtc/rtcx/device/nvram to export that memory. But will warn about
the deprecation.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r-- | drivers/rtc/class.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 58e2a05765bb..2ed970d61da1 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -290,6 +290,8 @@ EXPORT_SYMBOL_GPL(rtc_device_register); */ void rtc_device_unregister(struct rtc_device *rtc) { + rtc_nvmem_unregister(rtc); + mutex_lock(&rtc->ops_lock); /* * Remove innards of this RTC, then disable it, before @@ -448,6 +450,8 @@ int __rtc_register_device(struct module *owner, struct rtc_device *rtc) rtc_proc_add_device(rtc); + rtc_nvmem_register(rtc); + rtc->registered = true; dev_info(rtc->dev.parent, "registered as %s\n", dev_name(&rtc->dev)); |