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

regulator: twl6030: use variable for device node

Instead of refering the full pdev->dev.of_node use a local variable.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lore.kernel.org/r/20190725094542.16547-3-gregory.clement@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Gregory CLEMENT and committed by
Mark Brown
621d3ce8 906c4d5c

+3 -3
+3 -3
drivers/regulator/twl6030-regulator.c
··· 665 665 struct regulation_constraints *c; 666 666 struct regulator_dev *rdev; 667 667 struct regulator_config config = { }; 668 + struct device_node *np = pdev->dev.of_node; 668 669 669 670 template = of_device_get_match_data(&pdev->dev); 670 671 if (!template) 671 672 return -ENODEV; 672 673 673 674 id = template->desc.id; 674 - initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node, 675 - &template->desc); 675 + initdata = of_get_regulator_init_data(&pdev->dev, np, &template->desc); 676 676 if (!initdata) 677 677 return -EINVAL; 678 678 ··· 713 713 config.dev = &pdev->dev; 714 714 config.init_data = initdata; 715 715 config.driver_data = info; 716 - config.of_node = pdev->dev.of_node; 716 + config.of_node = np; 717 717 718 718 rdev = devm_regulator_register(&pdev->dev, &info->desc, &config); 719 719 if (IS_ERR(rdev)) {