summaryrefslogtreecommitdiff
path: root/Documentation/driver-api/driver-model
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2020-11-09 17:34:08 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2020-11-19 12:50:12 +0100
commitfdcfd854333be5b30377dc5daa9cd0fa1643a979 (patch)
tree89b755560a425f0eb332a86037e2b6d429b7fb5a /Documentation/driver-api/driver-model
parent6746bc095bbd1da719aadd9a11fe2c75a12f22e0 (diff)
rtc: rework rtc_register_device() resource management
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
Diffstat (limited to 'Documentation/driver-api/driver-model')
-rw-r--r--Documentation/driver-api/driver-model/devres.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 5df7ba54a4ba..cd8b6e657b94 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -414,6 +414,7 @@ RESET
RTC
devm_rtc_device_register()
devm_rtc_allocate_device()
+ devm_rtc_register_device()
devm_rtc_nvmem_register()
SERDEV