From patchwork Thu May 16 09:28:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 16987 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8658F2391B for ; Thu, 16 May 2013 09:32:18 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id cz11sf3771370veb.6 for ; Thu, 16 May 2013 02:31:39 -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=fcS+uq5bDZelI+hXM/g7hZjyAOBL93JB3BNUX5hhJBE=; b=OOjRYxfPhaOXoz6UVPXhxIq1HPGABdphORnM7lnuOFzv6s/uXq9bKcCcDl/ONaV24I zbHWsZzhoh3SgMCUkB7jjdmsXYAeU//St2fng/YEqcfbSPBIOWpw2zn1sctSScRnhWxb m6EMAbFuqY49VEfkodt1hgHPV5RdeRasek4hJNme8TPasIHv/+7/YRJRIxxOo4Dzt+k+ ldQwL9pWZfS3YiS65iWNpAuj+GDTW2CewEW7F9HmGswt7wkGJYsSItY1D7IYcsSmqclG xrfamdzgJRNu/HAbBqtP4Dd5Ge//M6k2kPTDE32NBBDKNoDa9PuEs4AH5W4gKpyCPNW+ 3YIg== X-Received: by 10.224.217.195 with SMTP id hn3mr25443062qab.5.1368696699676; Thu, 16 May 2013 02:31:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.197 with SMTP id e5ls1128315qeo.42.gmail; Thu, 16 May 2013 02:31:39 -0700 (PDT) X-Received: by 10.220.114.203 with SMTP id f11mr16647767vcq.21.1368696699486; Thu, 16 May 2013 02:31:39 -0700 (PDT) Received: from mail-vb0-x22e.google.com (mail-vb0-x22e.google.com [2607:f8b0:400c:c02::22e]) by mx.google.com with ESMTPS id l10si3482525vet.28.2013.05.16.02.31.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 02:31:39 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22e; Received: by mail-vb0-f46.google.com with SMTP id 10so1225132vbe.33 for ; Thu, 16 May 2013 02:31:39 -0700 (PDT) X-Received: by 10.52.20.210 with SMTP id p18mr22980205vde.42.1368696699319; Thu, 16 May 2013 02:31:39 -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 c10csp56028vcs; Thu, 16 May 2013 02:31:38 -0700 (PDT) X-Received: by 10.68.99.163 with SMTP id er3mr42938720pbb.36.1368696698443; Thu, 16 May 2013 02:31:38 -0700 (PDT) Received: from mail-pb0-x233.google.com (mail-pb0-x233.google.com [2607:f8b0:400e:c01::233]) by mx.google.com with ESMTPS id fn6si4411769pab.179.2013.05.16.02.31.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 02:31:38 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::233 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::233; Received: by mail-pb0-f51.google.com with SMTP id jt11so1103429pbb.10 for ; Thu, 16 May 2013 02:31:38 -0700 (PDT) X-Received: by 10.66.197.165 with SMTP id iv5mr43644777pac.67.1368696697955; Thu, 16 May 2013 02:31:37 -0700 (PDT) Received: from localhost ([106.197.193.133]) by mx.google.com with ESMTPSA id vu10sm6129195pbc.27.2013.05.16.02.31.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 May 2013 02:31:37 -0700 (PDT) From: Viresh Kumar To: toddpoynor@google.com Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, android-kernel@googlegroups.com, viresh.kumar@linaro.org Subject: [PATCH 10/16] cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c Date: Thu, 16 May 2013 14:58:48 +0530 Message-Id: <5c151be537a1826607388ae058e058d2ef42de54.1368696171.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: ALoCoQmMwzj+O/CPVz8AxLFVqCZovOFHZeE8lJFgUoADP1AtG2kpPpLOAweUuymlvE9HEyyhz0xR X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22e 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 d476bb8..763fc8e1 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 13ca17a..39ea9e5 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 9fd6bce..3f53526 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 */