All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: rjw@sisk.pl
Cc: linaro-kernel@lists.linaro.org, patches@linaro.org,
	cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 25/35] cpufreq: powernow: use cpufreq_table_validate_and_show()
Date: Thu,  8 Aug 2013 19:18:27 +0530	[thread overview]
Message-ID: <8ddaa40a58ddff7b5e7e7b689f241136adbd422e.1375964117.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1375964117.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1375964117.git.viresh.kumar@linaro.org>

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


WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 25/35] cpufreq: powernow: use cpufreq_table_validate_and_show()
Date: Thu,  8 Aug 2013 19:18:27 +0530	[thread overview]
Message-ID: <8ddaa40a58ddff7b5e7e7b689f241136adbd422e.1375964117.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1375964117.git.viresh.kumar@linaro.org>

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

  parent reply	other threads:[~2013-08-08 13:52 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 13:48 [PATCH 00/35] cpufreq: Introduce cpufreq_table_validate_and_show() Viresh Kumar
2013-08-08 13:48 ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 01/35] cpufreq: Add new helper cpufreq_table_validate_and_show() Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 02/35] cpufreq: pxa: call cpufreq_frequency_table_get_attr() Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 03/35] cpufreq: s3cx4xx: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 04/35] cpufreq: sparc: " Viresh Kumar
2013-08-08 14:00   ` Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 05/35] cpufreq: acpi-cpufreq: use cpufreq_table_validate_and_show() Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 06/35] cpufreq: arm_big_little: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 07/35] cpufreq: blackfin: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 08/35] cpufreq: cpufreq-cpu0: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-12  7:35   ` Shawn Guo
2013-08-12  7:35     ` Shawn Guo
2013-08-12  7:35     ` Shawn Guo
2013-08-12  7:49     ` Viresh Kumar
2013-08-12  7:49       ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 09/35] cpufreq: cris: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 10/35] cpufreq: davinci: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 11/35] cpufreq: dbx500: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-14 19:36   ` Linus Walleij
2013-08-14 19:36     ` Linus Walleij
2013-08-14 19:36     ` Linus Walleij
2013-08-08 13:48 ` [PATCH 12/35] cpufreq: e_powersaver: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 13/35] cpufreq: elanfreq: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 14/35] cpufreq: exynos: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 15/35] cpufreq: ia64-acpi: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 16/35] cpufreq: imx6q: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 17/35] cpufreq: kirkwood: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 14:16   ` Andrew Lunn
2013-08-08 14:16     ` Andrew Lunn
2013-08-08 13:48 ` [PATCH 18/35] cpufreq: longhaul: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 19/35] cpufreq: loongson2: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 20/35] cpufreq: maple: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 21/35] cpufreq: omap: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 14:19   ` Santosh Shilimkar
2013-08-08 14:19     ` Santosh Shilimkar
2013-08-08 14:19     ` Santosh Shilimkar
2013-08-08 13:48 ` [PATCH 22/35] cpufreq: p4-clockmod: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 23/35] cpufreq: pasemi: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 24/35] cpufreq: pmac: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` Viresh Kumar [this message]
2013-08-08 13:48   ` [PATCH 25/35] cpufreq: powernow: " Viresh Kumar
2013-08-08 13:48 ` [PATCH 26/35] cpufreq: ppc: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 27/35] cpufreq: pxa: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 28/35] cpufreq: s3cx4xx: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 29/35] cpufreq: s5pv210: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 30/35] cpufreq: sc520: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 31/35] cpufreq: sh: " Viresh Kumar
2013-08-08 13:54   ` Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 32/35] cpufreq: sparc: " Viresh Kumar
2013-08-08 13:54   ` Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 33/35] cpufreq: spear: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 34/35] cpufreq: speedstep: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 13:48 ` [PATCH 35/35] cpufreq: tegra: " Viresh Kumar
2013-08-08 13:48   ` Viresh Kumar
2013-08-08 15:44   ` Stephen Warren
2013-08-08 15:44     ` Stephen Warren
2013-08-08 16:07     ` Viresh Kumar
2013-08-08 16:07       ` Viresh Kumar
2013-08-09  4:04       ` Viresh Kumar
2013-08-09  4:04         ` Viresh Kumar
2013-08-09 16:19         ` Stephen Warren
2013-08-09 16:19           ` Stephen Warren
2013-08-09 17:09           ` Viresh Kumar
2013-08-09 17:09             ` Viresh Kumar
2013-08-09 22:08             ` Stephen Warren
2013-08-09 22:08               ` Stephen Warren
2013-08-10  2:53               ` Viresh Kumar
2013-08-10  2:53                 ` Viresh Kumar
2013-08-12 16:33                 ` Stephen Warren
2013-08-12 16:33                   ` Stephen Warren
2013-08-12 17:01                   ` Viresh Kumar
2013-08-12 17:01                     ` Viresh Kumar
2013-08-08 14:00 ` [PATCH 00/35] cpufreq: Introduce cpufreq_table_validate_and_show() Rafael J. Wysocki
2013-08-08 14:00   ` Rafael J. Wysocki
2013-08-08 13:53   ` Viresh Kumar
2013-08-08 13:53     ` Viresh Kumar
2013-08-08 14:06     ` Rafael J. Wysocki
2013-08-08 14:06       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ddaa40a58ddff7b5e7e7b689f241136adbd422e.1375964117.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.