Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1561324

[PATCH 3/3] PM / devfreq: Remove unnecessary separate _remove_devfreq()

From Chanwoo Choi <cw00.choi@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 3/3] PM / devfreq: Remove unnecessary separate _remove_devfreq()
Date 2017-01-18 08:00 +0100
Message-ID <t0SnV-HV-15@gated-at.bofh.it> (permalink)
References <t0SnU-HV-3@gated-at.bofh.it> <t0SnV-HV-17@gated-at.bofh.it> <t0SnU-HV-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The _remove_devfreq() releases the all resources of the devfreq
device. This function is only called in the devfreq_dev_release().
For that reason, the devfreq core doesn't need to leave the
_remove_devfreq() separately. This patch releases the all
resources in the devfreq_dev_release() and then removes the
_remove_devfreq().

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 6c560af2a801..c908c10c200a 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -480,11 +480,15 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type,
 }
 
 /**
- * _remove_devfreq() - Remove devfreq from the list and release its resources.
- * @devfreq:	the devfreq struct
+ * devfreq_dev_release() - Callback for struct device to release the device.
+ * @dev:	the devfreq device
+ *
+ * Remove devfreq from the list and release its resources.
  */
-static void _remove_devfreq(struct devfreq *devfreq)
+static void devfreq_dev_release(struct device *dev)
 {
+	struct devfreq *devfreq = to_devfreq(dev);
+
 	mutex_lock(&devfreq_list_lock);
 	if (IS_ERR(find_device_devfreq(devfreq->dev.parent))) {
 		mutex_unlock(&devfreq_list_lock);
@@ -506,19 +510,6 @@ static void _remove_devfreq(struct devfreq *devfreq)
 }
 
 /**
- * devfreq_dev_release() - Callback for struct device to release the device.
- * @dev:	the devfreq device
- *
- * This calls _remove_devfreq() if _remove_devfreq() is not called.
- */
-static void devfreq_dev_release(struct device *dev)
-{
-	struct devfreq *devfreq = to_devfreq(dev);
-
-	_remove_devfreq(devfreq);
-}
-
-/**
  * devfreq_add_device() - Add devfreq feature to the device
  * @dev:	the device to add devfreq feature.
  * @profile:	device-specific profile to run devfreq.
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] PM / devfreq: Fix issues about passive governor Chanwoo Choi <cw00.choi@samsung.com> - 2017-01-18 08:00 +0100
  [PATCH 1/3] PM / devfreq: Fix available_governor sysfs Chanwoo Choi <cw00.choi@samsung.com> - 2017-01-18 08:00 +0100
  [PATCH 3/3] PM / devfreq: Remove unnecessary separate _remove_devfreq() Chanwoo Choi <cw00.choi@samsung.com> - 2017-01-18 08:00 +0100
  [PATCH 2/3] PM / devfreq: Fix wrong trans_stat of passive devfreq  device Chanwoo Choi <cw00.choi@samsung.com> - 2017-01-18 08:00 +0100
  RE: [PATCH 1/3] PM / devfreq: Fix available_governor sysfs MyungJoo Ham <myungjoo.ham@samsung.com> - 2017-01-24 03:30 +0100
  RE: [PATCH 2/3] PM / devfreq: Fix wrong trans_stat of passive devfreq  device MyungJoo Ham <myungjoo.ham@samsung.com> - 2017-01-24 04:50 +0100
  RE: [PATCH 3/3] PM / devfreq: Remove unnecessary separate  _remove_devfreq() MyungJoo Ham <myungjoo.ham@samsung.com> - 2017-01-24 04:50 +0100
  RE: [PATCH 1/3] PM / devfreq: Fix available_governor sysfs MyungJoo Ham <myungjoo.ham@samsung.com> - 2017-01-24 05:00 +0100
    Re: [PATCH 1/3] PM / devfreq: Fix available_governor sysfs Chanwoo Choi <cw00.choi@samsung.com> - 2017-01-24 07:40 +0100

csiph-web