Commit d1efa2a7 authored by Julia Lawall's avatar Julia Lawall Committed by Benjamin Herrenschmidt

powerpc/powermac: Drop unnecessary of_node_put

for_each_node_by_name only exits when its first argument is NULL, and a
subsequent call to of_node_put on that argument is unnecessary.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
iterator name for_each_node_by_name;
expression np,E;
identifier l;
@@

for_each_node_by_name(np,...) {
  ... when != break;
      when != goto l;
}
... when != np = E
- of_node_put(np);
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Reviewed-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 249ec228
...@@ -2878,7 +2878,6 @@ set_initial_features(void) ...@@ -2878,7 +2878,6 @@ set_initial_features(void)
core99_airport_enable(np, 0, 0); core99_airport_enable(np, 0, 0);
} }
} }
of_node_put(np);
} }
/* On all machines that support sound PM, switch sound off */ /* On all machines that support sound PM, switch sound off */
......
...@@ -1155,13 +1155,11 @@ void __init pmac_pcibios_after_init(void) ...@@ -1155,13 +1155,11 @@ void __init pmac_pcibios_after_init(void)
pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0);
} }
} }
of_node_put(nd);
for_each_node_by_name(nd, "ethernet") { for_each_node_by_name(nd, "ethernet") {
if (nd->parent && of_device_is_compatible(nd, "gmac") if (nd->parent && of_device_is_compatible(nd, "gmac")
&& of_device_is_compatible(nd->parent, "uni-north")) && of_device_is_compatible(nd->parent, "uni-north"))
pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0);
} }
of_node_put(nd);
} }
void pmac_pci_fixup_cardbus(struct pci_dev* dev) void pmac_pci_fixup_cardbus(struct pci_dev* dev)
......
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