Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 c92f5dd2c42f ("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: Guodong Xu <guodong.xu@linaro.org>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Guodong Xu and committed by
Mark Brown
b8b27a44 7d1311b9

+7 -8
+1 -1
drivers/regulator/88pm8607.c
··· 319 319 struct regulator_config *config) 320 320 { 321 321 struct device_node *nproot, *np; 322 - nproot = of_node_get(pdev->dev.parent->of_node); 322 + nproot = pdev->dev.parent->of_node; 323 323 if (!nproot) 324 324 return -ENODEV; 325 325 nproot = of_get_child_by_name(nproot, "regulators");
+2 -2
drivers/regulator/da9052-regulator.c
··· 422 422 config.init_data = pdata->regulators[pdev->id]; 423 423 } else { 424 424 #ifdef CONFIG_OF 425 - struct device_node *nproot, *np; 425 + struct device_node *nproot = da9052->dev->of_node; 426 + struct device_node *np; 426 427 427 - nproot = of_node_get(da9052->dev->of_node); 428 428 if (!nproot) 429 429 return -ENODEV; 430 430
+1 -1
drivers/regulator/max8907-regulator.c
··· 226 226 struct device_node *np, *regulators; 227 227 int ret; 228 228 229 - np = of_node_get(pdev->dev.parent->of_node); 229 + np = pdev->dev.parent->of_node; 230 230 if (!np) 231 231 return 0; 232 232
+1 -1
drivers/regulator/max8925-regulator.c
··· 250 250 struct device_node *nproot, *np; 251 251 int rcount; 252 252 253 - nproot = of_node_get(pdev->dev.parent->of_node); 253 + nproot = pdev->dev.parent->of_node; 254 254 if (!nproot) 255 255 return -ENODEV; 256 256 np = of_get_child_by_name(nproot, "regulators");
+1 -1
drivers/regulator/max8997.c
··· 917 917 struct max8997_regulator_data *rdata; 918 918 unsigned int i, dvs_voltage_nr = 1, ret; 919 919 920 - pmic_np = of_node_get(iodev->dev->of_node); 920 + pmic_np = iodev->dev->of_node; 921 921 if (!pmic_np) { 922 922 dev_err(&pdev->dev, "could not find pmic sub-node\n"); 923 923 return -ENODEV;
-1
drivers/regulator/palmas-regulator.c
··· 1427 1427 u32 prop; 1428 1428 int idx, ret; 1429 1429 1430 - node = of_node_get(node); 1431 1430 regulators = of_get_child_by_name(node, "regulators"); 1432 1431 if (!regulators) { 1433 1432 dev_info(dev, "regulator node not found\n");
+1 -1
drivers/regulator/tps65910-regulator.c
··· 1014 1014 if (!pmic_plat_data) 1015 1015 return NULL; 1016 1016 1017 - np = of_node_get(pdev->dev.parent->of_node); 1017 + np = pdev->dev.parent->of_node; 1018 1018 regulators = of_get_child_by_name(np, "regulators"); 1019 1019 if (!regulators) { 1020 1020 dev_err(&pdev->dev, "regulator node not found\n");