All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I
@ 2013-09-16 13:26 Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 01/44] cpufreq: Add new helper cpufreq_table_validate_and_show() Viresh Kumar
                   ` (43 more replies)
  0 siblings, 44 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Hi Rafael,

This is resent of patches earlier sent as part of big patchset:

http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg503397.html

These contain first set of patches that you can now include in
bleeding-edge/linux-next branches of your repo. I have included all Acks/Tested
by tags into the patches..

--
viresh

Hans-Christian Egtvedt (1):
  cpufreq: at32ap: add frequency table

Viresh Kumar (43):
  cpufreq: Add new helper cpufreq_table_validate_and_show()
  cpufreq: pxa: call cpufreq_frequency_table_get_attr()
  cpufreq: s3cx4xx: call cpufreq_frequency_table_get_attr()
  cpufreq: sparc: call cpufreq_frequency_table_get_attr()
  cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show()
  cpufreq: arm_big_little: use cpufreq_table_validate_and_show()
  cpufreq: blackfin: use cpufreq_table_validate_and_show()
  cpufreq: cpufreq-cpu0: use cpufreq_table_validate_and_show()
  cpufreq: cris: use cpufreq_table_validate_and_show()
  cpufreq: davinci: use cpufreq_table_validate_and_show()
  cpufreq: dbx500: use cpufreq_table_validate_and_show()
  cpufreq: e_powersaver: use cpufreq_table_validate_and_show()
  cpufreq: elanfreq: use cpufreq_table_validate_and_show()
  cpufreq: exynos: use cpufreq_table_validate_and_show()
  cpufreq: ia64-acpi: use cpufreq_table_validate_and_show()
  cpufreq: imx6q: use cpufreq_table_validate_and_show()
  cpufreq: kirkwood: use cpufreq_table_validate_and_show()
  cpufreq: longhaul: use cpufreq_table_validate_and_show()
  cpufreq: loongson2: use cpufreq_table_validate_and_show()
  cpufreq: maple: use cpufreq_table_validate_and_show()
  cpufreq: omap: use cpufreq_table_validate_and_show()
  cpufreq: p4-clockmod: use cpufreq_table_validate_and_show()
  cpufreq: pasemi: use cpufreq_table_validate_and_show()
  cpufreq: pmac: use cpufreq_table_validate_and_show()
  cpufreq: powernow: use cpufreq_table_validate_and_show()
  cpufreq: ppc: use cpufreq_table_validate_and_show()
  cpufreq: pxa: use cpufreq_table_validate_and_show()
  cpufreq: s3cx4xx: use cpufreq_table_validate_and_show()
  cpufreq: s5pv210: use cpufreq_table_validate_and_show()
  cpufreq: sa11x0: Expose frequency table
  cpufreq: sa11x0: let cpufreq core initialize struct policy fields
  cpufreq: sc520: use cpufreq_table_validate_and_show()
  cpufreq: sh: use cpufreq_table_validate_and_show()
  cpufreq: sparc: use cpufreq_table_validate_and_show()
  cpufreq: spear: use cpufreq_table_validate_and_show()
  cpufreq: speedstep: use cpufreq_table_validate_and_show()
  cpufreq: tegra: use cpufreq_table_validate_and_show()
  cpufreq: tegra: fix implementation of ->exit()
  cpufreq: arm_big_little: call cpufreq_frequency_table_put_attr()
  cpufreq: blackfin: call cpufreq_frequency_table_put_attr()
  cpufreq: exynos: call cpufreq_frequency_table_put_attr()
  cpufreq: loongson2: call cpufreq_frequency_table_put_attr()
  cpufreq: omap: call cpufreq_frequency_table_put_attr()

 arch/arm/mach-sa1100/generic.c         | 45 +++++++++++++++----------------
 arch/arm/mach-sa1100/generic.h         |  1 +
 drivers/cpufreq/acpi-cpufreq.c         |  4 +--
 drivers/cpufreq/arm_big_little.c       |  5 ++--
 drivers/cpufreq/at32ap-cpufreq.c       | 49 +++++++++++++++++++++++++++++++---
 drivers/cpufreq/blackfin-cpufreq.c     | 11 ++++++--
 drivers/cpufreq/cpufreq-cpu0.c         |  4 +--
 drivers/cpufreq/cris-artpec3-cpufreq.c | 10 +------
 drivers/cpufreq/cris-etraxfs-cpufreq.c | 10 +------
 drivers/cpufreq/davinci-cpufreq.c      |  6 ++---
 drivers/cpufreq/dbx500-cpufreq.c       |  6 ++---
 drivers/cpufreq/e_powersaver.c         |  3 +--
 drivers/cpufreq/elanfreq.c             |  8 +-----
 drivers/cpufreq/exynos-cpufreq.c       |  4 +--
 drivers/cpufreq/exynos5440-cpufreq.c   |  9 +++++--
 drivers/cpufreq/freq_table.c           | 12 +++++++++
 drivers/cpufreq/ia64-acpi-cpufreq.c    |  4 +--
 drivers/cpufreq/imx6q-cpufreq.c        |  3 +--
 drivers/cpufreq/kirkwood-cpufreq.c     | 10 +------
 drivers/cpufreq/longhaul.c             |  8 +-----
 drivers/cpufreq/loongson2_cpufreq.c    |  6 ++---
 drivers/cpufreq/maple-cpufreq.c        |  4 +--
 drivers/cpufreq/omap-cpufreq.c         |  5 ++--
 drivers/cpufreq/p4-clockmod.c          |  3 +--
 drivers/cpufreq/pasemi-cpufreq.c       |  4 +--
 drivers/cpufreq/pmac32-cpufreq.c       |  3 +--
 drivers/cpufreq/pmac64-cpufreq.c       |  4 +--
 drivers/cpufreq/powernow-k6.c          |  9 +------
 drivers/cpufreq/powernow-k7.c          |  4 +--
 drivers/cpufreq/powernow-k8.c          |  4 +--
 drivers/cpufreq/ppc-corenet-cpufreq.c  |  3 +--
 drivers/cpufreq/ppc_cbe_cpufreq.c      |  4 +--
 drivers/cpufreq/pxa2xx-cpufreq.c       | 15 ++++++++---
 drivers/cpufreq/pxa3xx-cpufreq.c       |  9 ++++++-
 drivers/cpufreq/s3c2416-cpufreq.c      |  4 +--
 drivers/cpufreq/s3c24xx-cpufreq.c      |  2 +-
 drivers/cpufreq/s3c64xx-cpufreq.c      |  2 +-
 drivers/cpufreq/s5pv210-cpufreq.c      |  4 +--
 drivers/cpufreq/sa1100-cpufreq.c       |  7 +++--
 drivers/cpufreq/sa1110-cpufreq.c       |  7 +++--
 drivers/cpufreq/sc520_freq.c           |  9 +------
 drivers/cpufreq/sh-cpufreq.c           |  6 ++---
 drivers/cpufreq/sparc-us2e-cpufreq.c   |  6 +++--
 drivers/cpufreq/sparc-us3-cpufreq.c    |  6 +++--
 drivers/cpufreq/spear-cpufreq.c        |  5 ++--
 drivers/cpufreq/speedstep-centrino.c   | 10 +------
 drivers/cpufreq/speedstep-ich.c        |  9 +------
 drivers/cpufreq/speedstep-smi.c        |  8 +-----
 drivers/cpufreq/tegra-cpufreq.c        |  5 ++--
 include/linux/cpufreq.h                |  2 ++
 50 files changed, 179 insertions(+), 202 deletions(-)

-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 01/44] cpufreq: Add new helper cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 02/44] cpufreq: pxa: call cpufreq_frequency_table_get_attr() Viresh Kumar
                   ` (42 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Almost every cpufreq driver is required to validate its frequency table with:
cpufreq_frequency_table_cpuinfo() and then expose it to cpufreq core with:
cpufreq_frequency_table_get_attr().

This patch creates another helper routine cpufreq_table_validate_and_show() that
will do both these steps in a single call and will return 0 for success, error
otherwise.

This also fixes potential bugs in cpufreq drivers where people have called
cpufreq_frequency_table_get_attr() before calling
cpufreq_frequency_table_cpuinfo(), as the later may fail.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/freq_table.c | 12 ++++++++++++
 include/linux/cpufreq.h      |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index f111454a..11f6fa9 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -219,6 +219,18 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu)
 }
 EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
 
