Skip to content

Commit 240c5f2

Browse files
MrVanlinusw
authored andcommitted
pinctrl: bcm: bcm63xx: Use scope based of_node_put() cleanups
Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 3a0278c commit 240c5f2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/pinctrl/bcm/pinctrl-bcm63xx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ int bcm63xx_pinctrl_probe(struct platform_device *pdev,
6767
{
6868
struct device *dev = &pdev->dev;
6969
struct bcm63xx_pinctrl *pc;
70-
struct device_node *node;
7170
int err;
7271

7372
pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL);
@@ -94,12 +93,11 @@ int bcm63xx_pinctrl_probe(struct platform_device *pdev,
9493
if (IS_ERR(pc->pctl_dev))
9594
return PTR_ERR(pc->pctl_dev);
9695

97-
for_each_child_of_node(dev->parent->of_node, node) {
96+
for_each_child_of_node_scoped(dev->parent->of_node, node) {
9897
if (of_match_node(bcm63xx_gpio_of_match, node)) {
9998
err = bcm63xx_gpio_probe(dev, node, soc, pc);
10099
if (err) {
101100
dev_err(dev, "could not add GPIO chip\n");
102-
of_node_put(node);
103101
return err;
104102
}
105103
}

0 commit comments

Comments
 (0)