diff mbox series

[59/59] rtc: remove devm_rtc_device_register()

Message ID 20201119114149.4117-60-brgl@bgdev.pl
State Rejected
Headers show
Series rtc: remove all uses of devm_rtc_device_register() | expand

Commit Message

Bartosz Golaszewski Nov. 19, 2020, 11:41 a.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

All users have been converted to using the devm_rtc_allocate_device() +
devm_rtc_register_device() pair. We can remove the deprecated interface.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 .../driver-api/driver-model/devres.rst        |  1 -
 drivers/rtc/class.c                           | 36 -------------------
 include/linux/rtc.h                           |  4 ---
 3 files changed, 41 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index cd8b6e657b94..f22823af7265 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -412,7 +412,6 @@  RESET
   devm_reset_controller_register()
 
 RTC
-  devm_rtc_device_register()
   devm_rtc_allocate_device()
   devm_rtc_register_device()
   devm_rtc_nvmem_register()
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index e6b44b7c4ad3..e192ea39ff3f 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -415,42 +415,6 @@  int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
 }
 EXPORT_SYMBOL_GPL(__devm_rtc_register_device);
 
-/**
- * devm_rtc_device_register - resource managed rtc_device_register()
- * @dev: the device to register
- * @name: the name of the device (unused)
- * @ops: the rtc operations structure
- * @owner: the module owner
- *
- * @return a struct rtc on success, or an ERR_PTR on error
- *
- * Managed rtc_device_register(). The rtc_device returned from this function
- * are automatically freed on driver detach.
- * This function is deprecated, use devm_rtc_allocate_device and
- * rtc_register_device instead
- */
-struct rtc_device *devm_rtc_device_register(struct device *dev,
-					    const char *name,
-					    const struct rtc_class_ops *ops,
-					    struct module *owner)
-{
-	struct rtc_device *rtc;
-	int err;
-
-	rtc = devm_rtc_allocate_device(dev);
-	if (IS_ERR(rtc))
-		return rtc;
-
-	rtc->ops = ops;
-
-	err = __devm_rtc_register_device(owner, rtc);
-	if (err)
-		return ERR_PTR(err);
-
-	return rtc;
-}
-EXPORT_SYMBOL_GPL(devm_rtc_device_register);
-
 static int __init rtc_init(void)
 {
 	rtc_class = class_create(THIS_MODULE, "rtc");
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 55e7beed066c..e3623446a9d7 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -150,10 +150,6 @@  struct rtc_device {
 #define RTC_TIMESTAMP_END_2199		7258118399LL /* 2199-12-31 23:59:59 */
 #define RTC_TIMESTAMP_END_9999		253402300799LL /* 9999-12-31 23:59:59 */
 
-extern struct rtc_device *devm_rtc_device_register(struct device *dev,
-					const char *name,
-					const struct rtc_class_ops *ops,
-					struct module *owner);
 struct rtc_device *devm_rtc_allocate_device(struct device *dev);
 int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc);