Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / arch / powerpc / platforms / iseries / viopath.c
index 04e07e5..e2100ec 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/prom.h>
+#include <asm/firmware.h>
 #include <asm/iseries/hv_types.h>
 #include <asm/iseries/hv_lp_event.h>
 #include <asm/iseries/hv_lp_config.h>
@@ -119,10 +120,9 @@ static int proc_viopath_show(struct seq_file *m, void *v)
        struct device_node *node;
        const char *sysid;
 
-       buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL);
+       buf = kzalloc(HW_PAGE_SIZE, GFP_KERNEL);
        if (!buf)
                return 0;
-       memset(buf, 0, HW_PAGE_SIZE);
 
        handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE,
                                DMA_FROM_DEVICE);
@@ -173,7 +173,7 @@ static int proc_viopath_open(struct inode *inode, struct file *file)
        return single_open(file, proc_viopath_show, NULL);
 }
 
-static struct file_operations proc_viopath_operations = {
+static const struct file_operations proc_viopath_operations = {
        .open           = proc_viopath_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -184,6 +184,9 @@ static int __init vio_proc_init(void)
 {
        struct proc_dir_entry *e;
 
+       if (!firmware_has_feature(FW_FEATURE_ISERIES))
+               return 0;
+
        e = create_proc_entry("iSeries/config", 0, NULL);
        if (e)
                e->proc_fops = &proc_viopath_operations;