Merge remote-tracking branches 'regulator/topic/can-change', 'regulator/topic/constra...
authorMark Brown <broonie@kernel.org>
Fri, 13 May 2016 13:23:27 +0000 (14:23 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 13 May 2016 13:23:27 +0000 (14:23 +0100)
1  2  3  4  5 
drivers/regulator/core.c
include/linux/regulator/driver.h

index af88762b2fc805571180059af34ac80924787623,e0b7642847731390ed44bbc3e8718fd5dd9e7116,bca9167d8c4345a2fdebd7d84d6c5f890a62a948,73381752ff78ecc9f2cb2adc64ee97faa9f9ec0c,e0b7642847731390ed44bbc3e8718fd5dd9e7116..ec8184d53f131338ddb159b48eb89f7b47e3e077
@@@@@@ -913,32 -914,15 -890,34 -914,15 -914,15 +888,34 @@@@@@ static int machine_constraints_voltage(
                                 current_uV);
                        return current_uV;
                }
 - --           if (current_uV < rdev->constraints->min_uV ||
 - --               current_uV > rdev->constraints->max_uV) {
 + ++
 + ++           /*
 + ++            * If we're below the minimum voltage move up to the
 + ++            * minimum voltage, if we're above the maximum voltage
 + ++            * then move down to the maximum.
 + ++            */
 + ++           target_min = current_uV;
 + ++           target_max = current_uV;
 + ++
 + ++           if (current_uV < rdev->constraints->min_uV) {
 + ++                   target_min = rdev->constraints->min_uV;
 + ++                   target_max = rdev->constraints->min_uV;
 + ++           }
 + ++
 + ++           if (current_uV > rdev->constraints->max_uV) {
 + ++                   target_min = rdev->constraints->max_uV;
 + ++                   target_max = rdev->constraints->max_uV;
 + ++           }
 + ++
 + ++           if (target_min != current_uV || target_max != current_uV) {
++ ++                   rdev_info(rdev, "Bringing %duV into %d-%duV\n",
++ ++                             current_uV, target_min, target_max);
                        ret = _regulator_do_set_voltage(
 - --                           rdev, rdev->constraints->min_uV,
 - --                           rdev->constraints->max_uV);
 + ++                           rdev, target_min, target_max);
                        if (ret < 0) {
                                rdev_err(rdev,
 - --                                   "failed to apply %duV constraint(%d)\n",
 - --                                   rdev->constraints->min_uV, ret);
 + ++                                   "failed to apply %d-%duV constraint(%d)\n",
 + ++                                   target_min, target_max, ret);
                                return ret;
                        }
                }
@@@@@@ -4019,21 -3983,11 -3973,11 -4035,11 -3983,11 +4043,21 @@@@@@ regulator_register(const struct regulat
                                goto unset_supplies;
                        }
                }
 ++++           mutex_unlock(&regulator_list_mutex);
 +  +   }
 +  +
 ++++   ret = device_register(&rdev->dev);
 ++++   if (ret != 0) {
 ++++           put_device(&rdev->dev);
 ++++           goto unset_supplies;
  ++    }
  ++ 
 ++++   dev_set_drvdata(&rdev->dev, rdev);
        rdev_init_debugfs(rdev);
 ----out:
 ----   mutex_unlock(&regulator_list_mutex);
 ++++
 ++++   /* try to resolve regulators supply since a new one was registered */
 ++++   class_for_each_device(&regulator_class, NULL, NULL,
 ++++                         regulator_register_resolve_supply);
        kfree(config);
        return rdev;
     
Simple merge