aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/lparcfg.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 23:21:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:34 -0400
commitb177a29251081576df35cfbcb0f7d7c80deceb8b (patch)
treee0f9814ad8b634392c0a38861c0ebb9e56d5a72c /arch/powerpc/kernel/lparcfg.c
parent6ea1511ec4ed477aeb5846275b52c89204d47089 (diff)
lparcfg: don't bother saving pointer to proc_dir_entry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc/kernel/lparcfg.c')
-rw-r--r--arch/powerpc/kernel/lparcfg.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index f5725bce9ed2..801a757c3630 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -41,8 +41,6 @@
41 41
42/* #define LPARCFG_DEBUG */ 42/* #define LPARCFG_DEBUG */
43 43
44static struct proc_dir_entry *proc_ppc64_lparcfg;
45
46/* 44/*
47 * Track sum of all purrs across all processors. This is used to further 45 * Track sum of all purrs across all processors. This is used to further
48 * calculate usage values by different applications 46 * calculate usage values by different applications
@@ -688,27 +686,22 @@ static const struct file_operations lparcfg_fops = {
688 686
689static int __init lparcfg_init(void) 687static int __init lparcfg_init(void)
690{ 688{
691 struct proc_dir_entry *ent;
692 umode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 689 umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
693 690
694 /* Allow writing if we have FW_FEATURE_SPLPAR */ 691 /* Allow writing if we have FW_FEATURE_SPLPAR */
695 if (firmware_has_feature(FW_FEATURE_SPLPAR)) 692 if (firmware_has_feature(FW_FEATURE_SPLPAR))
696 mode |= S_IWUSR; 693 mode |= S_IWUSR;
697 694
698 ent = proc_create("powerpc/lparcfg", mode, NULL, &lparcfg_fops); 695 if (!proc_create("powerpc/lparcfg", mode, NULL, &lparcfg_fops)) {
699 if (!ent) {
700 printk(KERN_ERR "Failed to create powerpc/lparcfg\n"); 696 printk(KERN_ERR "Failed to create powerpc/lparcfg\n");
701 return -EIO; 697 return -EIO;
702 } 698 }
703
704 proc_ppc64_lparcfg = ent;
705 return 0; 699 return 0;
706} 700}
707 701
708static void __exit lparcfg_cleanup(void) 702static void __exit lparcfg_cleanup(void)
709{ 703{
710 if (proc_ppc64_lparcfg) 704 remove_proc_subtree("powerpc/lparcfg", NULL);
711 remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
712} 705}
713 706
714module_init(lparcfg_init); 707module_init(lparcfg_init);