diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-11-06 01:26:42 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-11-07 22:15:33 -0500 |
commit | 7992344fdeb9b3bc0ce6eacaf600eb801f231c30 (patch) | |
tree | 5b33535b26f05f6eff59549f63a4888aee51e7c2 /arch/powerpc/platforms/iseries | |
parent | aca71ef8827d11de243e30f170cfc126376803b4 (diff) |
[POWERPC] iSeries: Fix ref counting in vio setup
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/iseries')
-rw-r--r-- | arch/powerpc/platforms/iseries/vio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c index d6435b03971f..be06cfd9fa3d 100644 --- a/arch/powerpc/platforms/iseries/vio.c +++ b/arch/powerpc/platforms/iseries/vio.c | |||
@@ -523,15 +523,16 @@ static void __init get_viotape_info(struct device_node *vio_root) | |||
523 | static int __init iseries_vio_init(void) | 523 | static int __init iseries_vio_init(void) |
524 | { | 524 | { |
525 | struct device_node *vio_root; | 525 | struct device_node *vio_root; |
526 | int ret = -ENODEV; | ||
526 | 527 | ||
527 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) | 528 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) |
528 | return -ENODEV; | 529 | goto out; |
529 | 530 | ||
530 | iommu_vio_init(); | 531 | iommu_vio_init(); |
531 | 532 | ||
532 | vio_root = of_find_node_by_path("/vdevice"); | 533 | vio_root = of_find_node_by_path("/vdevice"); |
533 | if (!vio_root) | 534 | if (!vio_root) |
534 | return -ENODEV; | 535 | goto out; |
535 | 536 | ||
536 | if (viopath_hostLp == HvLpIndexInvalid) { | 537 | if (viopath_hostLp == HvLpIndexInvalid) { |
537 | vio_set_hostlp(); | 538 | vio_set_hostlp(); |
@@ -544,10 +545,11 @@ static int __init iseries_vio_init(void) | |||
544 | get_viocd_info(vio_root); | 545 | get_viocd_info(vio_root); |
545 | get_viotape_info(vio_root); | 546 | get_viotape_info(vio_root); |
546 | 547 | ||
547 | return 0; | 548 | ret = 0; |
548 | 549 | ||
549 | put_node: | 550 | put_node: |
550 | of_node_put(vio_root); | 551 | of_node_put(vio_root); |
551 | return -ENODEV; | 552 | out: |
553 | return ret; | ||
552 | } | 554 | } |
553 | arch_initcall(iseries_vio_init); | 555 | arch_initcall(iseries_vio_init); |