Commit 621d3ce8 authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Mark Brown

regulator: twl6030: use variable for device node

Instead of refering the full pdev->dev.of_node use a local variable.
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lore.kernel.org/r/20190725094542.16547-3-gregory.clement@bootlin.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 906c4d5c
...@@ -665,14 +665,14 @@ static int twlreg_probe(struct platform_device *pdev) ...@@ -665,14 +665,14 @@ static int twlreg_probe(struct platform_device *pdev)
struct regulation_constraints *c; struct regulation_constraints *c;
struct regulator_dev *rdev; struct regulator_dev *rdev;
struct regulator_config config = { }; struct regulator_config config = { };
struct device_node *np = pdev->dev.of_node;
template = of_device_get_match_data(&pdev->dev); template = of_device_get_match_data(&pdev->dev);
if (!template) if (!template)
return -ENODEV; return -ENODEV;
id = template->desc.id; id = template->desc.id;
initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node, initdata = of_get_regulator_init_data(&pdev->dev, np, &template->desc);
&template->desc);
if (!initdata) if (!initdata)
return -EINVAL; return -EINVAL;
...@@ -713,7 +713,7 @@ static int twlreg_probe(struct platform_device *pdev) ...@@ -713,7 +713,7 @@ static int twlreg_probe(struct platform_device *pdev)
config.dev = &pdev->dev; config.dev = &pdev->dev;
config.init_data = initdata; config.init_data = initdata;
config.driver_data = info; config.driver_data = info;
config.of_node = pdev->dev.of_node; config.of_node = np;
rdev = devm_regulator_register(&pdev->dev, &info->desc, &config); rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment