[POWERPC] Fix warning in hpte_decode(), and generalize it
[powerpc.git] / drivers / char / viotape.c
index 94d79cb..13faf8d 100644 (file)
@@ -49,7 +49,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/ioctls.h>
-
+#include <asm/firmware.h>
 #include <asm/vio.h>
 #include <asm/iseries/vio.h>
 #include <asm/iseries/hv_lp_event.h>
@@ -872,7 +872,7 @@ free_op:
        return ret;
 }
 
-struct file_operations viotap_fops = {
+const struct file_operations viotap_fops = {
        owner: THIS_MODULE,
        read: viotap_read,
        write: viotap_write,
@@ -997,6 +997,9 @@ int __init viotap_init(void)
        int ret;
        struct proc_dir_entry *e;
 
+       if (!firmware_has_feature(FW_FEATURE_ISERIES))
+               return -ENODEV;
+
        op_struct_list = NULL;
        if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) {
                printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n");