diff options
Diffstat (limited to 'arch/powerpc/kernel/lparcfg.c')
-rw-r--r-- | arch/powerpc/kernel/lparcfg.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index d92f3871e9cf..e2a0a162299b 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -35,7 +35,13 @@ | |||
35 | #include <asm/vdso_datapage.h> | 35 | #include <asm/vdso_datapage.h> |
36 | #include <asm/vio.h> | 36 | #include <asm/vio.h> |
37 | #include <asm/mmu.h> | 37 | #include <asm/mmu.h> |
38 | #include <asm/machdep.h> | ||
38 | 39 | ||
40 | |||
41 | /* | ||
42 | * This isn't a module but we expose that to userspace | ||
43 | * via /proc so leave the definitions here | ||
44 | */ | ||
39 | #define MODULE_VERS "1.9" | 45 | #define MODULE_VERS "1.9" |
40 | #define MODULE_NAME "lparcfg" | 46 | #define MODULE_NAME "lparcfg" |
41 | 47 | ||
@@ -418,7 +424,8 @@ static void parse_em_data(struct seq_file *m) | |||
418 | { | 424 | { |
419 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; | 425 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; |
420 | 426 | ||
421 | if (plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS) | 427 | if (firmware_has_feature(FW_FEATURE_LPAR) && |
428 | plpar_hcall(H_GET_EM_PARMS, retbuf) == H_SUCCESS) | ||
422 | seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]); | 429 | seq_printf(m, "power_mode_data=%016lx\n", retbuf[0]); |
423 | } | 430 | } |
424 | 431 | ||
@@ -677,7 +684,6 @@ static int lparcfg_open(struct inode *inode, struct file *file) | |||
677 | } | 684 | } |
678 | 685 | ||
679 | static const struct file_operations lparcfg_fops = { | 686 | static const struct file_operations lparcfg_fops = { |
680 | .owner = THIS_MODULE, | ||
681 | .read = seq_read, | 687 | .read = seq_read, |
682 | .write = lparcfg_write, | 688 | .write = lparcfg_write, |
683 | .open = lparcfg_open, | 689 | .open = lparcfg_open, |
@@ -699,14 +705,4 @@ static int __init lparcfg_init(void) | |||
699 | } | 705 | } |
700 | return 0; | 706 | return 0; |
701 | } | 707 | } |
702 | 708 | machine_device_initcall(pseries, lparcfg_init); | |
703 | static void __exit lparcfg_cleanup(void) | ||
704 | { | ||
705 | remove_proc_subtree("powerpc/lparcfg", NULL); | ||
706 | } | ||
707 | |||
708 | module_init(lparcfg_init); | ||
709 | module_exit(lparcfg_cleanup); | ||
710 | MODULE_DESCRIPTION("Interface for LPAR configuration data"); | ||
711 | MODULE_AUTHOR("Dave Engebretsen"); | ||
712 | MODULE_LICENSE("GPL"); | ||