Skip to content

Commit f73a2b0

Browse files
heicarstMartin Schwidefsky
authored andcommitted
[S390] vmcp: disallow modular build
Change the tristate Kbuild option into a bool option so that the module is either builtin or not available at all. There have been too many cases where people were missing the 'vmcp' device node and unable to send z/VM CP commands. So let's make sure that on distros it will always be present. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 86f2552 commit f73a2b0

2 files changed

Lines changed: 9 additions & 32 deletions

File tree

‎drivers/s390/char/Kconfig‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,12 @@ config VMLOGRDR
148148
This driver depends on the IUCV support driver.
149149

150150
config VMCP
151-
tristate "Support for the z/VM CP interface (VM only)"
151+
bool "Support for the z/VM CP interface"
152152
depends on S390
153153
help
154154
Select this option if you want to be able to interact with the control
155155
program on z/VM
156156

157-
158157
config MONREADER
159158
tristate "API for reading z/VM monitor service records"
160159
depends on IUCV

‎drivers/s390/char/vmcp.c‎

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,27 @@
11
/*
2-
* Copyright IBM Corp. 2004,2007
2+
* Copyright IBM Corp. 2004,2010
33
* Interface implementation for communication with the z/VM control program
4-
* Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
54
*
5+
* Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
66
*
77
* z/VMs CP offers the possibility to issue commands via the diagnose code 8
88
* this driver implements a character device that issues these commands and
99
* returns the answer of CP.
10-
10+
*
1111
* The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS
1212
*/
1313

14-
#define KMSG_COMPONENT "vmcp"
15-
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
16-
1714
#include <linux/fs.h>
1815
#include <linux/init.h>
1916
#include <linux/kernel.h>
2017
#include <linux/miscdevice.h>
21-
#include <linux/module.h>
2218
#include <linux/slab.h>
2319
#include <asm/compat.h>
2420
#include <asm/cpcmd.h>
2521
#include <asm/debug.h>
2622
#include <asm/uaccess.h>
2723
#include "vmcp.h"
2824

29-
MODULE_LICENSE("GPL");
30-
MODULE_AUTHOR("Christian Borntraeger <borntraeger@de.ibm.com>");
31-
MODULE_DESCRIPTION("z/VM CP interface");
32-
3325
static debug_info_t *vmcp_debug;
3426

3527
static int vmcp_open(struct inode *inode, struct file *file)
@@ -197,11 +189,8 @@ static int __init vmcp_init(void)
197189
{
198190
int ret;
199191

200-
if (!MACHINE_IS_VM) {
201-
pr_warning("The z/VM CP interface device driver cannot be "
202-
"loaded without z/VM\n");
203-
return -ENODEV;
204-
}
192+
if (!MACHINE_IS_VM)
193+
return 0;
205194

206195
vmcp_debug = debug_register("vmcp", 1, 1, 240);
207196
if (!vmcp_debug)
@@ -214,19 +203,8 @@ static int __init vmcp_init(void)
214203
}
215204

216205
ret = misc_register(&vmcp_dev);
217-
if (ret) {
206+
if (ret)
218207
debug_unregister(vmcp_debug);
219-
return ret;
220-
}
221-
222-
return 0;
223-
}
224-
225-
static void __exit vmcp_exit(void)
226-
{
227-
misc_deregister(&vmcp_dev);
228-
debug_unregister(vmcp_debug);
208+
return ret;
229209
}
230-
231-
module_init(vmcp_init);
232-
module_exit(vmcp_exit);
210+
device_initcall(vmcp_init);

0 commit comments

Comments
 (0)