From patchwork Wed Dec 21 02:04:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 9482445 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 440E960772 for ; Wed, 21 Dec 2016 02:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 377AD28138 for ; Wed, 21 Dec 2016 02:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C6AD281C3; Wed, 21 Dec 2016 02:04:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3168F28138 for ; Wed, 21 Dec 2016 02:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933330AbcLUCEV (ORCPT ); Tue, 20 Dec 2016 21:04:21 -0500 Received: from mga02.intel.com ([134.134.136.20]:65334 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932778AbcLUCEU (ORCPT ); Tue, 20 Dec 2016 21:04:20 -0500 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 20 Dec 2016 18:04:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,381,1477983600"; d="scan'208";a="45169056" Received: from gxu24-mobl1.ccr.corp.intel.com (HELO rzhang1-surface.ccr.corp.intel.com) ([10.255.28.231]) by fmsmga005.fm.intel.com with ESMTP; 20 Dec 2016 18:04:19 -0800 From: Zhang Rui To: linux-pm@vger.kernel.org Cc: Matthew Wilcox , Zhang Rui Subject: [PATCH 2/5] thermal: share get_ida()/release_ida() for other thermal ida users Date: Wed, 21 Dec 2016 10:04:12 +0800 Message-Id: <1482285855-2974-3-git-send-email-rui.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482285855-2974-1-git-send-email-rui.zhang@intel.com> References: <1482285855-2974-1-git-send-email-rui.zhang@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CC: Matthew Wilcox Signed-off-by: Zhang Rui --- 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);