Commit c667aac8 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by David S. Miller

[S390]: Adapt monreader driver to new IUCV API

Adapt monreader character device driver to new IUCV API
Signed-off-by: default avatarFrank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2356f4cb
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Character device driver for reading z/VM *MONITOR service records. * Character device driver for reading z/VM *MONITOR service records.
* *
* Copyright (C) 2004 IBM Corporation, IBM Deutschland Entwicklung GmbH. * Copyright 2004 IBM Corporation, IBM Deutschland Entwicklung GmbH.
* *
* Author: Gerald Schaefer <geraldsc@de.ibm.com> * Author: Gerald Schaefer <geraldsc@de.ibm.com>
*/ */
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
#include <asm/extmem.h> #include <asm/extmem.h>
#include <linux/poll.h> #include <linux/poll.h>
#include "../net/iucv.h" #include <net/iucv/iucv.h>
//#define MON_DEBUG /* Debug messages on/off */ //#define MON_DEBUG /* Debug messages on/off */
...@@ -50,14 +50,13 @@ static char mon_dcss_name[9] = "MONDCSS\0"; ...@@ -50,14 +50,13 @@ static char mon_dcss_name[9] = "MONDCSS\0";
struct mon_msg { struct mon_msg {
u32 pos; u32 pos;
u32 mca_offset; u32 mca_offset;
iucv_MessagePending local_eib; struct iucv_message msg;
char msglim_reached; char msglim_reached;
char replied_msglim; char replied_msglim;
}; };
struct mon_private { struct mon_private {
u16 pathid; struct iucv_path *path;
iucv_handle_t iucv_handle;
struct mon_msg *msg_array[MON_MSGLIM]; struct mon_msg *msg_array[MON_MSGLIM];
unsigned int write_index; unsigned int write_index;
unsigned int read_index; unsigned int read_index;
...@@ -75,8 +74,6 @@ static unsigned long mon_dcss_end; ...@@ -75,8 +74,6 @@ static unsigned long mon_dcss_end;
static DECLARE_WAIT_QUEUE_HEAD(mon_read_wait_queue); static DECLARE_WAIT_QUEUE_HEAD(mon_read_wait_queue);
static DECLARE_WAIT_QUEUE_HEAD(mon_conn_wait_queue); static DECLARE_WAIT_QUEUE_HEAD(mon_conn_wait_queue);
static u8 iucv_host[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static u8 user_data_connect[16] = { static u8 user_data_connect[16] = {
/* Version code, must be 0x01 for shared mode */ /* Version code, must be 0x01 for shared mode */
0x01, 0x01,
...@@ -100,8 +97,7 @@ static u8 user_data_sever[16] = { ...@@ -100,8 +97,7 @@ static u8 user_data_sever[16] = {
* Create the 8 bytes EBCDIC DCSS segment name from * Create the 8 bytes EBCDIC DCSS segment name from
* an ASCII name, incl. padding * an ASCII name, incl. padding
*/ */
static inline void static inline void dcss_mkname(char *ascii_name, char *ebcdic_name)
dcss_mkname(char *ascii_name, char *ebcdic_name)
{ {
int i; int i;
...@@ -119,8 +115,7 @@ dcss_mkname(char *ascii_name, char *ebcdic_name) ...@@ -119,8 +115,7 @@ dcss_mkname(char *ascii_name, char *ebcdic_name)
* print appropriate error message for segment_load()/segment_type() * print appropriate error message for segment_load()/segment_type()
* return code * return code
*/ */
static void static void mon_segment_warn(int rc, char* seg_name)
mon_segment_warn(int rc, char* seg_name)
{ {
switch (rc) { switch (rc) {
case -ENOENT: case -ENOENT:
...@@ -166,44 +161,37 @@ mon_segment_warn(int rc, char* seg_name) ...@@ -166,44 +161,37 @@ mon_segment_warn(int rc, char* seg_name)
} }
} }
static inline unsigned long static inline unsigned long mon_mca_start(struct mon_msg *monmsg)
mon_mca_start(struct mon_msg *monmsg)
{ {
return monmsg->local_eib.ln1msg1.iprmmsg1_u32; return *(u32 *) &monmsg->msg.rmmsg;
} }
static inline unsigned long static inline unsigned long mon_mca_end(struct mon_msg *monmsg)
mon_mca_end(struct mon_msg *monmsg)
{ {
return monmsg->local_eib.ln1msg2.ipbfln1f; return *(u32 *) &monmsg->msg.rmmsg[4];
} }
static inline u8 static inline u8 mon_mca_type(struct mon_msg *monmsg, u8 index)
mon_mca_type(struct mon_msg *monmsg, u8 index)
{ {
return *((u8 *) mon_mca_start(monmsg) + monmsg->mca_offset + index); return *((u8 *) mon_mca_start(monmsg) + monmsg->mca_offset + index);
} }
static inline u32 static inline u32 mon_mca_size(struct mon_msg *monmsg)
mon_mca_size(struct mon_msg *monmsg)
{ {
return mon_mca_end(monmsg) - mon_mca_start(monmsg) + 1; return mon_mca_end(monmsg) - mon_mca_start(monmsg) + 1;
} }
static inline u32 static inline u32 mon_rec_start(struct mon_msg *monmsg)
mon_rec_start(struct mon_msg *monmsg)
{ {
return *((u32 *) (mon_mca_start(monmsg) + monmsg->mca_offset + 4)); return *((u32 *) (mon_mca_start(monmsg) + monmsg->mca_offset + 4));
} }
static inline u32 static inline u32 mon_rec_end(struct mon_msg *monmsg)
mon_rec_end(struct mon_msg *monmsg)
{ {
return *((u32 *) (mon_mca_start(monmsg) + monmsg->mca_offset + 8)); return *((u32 *) (mon_mca_start(monmsg) + monmsg->mca_offset + 8));
} }
static inline int static inline int mon_check_mca(struct mon_msg *monmsg)
mon_check_mca(struct mon_msg *monmsg)
{ {
if ((mon_rec_end(monmsg) <= mon_rec_start(monmsg)) || if ((mon_rec_end(monmsg) <= mon_rec_start(monmsg)) ||
(mon_rec_start(monmsg) < mon_dcss_start) || (mon_rec_start(monmsg) < mon_dcss_start) ||
...@@ -221,20 +209,17 @@ mon_check_mca(struct mon_msg *monmsg) ...@@ -221,20 +209,17 @@ mon_check_mca(struct mon_msg *monmsg)
return 0; return 0;
} }
static inline int static inline int mon_send_reply(struct mon_msg *monmsg,
mon_send_reply(struct mon_msg *monmsg, struct mon_private *monpriv) struct mon_private *monpriv)
{ {
u8 prmmsg[8];
int rc; int rc;
P_DEBUG("read, REPLY: pathid = 0x%04X, msgid = 0x%08X, trgcls = " P_DEBUG("read, REPLY: pathid = 0x%04X, msgid = 0x%08X, trgcls = "
"0x%08X\n\n", "0x%08X\n\n",
monmsg->local_eib.ippathid, monmsg->local_eib.ipmsgid, monpriv->path->pathid, monmsg->msg.id, monmsg->msg.class);
monmsg->local_eib.iptrgcls);
rc = iucv_reply_prmmsg(monmsg->local_eib.ippathid, rc = iucv_message_reply(monpriv->path, &monmsg->msg,
monmsg->local_eib.ipmsgid, IUCV_IPRMDATA, NULL, 0);
monmsg->local_eib.iptrgcls,
0, prmmsg);
atomic_dec(&monpriv->msglim_count); atomic_dec(&monpriv->msglim_count);
if (likely(!monmsg->msglim_reached)) { if (likely(!monmsg->msglim_reached)) {
monmsg->pos = 0; monmsg->pos = 0;
...@@ -251,10 +236,19 @@ mon_send_reply(struct mon_msg *monmsg, struct mon_private *monpriv) ...@@ -251,10 +236,19 @@ mon_send_reply(struct mon_msg *monmsg, struct mon_private *monpriv)
return 0; return 0;
} }
static inline struct mon_private * static inline void mon_free_mem(struct mon_private *monpriv)
mon_alloc_mem(void) {
int i;
for (i = 0; i < MON_MSGLIM; i++)
if (monpriv->msg_array[i])
kfree(monpriv->msg_array[i]);
kfree(monpriv);
}
static inline struct mon_private *mon_alloc_mem(void)
{ {
int i,j; int i;
struct mon_private *monpriv; struct mon_private *monpriv;
monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
...@@ -267,16 +261,15 @@ mon_alloc_mem(void) ...@@ -267,16 +261,15 @@ mon_alloc_mem(void)
GFP_KERNEL); GFP_KERNEL);
if (!monpriv->msg_array[i]) { if (!monpriv->msg_array[i]) {
P_ERROR("open, no memory for msg_array\n"); P_ERROR("open, no memory for msg_array\n");
for (j = 0; j < i; j++) mon_free_mem(monpriv);
kfree(monpriv->msg_array[j]);
return NULL; return NULL;
} }
} }
return monpriv; return monpriv;
} }
static inline void static inline void mon_read_debug(struct mon_msg *monmsg,
mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv) struct mon_private *monpriv)
{ {
#ifdef MON_DEBUG #ifdef MON_DEBUG
u8 msg_type[2], mca_type; u8 msg_type[2], mca_type;
...@@ -284,7 +277,7 @@ mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv) ...@@ -284,7 +277,7 @@ mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv)
records_len = mon_rec_end(monmsg) - mon_rec_start(monmsg) + 1; records_len = mon_rec_end(monmsg) - mon_rec_start(monmsg) + 1;
memcpy(msg_type, &monmsg->local_eib.iptrgcls, 2); memcpy(msg_type, &monmsg->msg.class, 2);
EBCASC(msg_type, 2); EBCASC(msg_type, 2);
mca_type = mon_mca_type(monmsg, 0); mca_type = mon_mca_type(monmsg, 0);
EBCASC(&mca_type, 1); EBCASC(&mca_type, 1);
...@@ -292,8 +285,7 @@ mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv) ...@@ -292,8 +285,7 @@ mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv)
P_DEBUG("read, mon_read_index = %i, mon_write_index = %i\n", P_DEBUG("read, mon_read_index = %i, mon_write_index = %i\n",
monpriv->read_index, monpriv->write_index); monpriv->read_index, monpriv->write_index);
P_DEBUG("read, pathid = 0x%04X, msgid = 0x%08X, trgcls = 0x%08X\n", P_DEBUG("read, pathid = 0x%04X, msgid = 0x%08X, trgcls = 0x%08X\n",
monmsg->local_eib.ippathid, monmsg->local_eib.ipmsgid, monpriv->path->pathid, monmsg->msg.id, monmsg->msg.class);
monmsg->local_eib.iptrgcls);
P_DEBUG("read, msg_type = '%c%c', mca_type = '%c' / 0x%X / 0x%X\n", P_DEBUG("read, msg_type = '%c%c', mca_type = '%c' / 0x%X / 0x%X\n",
msg_type[0], msg_type[1], mca_type ? mca_type : 'X', msg_type[0], msg_type[1], mca_type ? mca_type : 'X',
mon_mca_type(monmsg, 1), mon_mca_type(monmsg, 2)); mon_mca_type(monmsg, 1), mon_mca_type(monmsg, 2));
...@@ -306,8 +298,7 @@ mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv) ...@@ -306,8 +298,7 @@ mon_read_debug(struct mon_msg *monmsg, struct mon_private *monpriv)
#endif #endif
} }
static inline void static inline void mon_next_mca(struct mon_msg *monmsg)
mon_next_mca(struct mon_msg *monmsg)
{ {
if (likely((mon_mca_size(monmsg) - monmsg->mca_offset) == 12)) if (likely((mon_mca_size(monmsg) - monmsg->mca_offset) == 12))
return; return;
...@@ -316,8 +307,7 @@ mon_next_mca(struct mon_msg *monmsg) ...@@ -316,8 +307,7 @@ mon_next_mca(struct mon_msg *monmsg)
monmsg->pos = 0; monmsg->pos = 0;
} }
static inline struct mon_msg * static inline struct mon_msg *mon_next_message(struct mon_private *monpriv)
mon_next_message(struct mon_private *monpriv)
{ {
struct mon_msg *monmsg; struct mon_msg *monmsg;
...@@ -342,39 +332,37 @@ mon_next_message(struct mon_private *monpriv) ...@@ -342,39 +332,37 @@ mon_next_message(struct mon_private *monpriv)
/****************************************************************************** /******************************************************************************
* IUCV handler * * IUCV handler *
*****************************************************************************/ *****************************************************************************/
static void static void mon_iucv_path_complete(struct iucv_path *path, u8 ipuser[16])
mon_iucv_ConnectionComplete(iucv_ConnectionComplete *eib, void *pgm_data)
{ {
struct mon_private *monpriv = (struct mon_private *) pgm_data; struct mon_private *monpriv = path->private;
P_DEBUG("IUCV connection completed\n"); P_DEBUG("IUCV connection completed\n");
P_DEBUG("IUCV ACCEPT (from *MONITOR): Version = 0x%02X, Event = " P_DEBUG("IUCV ACCEPT (from *MONITOR): Version = 0x%02X, Event = "
"0x%02X, Sample = 0x%02X\n", "0x%02X, Sample = 0x%02X\n",
eib->ipuser[0], eib->ipuser[1], eib->ipuser[2]); ipuser[0], ipuser[1], ipuser[2]);
atomic_set(&monpriv->iucv_connected, 1); atomic_set(&monpriv->iucv_connected, 1);
wake_up(&mon_conn_wait_queue); wake_up(&mon_conn_wait_queue);
} }
static void static void mon_iucv_path_severed(struct iucv_path *path, u8 ipuser[16])
mon_iucv_ConnectionSevered(iucv_ConnectionSevered *eib, void *pgm_data)
{ {
struct mon_private *monpriv = (struct mon_private *) pgm_data; struct mon_private *monpriv = path->private;
P_ERROR("IUCV connection severed with rc = 0x%X\n", P_ERROR("IUCV connection severed with rc = 0x%X\n", ipuser[0]);
(u8) eib->ipuser[0]); iucv_path_sever(path, NULL);
atomic_set(&monpriv->iucv_severed, 1); atomic_set(&monpriv->iucv_severed, 1);
wake_up(&mon_conn_wait_queue); wake_up(&mon_conn_wait_queue);
wake_up_interruptible(&mon_read_wait_queue); wake_up_interruptible(&mon_read_wait_queue);
} }
static void static void mon_iucv_message_pending(struct iucv_path *path,
mon_iucv_MessagePending(iucv_MessagePending *eib, void *pgm_data) struct iucv_message *msg)
{ {
struct mon_private *monpriv = (struct mon_private *) pgm_data; struct mon_private *monpriv = path->private;
P_DEBUG("IUCV message pending\n"); P_DEBUG("IUCV message pending\n");
memcpy(&monpriv->msg_array[monpriv->write_index]->local_eib, eib, memcpy(&monpriv->msg_array[monpriv->write_index]->msg,
sizeof(iucv_MessagePending)); msg, sizeof(*msg));
if (atomic_inc_return(&monpriv->msglim_count) == MON_MSGLIM) { if (atomic_inc_return(&monpriv->msglim_count) == MON_MSGLIM) {
P_WARNING("IUCV message pending, message limit (%i) reached\n", P_WARNING("IUCV message pending, message limit (%i) reached\n",
MON_MSGLIM); MON_MSGLIM);
...@@ -385,54 +373,45 @@ mon_iucv_MessagePending(iucv_MessagePending *eib, void *pgm_data) ...@@ -385,54 +373,45 @@ mon_iucv_MessagePending(iucv_MessagePending *eib, void *pgm_data)
wake_up_interruptible(&mon_read_wait_queue); wake_up_interruptible(&mon_read_wait_queue);
} }
static iucv_interrupt_ops_t mon_iucvops = { static struct iucv_handler monreader_iucv_handler = {
.ConnectionComplete = mon_iucv_ConnectionComplete, .path_complete = mon_iucv_path_complete,
.ConnectionSevered = mon_iucv_ConnectionSevered, .path_severed = mon_iucv_path_severed,
.MessagePending = mon_iucv_MessagePending, .message_pending = mon_iucv_message_pending,
}; };
/****************************************************************************** /******************************************************************************
* file operations * * file operations *
*****************************************************************************/ *****************************************************************************/
static int static int mon_open(struct inode *inode, struct file *filp)
mon_open(struct inode *inode, struct file *filp)
{ {
int rc, i;
struct mon_private *monpriv; struct mon_private *monpriv;
int rc;
/* /*
* only one user allowed * only one user allowed
*/ */
rc = -EBUSY;
if (test_and_set_bit(MON_IN_USE, &mon_in_use)) if (test_and_set_bit(MON_IN_USE, &mon_in_use))
return -EBUSY; goto out;
rc = -ENOMEM;
monpriv = mon_alloc_mem(); monpriv = mon_alloc_mem();
if (!monpriv) if (!monpriv)
return -ENOMEM; goto out_use;
/* /*
* Register with IUCV and connect to *MONITOR service * Connect to *MONITOR service
*/ */
monpriv->iucv_handle = iucv_register_program("my_monreader ", monpriv->path = iucv_path_alloc(MON_MSGLIM, IUCV_IPRMDATA, GFP_KERNEL);
MON_SERVICE, if (!monpriv->path)
NULL, goto out_priv;
&mon_iucvops, rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler,
monpriv); MON_SERVICE, NULL, user_data_connect, monpriv);
if (!monpriv->iucv_handle) {
P_ERROR("failed to register with iucv driver\n");
rc = -EIO;
goto out_error;
}
P_INFO("open, registered with IUCV\n");
rc = iucv_connect(&monpriv->pathid, MON_MSGLIM, user_data_connect,
MON_SERVICE, iucv_host, IPRMDATA, NULL, NULL,
monpriv->iucv_handle, NULL);
if (rc) { if (rc) {
P_ERROR("iucv connection to *MONITOR failed with " P_ERROR("iucv connection to *MONITOR failed with "
"IPUSER SEVER code = %i\n", rc); "IPUSER SEVER code = %i\n", rc);
rc = -EIO; rc = -EIO;
goto out_unregister; goto out_path;
} }
/* /*
* Wait for connection confirmation * Wait for connection confirmation
...@@ -444,24 +423,23 @@ mon_open(struct inode *inode, struct file *filp) ...@@ -444,24 +423,23 @@ mon_open(struct inode *inode, struct file *filp)
atomic_set(&monpriv->iucv_severed, 0); atomic_set(&monpriv->iucv_severed, 0);
atomic_set(&monpriv->iucv_connected, 0); atomic_set(&monpriv->iucv_connected, 0);
rc = -EIO; rc = -EIO;
goto out_unregister; goto out_path;
} }
P_INFO("open, established connection to *MONITOR service\n\n"); P_INFO("open, established connection to *MONITOR service\n\n");
filp->private_data = monpriv; filp->private_data = monpriv;
return nonseekable_open(inode, filp); return nonseekable_open(inode, filp);
out_unregister: out_path:
iucv_unregister_program(monpriv->iucv_handle); kfree(monpriv->path);
out_error: out_priv:
for (i = 0; i < MON_MSGLIM; i++) mon_free_mem(monpriv);
kfree(monpriv->msg_array[i]); out_use:
kfree(monpriv);
clear_bit(MON_IN_USE, &mon_in_use); clear_bit(MON_IN_USE, &mon_in_use);
out:
return rc; return rc;
} }
static int static int mon_close(struct inode *inode, struct file *filp)
mon_close(struct inode *inode, struct file *filp)
{ {
int rc, i; int rc, i;
struct mon_private *monpriv = filp->private_data; struct mon_private *monpriv = filp->private_data;
...@@ -469,18 +447,12 @@ mon_close(struct inode *inode, struct file *filp) ...@@ -469,18 +447,12 @@ mon_close(struct inode *inode, struct file *filp)
/* /*
* Close IUCV connection and unregister * Close IUCV connection and unregister
*/ */
rc = iucv_sever(monpriv->pathid, user_data_sever); rc = iucv_path_sever(monpriv->path, user_data_sever);
if (rc) if (rc)
P_ERROR("close, iucv_sever failed with rc = %i\n", rc); P_ERROR("close, iucv_sever failed with rc = %i\n", rc);
else else
P_INFO("close, terminated connection to *MONITOR service\n"); P_INFO("close, terminated connection to *MONITOR service\n");
rc = iucv_unregister_program(monpriv->iucv_handle);
if (rc)
P_ERROR("close, iucv_unregister failed with rc = %i\n", rc);
else
P_INFO("close, unregistered with IUCV\n");
atomic_set(&monpriv->iucv_severed, 0); atomic_set(&monpriv->iucv_severed, 0);
atomic_set(&monpriv->iucv_connected, 0); atomic_set(&monpriv->iucv_connected, 0);
atomic_set(&monpriv->read_ready, 0); atomic_set(&monpriv->read_ready, 0);
...@@ -495,8 +467,8 @@ mon_close(struct inode *inode, struct file *filp) ...@@ -495,8 +467,8 @@ mon_close(struct inode *inode, struct file *filp)
return 0; return 0;
} }
static ssize_t static ssize_t mon_read(struct file *filp, char __user *data,
mon_read(struct file *filp, char __user *data, size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct mon_private *monpriv = filp->private_data; struct mon_private *monpriv = filp->private_data;
struct mon_msg *monmsg; struct mon_msg *monmsg;
...@@ -563,8 +535,7 @@ mon_read(struct file *filp, char __user *data, size_t count, loff_t *ppos) ...@@ -563,8 +535,7 @@ mon_read(struct file *filp, char __user *data, size_t count, loff_t *ppos)
return count; return count;
} }
static unsigned int static unsigned int mon_poll(struct file *filp, struct poll_table_struct *p)
mon_poll(struct file *filp, struct poll_table_struct *p)
{ {
struct mon_private *monpriv = filp->private_data; struct mon_private *monpriv = filp->private_data;
...@@ -593,8 +564,7 @@ static struct miscdevice mon_dev = { ...@@ -593,8 +564,7 @@ static struct miscdevice mon_dev = {
/****************************************************************************** /******************************************************************************
* module init/exit * * module init/exit *
*****************************************************************************/ *****************************************************************************/
static int __init static int __init mon_init(void)
mon_init(void)
{ {
int rc; int rc;
...@@ -603,22 +573,34 @@ mon_init(void) ...@@ -603,22 +573,34 @@ mon_init(void)
return -ENODEV; return -ENODEV;
} }
/*
* Register with IUCV and connect to *MONITOR service
*/
rc = iucv_register(&monreader_iucv_handler, 1);
if (rc) {
P_ERROR("failed to register with iucv driver\n");
return rc;
}
P_INFO("open, registered with IUCV\n");
rc = segment_type(mon_dcss_name); rc = segment_type(mon_dcss_name);
if (rc < 0) { if (rc < 0) {
mon_segment_warn(rc, mon_dcss_name); mon_segment_warn(rc, mon_dcss_name);
return rc; goto out_iucv;
} }
if (rc != SEG_TYPE_SC) { if (rc != SEG_TYPE_SC) {
P_ERROR("segment %s has unsupported type, should be SC\n", P_ERROR("segment %s has unsupported type, should be SC\n",
mon_dcss_name); mon_dcss_name);
return -EINVAL; rc = -EINVAL;
goto out_iucv;
} }
rc = segment_load(mon_dcss_name, SEGMENT_SHARED, rc = segment_load(mon_dcss_name, SEGMENT_SHARED,
&mon_dcss_start, &mon_dcss_end); &mon_dcss_start, &mon_dcss_end);
if (rc < 0) { if (rc < 0) {
mon_segment_warn(rc, mon_dcss_name); mon_segment_warn(rc, mon_dcss_name);
return -EINVAL; rc = -EINVAL;
goto out_iucv;
} }
dcss_mkname(mon_dcss_name, &user_data_connect[8]); dcss_mkname(mon_dcss_name, &user_data_connect[8]);
...@@ -634,14 +616,16 @@ mon_init(void) ...@@ -634,14 +616,16 @@ mon_init(void)
out: out:
segment_unload(mon_dcss_name); segment_unload(mon_dcss_name);
out_iucv:
iucv_unregister(&monreader_iucv_handler, 1);
return rc; return rc;
} }
static void __exit static void __exit mon_exit(void)
mon_exit(void)
{ {
segment_unload(mon_dcss_name); segment_unload(mon_dcss_name);
WARN_ON(misc_deregister(&mon_dev) != 0); WARN_ON(misc_deregister(&mon_dev) != 0);
iucv_unregister(&monreader_iucv_handler, 1);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment