Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1293043 > unrolled thread

[PATCH] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties

Started byBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
First post2015-12-16 16:50 +0100
Last post2015-12-17 03:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] PM / OPP: Fix parsing of opp-microvolt and opp-microamp  properties Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2015-12-16 16:50 +0100
    Re: [PATCH] PM / OPP: Fix parsing of opp-microvolt and opp-microamp  properties Viresh Kumar <viresh.kumar@linaro.org> - 2015-12-17 03:10 +0100

#1293043 — [PATCH] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties

FromBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Date2015-12-16 16:50 +0100
Subject[PATCH] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties
Message-ID<qGmuZ-3Cs-3@gated-at.bofh.it>
Commit 01fb4d3c39d3 ("PM / OPP: Parse 'opp-<prop>-<name>'
bindings") broke support for parsing standard opp-microvolt and
opp-microamp properties.  Fix it by setting 'name' string to
proper value for !dev_opp->prop_name cases.

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Fixes: 01fb4d3c39d3 ("PM / OPP: Parse 'opp-<prop>-<name> 'bindings")
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
This fixes Exynos4x12 cpufreq-dt support regression present in
linux-pm/linux-next tree.  Rafael, please apply.  Thank you.

 drivers/base/power/opp/core.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Index: b/drivers/base/power/opp/core.c
===================================================================
--- a/drivers/base/power/opp/core.c	2015-12-16 16:10:13.509171420 +0100
+++ b/drivers/base/power/opp/core.c	2015-12-16 16:21:18.385183902 +0100
@@ -806,11 +806,11 @@ static int opp_parse_supplies(struct dev
 	struct property *prop = NULL;
 	char name[NAME_MAX];
 
+	sprintf(name, "opp-microvolt-%s", dev_opp->prop_name);
+
 	/* Search for "opp-microvolt-<name>" */
-	if (dev_opp->prop_name) {
-		sprintf(name, "opp-microvolt-%s", dev_opp->prop_name);
+	if (dev_opp->prop_name)
 		prop = of_find_property(opp->np, name, NULL);
-	}
 
 	if (!prop) {
 		/* Search for "opp-microvolt" */
@@ -848,10 +848,10 @@ static int opp_parse_supplies(struct dev
 
 	/* Search for "opp-microamp-<name>" */
 	prop = NULL;
-	if (dev_opp->prop_name) {
-		sprintf(name, "opp-microamp-%s", dev_opp->prop_name);
+	sprintf(name, "opp-microamp-%s", dev_opp->prop_name);
+
+	if (dev_opp->prop_name)
 		prop = of_find_property(opp->np, name, NULL);
-	}
 
 	if (!prop) {
 		/* Search for "opp-microamp" */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1293554

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-12-17 03:10 +0100
Message-ID<qGwb0-1vx-7@gated-at.bofh.it>
In reply to#1293043
On 16-12-15, 16:41, Bartlomiej Zolnierkiewicz wrote:
> Commit 01fb4d3c39d3 ("PM / OPP: Parse 'opp-<prop>-<name>'
> bindings") broke support for parsing standard opp-microvolt and
> opp-microamp properties.  Fix it by setting 'name' string to
> proper value for !dev_opp->prop_name cases.
> 
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Fixes: 01fb4d3c39d3 ("PM / OPP: Parse 'opp-<prop>-<name> 'bindings")
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
> This fixes Exynos4x12 cpufreq-dt support regression present in
> linux-pm/linux-next tree.  Rafael, please apply.  Thank you.
> 
>  drivers/base/power/opp/core.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> Index: b/drivers/base/power/opp/core.c
> ===================================================================
> --- a/drivers/base/power/opp/core.c	2015-12-16 16:10:13.509171420 +0100
> +++ b/drivers/base/power/opp/core.c	2015-12-16 16:21:18.385183902 +0100
> @@ -806,11 +806,11 @@ static int opp_parse_supplies(struct dev
>  	struct property *prop = NULL;
>  	char name[NAME_MAX];
>  
> +	sprintf(name, "opp-microvolt-%s", dev_opp->prop_name);
> +
>  	/* Search for "opp-microvolt-<name>" */
> -	if (dev_opp->prop_name) {
> -		sprintf(name, "opp-microvolt-%s", dev_opp->prop_name);
> +	if (dev_opp->prop_name)
>  		prop = of_find_property(opp->np, name, NULL);
> -	}
>  
>  	if (!prop) {
>  		/* Search for "opp-microvolt" */
> @@ -848,10 +848,10 @@ static int opp_parse_supplies(struct dev
>  
>  	/* Search for "opp-microamp-<name>" */
>  	prop = NULL;
> -	if (dev_opp->prop_name) {
> -		sprintf(name, "opp-microamp-%s", dev_opp->prop_name);
> +	sprintf(name, "opp-microamp-%s", dev_opp->prop_name);
> +
> +	if (dev_opp->prop_name)
>  		prop = of_find_property(opp->np, name, NULL);
> -	}
>  
>  	if (!prop) {
>  		/* Search for "opp-microamp" */

Sorry about this. And I am disliking the solution suggested by Stephen
more and more now. Please resend this patch with following changes
instead:

diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c
index 6c6856e426f0..a96df5cda303 100644
--- a/drivers/base/power/opp/core.c
+++ b/drivers/base/power/opp/core.c
@@ -816,7 +816,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
 
        if (!prop) {
                /* Search for "opp-microvolt" */
-               name[13] = '\0';
+               sprintf(name, "opp-microvolt");
                prop = of_find_property(opp->np, name, NULL);
 
                /* Missing property isn't a problem, but an invalid entry is */
@@ -857,7 +857,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
 
        if (!prop) {
                /* Search for "opp-microamp" */
-               name[12] = '\0';
+               sprintf(name, "opp-microamp");
                prop = of_find_property(opp->np, name, NULL);
        }

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web