ssize_t retval = -ENOMEM;
 
+       if (!firmware_has_feature(FW_FEATURE_SPLPAR) ||
+                       firmware_has_feature(FW_FEATURE_ISERIES))
+               return -EINVAL;
+
        kbuf = kmalloc(count, GFP_KERNEL);
        if (!kbuf)
                goto out;
 static ssize_t lparcfg_write(struct file *file, const char __user * buf,
                             size_t count, loff_t * off)
 {
-       return count;
+       return -EINVAL;
 }
 
 #endif                         /* CONFIG_PPC_PSERIES */
 struct file_operations lparcfg_fops = {
        .owner          = THIS_MODULE,
        .read           = seq_read,
+       .write          = lparcfg_write,
        .open           = lparcfg_open,
        .release        = single_release,
 };
 
        /* Allow writing if we have FW_FEATURE_SPLPAR */
        if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
-                       !firmware_has_feature(FW_FEATURE_ISERIES)) {
-               lparcfg_fops.write = lparcfg_write;
+                       !firmware_has_feature(FW_FEATURE_ISERIES))
                mode |= S_IWUSR;
-       }
 
        ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
        if (ent) {