From: Rafael J. Wysocki Date: Sat, 7 Nov 2015 00:30:40 +0000 (+0100) Subject: Merge branch 'pm-opp' X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ede53f73171722fcf1b5be63bcd64e42d14affc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'pm-opp' * pm-opp: PM / OPP: Add opp_rcu_lockdep_assert() to _find_device_opp() PM / OPP: Hold dev_opp_list_lock for writers PM / OPP: Protect updates to list_dev with mutex PM / OPP: Propagate error properly from dev_pm_opp_set_sharing_cpus() PM / OPP: Parse all power-supply related bindings together PM / OPP: Rename routines specific to old bindings with _v1 PM / OPP: Improve print messages with pr_fmt --- 1ede53f73171722fcf1b5be63bcd64e42d14affc diff --cc drivers/base/power/opp/core.c index d5c1149ff123,c987d2e1a83b..5e4b1d82b2f8 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@@ -770,22 -776,16 +776,23 @@@ unlock } /* TODO: Support multiple regulators */ - static int opp_get_microvolt(struct dev_pm_opp *opp, struct device *dev) + static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev) { u32 microvolt[3] = {0}; + u32 val; int count, ret; - count = of_property_count_u32_elems(opp->np, "opp-microvolt"); - if (!count) + /* Missing property isn't a problem, but an invalid entry is */ + if (!of_find_property(opp->np, "opp-microvolt", NULL)) return 0; + count = of_property_count_u32_elems(opp->np, "opp-microvolt"); + if (count < 0) { + dev_err(dev, "%s: Invalid opp-microvolt property (%d)\n", + __func__, count); + return count; + } + /* There can be one or three elements here */ if (count != 1 && count != 3) { dev_err(dev, "%s: Invalid number of elements in opp-microvolt property (%d)\n",