+int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
+				      struct cpufreq_frequency_table *table)
+{
+	int ret = cpufreq_frequency_table_cpuinfo(policy, table);
+
+	if (!ret)
+		cpufreq_frequency_table_get_attr(table, policy->cpu);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(cpufreq_table_validate_and_show);
+
 void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy)
 {
 	pr_debug("Updating show_table for new_cpu %u from last_cpu %u\n",
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index fcabc42..6b199ed 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -410,5 +410,7 @@ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
 void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
 				      unsigned int cpu);
 void cpufreq_frequency_table_put_attr(unsigned int cpu);
+int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
+				      struct cpufreq_frequency_table *table);
 
 #endif /* _LINUX_CPUFREQ_H */
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 02/44] cpufreq: pxa: call cpufreq_frequency_table_get_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 01/44] cpufreq: Add new helper cpufreq_table_validate_and_show() Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 03/44] cpufreq: s3cx4xx: " Viresh Kumar
                   ` (41 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

This exposes frequency table of driver to cpufreq core and is required for core
to guess what the index for a target frequency is, when it calls
cpufreq_frequency_table_target(). And so this driver needs to expose it.

Cc: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/pxa2xx-cpufreq.c | 13 ++++++++++++-
 drivers/cpufreq/pxa3xx-cpufreq.c | 15 +++++++++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
index 8749eaf18..b004cf1 100644
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -453,20 +453,31 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy)
 		find_freq_tables(&pxa255_freq_table, &pxa255_freqs);
 		pr_info("PXA255 cpufreq using %s frequency table\n",
 			pxa255_turbo_table ? "turbo" : "run");
+
 		cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table);
+		cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu);
 	}
-	else if (cpu_is_pxa27x())
+	else if (cpu_is_pxa27x()) {
 		cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table);
+		cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu);
+	}
 
 	printk(KERN_INFO "PXA CPU frequency change support initialized\n");
 
 	return 0;
 }
 
+static int pxa_cpufreq_exit(struct cpufreq_policy *policy)
+{
+	cpufreq_frequency_table_put_attr(policy->cpu);
+	return 0;
+}
+
 static struct cpufreq_driver pxa_cpufreq_driver = {
 	.verify	= pxa_verify_policy,
 	.target	= pxa_set_target,
 	.init	= pxa_cpufreq_init,
+	.exit	= pxa_cpufreq_exit,
 	.get	= pxa_cpufreq_get,
 	.name	= "PXA2xx",
 };
diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c
index d26306f..cebbed1 100644
--- a/drivers/cpufreq/pxa3xx-cpufreq.c
+++ b/drivers/cpufreq/pxa3xx-cpufreq.c
@@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy,
 			     struct pxa3xx_freq_info *freqs, int num)
 {
 	struct cpufreq_frequency_table *table;
-	int i;
+	int i, ret;
 
 	table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL);
 	if (table == NULL)
@@ -108,7 +108,11 @@ static int setup_freqs_table(struct cpufreq_policy *policy,
 	pxa3xx_freqs_num = num;
 	pxa3xx_freqs_table = table;
 
-	return cpufreq_frequency_table_cpuinfo(policy, table);
+	ret = cpufreq_frequency_table_cpuinfo(policy, table);
+	if (!ret)
+		cpufreq_frequency_table_get_attr(table, policy->cpu);
+
+	return ret;
 }
 
 static void __update_core_freq(struct pxa3xx_freq_info *info)
@@ -229,10 +233,17 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy)
 	return 0;
 }
 
+static int pxa3xx_cpufreq_exit(struct cpufreq_policy *policy)
+{
+	cpufreq_frequency_table_put_attr(policy->cpu);
+	return 0;
+}
+
 static struct cpufreq_driver pxa3xx_cpufreq_driver = {
 	.verify		= pxa3xx_cpufreq_verify,
 	.target		= pxa3xx_cpufreq_set,
 	.init		= pxa3xx_cpufreq_init,
+	.exit		= pxa3xx_cpufreq_exit,
 	.get		= pxa3xx_cpufreq_get,
 	.name		= "pxa3xx-cpufreq",
 };
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 03/44] cpufreq: s3cx4xx: call cpufreq_frequency_table_get_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 01/44] cpufreq: Add new helper cpufreq_table_validate_and_show() Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 02/44] cpufreq: pxa: call cpufreq_frequency_table_get_attr() Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 04/44] cpufreq: sparc: " Viresh Kumar
                   ` (40 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

This exposes frequency table of driver to cpufreq core and is required for core
to guess what the index for a target frequency is, when it calls
cpufreq_frequency_table_target(). And so this driver needs to expose it.

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/s3c24xx-cpufreq.c | 4 +++-
 drivers/cpufreq/s3c64xx-cpufreq.c | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index b0f343f..f2c872c 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -386,8 +386,10 @@ static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 	/* feed the latency information from the cpu driver */
 	policy->cpuinfo.transition_latency = cpu_cur.info->latency;
 
-	if (ftab)
+	if (ftab) {
 		cpufreq_frequency_table_cpuinfo(policy, ftab);
+		cpufreq_frequency_table_get_attr(ftab, policy->cpu);
+	}
 
 	return 0;
 }
diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c
index 8a72b0c..9024043 100644
--- a/drivers/cpufreq/s3c64xx-cpufreq.c
+++ b/drivers/cpufreq/s3c64xx-cpufreq.c
@@ -257,6 +257,9 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
 		       ret);
 		regulator_put(vddarm);
 		clk_put(armclk);
+	} else {
+		cpufreq_frequency_table_get_attr(s3c64xx_freq_table,
+				policy->cpu);
 	}
 
 	return ret;
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 04/44] cpufreq: sparc: call cpufreq_frequency_table_get_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (2 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 03/44] cpufreq: s3cx4xx: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 05/44] cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show() Viresh Kumar
                   ` (39 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

This exposes frequency table of driver to cpufreq core and is required for core
to guess what the index for a target frequency is, when it calls
cpufreq_frequency_table_target(). And so this driver needs to expose it.

Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sparc-us2e-cpufreq.c | 10 ++++++++--
 drivers/cpufreq/sparc-us3-cpufreq.c  | 11 +++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
index cf5bc2c..63b3eae 100644
--- a/drivers/cpufreq/sparc-us2e-cpufreq.c
+++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
@@ -307,6 +307,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
 	unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
 	struct cpufreq_frequency_table *table =
 		&us2e_freq_table[cpu].table[0];
+	int ret;
 
 	table[0].driver_data = 0;
 	table[0].frequency = clock_tick / 1;
@@ -324,13 +325,18 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 0;
 	policy->cur = clock_tick;
 
-	return cpufreq_frequency_table_cpuinfo(policy, table);
+	ret = cpufreq_frequency_table_cpuinfo(policy, table);
+	if (!ret)
+		cpufreq_frequency_table_get_attr(table, policy->cpu);
+	return ret;
 }
 
 static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
 {
-	if (cpufreq_us2e_driver)
+	if (cpufreq_us2e_driver) {
+		cpufreq_frequency_table_put_attr(policy->cpu);
 		us2e_set_cpu_divider_index(policy, 0);
+	}
 
 	return 0;
 }
diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c
index ac76b48..985bc56 100644
--- a/drivers/cpufreq/sparc-us3-cpufreq.c
+++ b/drivers/cpufreq/sparc-us3-cpufreq.c
@@ -168,6 +168,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
 	unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
 	struct cpufreq_frequency_table *table =
 		&us3_freq_table[cpu].table[0];
+	int ret;
 
 	table[0].driver_data = 0;
 	table[0].frequency = clock_tick / 1;
@@ -181,13 +182,19 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 0;
 	policy->cur = clock_tick;
 
-	return cpufreq_frequency_table_cpuinfo(policy, table);
+	ret = cpufreq_frequency_table_cpuinfo(policy, table);
+	if (!ret)
+		cpufreq_frequency_table_get_attr(table, policy->cpu);
+
+	return ret;
 }
 
 static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
 {
-	if (cpufreq_us3_driver)
+	if (cpufreq_us3_driver) {
+		cpufreq_frequency_table_put_attr(policy->cpu);
 		us3_set_cpu_divider_index(policy, 0);
+	}
 
 	return 0;
 }
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 05/44] cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (3 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 04/44] cpufreq: sparc: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 06/44] cpufreq: arm_big_little: " Viresh Kumar
                   ` (38 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/acpi-cpufreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index a1260b4..71f8e15 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -837,7 +837,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
 	perf->state = 0;
 
-	result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table);
+	result = cpufreq_table_validate_and_show(policy, data->freq_table);
 	if (result)
 		goto err_freqfree;
 
@@ -868,8 +868,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 			(u32) perf->states[i].power,
 			(u32) perf->states[i].transition_latency);
 
