Skip to content

Commit

Permalink
Merge branches 'pm-cpuidle', 'pm-opp' and 'pm-avs'
Browse files Browse the repository at this point in the history
* pm-cpuidle:
  ARM: cpuidle: Fix error return code

* pm-opp:
  PM / OPP: Don't support OPP if it provides supported-hw but platform does not
  PM / OPP: avoid maybe-uninitialized warning

* pm-avs:
  PM / AVS: SmartReflex: Neaten logging
  • Loading branch information
Rafael J. Wysocki committed Oct 1, 2016
4 parents 7005f6d + af48d7b + a4ee454 + e2cdeaa commit e35db92
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 70 deletions.
10 changes: 3 additions & 7 deletions drivers/base/power/opp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
struct clk *clk;
unsigned long freq, old_freq;
unsigned long u_volt, u_volt_min, u_volt_max;
unsigned long ou_volt, ou_volt_min, ou_volt_max;
int ret;

if (unlikely(!target_freq)) {
Expand Down Expand Up @@ -620,11 +619,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
}

old_opp = _find_freq_ceil(opp_table, &old_freq);
if (!IS_ERR(old_opp)) {
ou_volt = old_opp->u_volt;
ou_volt_min = old_opp->u_volt_min;
ou_volt_max = old_opp->u_volt_max;
} else {
if (IS_ERR(old_opp)) {
dev_err(dev, "%s: failed to find current OPP for freq %lu (%ld)\n",
__func__, old_freq, PTR_ERR(old_opp));
}
Expand Down Expand Up @@ -683,7 +678,8 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
restore_voltage:
/* This shouldn't harm even if the voltages weren't updated earlier */
if (!IS_ERR(old_opp))
_set_opp_voltage(dev, reg, ou_volt, ou_volt_min, ou_volt_max);
_set_opp_voltage(dev, reg, old_opp->u_volt,
old_opp->u_volt_min, old_opp->u_volt_max);

return ret;
}
Expand Down
14 changes: 12 additions & 2 deletions drivers/base/power/opp/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,18 @@ static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
u32 version;
int ret;

if (!opp_table->supported_hw)
return true;
if (!opp_table->supported_hw) {
/*
* In the case that no supported_hw has been set by the
* platform but there is an opp-supported-hw value set for
* an OPP then the OPP should not be enabled as there is
* no way to see if the hardware supports it.
*/
if (of_find_property(np, "opp-supported-hw", NULL))
return false;
else
return true;
}

while (count--) {
ret = of_property_read_u32_index(np, "opp-supported-hw", count,
Expand Down
1 change: 1 addition & 0 deletions drivers/cpuidle/cpuidle-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static int __init arm_idle_init(void)
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
pr_err("Failed to allocate cpuidle device\n");
ret = -ENOMEM;
goto out_fail;
}
dev->cpu = cpu;
Expand Down
Loading

0 comments on commit e35db92

Please sign in to comment.