diff mbox

[v2,4/5] cpufreq: arm_big_little_dt: enhance OPP error checking

Message ID 1380634382-15609-5-git-send-email-Sudeep.KarkadaNagesha@arm.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Sudeep KarkadaNagesha Oct. 1, 2013, 1:33 p.m. UTC
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Since the OPPs can be specified either through 'operating-points'
as tuples or through 'operating-points-phandle' as phandle to the
node containing tuples, we need to check for both the properties.

Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/arm_big_little_dt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Viresh Kumar Oct. 3, 2013, 4:55 a.m. UTC | #1
On 1 October 2013 19:03, Sudeep KarkadaNagesha
<Sudeep.KarkadaNagesha@arm.com> wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> Since the OPPs can be specified either through 'operating-points'
> as tuples or through 'operating-points-phandle' as phandle to the
> node containing tuples, we need to check for both the properties.
>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
>  drivers/cpufreq/arm_big_little_dt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon Oct. 3, 2013, 2:26 p.m. UTC | #2
On 10/01/2013 08:33 AM, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> 
> Since the OPPs can be specified either through 'operating-points'
> as tuples or through 'operating-points-phandle' as phandle to the
> node containing tuples, we need to check for both the properties.
> 
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
>  drivers/cpufreq/arm_big_little_dt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/arm_big_little_dt.c b/drivers/cpufreq/arm_big_little_dt.c
> index 480c0bd..b03d4fe 100644
> --- a/drivers/cpufreq/arm_big_little_dt.c
> +++ b/drivers/cpufreq/arm_big_little_dt.c
> @@ -35,7 +35,8 @@ static struct device_node *get_cpu_node_with_valid_op(int cpu)
>  {
>  	struct device_node *np = of_cpu_device_node_get(cpu);
>  
> -	if (!of_get_property(np, "operating-points", NULL)) {
> +	if (!of_get_property(np, "operating-points", NULL) &&
> +		!of_get_property(np, "operating-points-phandle", NULL)) {
>  		of_node_put(np);
>  		np = NULL;
>  	}
> 
generated checkpatch --strict warning:
CHECK: Alignment should match open parenthesis
#28: FILE: drivers/cpufreq/arm_big_little_dt.c:39:
+	if (!of_get_property(np, "operating-points", NULL) &&
+		!of_get_property(np, "operating-points-phandle", NULL)) {

otherwise,
Reviewed-by: Nishanth Menon <nm@ti.com>
diff mbox

Patch

diff --git a/drivers/cpufreq/arm_big_little_dt.c b/drivers/cpufreq/arm_big_little_dt.c
index 480c0bd..b03d4fe 100644
--- a/drivers/cpufreq/arm_big_little_dt.c
+++ b/drivers/cpufreq/arm_big_little_dt.c
@@ -35,7 +35,8 @@  static struct device_node *get_cpu_node_with_valid_op(int cpu)
 {
 	struct device_node *np = of_cpu_device_node_get(cpu);
 
-	if (!of_get_property(np, "operating-points", NULL)) {
+	if (!of_get_property(np, "operating-points", NULL) &&
+		!of_get_property(np, "operating-points-phandle", NULL)) {
 		of_node_put(np);
 		np = NULL;
 	}