|
@@ -1,24 +1,20 @@
|
|
/*
|
|
/*
|
|
- * Copyright IBM Corp. 2004,2007
|
|
|
|
|
|
+ * Copyright IBM Corp. 2004,2010
|
|
* Interface implementation for communication with the z/VM control program
|
|
* Interface implementation for communication with the z/VM control program
|
|
- * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
|
|
|
|
*
|
|
*
|
|
|
|
+ * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
|
|
*
|
|
*
|
|
* z/VMs CP offers the possibility to issue commands via the diagnose code 8
|
|
* z/VMs CP offers the possibility to issue commands via the diagnose code 8
|
|
* this driver implements a character device that issues these commands and
|
|
* this driver implements a character device that issues these commands and
|
|
* returns the answer of CP.
|
|
* returns the answer of CP.
|
|
-
|
|
|
|
|
|
+ *
|
|
* The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS
|
|
* The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS
|
|
*/
|
|
*/
|
|
|
|
|
|
-#define KMSG_COMPONENT "vmcp"
|
|
|
|
-#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
|
|
|
|
-
|
|
|
|
#include <linux/fs.h>
|
|
#include <linux/fs.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/miscdevice.h>
|
|
#include <linux/miscdevice.h>
|
|
-#include <linux/module.h>
|
|
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
#include <asm/compat.h>
|
|
#include <asm/compat.h>
|
|
#include <asm/cpcmd.h>
|
|
#include <asm/cpcmd.h>
|
|
@@ -26,10 +22,6 @@
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
#include "vmcp.h"
|
|
#include "vmcp.h"
|
|
|
|
|
|
-MODULE_LICENSE("GPL");
|
|
|
|
-MODULE_AUTHOR("Christian Borntraeger <borntraeger@de.ibm.com>");
|
|
|
|
-MODULE_DESCRIPTION("z/VM CP interface");
|
|
|
|
-
|
|
|
|
static debug_info_t *vmcp_debug;
|
|
static debug_info_t *vmcp_debug;
|
|
|
|
|
|
static int vmcp_open(struct inode *inode, struct file *file)
|
|
static int vmcp_open(struct inode *inode, struct file *file)
|
|
@@ -197,11 +189,8 @@ static int __init vmcp_init(void)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- if (!MACHINE_IS_VM) {
|
|
|
|
- pr_warning("The z/VM CP interface device driver cannot be "
|
|
|
|
- "loaded without z/VM\n");
|
|
|
|
- return -ENODEV;
|
|
|
|
- }
|
|
|
|
|
|
+ if (!MACHINE_IS_VM)
|
|
|
|
+ return 0;
|
|
|
|
|
|
vmcp_debug = debug_register("vmcp", 1, 1, 240);
|
|
vmcp_debug = debug_register("vmcp", 1, 1, 240);
|
|
if (!vmcp_debug)
|
|
if (!vmcp_debug)
|
|
@@ -214,19 +203,8 @@ static int __init vmcp_init(void)
|
|
}
|
|
}
|
|
|
|
|
|
ret = misc_register(&vmcp_dev);
|
|
ret = misc_register(&vmcp_dev);
|
|
- if (ret) {
|
|
|
|
|
|
+ if (ret)
|
|
debug_unregister(vmcp_debug);
|
|
debug_unregister(vmcp_debug);
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void __exit vmcp_exit(void)
|
|
|
|
-{
|
|
|
|
- misc_deregister(&vmcp_dev);
|
|
|
|
- debug_unregister(vmcp_debug);
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
-
|
|
|
|
-module_init(vmcp_init);
|
|
|
|
-module_exit(vmcp_exit);
|
|
|
|
|
|
+device_initcall(vmcp_init);
|