Commit 85cc5751 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'regulator-fix-v6.14-rc2' of...

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
parents f9af8e77 35e21de4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -5774,27 +5774,17 @@ 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.
	 * DT may override the config->init_data provided if the platform
	 * needs to do so. If so, config->init_data is completely ignored.
	 */
		if (regulator_desc->of_match)
			dev_warn(dev, "Using provided init data - OF match ignored\n");

		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,
	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.
	 * 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;
@@ -5804,13 +5794,16 @@ regulator_register(struct device *dev,
	/*
	 * 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
	 * 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);
	}

	ww_mutex_init(&rdev->mutex, &regulator_ww_class);