All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, rjw@rjwysocki.net
Cc: cw00.choi@samsung.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] PM / devfreq: Remove unnecessary separate _remove_devfreq()
Date: Wed, 18 Jan 2017 15:56:51 +0900	[thread overview]
Message-ID: <1484722611-10555-4-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1484722611-10555-1-git-send-email-cw00.choi@samsung.com>

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

  parent reply	other threads:[~2017-01-18  6:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170118065653epcas5p23158122f1f54c7419bc010527174b48e@epcas5p2.samsung.com>
2017-01-18  6:56 ` [PATCH 0/3] PM / devfreq: Fix issues about passive governor Chanwoo Choi
     [not found]   ` <CGME20170118065653epcas5p2b1b4a964772e300b56356a26ec5cb9e5@epcas5p2.samsung.com>
2017-01-18  6:56     ` [PATCH 1/3] PM / devfreq: Fix available_governor sysfs Chanwoo Choi
2017-01-24  2:24     ` MyungJoo Ham
2017-01-24  3:51     ` MyungJoo Ham
2017-01-24  6:23       ` Chanwoo Choi
     [not found]   ` <CGME20170118065653epcas5p25728109e3bc2458dc16c23904f908c66@epcas5p2.samsung.com>
2017-01-18  6:56     ` Chanwoo Choi [this message]
2017-01-24  3:41     ` [PATCH 3/3] PM / devfreq: Remove unnecessary separate _remove_devfreq() MyungJoo Ham
     [not found]   ` <CGME20170118065653epcas5p2da6963fbad338a3c402c7d99f5e8473f@epcas5p2.samsung.com>
2017-01-18  6:56     ` [PATCH 2/3] PM / devfreq: Fix wrong trans_stat of passive devfreq device Chanwoo Choi
2017-01-24  3:40     ` MyungJoo Ham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484722611-10555-4-git-send-email-cw00.choi@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.