diff options
author | Nicolas Palix <npalix@diku.dk> | 2008-12-02 19:25:03 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-08 00:25:07 -0500 |
commit | afcb065450913745027169d906b9afc8294f7007 (patch) | |
tree | ca98b87807652244cb93a192729d5bfe3e1ef729 /arch/powerpc | |
parent | c1f343028d35ba4e88cd4a3c44e0d8b8a84264ee (diff) |
powerpc/powermac: Add missing of_node_put
This patch fixes some unbalanced OF node references in the
powermac code
Signed-off-by: Nicolas Palix <npalix@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/time.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 54b7b76ed4f..04cdd32624d 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -661,6 +661,7 @@ static void __init init_second_ohare(void) | |||
661 | pci_find_hose_for_OF_device(np); | 661 | pci_find_hose_for_OF_device(np); |
662 | if (!hose) { | 662 | if (!hose) { |
663 | printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); | 663 | printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); |
664 | of_node_put(np); | ||
664 | return; | 665 | return; |
665 | } | 666 | } |
666 | early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); | 667 | early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); |
@@ -669,6 +670,7 @@ static void __init init_second_ohare(void) | |||
669 | early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); | 670 | early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); |
670 | } | 671 | } |
671 | has_second_ohare = 1; | 672 | has_second_ohare = 1; |
673 | of_node_put(np); | ||
672 | } | 674 | } |
673 | 675 | ||
674 | /* | 676 | /* |
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index 59eb840d8ce..1810e4226e5 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
@@ -265,12 +265,15 @@ int __init via_calibrate_decr(void) | |||
265 | struct resource rsrc; | 265 | struct resource rsrc; |
266 | 266 | ||
267 | vias = of_find_node_by_name(NULL, "via-cuda"); | 267 | vias = of_find_node_by_name(NULL, "via-cuda"); |
268 | if (vias == 0) | 268 | if (vias == NULL) |
269 | vias = of_find_node_by_name(NULL, "via-pmu"); | 269 | vias = of_find_node_by_name(NULL, "via-pmu"); |
270 | if (vias == 0) | 270 | if (vias == NULL) |
271 | vias = of_find_node_by_name(NULL, "via"); | 271 | vias = of_find_node_by_name(NULL, "via"); |
272 | if (vias == 0 || of_address_to_resource(vias, 0, &rsrc)) | 272 | if (vias == NULL || of_address_to_resource(vias, 0, &rsrc)) { |
273 | of_node_put(vias); | ||
273 | return 0; | 274 | return 0; |
275 | } | ||
276 | of_node_put(vias); | ||
274 | via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); | 277 | via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); |
275 | if (via == NULL) { | 278 | if (via == NULL) { |
276 | printk(KERN_ERR "Failed to map VIA for timer calibration !\n"); | 279 | printk(KERN_ERR "Failed to map VIA for timer calibration !\n"); |
@@ -297,7 +300,7 @@ int __init via_calibrate_decr(void) | |||
297 | ppc_tb_freq = (dstart - dend) * 100 / 6; | 300 | ppc_tb_freq = (dstart - dend) * 100 / 6; |
298 | 301 | ||
299 | iounmap(via); | 302 | iounmap(via); |
300 | 303 | ||
301 | return 1; | 304 | return 1; |
302 | } | 305 | } |
303 | #endif | 306 | #endif |