From patchwork Fri Mar 22 16:20:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Andersson X-Patchwork-Id: 2321671 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 88A30E00DD for ; Fri, 22 Mar 2013 16:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933747Ab3CVQU3 (ORCPT ); Fri, 22 Mar 2013 12:20:29 -0400 Received: from eu1sys200aog108.obsmtp.com ([207.126.144.125]:59103 "EHLO eu1sys200aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933811Ab3CVQU2 (ORCPT ); Fri, 22 Mar 2013 12:20:28 -0400 Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob108.postini.com ([207.126.147.11]) with SMTP ID DSNKUUyEyOGjA/5FomrZvg88uFnxjsidaXzs@postini.com; Fri, 22 Mar 2013 16:20:28 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 1AC1455; Fri, 22 Mar 2013 16:19:30 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 0C99055; Fri, 22 Mar 2013 09:52:42 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 8D657A8081; Fri, 22 Mar 2013 17:20:14 +0100 (CET) Received: from steludxu2826.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Fri, 22 Mar 2013 17:20:20 +0100 From: Rickard Andersson To: , Cc: , , , , , Subject: [RFC PATCH 4/8] PM / Domains: Lookup domain by name Date: Fri, 22 Mar 2013 17:20:08 +0100 Message-ID: <1363969212-14864-5-git-send-email-rickard.andersson@stericsson.com> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1363969212-14864-1-git-send-email-rickard.andersson@stericsson.com> References: <1363969212-14864-1-git-send-email-rickard.andersson@stericsson.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Make the function pm_genpd_lookup_name(..) non static. This is done to limit the need for "name functions" as e.g. pm_genpd_name_attach_cpuidle. Also the name lookup takes a mutex and should not be called when IRQ's are off. So by exporting this function the name lookup can be done before IRQ's are off. Signed-off-by: Rickard Andersson --- drivers/base/power/domain.c | 2 +- include/linux/pm_domain.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 91e3b7d..a8755cb 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -53,7 +53,7 @@ static LIST_HEAD(gpd_list); static DEFINE_MUTEX(gpd_list_lock); -static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name) +struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name) { struct generic_pm_domain *genpd = NULL, *gpd; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index bf5e7d514..0fa2d5e 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -129,7 +129,7 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) } extern struct dev_power_governor simple_qos_governor; - +extern struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name); extern struct generic_pm_domain *dev_to_genpd(struct device *dev); extern int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, @@ -181,6 +181,10 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) { return ERR_PTR(-ENOSYS); } +static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name) +{ + return ERR_PTR(-ENOSYS); +} static inline struct generic_pm_domain *dev_to_genpd(struct device *dev) { return ERR_PTR(-ENOSYS);