aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/ldc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/ldc.c')
-rw-r--r--arch/sparc64/kernel/ldc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c
index 217478a94128..63969f610284 100644
--- a/arch/sparc64/kernel/ldc.c
+++ b/arch/sparc64/kernel/ldc.c
@@ -2338,6 +2338,7 @@ static int __init ldc_init(void)
2338 unsigned long major, minor; 2338 unsigned long major, minor;
2339 struct mdesc_handle *hp; 2339 struct mdesc_handle *hp;
2340 const u64 *v; 2340 const u64 *v;
2341 int err;
2341 u64 mp; 2342 u64 mp;
2342 2343
2343 hp = mdesc_grab(); 2344 hp = mdesc_grab();
@@ -2345,29 +2346,33 @@ static int __init ldc_init(void)
2345 return -ENODEV; 2346 return -ENODEV;
2346 2347
2347 mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform"); 2348 mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform");
2349 err = -ENODEV;
2348 if (mp == MDESC_NODE_NULL) 2350 if (mp == MDESC_NODE_NULL)
2349 return -ENODEV; 2351 goto out;
2350 2352
2351 v = mdesc_get_property(hp, mp, "domaining-enabled", NULL); 2353 v = mdesc_get_property(hp, mp, "domaining-enabled", NULL);
2352 if (!v) 2354 if (!v)
2353 return -ENODEV; 2355 goto out;
2354 2356
2355 major = 1; 2357 major = 1;
2356 minor = 0; 2358 minor = 0;
2357 if (sun4v_hvapi_register(HV_GRP_LDOM, major, &minor)) { 2359 if (sun4v_hvapi_register(HV_GRP_LDOM, major, &minor)) {
2358 printk(KERN_INFO PFX "Could not register LDOM hvapi.\n"); 2360 printk(KERN_INFO PFX "Could not register LDOM hvapi.\n");
2359 return -ENODEV; 2361 goto out;
2360 } 2362 }
2361 2363
2362 printk(KERN_INFO "%s", version); 2364 printk(KERN_INFO "%s", version);
2363 2365
2364 if (!*v) { 2366 if (!*v) {
2365 printk(KERN_INFO PFX "Domaining disabled.\n"); 2367 printk(KERN_INFO PFX "Domaining disabled.\n");
2366 return -ENODEV; 2368 goto out;
2367 } 2369 }
2368 ldom_domaining_enabled = 1; 2370 ldom_domaining_enabled = 1;
2371 err = 0;
2369 2372
2370 return 0; 2373out:
2374 mdesc_release(hp);
2375 return err;
2371} 2376}
2372 2377
2373core_initcall(ldc_init); 2378core_initcall(ldc_init);