aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/Kconfig3
-rw-r--r--drivers/s390/char/fs3270.c1
-rw-r--r--drivers/s390/char/keyboard.c21
-rw-r--r--drivers/s390/char/vmcp.c38
-rw-r--r--drivers/s390/char/zcore.c4
5 files changed, 21 insertions, 46 deletions
diff --git a/drivers/s390/char/Kconfig b/drivers/s390/char/Kconfig
index 4e34d3686c23..40834f18754c 100644
--- a/drivers/s390/char/Kconfig
+++ b/drivers/s390/char/Kconfig
@@ -148,13 +148,12 @@ config VMLOGRDR
148 This driver depends on the IUCV support driver. 148 This driver depends on the IUCV support driver.
149 149
150config VMCP 150config VMCP
151 tristate "Support for the z/VM CP interface (VM only)" 151 bool "Support for the z/VM CP interface"
152 depends on S390 152 depends on S390
153 help 153 help
154 Select this option if you want to be able to interact with the control 154 Select this option if you want to be able to interact with the control
155 program on z/VM 155 program on z/VM
156 156
157
158config MONREADER 157config MONREADER
159 tristate "API for reading z/VM monitor service records" 158 tristate "API for reading z/VM monitor service records"
160 depends on IUCV 159 depends on IUCV
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 0eabcca3c92d..857dfcb7b359 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -484,6 +484,7 @@ fs3270_open(struct inode *inode, struct file *filp)
484 raw3270_del_view(&fp->view); 484 raw3270_del_view(&fp->view);
485 goto out; 485 goto out;
486 } 486 }
487 nonseekable_open(inode, filp);
487 filp->private_data = fp; 488 filp->private_data = fp;
488out: 489out:
489 mutex_unlock(&fs3270_mutex); 490 mutex_unlock(&fs3270_mutex);
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index cb6bffe7141a..18d9a497863b 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -49,7 +49,7 @@ static unsigned char ret_diacr[NR_DEAD] = {
49struct kbd_data * 49struct kbd_data *
50kbd_alloc(void) { 50kbd_alloc(void) {
51 struct kbd_data *kbd; 51 struct kbd_data *kbd;
52 int i, len; 52 int i;
53 53
54 kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL); 54 kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL);
55 if (!kbd) 55 if (!kbd)
@@ -59,12 +59,11 @@ kbd_alloc(void) {
59 goto out_kbd; 59 goto out_kbd;
60 for (i = 0; i < ARRAY_SIZE(key_maps); i++) { 60 for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
61 if (key_maps[i]) { 61 if (key_maps[i]) {
62 kbd->key_maps[i] = 62 kbd->key_maps[i] = kmemdup(key_maps[i],
63 kmalloc(sizeof(u_short)*NR_KEYS, GFP_KERNEL); 63 sizeof(u_short) * NR_KEYS,
64 GFP_KERNEL);
64 if (!kbd->key_maps[i]) 65 if (!kbd->key_maps[i])
65 goto out_maps; 66 goto out_maps;
66 memcpy(kbd->key_maps[i], key_maps[i],
67 sizeof(u_short)*NR_KEYS);
68 } 67 }
69 } 68 }
70 kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL); 69 kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL);
@@ -72,23 +71,21 @@ kbd_alloc(void) {
72 goto out_maps; 71 goto out_maps;
73 for (i = 0; i < ARRAY_SIZE(func_table); i++) { 72 for (i = 0; i < ARRAY_SIZE(func_table); i++) {
74 if (func_table[i]) { 73 if (func_table[i]) {
75 len = strlen(func_table[i]) + 1; 74 kbd->func_table[i] = kstrdup(func_table[i],
76 kbd->func_table[i] = kmalloc(len, GFP_KERNEL); 75 GFP_KERNEL);
77 if (!kbd->func_table[i]) 76 if (!kbd->func_table[i])
78 goto out_func; 77 goto out_func;
79 memcpy(kbd->func_table[i], func_table[i], len);
80 } 78 }
81 } 79 }
82 kbd->fn_handler = 80 kbd->fn_handler =
83 kzalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL); 81 kzalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL);
84 if (!kbd->fn_handler) 82 if (!kbd->fn_handler)
85 goto out_func; 83 goto out_func;
86 kbd->accent_table = 84 kbd->accent_table = kmemdup(accent_table,
87 kmalloc(sizeof(struct kbdiacruc)*MAX_DIACR, GFP_KERNEL); 85 sizeof(struct kbdiacruc) * MAX_DIACR,
86 GFP_KERNEL);
88 if (!kbd->accent_table) 87 if (!kbd->accent_table)
89 goto out_fn_handler; 88 goto out_fn_handler;
90 memcpy(kbd->accent_table, accent_table,
91 sizeof(struct kbdiacruc)*MAX_DIACR);
92 kbd->accent_table_size = accent_table_size; 89 kbd->accent_table_size = accent_table_size;
93 return kbd; 90 return kbd;
94 91
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 5bb59d36a6d4..04e532eec032 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -1,24 +1,20 @@
1/* 1/*
2 * Copyright IBM Corp. 2004,2007 2 * Copyright IBM Corp. 2004,2010
3 * Interface implementation for communication with the z/VM control program 3 * Interface implementation for communication with the z/VM control program
4 * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
5 * 4 *
5 * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
6 * 6 *
7 * z/VMs CP offers the possibility to issue commands via the diagnose code 8 7 * z/VMs CP offers the possibility to issue commands via the diagnose code 8
8 * this driver implements a character device that issues these commands and 8 * this driver implements a character device that issues these commands and
9 * returns the answer of CP. 9 * returns the answer of CP.
10 10 *
11 * The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS 11 * The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS
12 */ 12 */
13 13
14#define KMSG_COMPONENT "vmcp"
15#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
16
17#include <linux/fs.h> 14#include <linux/fs.h>
18#include <linux/init.h> 15#include <linux/init.h>
19#include <linux/kernel.h> 16#include <linux/kernel.h>
20#include <linux/miscdevice.h> 17#include <linux/miscdevice.h>
21#include <linux/module.h>
22#include <linux/slab.h> 18#include <linux/slab.h>
23#include <asm/compat.h> 19#include <asm/compat.h>
24#include <asm/cpcmd.h> 20#include <asm/cpcmd.h>
@@ -26,10 +22,6 @@
26#include <asm/uaccess.h> 22#include <asm/uaccess.h>
27#include "vmcp.h" 23#include "vmcp.h"
28 24
29MODULE_LICENSE("GPL");
30MODULE_AUTHOR("Christian Borntraeger <borntraeger@de.ibm.com>");
31MODULE_DESCRIPTION("z/VM CP interface");
32
33static debug_info_t *vmcp_debug; 25static debug_info_t *vmcp_debug;
34 26
35static int vmcp_open(struct inode *inode, struct file *file) 27static int vmcp_open(struct inode *inode, struct file *file)
@@ -197,11 +189,8 @@ static int __init vmcp_init(void)
197{ 189{
198 int ret; 190 int ret;
199 191
200 if (!MACHINE_IS_VM) { 192 if (!MACHINE_IS_VM)
201 pr_warning("The z/VM CP interface device driver cannot be " 193 return 0;
202 "loaded without z/VM\n");
203 return -ENODEV;
204 }
205 194
206 vmcp_debug = debug_register("vmcp", 1, 1, 240); 195 vmcp_debug = debug_register("vmcp", 1, 1, 240);
207 if (!vmcp_debug) 196 if (!vmcp_debug)
@@ -214,19 +203,8 @@ static int __init vmcp_init(void)
214 } 203 }
215 204
216 ret = misc_register(&vmcp_dev); 205 ret = misc_register(&vmcp_dev);
217 if (ret) { 206 if (ret)
218 debug_unregister(vmcp_debug); 207 debug_unregister(vmcp_debug);
219 return ret; 208 return ret;
220 }
221
222 return 0;
223}
224
225static void __exit vmcp_exit(void)
226{
227 misc_deregister(&vmcp_dev);
228 debug_unregister(vmcp_debug);
229} 209}
230 210device_initcall(vmcp_init);
231module_init(vmcp_init);
232module_exit(vmcp_exit);
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 7217966f7d31..f5ea3384a4b9 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -445,7 +445,7 @@ static int zcore_memmap_open(struct inode *inode, struct file *filp)
445 } 445 }
446 kfree(chunk_array); 446 kfree(chunk_array);
447 filp->private_data = buf; 447 filp->private_data = buf;
448 return 0; 448 return nonseekable_open(inode, filp);
449} 449}
450 450
451static int zcore_memmap_release(struct inode *inode, struct file *filp) 451static int zcore_memmap_release(struct inode *inode, struct file *filp)
@@ -473,7 +473,7 @@ static ssize_t zcore_reipl_write(struct file *filp, const char __user *buf,
473 473
474static int zcore_reipl_open(struct inode *inode, struct file *filp) 474static int zcore_reipl_open(struct inode *inode, struct file *filp)
475{ 475{
476 return 0; 476 return nonseekable_open(inode, filp);
477} 477}
478 478
479static int zcore_reipl_release(struct inode *inode, struct file *filp) 479static int zcore_reipl_release(struct inode *inode, struct file *filp)