From patchwork Thu May 16 05:09:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 16971 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f197.google.com (mail-gg0-f197.google.com [209.85.161.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 28D2E25E17 for ; Thu, 16 May 2013 05:11:13 +0000 (UTC) Received: by mail-gg0-f197.google.com with SMTP id u1sf2908982ggn.8 for ; Wed, 15 May 2013 22:10:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=0qVHCNpbEBZ5GFLq8+tayzmj5Lshx/QuxuB4xiHYzTs=; b=lDfpLP91KyMgftt2xoSaGbpd6bgjididfsqbTdlz/xgOn3L5nscG/jSaxBncES0A7L 1/wQFHbJ68G5h13L69IakhCKlXMhEPGiIDJHWoX92ZIoMxlS31GYHjdv5TPUoRdi6HA6 VdOTp4o1hxgcollDcl3jqYPkvfSwa3nlS28ETnOKJ+5e+V12ZBk3GJx8h77hWb6hDMX3 B2PWHMHecoQ8TGkKYVuMhERP/DmwQyToKmqwBwbsad+dAjaCZJbrSC+Hy7SHeL7/Okfj PGRiBWqGZaS6VUS/no7vQv99gHVptz9hCGHAVlvRDs5hn8YTMcRudHv46B7do9rXLfb+ qQ1g== X-Received: by 10.236.134.132 with SMTP id s4mr22092668yhi.56.1368681034735; Wed, 15 May 2013 22:10:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.71 with SMTP id w7ls1031411qej.69.gmail; Wed, 15 May 2013 22:10:34 -0700 (PDT) X-Received: by 10.52.240.48 with SMTP id vx16mr23551422vdc.127.1368681034566; Wed, 15 May 2013 22:10:34 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ry9si748696vdc.4.2013.05.15.22.10.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 22:10:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hr11so2441089vcb.5 for ; Wed, 15 May 2013 22:10:34 -0700 (PDT) X-Received: by 10.58.90.5 with SMTP id bs5mr26448123veb.60.1368681034383; Wed, 15 May 2013 22:10:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp47995vcs; Wed, 15 May 2013 22:10:33 -0700 (PDT) X-Received: by 10.68.197.165 with SMTP id iv5mr40792243pbc.213.1368681033460; Wed, 15 May 2013 22:10:33 -0700 (PDT) Received: from mail-pb0-x232.google.com (mail-pb0-x232.google.com [2607:f8b0:400e:c01::232]) by mx.google.com with ESMTPS id gx10si3596586pbc.7.2013.05.15.22.10.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 22:10:33 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::232 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::232; Received: by mail-pb0-f50.google.com with SMTP id um15so1959772pbc.23 for ; Wed, 15 May 2013 22:10:33 -0700 (PDT) X-Received: by 10.68.190.131 with SMTP id gq3mr42280616pbc.185.1368681033083; Wed, 15 May 2013 22:10:33 -0700 (PDT) Received: from localhost ([106.197.193.133]) by mx.google.com with ESMTPSA id kr16sm5962739pab.23.2013.05.15.22.10.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 15 May 2013 22:10:32 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, Viresh Kumar Subject: [PATCH 2/3] cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c Date: Thu, 16 May 2013 10:39:57 +0530 Message-Id: <62124facb77c79553e2ff7c5b69029094029a31c.1368679353.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQl052RygQ8sOYGcRBLcxwPUB6l5GDPamGBW8ZCsUzrwJBskoZ5sGO29KDqcJF9sFP4qW5Do X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , get_governor_parent_kobj() can be used by any governor, generic cpufreq governors or platform specific ones and so must be present in cpufreq.c instead of cpufreq_governor.c. This patch moves it to cpufreq.c. This also adds EXPORT_SYMBOL_GPL(get_governor_parent_kobj) so that modules can use this function too. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 9 +++++++++ drivers/cpufreq/cpufreq_governor.c | 8 -------- include/linux/cpufreq.h | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 21a7fb0..cb0f723 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -134,6 +134,15 @@ bool have_governor_per_policy(void) } EXPORT_SYMBOL_GPL(have_governor_per_policy); +struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy) +{ + if (have_governor_per_policy()) + return &policy->kobj; + else + return cpufreq_global_kobject; +} +EXPORT_SYMBOL_GPL(get_governor_parent_kobj); + static struct cpufreq_policy *__cpufreq_cpu_get(unsigned int cpu, bool sysfs) { struct cpufreq_policy *data; diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 5af40ad..d1421b4 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -29,14 +29,6 @@ #include "cpufreq_governor.h" -static struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy) -{ - if (have_governor_per_policy()) - return &policy->kobj; - else - return cpufreq_global_kobject; -} - static struct attribute_group *get_sysfs_attr(struct dbs_data *dbs_data) { if (have_governor_per_policy()) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index aa0c2a3..7ffb4d5 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -340,6 +340,7 @@ const char *cpufreq_get_current_driver(void); int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); int cpufreq_update_policy(unsigned int cpu); bool have_governor_per_policy(void); +struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); #ifdef CONFIG_CPU_FREQ /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */