Commit 0de6219f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'regulator-fix-v7.0-merge-window' of...

Merge tag 'regulator-fix-v7.0-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "A few driver specific fixes, plus a patch from Bjorn which removes a
  fixed limit on regulator names that was breaking some Qualcomm
  systems"

* tag 'regulator-fix-v7.0-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: s2mps11: fix pctrlsel macro usage in s2mpg10_of_parse_cb()
  regulator: s2mps11: drop redundant sanity checks in s2mpg10_of_parse_cb()
  regulator: core: Remove regulator supply_name length limit
  regulator: mt6363: Fix interrmittent timeout
parents 3f6eb5a6 09ad01a5
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -1965,8 +1965,6 @@ static const struct file_operations constraint_flags_fops = {
#endif
};

#define REG_STR_SIZE	64

static void link_and_create_debugfs(struct regulator *regulator, struct regulator_dev *rdev,
				    struct device *dev)
{
@@ -2014,15 +2012,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
	lockdep_assert_held_once(&rdev->mutex.base);

	if (dev) {
		char buf[REG_STR_SIZE];
		int size;

		size = snprintf(buf, REG_STR_SIZE, "%s-%s",
				dev->kobj.name, supply_name);
		if (size >= REG_STR_SIZE)
			return NULL;

		supply_name = kstrdup(buf, GFP_KERNEL);
		supply_name = kasprintf(GFP_KERNEL, "%s-%s", dev->kobj.name, supply_name);
		if (supply_name == NULL)
			return NULL;
	} else {
+8 −1
Original line number Diff line number Diff line
@@ -861,7 +861,7 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
	struct irq_domain *domain;
	struct irq_fwspec fwspec;
	struct spmi_device *sdev;
	int i, ret;
	int i, ret, val;

	config.regmap = mt6363_spmi_register_regmap(dev);
	if (IS_ERR(config.regmap))
@@ -870,6 +870,13 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
	config.dev = dev;
	sdev = to_spmi_device(dev->parent);

	/*
	 * The first read may fail if the bootloader sets sleep mode: wake up
	 * this PMIC with W/R on the SPMI bus and ignore the first result.
	 * This matches the MT6373 driver behavior.
	 */
	regmap_read(config.regmap, MT6363_TOP_TRAP, &val);

	interrupt_parent = of_irq_find_parent(dev->of_node);
	if (!interrupt_parent)
		return dev_err_probe(dev, -EINVAL, "Cannot find IRQ parent\n");
+9 −13
Original line number Diff line number Diff line
@@ -440,15 +440,15 @@ static int s2mpg10_of_parse_cb(struct device_node *np,
		[S2MPG10_EXTCTRL_LDO20M_EN] = S2MPG10_PCTRLSEL_LDO20M_EN,
	};
	static const u32 ext_control_s2mpg11[] = {
		[S2MPG11_EXTCTRL_PWREN] = S2MPG10_PCTRLSEL_PWREN,
		[S2MPG11_EXTCTRL_PWREN_MIF] = S2MPG10_PCTRLSEL_PWREN_MIF,
		[S2MPG11_EXTCTRL_AP_ACTIVE_N] = S2MPG10_PCTRLSEL_AP_ACTIVE_N,
		[S2MPG11_EXTCTRL_G3D_EN] = S2MPG10_PCTRLSEL_CPUCL1_EN,
		[S2MPG11_EXTCTRL_G3D_EN2] = S2MPG10_PCTRLSEL_CPUCL1_EN2,
		[S2MPG11_EXTCTRL_AOC_VDD] = S2MPG10_PCTRLSEL_CPUCL2_EN,
		[S2MPG11_EXTCTRL_AOC_RET] = S2MPG10_PCTRLSEL_CPUCL2_EN2,
		[S2MPG11_EXTCTRL_UFS_EN] = S2MPG10_PCTRLSEL_TPU_EN,
		[S2MPG11_EXTCTRL_LDO13S_EN] = S2MPG10_PCTRLSEL_TPU_EN2,
		[S2MPG11_EXTCTRL_PWREN] = S2MPG11_PCTRLSEL_PWREN,
		[S2MPG11_EXTCTRL_PWREN_MIF] = S2MPG11_PCTRLSEL_PWREN_MIF,
		[S2MPG11_EXTCTRL_AP_ACTIVE_N] = S2MPG11_PCTRLSEL_AP_ACTIVE_N,
		[S2MPG11_EXTCTRL_G3D_EN] = S2MPG11_PCTRLSEL_G3D_EN,
		[S2MPG11_EXTCTRL_G3D_EN2] = S2MPG11_PCTRLSEL_G3D_EN2,
		[S2MPG11_EXTCTRL_AOC_VDD] = S2MPG11_PCTRLSEL_AOC_VDD,
		[S2MPG11_EXTCTRL_AOC_RET] = S2MPG11_PCTRLSEL_AOC_RET,
		[S2MPG11_EXTCTRL_UFS_EN] = S2MPG11_PCTRLSEL_UFS_EN,
		[S2MPG11_EXTCTRL_LDO13S_EN] = S2MPG11_PCTRLSEL_LDO13S_EN,
	};
	u32 ext_control;

@@ -478,8 +478,6 @@ static int s2mpg10_of_parse_cb(struct device_node *np,
			return -EINVAL;
		}

		if (ext_control > ARRAY_SIZE(ext_control_s2mpg10))
			return -EINVAL;
		ext_control = ext_control_s2mpg10[ext_control];
		break;

@@ -503,8 +501,6 @@ static int s2mpg10_of_parse_cb(struct device_node *np,
			return -EINVAL;
		}

		if (ext_control > ARRAY_SIZE(ext_control_s2mpg11))
			return -EINVAL;
		ext_control = ext_control_s2mpg11[ext_control];
		break;