-	cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
-
 	/*
 	 * the first call to ->target() should result in us actually
 	 * writing something to the appropriate registers.
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 06/44] cpufreq: arm_big_little: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (4 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 05/44] cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show() Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 07/44] cpufreq: blackfin: " Viresh Kumar
                   ` (37 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/arm_big_little.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 3549f07..5070273 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -165,7 +165,7 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
 	if (ret)
 		return ret;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, freq_table[cur_cluster]);
+	ret = cpufreq_table_validate_and_show(policy, freq_table[cur_cluster]);
 	if (ret) {
 		dev_err(cpu_dev, "CPU %d, cluster: %d invalid freq table\n",
 				policy->cpu, cur_cluster);
@@ -173,8 +173,6 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
-	cpufreq_frequency_table_get_attr(freq_table[cur_cluster], policy->cpu);
-
 	if (arm_bL_ops->get_transition_latency)
 		policy->cpuinfo.transition_latency =
 			arm_bL_ops->get_transition_latency(cpu_dev);
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 07/44] cpufreq: blackfin: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (5 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 06/44] cpufreq: arm_big_little: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 08/44] cpufreq: cpufreq-cpu0: " Viresh Kumar
                   ` (36 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Steven Miao <realmz6@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/blackfin-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cpufreq/blackfin-cpufreq.c b/drivers/cpufreq/blackfin-cpufreq.c
index ef05978..54c0a0c 100644
--- a/drivers/cpufreq/blackfin-cpufreq.c
+++ b/drivers/cpufreq/blackfin-cpufreq.c
@@ -210,8 +210,7 @@ static int __bfin_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 50000; /* 50us assumed */
 
 	policy->cur = cclk;
-	cpufreq_frequency_table_get_attr(bfin_freq_table, policy->cpu);
-	return cpufreq_frequency_table_cpuinfo(policy, bfin_freq_table);
+	return cpufreq_table_validate_and_show(policy, bfin_freq_table);
 }
 
 static struct freq_attr *bfin_freq_attr[] = {
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 08/44] cpufreq: cpufreq-cpu0: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (6 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 07/44] cpufreq: blackfin: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 09/44] cpufreq: cris: " Viresh Kumar
                   ` (35 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq-cpu0.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index cbfffa9..ce4fa47 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -128,7 +128,7 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
 {
 	int ret;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+	ret = cpufreq_table_validate_and_show(policy, freq_table);
 	if (ret) {
 		pr_err("invalid frequency table: %d\n", ret);
 		return ret;
@@ -144,8 +144,6 @@ static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
 	 */
 	cpumask_setall(policy->cpus);
 
-	cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
-
 	return 0;
 }
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 09/44] cpufreq: cris: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (7 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 08/44] cpufreq: cpufreq-cpu0: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 10/44] cpufreq: davinci: " Viresh Kumar
                   ` (34 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-cris-kernel@axis.com
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cris-artpec3-cpufreq.c | 10 +---------
 drivers/cpufreq/cris-etraxfs-cpufreq.c | 10 +---------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/cpufreq/cris-artpec3-cpufreq.c b/drivers/cpufreq/cris-artpec3-cpufreq.c
index cb8276d..444fd96 100644
--- a/drivers/cpufreq/cris-artpec3-cpufreq.c
+++ b/drivers/cpufreq/cris-artpec3-cpufreq.c
@@ -76,19 +76,11 @@ static int cris_freq_target(struct cpufreq_policy *policy,
 
 static int cris_freq_cpu_init(struct cpufreq_policy *policy)
 {
-	int result;
-
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 1000000; /* 1ms */
 	policy->cur = cris_freq_get_cpu_frequency(0);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table);
-	if (result)
-		return (result);
-
-	cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, cris_freq_table);
 }
 
 
diff --git a/drivers/cpufreq/cris-etraxfs-cpufreq.c b/drivers/cpufreq/cris-etraxfs-cpufreq.c
index 72328f7..428395e 100644
--- a/drivers/cpufreq/cris-etraxfs-cpufreq.c
+++ b/drivers/cpufreq/cris-etraxfs-cpufreq.c
@@ -75,19 +75,11 @@ static int cris_freq_target(struct cpufreq_policy *policy,
 
 static int cris_freq_cpu_init(struct cpufreq_policy *policy)
 {
-	int result;
-
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 1000000;	/* 1ms */
 	policy->cur = cris_freq_get_cpu_frequency(0);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table);
-	if (result)
-		return (result);
-
-	cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, cris_freq_table);
 }
 
 static int cris_freq_cpu_exit(struct cpufreq_policy *policy)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 10/44] cpufreq: davinci: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (8 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 09/44] cpufreq: cris: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 11/44] cpufreq: dbx500: " Viresh Kumar
                   ` (33 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/davinci-cpufreq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c
index 551dd65..f67196e 100644
--- a/drivers/cpufreq/davinci-cpufreq.c
+++ b/drivers/cpufreq/davinci-cpufreq.c
@@ -140,15 +140,13 @@ static int davinci_cpu_init(struct cpufreq_policy *policy)
 
 	policy->cur = davinci_getspeed(0);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+	result = cpufreq_table_validate_and_show(policy, freq_table);
 	if (result) {
-		pr_err("%s: cpufreq_frequency_table_cpuinfo() failed",
+		pr_err("%s: cpufreq_table_validate_and_show() failed",
 				__func__);
 		return result;
 	}
 
-	cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
-
 	/*
 	 * Time measurement across the target() function yields ~1500-1800us
 	 * time taken with no drivers on notification list.
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 11/44] cpufreq: dbx500: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (9 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 10/44] cpufreq: davinci: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 12/44] cpufreq: e_powersaver: " Viresh Kumar
                   ` (32 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/dbx500-cpufreq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 26321cd..8a484e9 100644
--- a/drivers/cpufreq/dbx500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -87,10 +87,8 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy)
 	int res;
 
 	/* get policy fields based on the table */
-	res = cpufreq_frequency_table_cpuinfo(policy, freq_table);
-	if (!res)
-		cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
-	else {
+	res = cpufreq_table_validate_and_show(policy, freq_table);
+	if (res) {
 		pr_err("dbx500-cpufreq: Failed to read policy table\n");
 		return res;
 	}
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 12/44] cpufreq: e_powersaver: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (10 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 11/44] cpufreq: dbx500: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 13/44] cpufreq: elanfreq: " Viresh Kumar
                   ` (31 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/e_powersaver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c
index 09f64cc..c1b7c99 100644
--- a/drivers/cpufreq/e_powersaver.c
+++ b/drivers/cpufreq/e_powersaver.c
@@ -403,13 +403,12 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 140000; /* 844mV -> 700mV in ns */
 	policy->cur = fsb * current_multiplier;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, &centaur->freq_table[0]);
+	ret = cpufreq_table_validate_and_show(policy, &centaur->freq_table[0]);
 	if (ret) {
 		kfree(centaur);
 		return ret;
 	}
 
-	cpufreq_frequency_table_get_attr(&centaur->freq_table[0], policy->cpu);
 	return 0;
 }
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 13/44] cpufreq: elanfreq: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (11 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 12/44] cpufreq: e_powersaver: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 14/44] cpufreq: exynos: " Viresh Kumar
                   ` (30 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/elanfreq.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c
index 823a400..4000c34 100644
--- a/drivers/cpufreq/elanfreq.c
+++ b/drivers/cpufreq/elanfreq.c
@@ -202,7 +202,6 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
 {
 	struct cpuinfo_x86 *c = &cpu_data(0);
 	unsigned int i;
-	int result;
 
 	/* capability check */
 	if ((c->x86_vendor != X86_VENDOR_AMD) ||
@@ -223,12 +222,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 	policy->cur = elanfreq_get_cpu_frequency(0);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table);
-	if (result)
-		return result;
-
-	cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu);
-	return 0;
+	return cpufreq_table_validate_and_show(policy, elanfreq_table);
 }
 
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 14/44] cpufreq: exynos: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (12 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 13/44] cpufreq: elanfreq: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 15/44] cpufreq: ia64-acpi: " Viresh Kumar
                   ` (29 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/exynos-cpufreq.c     | 4 +---
 drivers/cpufreq/exynos5440-cpufreq.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 0fac344..954baed 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -249,14 +249,12 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	policy->cur = policy->min = policy->max = exynos_getspeed(policy->cpu);
 
-	cpufreq_frequency_table_get_attr(exynos_info->freq_table, policy->cpu);
-
 	/* set the transition latency value */
 	policy->cpuinfo.transition_latency = 100000;
 
 	cpumask_setall(policy->cpus);
 
-	return cpufreq_frequency_table_cpuinfo(policy, exynos_info->freq_table);
+	return cpufreq_table_validate_and_show(policy, exynos_info->freq_table);
 }
 
 static int exynos_cpufreq_cpu_exit(struct cpufreq_policy *policy)
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index d514c15..cf52759 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -326,7 +326,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	int ret;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, dvfs_info->freq_table);
+	ret = cpufreq_table_validate_and_show(policy, dvfs_info->freq_table);
 	if (ret) {
 		dev_err(dvfs_info->dev, "Invalid frequency table: %d\n", ret);
 		return ret;
@@ -336,8 +336,6 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = dvfs_info->latency;
 	cpumask_setall(policy->cpus);
 
-	cpufreq_frequency_table_get_attr(dvfs_info->freq_table, policy->cpu);
-
 	return 0;
 }
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 15/44] cpufreq: ia64-acpi: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (13 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 14/44] cpufreq: exynos: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 16/44] cpufreq: imx6q: " Viresh Kumar
                   ` (28 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/ia64-acpi-cpufreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c
index 3e14f03..6cfad51 100644
--- a/drivers/cpufreq/ia64-acpi-cpufreq.c
+++ b/drivers/cpufreq/ia64-acpi-cpufreq.c
@@ -335,7 +335,7 @@ acpi_cpufreq_cpu_init (
 		}
 	}
 
