Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8b27a44 authored by Guodong Xu's avatar Guodong Xu Committed by Mark Brown
Browse files

regulator: remove unnecessary of_node_get() to parent



These of_node_get() were added to balance refcount decrements inside of
of_find_node_by_name().
See: commit c92f5dd2 ("regulator: Add missing of_node_put()")

However of_find_node_by_name() was then replaced by of_get_child_by_name(),
which doesn't call of_node_put() against its input parameter.

So, need to remove these unnecessary of_node_get() calls.

Signed-off-by: default avatarGuodong Xu <guodong.xu@linaro.org>
Reviewed-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7d1311b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
				    struct regulator_config *config)
{
	struct device_node *nproot, *np;
	nproot = of_node_get(pdev->dev.parent->of_node);
	nproot = pdev->dev.parent->of_node;
	if (!nproot)
		return -ENODEV;
	nproot = of_get_child_by_name(nproot, "regulators");
+2 −2
Original line number Diff line number Diff line
@@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
		config.init_data = pdata->regulators[pdev->id];
	} else {
#ifdef CONFIG_OF
		struct device_node *nproot, *np;
		struct device_node *nproot = da9052->dev->of_node;
		struct device_node *np;

		nproot = of_node_get(da9052->dev->of_node);
		if (!nproot)
			return -ENODEV;

+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
	struct device_node *np, *regulators;
	int ret;

	np = of_node_get(pdev->dev.parent->of_node);
	np = pdev->dev.parent->of_node;
	if (!np)
		return 0;

+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
	struct device_node *nproot, *np;
	int rcount;

	nproot = of_node_get(pdev->dev.parent->of_node);
	nproot = pdev->dev.parent->of_node;
	if (!nproot)
		return -ENODEV;
	np = of_get_child_by_name(nproot, "regulators");
+1 −1
Original line number Diff line number Diff line
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
	struct max8997_regulator_data *rdata;
	unsigned int i, dvs_voltage_nr = 1, ret;

	pmic_np = of_node_get(iodev->dev->of_node);
	pmic_np = iodev->dev->of_node;
	if (!pmic_np) {
		dev_err(&pdev->dev, "could not find pmic sub-node\n");
		return -ENODEV;
Loading