From: Bartlomiej Zolnierkiewicz Date: Thu, 17 Dec 2015 18:04:38 +0000 (+0100) Subject: PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties X-Git-Tag: firefly_0821_release~176^2~4^2~51^2~26 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ff7d038f3c5def395c4b06c156cca9947d4b5a02;p=firefly-linux-kernel-4.4.55.git PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties Commit 01fb4d3c39d3 ("PM / OPP: Parse 'opp--' bindings") broke support for parsing standard opp-microvolt and opp-microamp properties. Fix it by setting 'name' string to proper value for !prop cases. Fixes: 01fb4d3c39d3 ("PM / OPP: Parse 'opp-- 'bindings") Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki (cherry picked from commit fd8d8e63467c922be9ae4452cca2980d473477d9) Signed-off-by: Alex Shi --- diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 5c01fec1ed14..cd230c63aee6 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -814,7 +814,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 */ @@ -855,7 +855,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); }