rtc_register_device() is a managed interface but it doesn't use devres
by itself - instead it marks an rtc_device as "registered" and the devres
callback for devm_rtc_allocate_device() takes care of resource release.
This doesn't correspond with the design behind devres where managed
structures should not be aware of being managed. The correct solution
here is to register a separate devres callback for unregistering the
device.
While at it: rename rtc_register_device() to devm_rtc_register_device()
and add it to the list of managed interfaces in devres.rst. This way we
can avoid any potential confusion of driver developers who may expect
there to exist a corresponding unregister function.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201109163409.24301-8-brgl@bgdev.pl
Add an RTC driver for the RTC device on Ricoh MFD RC5T619,
which is implemented as a variant of RN5T618.
rtc-range output:
Testing 2000-02-28 23:59:59.
OK
Testing 2038-01-19 03:14:07.
OK
Testing 2069-12-31 23:59:59.
OK
Testing 2099-12-31 23:59:59.
KO RTC_RD_TIME returned 22 (line 138)
Testing 2100-02-28 23:59:59.
KO RTC_SET_TIME returned 34 (line 122)
Testing 2106-02-07 06:28:15.
KO RTC_SET_TIME returned 34 (line 122)
Testing 2262-04-11 23:47:16.
KO RTC_SET_TIME returned 34 (line 122)
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>