-	result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table);
+	result = cpufreq_table_validate_and_show(policy, data->freq_table);
 	if (result) {
 		goto err_freqfree;
 	}
@@ -356,8 +356,6 @@ acpi_cpufreq_cpu_init (
 			(u32) data->acpi_data.states[i].status,
 			(u32) data->acpi_data.states[i].control);
 
-	cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
-
 	/* the first call to ->target() should result in us actually
 	 * writing something to the appropriate registers. */
 	data->resume = 1;
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 16/44] cpufreq: imx6q: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (14 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 15/44] cpufreq: ia64-acpi: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 17/44] cpufreq: kirkwood: " Viresh Kumar
                   ` (27 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/imx6q-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 3e39654..cd9489f 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -160,7 +160,7 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy)
 {
 	int ret;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+	ret = cpufreq_table_validate_and_show(policy, freq_table);
 	if (ret) {
 		dev_err(cpu_dev, "invalid frequency table: %d\n", ret);
 		return ret;
@@ -169,7 +169,6 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = transition_latency;
 	policy->cur = clk_get_rate(arm_clk) / 1000;
 	cpumask_setall(policy->cpus);
-	cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
 
 	return 0;
 }
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 17/44] cpufreq: kirkwood: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (15 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 16/44] cpufreq: imx6q: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 18/44] cpufreq: longhaul: " Viresh Kumar
                   ` (26 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/kirkwood-cpufreq.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c
index ba10658..59cbb35 100644
--- a/drivers/cpufreq/kirkwood-cpufreq.c
+++ b/drivers/cpufreq/kirkwood-cpufreq.c
@@ -125,19 +125,11 @@ static int kirkwood_cpufreq_target(struct cpufreq_policy *policy,
 /* Module init and exit code */
 static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-	int result;
-
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.transition_latency = 5000; /* 5uS */
 	policy->cur = kirkwood_cpufreq_get_cpu_frequency(0);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, kirkwood_freq_table);
-	if (result)
-		return result;
-
-	cpufreq_frequency_table_get_attr(kirkwood_freq_table, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, kirkwood_freq_table);
 }
 
 static int kirkwood_cpufreq_cpu_exit(struct cpufreq_policy *policy)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 18/44] cpufreq: longhaul: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (16 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 17/44] cpufreq: kirkwood: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 19/44] cpufreq: loongson2: " Viresh Kumar
                   ` (25 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/longhaul.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 4ada1cc..70b66fd 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -921,13 +921,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 200000;	/* nsec */
 	policy->cur = calc_speed(longhaul_get_cpu_mult());
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
-	if (ret)
-		return ret;
-
-	cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, longhaul_table);
 }
 
 static int longhaul_cpu_exit(struct cpufreq_policy *policy)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 19/44] cpufreq: loongson2: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (17 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 18/44] cpufreq: longhaul: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 20/44] cpufreq: maple: " Viresh Kumar
                   ` (24 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/loongson2_cpufreq.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c
index 7bc3c44..5dd3692 100644
--- a/drivers/cpufreq/loongson2_cpufreq.c
+++ b/drivers/cpufreq/loongson2_cpufreq.c
@@ -133,10 +133,7 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
 	policy->cur = loongson2_cpufreq_get(policy->cpu);
 
-	cpufreq_frequency_table_get_attr(&loongson2_clockmod_table[0],
-					 policy->cpu);
-
-	return cpufreq_frequency_table_cpuinfo(policy,
+	return cpufreq_table_validate_and_show(policy,
 					    &loongson2_clockmod_table[0]);
 }
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 20/44] cpufreq: maple: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (18 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 19/44] cpufreq: loongson2: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 21/44] cpufreq: omap: " Viresh Kumar
                   ` (23 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/maple-cpufreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c
index 6168d77..b3fb661 100644
--- a/drivers/cpufreq/maple-cpufreq.c
+++ b/drivers/cpufreq/maple-cpufreq.c
@@ -181,10 +181,8 @@ static int maple_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	 * cpufreq core if in the secondary policy we tell it that
 	 * it actually must be one policy together with all others. */
 	cpumask_setall(policy->cpus);
-	cpufreq_frequency_table_get_attr(maple_cpu_freqs, policy->cpu);
 
-	return cpufreq_frequency_table_cpuinfo(policy,
-		maple_cpu_freqs);
+	return cpufreq_table_validate_and_show(policy, maple_cpu_freqs);
 }
 
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 21/44] cpufreq: omap: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (19 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 20/44] cpufreq: maple: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 22/44] cpufreq: p4-clockmod: " Viresh Kumar
                   ` (22 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/omap-cpufreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index f31fcfc..b68ce4e 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -191,12 +191,10 @@ static int omap_cpu_init(struct cpufreq_policy *policy)
 
 	atomic_inc_return(&freq_table_users);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+	result = cpufreq_table_validate_and_show(policy, freq_table);
 	if (result)
 		goto fail_table;
 
-	cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
-
 	policy->cur = omap_getspeed(policy->cpu);
 
 	/*
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 22/44] cpufreq: p4-clockmod: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (20 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 21/44] cpufreq: omap: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 23/44] cpufreq: pasemi: " Viresh Kumar
                   ` (21 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/p4-clockmod.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c
index 2f0a2a6..03478bf 100644
--- a/drivers/cpufreq/p4-clockmod.c
+++ b/drivers/cpufreq/p4-clockmod.c
@@ -230,7 +230,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
 		else
 			p4clockmod_table[i].frequency = (stock_freq * i)/8;
 	}
-	cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu);
 
 	/* cpuinfo and default policy values */
 
@@ -239,7 +238,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 10000001;
 	policy->cur = stock_freq;
 
-	return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]);
+	return cpufreq_table_validate_and_show(policy, &p4clockmod_table[0]);
 }
 
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 23/44] cpufreq: pasemi: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (21 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 22/44] cpufreq: p4-clockmod: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 24/44] cpufreq: pmac: " Viresh Kumar
                   ` (20 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/pasemi-cpufreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c
index 534e43a..23bc8a82 100644
--- a/drivers/cpufreq/pasemi-cpufreq.c
+++ b/drivers/cpufreq/pasemi-cpufreq.c
@@ -219,12 +219,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
 	ppc_proc_freq = policy->cur * 1000ul;
 
-	cpufreq_frequency_table_get_attr(pas_freqs, policy->cpu);
-
 	/* this ensures that policy->cpuinfo_min and policy->cpuinfo_max
 	 * are set correctly
 	 */
-	return cpufreq_frequency_table_cpuinfo(policy, pas_freqs);
+	return cpufreq_table_validate_and_show(policy, pas_freqs);
 
 out_unmap_sdcpwr:
 	iounmap(sdcpwr_mapbase);
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 24/44] cpufreq: pmac: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (22 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 23/44] cpufreq: pasemi: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 25/44] cpufreq: powernow: " Viresh Kumar
                   ` (19 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/pmac32-cpufreq.c | 3 +--
 drivers/cpufreq/pmac64-cpufreq.c | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index a096cd3..470b555 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -408,8 +408,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency	= transition_latency;
 	policy->cur = cur_freq;
 
-	cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu);
-	return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
+	return cpufreq_table_validate_and_show(policy, pmac_cpu_freqs);
 }
 
 static u32 read_gpio(struct device_node *np)
diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c
index 3a51ad7..41fa89e 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -363,10 +363,8 @@ static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	 * cpufreq core if in the secondary policy we tell it that
 	 * it actually must be one policy together with all others. */
 	cpumask_copy(policy->cpus, cpu_online_mask);
-	cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
 
