[PATCH] PM / devfreq: Remove unused devm_devfreq_(un)register_notifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx>

devm_devfreq_register_notifier() and devm_devfreq_unregister_notifier()
have been unused since 2019's
commit 0ef7c7cce43f ("PM / devfreq: passive: Use non-devm notifiers")

Remove them, and the helpers they used.

Note, devm_devfreq_register_notifier() is still used as an example
in Documentation/doc-guide/contributing.rst but that's just
an example of an old doc bug rather than anything about the function
itself.

Signed-off-by: Dr. David Alan Gilbert <linux@xxxxxxxxxxx>
---
 drivers/devfreq/devfreq.c | 67 ---------------------------------------
 include/linux/devfreq.h   | 23 --------------
 2 files changed, 90 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 98657d3b9435..6c3b241b4458 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -2224,70 +2224,3 @@ int devfreq_unregister_notifier(struct devfreq *devfreq,
 	return ret;
 }
 EXPORT_SYMBOL(devfreq_unregister_notifier);
-
-struct devfreq_notifier_devres {
-	struct devfreq *devfreq;
-	struct notifier_block *nb;
-	unsigned int list;
-};
-
-static void devm_devfreq_notifier_release(struct device *dev, void *res)
-{
-	struct devfreq_notifier_devres *this = res;
-
-	devfreq_unregister_notifier(this->devfreq, this->nb, this->list);
-}
-
-/**
- * devm_devfreq_register_notifier()
- *	- Resource-managed devfreq_register_notifier()
- * @dev:	The devfreq user device. (parent of devfreq)
- * @devfreq:	The devfreq object.
- * @nb:		The notifier block to be unregistered.
- * @list:	DEVFREQ_TRANSITION_NOTIFIER.
- */
-int devm_devfreq_register_notifier(struct device *dev,
-				struct devfreq *devfreq,
-				struct notifier_block *nb,
-				unsigned int list)
-{
-	struct devfreq_notifier_devres *ptr;
-	int ret;
-
-	ptr = devres_alloc(devm_devfreq_notifier_release, sizeof(*ptr),
-				GFP_KERNEL);
-	if (!ptr)
-		return -ENOMEM;
-
-	ret = devfreq_register_notifier(devfreq, nb, list);
-	if (ret) {
-		devres_free(ptr);
-		return ret;
-	}
-
-	ptr->devfreq = devfreq;
-	ptr->nb = nb;
-	ptr->list = list;
-	devres_add(dev, ptr);
-
-	return 0;
-}
-EXPORT_SYMBOL(devm_devfreq_register_notifier);
-
-/**
- * devm_devfreq_unregister_notifier()
- *	- Resource-managed devfreq_unregister_notifier()
- * @dev:	The devfreq user device. (parent of devfreq)
- * @devfreq:	The devfreq object.
- * @nb:		The notifier block to be unregistered.
- * @list:	DEVFREQ_TRANSITION_NOTIFIER.
- */
-void devm_devfreq_unregister_notifier(struct device *dev,
-				      struct devfreq *devfreq,
-				      struct notifier_block *nb,
-				      unsigned int list)
-{
-	WARN_ON(devres_release(dev, devm_devfreq_notifier_release,
-			       devm_devfreq_dev_match, devfreq));
-}
-EXPORT_SYMBOL(devm_devfreq_unregister_notifier);
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index d312ffbac4dd..ea161657ebc6 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -263,14 +263,6 @@ int devfreq_register_notifier(struct devfreq *devfreq,
 int devfreq_unregister_notifier(struct devfreq *devfreq,
 				struct notifier_block *nb,
 				unsigned int list);
-int devm_devfreq_register_notifier(struct device *dev,
-				struct devfreq *devfreq,
-				struct notifier_block *nb,
-				unsigned int list);
-void devm_devfreq_unregister_notifier(struct device *dev,
-				struct devfreq *devfreq,
-				struct notifier_block *nb,
-				unsigned int list);
 struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node);
 struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
 				const char *phandle_name, int index);
@@ -420,21 +412,6 @@ static inline int devfreq_unregister_notifier(struct devfreq *devfreq,
 	return 0;
 }
 
-static inline int devm_devfreq_register_notifier(struct device *dev,
-					struct devfreq *devfreq,
-					struct notifier_block *nb,
-					unsigned int list)
-{
-	return 0;
-}
-
-static inline void devm_devfreq_unregister_notifier(struct device *dev,
-					struct devfreq *devfreq,
-					struct notifier_block *nb,
-					unsigned int list)
-{
-}
-
 static inline struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
 {
 	return ERR_PTR(-ENODEV);
-- 
2.47.0





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux