Skip to content

Commit

Permalink
regulator: twl6030: use variable for device node
Browse files Browse the repository at this point in the history
Instead of refering the full pdev->dev.of_node use a local variable.

Signed-off-by: Gregory CLEMENT <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
gclement authored and broonie committed Aug 9, 2019
1 parent 906c4d5 commit 621d3ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/regulator/twl6030-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,14 @@ static int twlreg_probe(struct platform_device *pdev)
struct regulation_constraints *c;
struct regulator_dev *rdev;
struct regulator_config config = { };
struct device_node *np = pdev->dev.of_node;

template = of_device_get_match_data(&pdev->dev);
if (!template)
return -ENODEV;

id = template->desc.id;
initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node,
&template->desc);
initdata = of_get_regulator_init_data(&pdev->dev, np, &template->desc);
if (!initdata)
return -EINVAL;

Expand Down Expand Up @@ -713,7 +713,7 @@ static int twlreg_probe(struct platform_device *pdev)
config.dev = &pdev->dev;
config.init_data = initdata;
config.driver_data = info;
config.of_node = pdev->dev.of_node;
config.of_node = np;

rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
if (IS_ERR(rdev)) {
Expand Down

0 comments on commit 621d3ce

Please sign in to comment.