-	return cpufreq_frequency_table_cpuinfo(policy,
-		g5_cpu_freqs);
+	return cpufreq_table_validate_and_show(policy, g5_cpu_freqs);
 }
 
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 25/44] cpufreq: powernow: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (23 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 24/44] cpufreq: pmac: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 26/44] cpufreq: ppc: " Viresh Kumar
                   ` (18 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/powernow-k6.c | 9 +--------
 drivers/cpufreq/powernow-k7.c | 4 +---
 drivers/cpufreq/powernow-k8.c | 4 +---
 3 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c
index 85f1c8c..ab1de0d 100644
--- a/drivers/cpufreq/powernow-k6.c
+++ b/drivers/cpufreq/powernow-k6.c
@@ -145,7 +145,6 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
 static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
 {
 	unsigned int i, f;
-	int result;
 
 	if (policy->cpu != 0)
 		return -ENODEV;
@@ -167,13 +166,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 200000;
 	policy->cur = busfreq * max_multiplier;
 
-	result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio);
-	if (result)
-		return result;
-
-	cpufreq_frequency_table_get_attr(clock_ratio, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, clock_ratio);
 }
 
 
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index 14ce480..c863c13 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -680,9 +680,7 @@ static int powernow_cpu_init(struct cpufreq_policy *policy)
 
 	policy->cur = powernow_get(0);
 
-	cpufreq_frequency_table_get_attr(powernow_table, policy->cpu);
-
-	return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
+	return cpufreq_table_validate_and_show(policy, powernow_table);
 }
 
 static int powernow_cpu_exit(struct cpufreq_policy *policy)
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 2344a9e..8d4114a 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1156,7 +1156,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
 	pr_debug("policy current frequency %d kHz\n", pol->cur);
 
 	/* min/max the cpu is capable of */
-	if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) {
+	if (cpufreq_table_validate_and_show(pol, data->powernow_table)) {
 		printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n");
 		powernow_k8_cpu_exit_acpi(data);
 		kfree(data->powernow_table);
@@ -1164,8 +1164,6 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
 		return -EINVAL;
 	}
 
-	cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
-
 	pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n",
 		 data->currfid, data->currvid);
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 26/44] cpufreq: ppc: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (24 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 25/44] cpufreq: powernow: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 27/44] cpufreq: pxa: " Viresh Kumar
                   ` (17 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/ppc-corenet-cpufreq.c | 3 +--
 drivers/cpufreq/ppc_cbe_cpufreq.c     | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c
index 60e81d5..5716b44 100644
--- a/drivers/cpufreq/ppc-corenet-cpufreq.c
+++ b/drivers/cpufreq/ppc-corenet-cpufreq.c
@@ -202,7 +202,7 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	table[i].frequency = CPUFREQ_TABLE_END;
 
 	/* set the min and max frequency properly */
-	ret = cpufreq_frequency_table_cpuinfo(policy, table);
+	ret = cpufreq_table_validate_and_show(policy, table);
 	if (ret) {
 		pr_err("invalid frequency table: %d\n", ret);
 		goto err_nomem1;
@@ -219,7 +219,6 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 	policy->cur = corenet_cpufreq_get_speed(policy->cpu);
 
-	cpufreq_frequency_table_get_attr(table, cpu);
 	of_node_put(np);
 
 	return 0;
diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c
index 2e448f0..6c5be63 100644
--- a/drivers/cpufreq/ppc_cbe_cpufreq.c
+++ b/drivers/cpufreq/ppc_cbe_cpufreq.c
@@ -123,11 +123,9 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	cpumask_copy(policy->cpus, cpu_sibling_mask(policy->cpu));
 #endif
 
-	cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
-
 	/* this ensures that policy->cpuinfo_min
 	 * and policy->cpuinfo_max are set correctly */
-	return cpufreq_frequency_table_cpuinfo(policy, cbe_freqs);
+	return cpufreq_table_validate_and_show(policy, cbe_freqs);
 }
 
 static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 27/44] cpufreq: pxa: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (25 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 26/44] cpufreq: ppc: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 28/44] cpufreq: s3cx4xx: " Viresh Kumar
                   ` (16 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/pxa2xx-cpufreq.c | 6 ++----
 drivers/cpufreq/pxa3xx-cpufreq.c | 8 ++------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
index b004cf1..236531a 100644
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -454,12 +454,10 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy)
 		pr_info("PXA255 cpufreq using %s frequency table\n",
 			pxa255_turbo_table ? "turbo" : "run");
 
-		cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table);
-		cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu);
+		cpufreq_table_validate_and_show(policy, pxa255_freq_table);
 	}
 	else if (cpu_is_pxa27x()) {
-		cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table);
-		cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu);
+		cpufreq_table_validate_and_show(policy, pxa27x_freq_table);
 	}
 
 	printk(KERN_INFO "PXA CPU frequency change support initialized\n");
diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c
index cebbed1..65fd01e 100644
--- a/drivers/cpufreq/pxa3xx-cpufreq.c
+++ b/drivers/cpufreq/pxa3xx-cpufreq.c
@@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy,
 			     struct pxa3xx_freq_info *freqs, int num)
 {
 	struct cpufreq_frequency_table *table;
-	int i, ret;
+	int i;
 
 	table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL);
 	if (table == NULL)
@@ -108,11 +108,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy,
 	pxa3xx_freqs_num = num;
 	pxa3xx_freqs_table = table;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, table);
-	if (!ret)
-		cpufreq_frequency_table_get_attr(table, policy->cpu);
-
-	return ret;
+	return cpufreq_table_validate_and_show(policy, table);
 }
 
 static void __update_core_freq(struct pxa3xx_freq_info *info)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 28/44] cpufreq: s3cx4xx: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (26 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 27/44] cpufreq: pxa: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 29/44] cpufreq: s5pv210: " Viresh Kumar
                   ` (15 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/s3c2416-cpufreq.c | 4 +---
 drivers/cpufreq/s3c24xx-cpufreq.c | 6 ++----
 drivers/cpufreq/s3c64xx-cpufreq.c | 5 +----
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/cpufreq/s3c2416-cpufreq.c b/drivers/cpufreq/s3c2416-cpufreq.c
index 22dcb81..a7a4c61 100644
--- a/drivers/cpufreq/s3c2416-cpufreq.c
+++ b/drivers/cpufreq/s3c2416-cpufreq.c
@@ -494,12 +494,10 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = (500 * 1000) +
 					     s3c_freq->regulator_latency;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, s3c_freq->freq_table);
+	ret = cpufreq_table_validate_and_show(policy, s3c_freq->freq_table);
 	if (ret)
 		goto err_freq_table;
 
-	cpufreq_frequency_table_get_attr(s3c_freq->freq_table, 0);
-
 	register_reboot_notifier(&s3c2416_cpufreq_reboot_notifier);
 
 	return 0;
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index f2c872c..73856d1 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -386,10 +386,8 @@ static int s3c_cpufreq_init(struct cpufreq_policy *policy)
 	/* feed the latency information from the cpu driver */
 	policy->cpuinfo.transition_latency = cpu_cur.info->latency;
 
-	if (ftab) {
-		cpufreq_frequency_table_cpuinfo(policy, ftab);
-		cpufreq_frequency_table_get_attr(ftab, policy->cpu);
-	}
+	if (ftab)
+		return cpufreq_table_validate_and_show(policy, ftab);
 
 	return 0;
 }
diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c
index 9024043..872f74d 100644
--- a/drivers/cpufreq/s3c64xx-cpufreq.c
+++ b/drivers/cpufreq/s3c64xx-cpufreq.c
@@ -251,15 +251,12 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
 	 */
 	policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table);
+	ret = cpufreq_table_validate_and_show(policy, s3c64xx_freq_table);
 	if (ret != 0) {
 		pr_err("Failed to configure frequency table: %d\n",
 		       ret);
 		regulator_put(vddarm);
 		clk_put(armclk);
-	} else {
-		cpufreq_frequency_table_get_attr(s3c64xx_freq_table,
-				policy->cpu);
 	}
 
 	return ret;
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 29/44] cpufreq: s5pv210: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (27 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 28/44] cpufreq: s3cx4xx: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 30/44] cpufreq: sa11x0: Expose frequency table Viresh Kumar
                   ` (14 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/s5pv210-cpufreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index 5c77570..c266a7e 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -553,11 +553,9 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy)
 
 	policy->cur = policy->min = policy->max = s5pv210_getspeed(0);
 
-	cpufreq_frequency_table_get_attr(s5pv210_freq_table, policy->cpu);
-
 	policy->cpuinfo.transition_latency = 40000;
 
-	return cpufreq_frequency_table_cpuinfo(policy, s5pv210_freq_table);
+	return cpufreq_table_validate_and_show(policy, s5pv210_freq_table);
 
 out_dmc1:
 	clk_put(dmc0_clk);
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 30/44] cpufreq: sa11x0: Expose frequency table
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (28 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 29/44] cpufreq: s5pv210: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 31/44] cpufreq: sa11x0: let cpufreq core initialize struct policy fields Viresh Kumar
                   ` (13 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

This patch exposes sa11x0's frequency table to cpufreq core. It always existed
but not as an array frequencies and not in the format cpufreq core wants it to.
Also it was present in the unit of 100kHz earlier which is made consistent with
cpufreq core now, i.e. kHz.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 arch/arm/mach-sa1100/generic.c   | 45 ++++++++++++++++++++--------------------
 arch/arm/mach-sa1100/generic.h   |  1 +
 drivers/cpufreq/sa1100-cpufreq.c |  3 ++-
 drivers/cpufreq/sa1110-cpufreq.c |  3 ++-
 4 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index f25b611..5c8167b 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -42,23 +42,24 @@ EXPORT_SYMBOL(reset_status);
 /*
  * This table is setup for a 3.6864MHz Crystal.
  */
-static const unsigned short cclk_frequency_100khz[NR_FREQS] = {
-	 590,	/*  59.0 MHz */
-	 737,	/*  73.7 MHz */
-	 885,	/*  88.5 MHz */
-	1032,	/* 103.2 MHz */
-	1180,	/* 118.0 MHz */
-	1327,	/* 132.7 MHz */
-	1475,	/* 147.5 MHz */
-	1622,	/* 162.2 MHz */
-	1769,	/* 176.9 MHz */
-	1917,	/* 191.7 MHz */
-	2064,	/* 206.4 MHz */
-	2212,	/* 221.2 MHz */
-	2359,	/* 235.9 MHz */
-	2507,	/* 250.7 MHz */
-	2654,	/* 265.4 MHz */
-	2802	/* 280.2 MHz */
+struct cpufreq_frequency_table sa11x0_freq_table[NR_FREQS+1] = {
+	{ .frequency = 59000,	/*  59.0 MHz */},
+	{ .frequency = 73700,	/*  73.7 MHz */},
+	{ .frequency = 88500,	/*  88.5 MHz */},
+	{ .frequency = 103200,	/* 103.2 MHz */},
+	{ .frequency = 118000,	/* 118.0 MHz */},
+	{ .frequency = 132700,	/* 132.7 MHz */},
+	{ .frequency = 147500,	/* 147.5 MHz */},
+	{ .frequency = 162200,	/* 162.2 MHz */},
+	{ .frequency = 176900,	/* 176.9 MHz */},
+	{ .frequency = 191700,	/* 191.7 MHz */},
+	{ .frequency = 206400,	/* 206.4 MHz */},
+	{ .frequency = 221200,	/* 221.2 MHz */},
+	{ .frequency = 235900,	/* 235.9 MHz */},
+	{ .frequency = 250700,	/* 250.7 MHz */},
+	{ .frequency = 265400,	/* 265.4 MHz */},
+	{ .frequency = 280200,	/* 280.2 MHz */},
+	{ .frequency = CPUFREQ_TABLE_END, },
 };
 
 /* rounds up(!)  */
@@ -66,10 +67,8 @@ unsigned int sa11x0_freq_to_ppcr(unsigned int khz)
 {
 	int i;
 
-	khz /= 100;
-
 	for (i = 0; i < NR_FREQS; i++)
-		if (cclk_frequency_100khz[i] >= khz)
+		if (sa11x0_freq_table[i].frequency >= khz)
 			break;
 
 	return i;
@@ -79,7 +78,7 @@ unsigned int sa11x0_ppcr_to_freq(unsigned int idx)
 {
 	unsigned int freq = 0;
 	if (idx < NR_FREQS)
-		freq = cclk_frequency_100khz[idx] * 100;
+		freq = sa11x0_freq_table[idx].frequency;
 	return freq;
 }
 
@@ -96,7 +95,7 @@ int sa11x0_verify_speed(struct cpufreq_policy *policy)
 	cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
 
 	/* make sure that at least one frequency is within the policy */
-	tmp = cclk_frequency_100khz[sa11x0_freq_to_ppcr(policy->min)] * 100;
+	tmp = sa11x0_freq_table[sa11x0_freq_to_ppcr(policy->min)].frequency;
 	if (tmp > policy->max)
 		policy->max = tmp;
 
@@ -109,7 +108,7 @@ unsigned int sa11x0_getspeed(unsigned int cpu)
 {
 	if (cpu)
 		return 0;
-	return cclk_frequency_100khz[PPCR & 0xf] * 100;
+	return sa11x0_freq_table[PPCR & 0xf].frequency;
 }
 
 /*
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 9a33695..f5214ce 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -21,6 +21,7 @@ extern void sa1110_mb_disable(void);
 
 struct cpufreq_policy;
 
+extern struct cpufreq_frequency_table sa11x0_freq_table[];
 extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz);
 extern int sa11x0_verify_speed(struct cpufreq_policy *policy);
 extern unsigned int sa11x0_getspeed(unsigned int cpu);
diff --git a/drivers/cpufreq/sa1100-cpufreq.c b/drivers/cpufreq/sa1100-cpufreq.c
index cff18e8..1323a69 100644
--- a/drivers/cpufreq/sa1100-cpufreq.c
+++ b/drivers/cpufreq/sa1100-cpufreq.c
@@ -224,7 +224,8 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.min_freq = 59000;
 	policy->cpuinfo.max_freq = 287000;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	return 0;
+
+	return cpufreq_table_validate_and_show(policy, sa11x0_freq_table);
 }
 
 static struct cpufreq_driver sa1100_driver __refdata = {
diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c
index 39c90b6..adb0524 100644
--- a/drivers/cpufreq/sa1110-cpufreq.c
+++ b/drivers/cpufreq/sa1110-cpufreq.c
@@ -338,7 +338,8 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.min_freq = 59000;
 	policy->cpuinfo.max_freq = 287000;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	return 0;
+
+	return cpufreq_table_validate_and_show(policy, sa11x0_freq_table);
 }
 
 /* sa1110_driver needs __refdata because it must remain after init registers
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 31/44] cpufreq: sa11x0: let cpufreq core initialize struct policy fields
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (29 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 30/44] cpufreq: sa11x0: Expose frequency table Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 32/44] cpufreq: sc520: use cpufreq_table_validate_and_show() Viresh Kumar
                   ` (12 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Many fields of struct policy are filled by cpufreq core when we call
cpufreq_table_validate_and_show() and so cpufreq driver doesn't need to set them
anymore.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sa1100-cpufreq.c | 4 +---
 drivers/cpufreq/sa1110-cpufreq.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/sa1100-cpufreq.c b/drivers/cpufreq/sa1100-cpufreq.c
index 1323a69..37fce2f 100644
--- a/drivers/cpufreq/sa1100-cpufreq.c
+++ b/drivers/cpufreq/sa1100-cpufreq.c
@@ -220,9 +220,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
-	policy->cpuinfo.min_freq = 59000;
-	policy->cpuinfo.max_freq = 287000;
+	policy->cur = sa11x0_getspeed(0);
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 
 	return cpufreq_table_validate_and_show(policy, sa11x0_freq_table);
diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c
index adb0524..13760fc 100644
--- a/drivers/cpufreq/sa1110-cpufreq.c
+++ b/drivers/cpufreq/sa1110-cpufreq.c
@@ -334,9 +334,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
-	policy->cpuinfo.min_freq = 59000;
-	policy->cpuinfo.max_freq = 287000;
+	policy->cur = sa11x0_getspeed(0);
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 
 	return cpufreq_table_validate_and_show(policy, sa11x0_freq_table);
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 32/44] cpufreq: sc520: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (30 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 31/44] cpufreq: sa11x0: let cpufreq core initialize struct policy fields Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 33/44] cpufreq: sh: " Viresh Kumar
                   ` (11 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sc520_freq.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c
index d6f6c6f..bb9c0de 100644
--- a/drivers/cpufreq/sc520_freq.c
+++ b/drivers/cpufreq/sc520_freq.c
@@ -106,7 +106,6 @@ static int sc520_freq_target(struct cpufreq_policy *policy,
 static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
 {
 	struct cpuinfo_x86 *c = &cpu_data(0);
-	int result;
 
 	/* capability check */
 	if (c->x86_vendor != X86_VENDOR_AMD ||
@@ -117,13 +116,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 1000000; /* 1ms */
 	policy->cur = sc520_freq_get_cpu_frequency(0);
 
-	result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table);
-	if (result)
-		return result;
-
-	cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, sc520_freq_table);
 }
 
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 33/44] cpufreq: sh: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (31 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 32/44] cpufreq: sc520: use cpufreq_table_validate_and_show() Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 34/44] cpufreq: sparc: " Viresh Kumar
                   ` (10 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sh-cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c
index ffc6d24..1362e88 100644
--- a/drivers/cpufreq/sh-cpufreq.c
+++ b/drivers/cpufreq/sh-cpufreq.c
@@ -120,9 +120,9 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	if (freq_table) {
 		int result;
 
-		result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
-		if (!result)
-			cpufreq_frequency_table_get_attr(freq_table, cpu);
+		result = cpufreq_table_validate_and_show(policy, freq_table);
+		if (result)
+			return result;
 	} else {
 		dev_notice(dev, "no frequency table found, falling back "
 			   "to rate rounding.\n");
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 34/44] cpufreq: sparc: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (32 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 33/44] cpufreq: sh: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 35/44] cpufreq: spear: " Viresh Kumar
                   ` (9 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sparc-us2e-cpufreq.c | 6 +-----
 drivers/cpufreq/sparc-us3-cpufreq.c  | 7 +------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
index 63b3eae..8db0c18 100644
--- a/drivers/cpufreq/sparc-us2e-cpufreq.c
+++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
@@ -307,7 +307,6 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
 	unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
 	struct cpufreq_frequency_table *table =
 		&us2e_freq_table[cpu].table[0];
-	int ret;
 
 	table[0].driver_data = 0;
 	table[0].frequency = clock_tick / 1;
@@ -325,10 +324,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 0;
 	policy->cur = clock_tick;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, table);
-	if (!ret)
-		cpufreq_frequency_table_get_attr(table, policy->cpu);
-	return ret;
+	return cpufreq_table_validate_and_show(policy, table);
 }
 
 static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c
