Merge tag 'regulator-fix-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "The main change here is a revert for a cleanup that was done in the
  core, attempting to resolve some confusion about how we handle systems
  where we've somehow managed to end up with both platform data and
  device tree data for the same device. Unfortunately it turns out there
  are actually a few systems that deliberately do this and were broken
  by the change so we've just reverted it.

  There's also a new Qualcomm device ID"

* tag 'regulator-fix-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: let dt properties override driver init_data
  regulator: qcom_smd: Add l2, l5 sub-node to mp5496 regulator
This commit is contained in:
Linus Torvalds
2025-02-13 13:09:01 -08:00
2 changed files with 28 additions and 35 deletions
@@ -22,7 +22,7 @@ description:
Each sub-node is identified using the node's name, with valid values listed
for each of the pmics below.
For mp5496, s1, s2
For mp5496, s1, s2, l2, l5
For pm2250, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22
+27 -34
View File
@@ -5774,43 +5774,36 @@ regulator_register(struct device *dev,
goto clean;
}
if (config->init_data) {
/*
* Providing of_match means the framework is expected to parse
* DT to get the init_data. This would conflict with provided
* init_data, if set. Warn if it happens.
*/
if (regulator_desc->of_match)
dev_warn(dev, "Using provided init data - OF match ignored\n");
/*
* DT may override the config->init_data provided if the platform
* needs to do so. If so, config->init_data is completely ignored.
*/
init_data = regulator_of_get_init_data(dev, regulator_desc, config,
&rdev->dev.of_node);
/*
* Sometimes not all resources are probed already so we need to take
* that into account. This happens most the time if the ena_gpiod comes
* from a gpio extender or something else.
*/
if (PTR_ERR(init_data) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
goto clean;
}
/*
* We need to keep track of any GPIO descriptor coming from the
* device tree until we have handled it over to the core. If the
* config that was passed in to this function DOES NOT contain
* a descriptor, and the config after this call DOES contain
* a descriptor, we definitely got one from parsing the device
* tree.
*/
if (!cfg->ena_gpiod && config->ena_gpiod)
dangling_of_gpiod = true;
if (!init_data) {
init_data = config->init_data;
rdev->dev.of_node = of_node_get(config->of_node);
} else {
init_data = regulator_of_get_init_data(dev, regulator_desc,
config,
&rdev->dev.of_node);
/*
* Sometimes not all resources are probed already so we need to
* take that into account. This happens most the time if the
* ena_gpiod comes from a gpio extender or something else.
*/
if (PTR_ERR(init_data) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
goto clean;
}
/*
* We need to keep track of any GPIO descriptor coming from the
* device tree until we have handled it over to the core. If the
* config that was passed in to this function DOES NOT contain a
* descriptor, and the config after this call DOES contain a
* descriptor, we definitely got one from parsing the device
* tree.
*/
if (!cfg->ena_gpiod && config->ena_gpiod)
dangling_of_gpiod = true;
}
ww_mutex_init(&rdev->mutex, &regulator_ww_class);