linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: linux-pm@vger.kernel.org
Cc: Matthew Wilcox <mawilcox@microsoft.com>, Zhang Rui <rui.zhang@intel.com>
Subject: [PATCH 2/5] thermal: share get_ida()/release_ida() for other thermal ida users
Date: Wed, 21 Dec 2016 10:04:12 +0800	[thread overview]
Message-ID: <1482285855-2974-3-git-send-email-rui.zhang@intel.com> (raw)
In-Reply-To: <1482285855-2974-1-git-send-email-rui.zhang@intel.com>

CC: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/thermal_core.c | 4 ++--
 drivers/thermal/thermal_core.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 1b6fde2..5849727 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -589,7 +589,7 @@ void thermal_zone_device_unbind_exception(struct thermal_zone_device *tz,
  * - thermal zone devices lifecycle: registration, unregistration,
  *				     binding, and unbinding.
  */
-static int get_ida(struct ida *ida, struct mutex *lock, int *id)
+int get_ida(struct ida *ida, struct mutex *lock, int *id)
 {
 	int ret;
 
@@ -605,7 +605,7 @@ static int get_ida(struct ida *ida, struct mutex *lock, int *id)
 	return ret;
 }
 
-static void release_ida(struct ida *ida, struct mutex *lock, int id)
+void release_ida(struct ida *ida, struct mutex *lock, int id)
 {
 	if (!ida || !lock)
 		return;
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 2412b37..e49f9f5 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -68,6 +68,8 @@ void thermal_zone_device_unbind_exception(struct thermal_zone_device *,
 					  const char *, size_t);
 int thermal_zone_device_set_policy(struct thermal_zone_device *, char *);
 int thermal_build_list_of_policies(char *buf);
+int get_ida(struct ida *, struct mutex *, int *);
+void release_ida(struct ida *, struct mutex *, int);
 
 /* sysfs I/F */
 int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
-- 
2.7.4


  parent reply	other threads:[~2016-12-21  2:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21  2:04 [PATCH 0/5] thermal: convert ID allocation to IDA Zhang Rui
2016-12-21  2:04 ` [PATCH 1/5] thermal: core: " Zhang Rui
2016-12-21  2:04 ` Zhang Rui [this message]
2016-12-21 15:54   ` [PATCH 2/5] thermal: share get_ida()/release_ida() for other thermal ida users Matthew Wilcox
2016-12-21  2:04 ` [PATCH 3/5] thermal: cpu cooling: convert ID allocation to IDA Zhang Rui
2016-12-21  2:04 ` [PATCH 4/5] thermal: devfreq " Zhang Rui
2016-12-21  2:04 ` [PATCH 5/5] thermal: clock " Zhang Rui

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=1482285855-2974-3-git-send-email-rui.zhang@intel.com \
    --to=rui.zhang@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).