aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/vmlogrdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/vmlogrdr.c')
-rw-r--r--drivers/s390/char/vmlogrdr.c37
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 2c2428cc05d8..c31faefa2b3b 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -25,6 +25,7 @@
25#include <linux/kmod.h> 25#include <linux/kmod.h>
26#include <linux/cdev.h> 26#include <linux/cdev.h>
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/smp_lock.h>
28#include <linux/string.h> 29#include <linux/string.h>
29 30
30 31
@@ -216,9 +217,7 @@ static int vmlogrdr_get_recording_class_AB(void)
216 char *tail; 217 char *tail;
217 int len,i; 218 int len,i;
218 219
219 printk (KERN_DEBUG "vmlogrdr: query command: %s\n", cp_command);
220 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); 220 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
221 printk (KERN_DEBUG "vmlogrdr: response: %s", cp_response);
222 len = strnlen(cp_response,sizeof(cp_response)); 221 len = strnlen(cp_response,sizeof(cp_response));
223 // now the parsing 222 // now the parsing
224 tail=strnchr(cp_response,len,'='); 223 tail=strnchr(cp_response,len,'=');
@@ -268,11 +267,7 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr,
268 logptr->recording_name, 267 logptr->recording_name,
269 qid_string); 268 qid_string);
270 269
271 printk (KERN_DEBUG "vmlogrdr: recording command: %s\n",
272 cp_command);
273 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); 270 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
274 printk (KERN_DEBUG "vmlogrdr: recording response: %s",
275 cp_response);
276 } 271 }
277 272
278 memset(cp_command, 0x00, sizeof(cp_command)); 273 memset(cp_command, 0x00, sizeof(cp_command));
@@ -282,10 +277,7 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr,
282 onoff, 277 onoff,
283 qid_string); 278 qid_string);
284 279
285 printk (KERN_DEBUG "vmlogrdr: recording command: %s\n", cp_command);
286 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); 280 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
287 printk (KERN_DEBUG "vmlogrdr: recording response: %s",
288 cp_response);
289 /* The recording command will usually answer with 'Command complete' 281 /* The recording command will usually answer with 'Command complete'
290 * on success, but when the specific service was never connected 282 * on success, but when the specific service was never connected
291 * before then there might be an additional informational message 283 * before then there might be an additional informational message
@@ -319,9 +311,11 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
319 return -ENOSYS; 311 return -ENOSYS;
320 312
321 /* Besure this device hasn't already been opened */ 313 /* Besure this device hasn't already been opened */
314 lock_kernel();
322 spin_lock_bh(&logptr->priv_lock); 315 spin_lock_bh(&logptr->priv_lock);
323 if (logptr->dev_in_use) { 316 if (logptr->dev_in_use) {
324 spin_unlock_bh(&logptr->priv_lock); 317 spin_unlock_bh(&logptr->priv_lock);
318 unlock_kernel();
325 return -EBUSY; 319 return -EBUSY;
326 } 320 }
327 logptr->dev_in_use = 1; 321 logptr->dev_in_use = 1;
@@ -365,7 +359,9 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
365 || (logptr->iucv_path_severed)); 359 || (logptr->iucv_path_severed));
366 if (logptr->iucv_path_severed) 360 if (logptr->iucv_path_severed)
367 goto out_record; 361 goto out_record;
368 return nonseekable_open(inode, filp); 362 ret = nonseekable_open(inode, filp);
363 unlock_kernel();
364 return ret;
369 365
370out_record: 366out_record:
371 if (logptr->autorecording) 367 if (logptr->autorecording)
@@ -375,6 +371,7 @@ out_path:
375 logptr->path = NULL; 371 logptr->path = NULL;
376out_dev: 372out_dev:
377 logptr->dev_in_use = 0; 373 logptr->dev_in_use = 0;
374 unlock_kernel();
378 return -EIO; 375 return -EIO;
379} 376}
380 377
@@ -567,10 +564,7 @@ static ssize_t vmlogrdr_purge_store(struct device * dev,
567 "RECORDING %s PURGE ", 564 "RECORDING %s PURGE ",
568 priv->recording_name); 565 priv->recording_name);
569 566
570 printk (KERN_DEBUG "vmlogrdr: recording command: %s\n", cp_command);
571 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); 567 cpcmd(cp_command, cp_response, sizeof(cp_response), NULL);
572 printk (KERN_DEBUG "vmlogrdr: recording response: %s",
573 cp_response);
574 568
575 return count; 569 return count;
576} 570}
@@ -682,28 +676,20 @@ static int vmlogrdr_register_driver(void)
682 676
683 /* Register with iucv driver */ 677 /* Register with iucv driver */
684 ret = iucv_register(&vmlogrdr_iucv_handler, 1); 678 ret = iucv_register(&vmlogrdr_iucv_handler, 1);
685 if (ret) { 679 if (ret)
686 printk (KERN_ERR "vmlogrdr: failed to register with "
687 "iucv driver\n");
688 goto out; 680 goto out;
689 }
690 681
691 ret = driver_register(&vmlogrdr_driver); 682 ret = driver_register(&vmlogrdr_driver);
692 if (ret) { 683 if (ret)
693 printk(KERN_ERR "vmlogrdr: failed to register driver.\n");
694 goto out_iucv; 684 goto out_iucv;
695 }
696 685
697 ret = driver_create_file(&vmlogrdr_driver, 686 ret = driver_create_file(&vmlogrdr_driver,
698 &driver_attr_recording_status); 687 &driver_attr_recording_status);
699 if (ret) { 688 if (ret)
700 printk(KERN_ERR "vmlogrdr: failed to add driver attribute.\n");
701 goto out_driver; 689 goto out_driver;
702 }
703 690
704 vmlogrdr_class = class_create(THIS_MODULE, "vmlogrdr"); 691 vmlogrdr_class = class_create(THIS_MODULE, "vmlogrdr");
705 if (IS_ERR(vmlogrdr_class)) { 692 if (IS_ERR(vmlogrdr_class)) {
706 printk(KERN_ERR "vmlogrdr: failed to create class.\n");
707 ret = PTR_ERR(vmlogrdr_class); 693 ret = PTR_ERR(vmlogrdr_class);
708 vmlogrdr_class = NULL; 694 vmlogrdr_class = NULL;
709 goto out_attr; 695 goto out_attr;
@@ -871,12 +857,10 @@ static int __init vmlogrdr_init(void)
871 rc = vmlogrdr_register_cdev(dev); 857 rc = vmlogrdr_register_cdev(dev);
872 if (rc) 858 if (rc)
873 goto cleanup; 859 goto cleanup;
874 printk (KERN_INFO "vmlogrdr: driver loaded\n");
875 return 0; 860 return 0;
876 861
877cleanup: 862cleanup:
878 vmlogrdr_cleanup(); 863 vmlogrdr_cleanup();
879 printk (KERN_ERR "vmlogrdr: driver not loaded.\n");
880 return rc; 864 return rc;
881} 865}
882 866
@@ -884,7 +868,6 @@ cleanup:
884static void __exit vmlogrdr_exit(void) 868static void __exit vmlogrdr_exit(void)
885{ 869{
886 vmlogrdr_cleanup(); 870 vmlogrdr_cleanup();
887 printk (KERN_INFO "vmlogrdr: driver unloaded\n");
888 return; 871 return;
889} 872}
890 873