[4.4.y-cip 09/15] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties


Chen-Yu Tsai (Moxa) <wens@...>
 

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

commit fd8d8e63467c922be9ae4452cca2980d473477d9 upstream.

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 !prop cases.

Fixes: 01fb4d3c39d3 ("PM / OPP: Parse 'opp-<prop>-<name> 'bindings")
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Chen-Yu Tsai (Moxa) <wens@csie.org>
---
drivers/base/power/opp/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.=
c
index 408fee4cb72df..504a6d4e46723 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,
=20
if (!prop) {
/* Search for "opp-microvolt" */
- name[13] =3D '\0';
+ sprintf(name, "opp-microvolt");
prop =3D of_find_property(opp->np, name, NULL);
=20
/* Missing property isn't a problem, but an invalid entry is */
@@ -861,7 +861,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp,=
struct device *dev,
=20
if (!prop) {
/* Search for "opp-microamp" */
- name[12] =3D '\0';
+ sprintf(name, "opp-microamp");
prop =3D of_find_property(opp->np, name, NULL);
}
=20
--=20
2.27.0.rc0

Join cip-dev@lists.cip-project.org to automatically receive all group messages.