index 985bc56..120a2df 100644
--- a/drivers/cpufreq/sparc-us3-cpufreq.c
+++ b/drivers/cpufreq/sparc-us3-cpufreq.c
@@ -168,7 +168,6 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
 	unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
 	struct cpufreq_frequency_table *table =
 		&us3_freq_table[cpu].table[0];
-	int ret;
 
 	table[0].driver_data = 0;
 	table[0].frequency = clock_tick / 1;
@@ -182,11 +181,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = 0;
 	policy->cur = clock_tick;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, table);
-	if (!ret)
-		cpufreq_frequency_table_get_attr(table, policy->cpu);
-
-	return ret;
+	return cpufreq_table_validate_and_show(policy, table);
 }
 
 static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 35/44] cpufreq: spear: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (33 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 34/44] cpufreq: sparc: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 36/44] cpufreq: speedstep: " Viresh Kumar
                   ` (8 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: spear-devel@list.st.com
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/spear-cpufreq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
index 19e364fa..b86be6b 100644
--- a/drivers/cpufreq/spear-cpufreq.c
+++ b/drivers/cpufreq/spear-cpufreq.c
@@ -178,13 +178,12 @@ static int spear_cpufreq_init(struct cpufreq_policy *policy)
 {
 	int ret;
 
-	ret = cpufreq_frequency_table_cpuinfo(policy, spear_cpufreq.freq_tbl);
+	ret = cpufreq_table_validate_and_show(policy, spear_cpufreq.freq_tbl);
 	if (ret) {
-		pr_err("cpufreq_frequency_table_cpuinfo() failed");
+		pr_err("cpufreq_table_validate_and_show() failed");
 		return ret;
 	}
 
-	cpufreq_frequency_table_get_attr(spear_cpufreq.freq_tbl, policy->cpu);
 	policy->cpuinfo.transition_latency = spear_cpufreq.transition_latency;
 	policy->cur = spear_cpufreq_get(0);
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 36/44] cpufreq: speedstep: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (34 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 35/44] cpufreq: spear: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 37/44] cpufreq: tegra: " Viresh Kumar
                   ` (7 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/speedstep-centrino.c | 10 +---------
 drivers/cpufreq/speedstep-ich.c      |  9 +--------
 drivers/cpufreq/speedstep-smi.c      |  8 +-------
 3 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c
index f897d51..f180561 100644
--- a/drivers/cpufreq/speedstep-centrino.c
+++ b/drivers/cpufreq/speedstep-centrino.c
@@ -345,7 +345,6 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
 	struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu);
 	unsigned freq;
 	unsigned l, h;
-	int ret;
 	int i;
 
 	/* Only Intel makes Enhanced Speedstep-capable CPUs */
@@ -402,15 +401,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
 
 	pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
 
-	ret = cpufreq_frequency_table_cpuinfo(policy,
+	return cpufreq_table_validate_and_show(policy,
 		per_cpu(centrino_model, policy->cpu)->op_points);
-	if (ret)
-		return (ret);
-
-	cpufreq_frequency_table_get_attr(
-		per_cpu(centrino_model, policy->cpu)->op_points, policy->cpu);
-
-	return 0;
 }
 
 static int centrino_cpu_exit(struct cpufreq_policy *policy)
diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c
index 5355abb..86a184e 100644
--- a/drivers/cpufreq/speedstep-ich.c
+++ b/drivers/cpufreq/speedstep-ich.c
@@ -320,7 +320,6 @@ static void get_freqs_on_cpu(void *_get_freqs)
 
 static int speedstep_cpu_init(struct cpufreq_policy *policy)
 {
-	int result;
 	unsigned int policy_cpu, speed;
 	struct get_freqs gf;
 
@@ -349,13 +348,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 	/* cpuinfo and default policy values */
 	policy->cur = speed;
 
-	result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
-	if (result)
-		return result;
-
-	cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, speedstep_freqs);
 }
 
 
diff --git a/drivers/cpufreq/speedstep-smi.c b/drivers/cpufreq/speedstep-smi.c
index abfba4f..f4d0318 100644
--- a/drivers/cpufreq/speedstep-smi.c
+++ b/drivers/cpufreq/speedstep-smi.c
@@ -329,13 +329,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 	policy->cur = speed;
 
-	result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
-	if (result)
-		return result;
-
-	cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
-
-	return 0;
+	return cpufreq_table_validate_and_show(policy, speedstep_freqs);
 }
 
 static int speedstep_cpu_exit(struct cpufreq_policy *policy)
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 37/44] cpufreq: tegra: use cpufreq_table_validate_and_show()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (35 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 36/44] cpufreq: speedstep: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 38/44] cpufreq: tegra: fix implementation of ->exit() Viresh Kumar
                   ` (6 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/tegra-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
index a7b876f..d45c1d8 100644
--- a/drivers/cpufreq/tegra-cpufreq.c
+++ b/drivers/cpufreq/tegra-cpufreq.c
@@ -215,8 +215,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
 	clk_prepare_enable(emc_clk);
 	clk_prepare_enable(cpu_clk);
 
-	cpufreq_frequency_table_cpuinfo(policy, freq_table);
-	cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
+	cpufreq_table_validate_and_show(policy, freq_table);
 	policy->cur = tegra_getspeed(policy->cpu);
 	target_cpu_speed[policy->cpu] = policy->cur;
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 38/44] cpufreq: tegra: fix implementation of ->exit()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (36 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 37/44] cpufreq: tegra: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 39/44] cpufreq: at32ap: add frequency table Viresh Kumar
                   ` (5 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

->exit() of drivers should call cpufreq_frequency_table_put_attr() if they have
called cpufreq_frequency_table_get_attr() earlier in init() and they aren't
required to validate their cpufreq table in exit by calling
cpufreq_frequency_table_cpuinfo(). Tegra's driver wasn't calling
cpufreq_frequency_table_put_attr() and was calling
cpufreq_frequency_table_cpuinfo() in exit.

Fix both these issues in it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/tegra-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
index d45c1d8..e014077 100644
--- a/drivers/cpufreq/tegra-cpufreq.c
+++ b/drivers/cpufreq/tegra-cpufreq.c
@@ -232,7 +232,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
 
 static int tegra_cpu_exit(struct cpufreq_policy *policy)
 {
-	cpufreq_frequency_table_cpuinfo(policy, freq_table);
+	cpufreq_frequency_table_put_attr(policy->cpu);
 	clk_disable_unprepare(emc_clk);
 	return 0;
 }
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 39/44] cpufreq: at32ap: add frequency table
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (37 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 38/44] cpufreq: tegra: fix implementation of ->exit() Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 40/44] cpufreq: arm_big_little: call cpufreq_frequency_table_put_attr() Viresh Kumar
                   ` (4 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

From: Hans-Christian Egtvedt <egtvedt@samfundet.no>

This patch adds a dynamically calculated frequency table to the at32ap driver.
In short the architecture can scale in power of two between a maximum and
minimum frequency. Min, max, and the steps in between are added to the table.

Signed-off-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/at32ap-cpufreq.c | 49 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 46 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c
index e0c38d9..1d19fa5 100644
--- a/drivers/cpufreq/at32ap-cpufreq.c
+++ b/drivers/cpufreq/at32ap-cpufreq.c
@@ -19,8 +19,10 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/export.h>
+#include <linux/slab.h>
 
 static struct clk *cpuclk;
+static struct cpufreq_frequency_table *freq_table;
 
 static int at32_verify_speed(struct cpufreq_policy *policy)
 {
@@ -85,13 +87,17 @@ static int at32_set_target(struct cpufreq_policy *policy,
 
 static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
 {
+	unsigned int frequency, rate;
+	int retval, steps, i;
+
 	if (policy->cpu != 0)
 		return -EINVAL;
 
 	cpuclk = clk_get(NULL, "cpu");
 	if (IS_ERR(cpuclk)) {
 		pr_debug("cpufreq: could not get CPU clk\n");
-		return PTR_ERR(cpuclk);
+		retval = PTR_ERR(cpuclk);
+		goto out_err;
 	}
 
 	policy->cpuinfo.min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000;
@@ -101,9 +107,46 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
 	policy->min = policy->cpuinfo.min_freq;
 	policy->max = policy->cpuinfo.max_freq;
 
-	printk("cpufreq: AT32AP CPU frequency driver\n");
+	/*
+	 * AVR32 CPU frequency rate scales in power of two between maximum and
+	 * minimum, also add space for the table end marker.
+	 *
+	 * Further validate that the frequency is usable, and append it to the
+	 * frequency table.
+	 */
+	steps = fls(policy->cpuinfo.max_freq / policy->cpuinfo.min_freq) + 1;
+	freq_table = kzalloc(steps * sizeof(struct cpufreq_frequency_table),
+			GFP_KERNEL);
+	if (!freq_table) {
+		retval = -ENOMEM;
+		goto out_err_put_clk;
+	}
 
-	return 0;
+	frequency = policy->cpuinfo.max_freq;
+	for (i = 0; i < (steps - 1); i++) {
+		rate = clk_round_rate(cpuclk, frequency * 1000) / 1000;
+
+		if (rate != frequency)
+			freq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+		else
+			freq_table[i].frequency = frequency;
+
+		frequency /= 2;
+	}
+
+	freq_table[steps - 1].frequency = CPUFREQ_TABLE_END;
+
+	retval = cpufreq_table_validate_and_show(policy, freq_table);
+	if (!retval) {
+		printk("cpufreq: AT32AP CPU frequency driver\n");
+		return 0;
+	}
+
+	kfree(freq_table);
+out_err_put_clk:
+	clk_put(cpuclk);
+out_err:
+	return retval;
 }
 
 static struct cpufreq_driver at32_driver = {
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 40/44] cpufreq: arm_big_little: call cpufreq_frequency_table_put_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (38 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 39/44] cpufreq: at32ap: add frequency table Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 41/44] cpufreq: blackfin: " Viresh Kumar
                   ` (3 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Drivers which have an exit path must call cpufreq_frequency_table_put_attr() if
they have called cpufreq_frequency_table_get_attr() in their init path.

This driver was missing this part and is fixed with this patch.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/arm_big_little.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 5070273..9acfb82 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -198,6 +198,7 @@ static int bL_cpufreq_exit(struct cpufreq_policy *policy)
 		return -ENODEV;
 	}
 
