aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/lparcfg.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-08 13:04:20 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-08 13:04:20 -0500
commit21eb4fa1700112d1420d72e1de708af671a251c8 (patch)
tree3afd9f526da50108c27e05ac69826be5e7c2ad6e /arch/powerpc/kernel/lparcfg.c
parent0c0e8caf9fd6c9a49fb9fbdba14a8b7b4239adde (diff)
parentd003e7a1a569501cbe9a5ca14748177498c4893a (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
* master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: (116 commits) [POWERPC] Add export of vgacon_remap_base [POWERPC] Remove bogus comment about page_is_ram [POWERPC] windfarm: don't die on suspend thread signal [POWERPC] Fix comment in kernel/irq.c [POWERPC] ppc: Fix booke watchdog initialization [POWERPC] PPC: Use ARRAY_SIZE macro when appropriate [POWERPC] Use ARRAY_SIZE macro when appropriate [POWERPC] Fix ppc64's writing to struct file_operations [POWERPC] ppc: use syslog macro for the printk log level [POWERPC] ppc: cs4218_tdm remove extra brace [POWERPC] Add mpc52xx/lite5200 PCI support [POWERPC] Only use H_BULK_REMOVE if the firmware supports it [POWERPC] Fixup error handling when emulating a floating point instruction [POWERPC] Enable interrupts if we are doing fp math emulation [POWERPC] Added kprobes support to ppc32 [POWERPC] Make pSeries use the H_BULK_REMOVE hypervisor call [POWERPC] Clear RI bit in MSR before restoring r13 when returning to userspace [POWERPC] Fix performance monitor exception [POWERPC] Compile fixes for arch/powerpc dcr code [POWERPC] Maple: use mmio nvram ...
Diffstat (limited to 'arch/powerpc/kernel/lparcfg.c')
-rw-r--r--arch/powerpc/kernel/lparcfg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 41c05dcd68f4..0de5a08cf9b0 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -439,6 +439,10 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
439 439
440 ssize_t retval = -ENOMEM; 440 ssize_t retval = -ENOMEM;
441 441
442 if (!firmware_has_feature(FW_FEATURE_SPLPAR) ||
443 firmware_has_feature(FW_FEATURE_ISERIES))
444 return -EINVAL;
445
442 kbuf = kmalloc(count, GFP_KERNEL); 446 kbuf = kmalloc(count, GFP_KERNEL);
443 if (!kbuf) 447 if (!kbuf)
444 goto out; 448 goto out;
@@ -517,7 +521,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
517static ssize_t lparcfg_write(struct file *file, const char __user * buf, 521static ssize_t lparcfg_write(struct file *file, const char __user * buf,
518 size_t count, loff_t * off) 522 size_t count, loff_t * off)
519{ 523{
520 return count; 524 return -EINVAL;
521} 525}
522 526
523#endif /* CONFIG_PPC_PSERIES */ 527#endif /* CONFIG_PPC_PSERIES */
@@ -570,6 +574,7 @@ static int lparcfg_open(struct inode *inode, struct file *file)
570struct file_operations lparcfg_fops = { 574struct file_operations lparcfg_fops = {
571 .owner = THIS_MODULE, 575 .owner = THIS_MODULE,
572 .read = seq_read, 576 .read = seq_read,
577 .write = lparcfg_write,
573 .open = lparcfg_open, 578 .open = lparcfg_open,
574 .release = single_release, 579 .release = single_release,
575}; 580};
@@ -581,10 +586,8 @@ int __init lparcfg_init(void)
581 586
582 /* Allow writing if we have FW_FEATURE_SPLPAR */ 587 /* Allow writing if we have FW_FEATURE_SPLPAR */
583 if (firmware_has_feature(FW_FEATURE_SPLPAR) && 588 if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
584 !firmware_has_feature(FW_FEATURE_ISERIES)) { 589 !firmware_has_feature(FW_FEATURE_ISERIES))
585 lparcfg_fops.write = lparcfg_write;
586 mode |= S_IWUSR; 590 mode |= S_IWUSR;
587 }
588 591
589 ent = create_proc_entry("ppc64/lparcfg", mode, NULL); 592 ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
590 if (ent) { 593 if (ent) {