linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat: Backport cpufreq_quick_get_max()
@ 2012-07-03 20:03 Ozan Çağlayan
  2012-07-03 20:42 ` Luis R. Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Ozan Çağlayan @ 2012-07-03 20:03 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Ozan Çağlayan

This backports:

commit 3d73710880afa3d61cf57b5d4eb192e812eb7e4f
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Tue Jun 28 10:59:12 2011 -0700

  cpufreq: expose a cpufreq_quick_get_max routine

Trying kernel  3.4.0-030400-generic [OK]
Trying kernel  3.3.7-030307-generic [OK]
Trying kernel  3.2.2-030202-generic [OK]
Trying kernel  3.1.10-030110-generic [OK]
Trying kernel  3.0.18-030018-generic [OK]
Trying kernel  2.6.39-02063904-generic [OK]
Trying kernel  2.6.38-02063808-generic [OK]
Trying kernel  2.6.37-02063706-generic [OK]
Trying kernel  2.6.36-02063604-generic [OK]
Trying kernel  2.6.35-02063512-generic [OK]
Trying kernel  2.6.34-02063410-generic [OK]
Trying kernel  2.6.33-02063305-generic [OK]
Trying kernel  2.6.32-02063255-generic [OK]
Trying kernel  2.6.31-02063113-generic [OK]
Trying kernel  2.6.30-02063010-generic [OK]
Trying kernel  2.6.29-02062906-generic [OK]
Trying kernel  2.6.28-02062810-generic [OK]
Trying kernel  2.6.27-020627-generic [OK]
Trying kernel  2.6.26-020626-generic [OK]
Trying kernel  2.6.25-020625-generic [OK]
Trying kernel  2.6.24-020624-generic [OK]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
---
 compat/compat-3.1.c        |   24 ++++++++++++++++++++++++
 include/linux/compat-3.1.h |    1 +
 2 files changed, 25 insertions(+)

diff --git a/compat/compat-3.1.c b/compat/compat-3.1.c
index d427dd3..e81a3e7 100644
--- a/compat/compat-3.1.c
+++ b/compat/compat-3.1.c
@@ -9,6 +9,30 @@
  */
 
 #include <linux/idr.h>
+#include <linux/cpufreq.h>
+
+/* This backports:
+ * commit 3d73710880afa3d61cf57b5d4eb192e812eb7e4f
+ * Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+ * Date:   Tue Jun 28 10:59:12 2011 -0700
+ *
+ * 	cpufreq: expose a cpufreq_quick_get_max routine
+ */
+
+unsigned int cpufreq_quick_get_max(unsigned int cpu)
+{
+	struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
+	unsigned int ret_freq = 0;
+
+	if (policy) {
+		ret_freq = policy->max;
+		cpufreq_cpu_put(policy);
+	}
+
+	return ret_freq;
+}
+EXPORT_SYMBOL(cpufreq_quick_get_max);
+
 
 static DEFINE_SPINLOCK(simple_ida_lock);
 
diff --git a/include/linux/compat-3.1.h b/include/linux/compat-3.1.h
index 5998bb1..bf8a4ef 100644
--- a/include/linux/compat-3.1.h
+++ b/include/linux/compat-3.1.h
@@ -102,6 +102,7 @@ int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
 		   gfp_t gfp_mask);
 void ida_simple_remove(struct ida *ida, unsigned int id);
 
+unsigned int cpufreq_quick_get_max(unsigned int cpu);
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) */
 
 #endif /* LINUX_3_1_COMPAT_H */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] compat: Backport cpufreq_quick_get_max()
  2012-07-03 20:03 [PATCH] compat: Backport cpufreq_quick_get_max() Ozan Çağlayan
@ 2012-07-03 20:42 ` Luis R. Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2012-07-03 20:42 UTC (permalink / raw)
  To: Ozan Çağlayan; +Cc: mcgrof, linux-wireless

On Tue, Jul 3, 2012 at 1:03 PM, Ozan Çağlayan <ozancag@gmail.com> wrote:
> This backports:
>
> commit 3d73710880afa3d61cf57b5d4eb192e812eb7e4f
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Tue Jun 28 10:59:12 2011 -0700
>
>   cpufreq: expose a cpufreq_quick_get_max routine
>
> Trying kernel  3.4.0-030400-generic [OK]
> Trying kernel  3.3.7-030307-generic [OK]
> Trying kernel  3.2.2-030202-generic [OK]
> Trying kernel  3.1.10-030110-generic [OK]
> Trying kernel  3.0.18-030018-generic [OK]
> Trying kernel  2.6.39-02063904-generic [OK]
> Trying kernel  2.6.38-02063808-generic [OK]
> Trying kernel  2.6.37-02063706-generic [OK]
> Trying kernel  2.6.36-02063604-generic [OK]
> Trying kernel  2.6.35-02063512-generic [OK]
> Trying kernel  2.6.34-02063410-generic [OK]
> Trying kernel  2.6.33-02063305-generic [OK]
> Trying kernel  2.6.32-02063255-generic [OK]
> Trying kernel  2.6.31-02063113-generic [OK]
> Trying kernel  2.6.30-02063010-generic [OK]
> Trying kernel  2.6.29-02062906-generic [OK]
> Trying kernel  2.6.28-02062810-generic [OK]
> Trying kernel  2.6.27-020627-generic [OK]
> Trying kernel  2.6.26-020626-generic [OK]
> Trying kernel  2.6.25-020625-generic [OK]
> Trying kernel  2.6.24-020624-generic [OK]
>
> Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>

Thanks, applied and pushed, next time if you can add in the commit log
something like this:

mcgrof@tux ~/linux-stable (git::master)$ git describe --contains
3d73710880afa3d61cf57b5d4eb192e812eb7e4f
v3.1-rc1~230^2~18^2~36

That would prove this was introduced in 3.1 and that compat-3.1.[ch]
are the right files to be modifying.

Thanks!

  Luis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-03 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03 20:03 [PATCH] compat: Backport cpufreq_quick_get_max() Ozan Çağlayan
2012-07-03 20:42 ` Luis R. Rodriguez

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).