+	cpufreq_frequency_table_put_attr(policy->cpu);
 	put_cluster_clk_and_freq_table(cpu_dev);
 	dev_dbg(cpu_dev, "%s: Exited, cpu: %d\n", __func__, policy->cpu);
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 41/44] cpufreq: blackfin: call cpufreq_frequency_table_put_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (39 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 40/44] cpufreq: arm_big_little: call cpufreq_frequency_table_put_attr() Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 42/44] cpufreq: exynos: " Viresh Kumar
                   ` (2 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Drivers which have an exit path must call cpufreq_frequency_table_put_attr() if
they have called cpufreq_frequency_table_get_attr() in their init path.

This driver was missing this part and is fixed with this patch.

Cc: Steven Miao <realmz6@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/blackfin-cpufreq.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/cpufreq/blackfin-cpufreq.c b/drivers/cpufreq/blackfin-cpufreq.c
index 54c0a0c..0e76c09 100644
--- a/drivers/cpufreq/blackfin-cpufreq.c
+++ b/drivers/cpufreq/blackfin-cpufreq.c
@@ -213,6 +213,13 @@ static int __bfin_cpu_init(struct cpufreq_policy *policy)
 	return cpufreq_table_validate_and_show(policy, bfin_freq_table);
 }
 
+static int __bfin_cpu_exit(struct cpufreq_policy *policy)
+{
+
+	cpufreq_frequency_table_put_attr(policy->cpu);
+	return 0;
+}
+
 static struct freq_attr *bfin_freq_attr[] = {
 	&cpufreq_freq_attr_scaling_available_freqs,
 	NULL,
@@ -223,6 +230,7 @@ static struct cpufreq_driver bfin_driver = {
 	.target = bfin_target,
 	.get = bfin_getfreq_khz,
 	.init = __bfin_cpu_init,
+	.exit = __bfin_cpu_exit,
 	.name = "bfin cpufreq",
 	.attr = bfin_freq_attr,
 };
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 42/44] cpufreq: exynos: call cpufreq_frequency_table_put_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (40 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 41/44] cpufreq: blackfin: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 43/44] cpufreq: loongson2: " Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 44/44] cpufreq: omap: " Viresh Kumar
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Drivers which have an exit path must call cpufreq_frequency_table_put_attr() if
they have called cpufreq_frequency_table_get_attr() in their init path.

This driver was missing this part and is fixed with this patch.

Acked-By: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/exynos5440-cpufreq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index cf52759..ea3e3b2 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -339,12 +339,19 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	return 0;
 }
 
+static int exynos_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+	cpufreq_frequency_table_put_attr(policy->cpu);
+	return 0;
+}
+
 static struct cpufreq_driver exynos_driver = {
 	.flags		= CPUFREQ_STICKY,
 	.verify		= exynos_verify_speed,
 	.target		= exynos_target,
 	.get		= exynos_getspeed,
 	.init		= exynos_cpufreq_cpu_init,
+	.exit		= exynos_cpufreq_cpu_exit,
 	.name		= CPUFREQ_NAME,
 };
 
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 43/44] cpufreq: loongson2: call cpufreq_frequency_table_put_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (41 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 42/44] cpufreq: exynos: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  2013-09-16 13:26 ` [PATCH V2 Resend 44/44] cpufreq: omap: " Viresh Kumar
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Drivers which have an exit path must call cpufreq_frequency_table_put_attr() if
they have called cpufreq_frequency_table_get_attr() in their init path.

This driver was missing this part and is fixed with this patch.

Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/loongson2_cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c
index 5dd3692..cec4e72 100644
--- a/drivers/cpufreq/loongson2_cpufreq.c
+++ b/drivers/cpufreq/loongson2_cpufreq.c
@@ -145,6 +145,7 @@ static int loongson2_cpufreq_verify(struct cpufreq_policy *policy)
 
 static int loongson2_cpufreq_exit(struct cpufreq_policy *policy)
 {
+	cpufreq_frequency_table_put_attr(policy->cpu);
 	clk_put(cpuclk);
 	return 0;
 }
-- 
1.7.12.rc2.18.g61b472e


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

* [PATCH V2 Resend 44/44] cpufreq: omap: call cpufreq_frequency_table_put_attr()
  2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
                   ` (42 preceding siblings ...)
  2013-09-16 13:26 ` [PATCH V2 Resend 43/44] cpufreq: loongson2: " Viresh Kumar
@ 2013-09-16 13:26 ` Viresh Kumar
  43 siblings, 0 replies; 45+ messages in thread
From: Viresh Kumar @ 2013-09-16 13:26 UTC (permalink / raw
  To: rjw; +Cc: cpufreq, linux-pm

Drivers which have an exit path must call cpufreq_frequency_table_put_attr() if
they have called cpufreq_frequency_table_get_attr() in their init path.

This driver was missing this part and is fixed with this patch.

Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/omap-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index b68ce4e..091f233 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -221,6 +221,7 @@ fail_ck:
 
 static int omap_cpu_exit(struct cpufreq_policy *policy)
 {
+	cpufreq_frequency_table_put_attr(policy->cpu);
 	freq_table_free();
 	clk_put(mpu_clk);
 	return 0;
-- 
1.7.12.rc2.18.g61b472e


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

end of thread, other threads:[~2013-09-16 13:31 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16 13:26 [PATCH V2 Resend 00/44] CPUFreq Cleanup Series: Part I Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 01/44] cpufreq: Add new helper cpufreq_table_validate_and_show() Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 02/44] cpufreq: pxa: call cpufreq_frequency_table_get_attr() Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 03/44] cpufreq: s3cx4xx: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 04/44] cpufreq: sparc: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 05/44] cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show() Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 06/44] cpufreq: arm_big_little: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 07/44] cpufreq: blackfin: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 08/44] cpufreq: cpufreq-cpu0: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 09/44] cpufreq: cris: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 10/44] cpufreq: davinci: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 11/44] cpufreq: dbx500: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 12/44] cpufreq: e_powersaver: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 13/44] cpufreq: elanfreq: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 14/44] cpufreq: exynos: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 15/44] cpufreq: ia64-acpi: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 16/44] cpufreq: imx6q: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 17/44] cpufreq: kirkwood: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 18/44] cpufreq: longhaul: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 19/44] cpufreq: loongson2: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 20/44] cpufreq: maple: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 21/44] cpufreq: omap: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 22/44] cpufreq: p4-clockmod: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 23/44] cpufreq: pasemi: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 24/44] cpufreq: pmac: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 25/44] cpufreq: powernow: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 26/44] cpufreq: ppc: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 27/44] cpufreq: pxa: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 28/44] cpufreq: s3cx4xx: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 29/44] cpufreq: s5pv210: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 30/44] cpufreq: sa11x0: Expose frequency table Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 31/44] cpufreq: sa11x0: let cpufreq core initialize struct policy fields Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 32/44] cpufreq: sc520: use cpufreq_table_validate_and_show() Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 33/44] cpufreq: sh: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 34/44] cpufreq: sparc: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 35/44] cpufreq: spear: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 36/44] cpufreq: speedstep: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 37/44] cpufreq: tegra: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 38/44] cpufreq: tegra: fix implementation of ->exit() Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 39/44] cpufreq: at32ap: add frequency table Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 40/44] cpufreq: arm_big_little: call cpufreq_frequency_table_put_attr() Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 41/44] cpufreq: blackfin: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 42/44] cpufreq: exynos: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 43/44] cpufreq: loongson2: " Viresh Kumar
2013-09-16 13:26 ` [PATCH V2 Resend 44/44] cpufreq: omap: " Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.