diff options
author | Carsten Otte <cotte@de.ibm.com> | 2009-03-26 10:24:38 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:25 -0400 |
commit | ab640db01013192f6867785a7def7c9d9ec8903d (patch) | |
tree | 3df0fb5b788eeaaa4b0540fbf136b20c9ffd56f4 /drivers/s390/char/tape_core.c | |
parent | 1edad85b16fdda43c8ab809e2779e8bf64ab8bb2 (diff) |
[S390] tape message cleanup
This is a cleanup of all the messages this driver prints. It uses the
dev_message macros now.
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/tape_core.c')
-rw-r--r-- | drivers/s390/char/tape_core.c | 62 |
1 files changed, 9 insertions, 53 deletions
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index f9bb51fa7f5..1b6a2441246 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * Stefan Bader <shbader@de.ibm.com> | 11 | * Stefan Bader <shbader@de.ibm.com> |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define KMSG_COMPONENT "tape" | ||
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/init.h> // for kernel parameters | 16 | #include <linux/init.h> // for kernel parameters |
16 | #include <linux/kmod.h> // for requesting modules | 17 | #include <linux/kmod.h> // for requesting modules |
@@ -25,7 +26,6 @@ | |||
25 | #include "tape.h" | 26 | #include "tape.h" |
26 | #include "tape_std.h" | 27 | #include "tape_std.h" |
27 | 28 | ||
28 | #define PRINTK_HEADER "TAPE_CORE: " | ||
29 | #define LONG_BUSY_TIMEOUT 180 /* seconds */ | 29 | #define LONG_BUSY_TIMEOUT 180 /* seconds */ |
30 | 30 | ||
31 | static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *); | 31 | static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *); |
@@ -214,13 +214,13 @@ tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate) | |||
214 | switch(newstate){ | 214 | switch(newstate){ |
215 | case MS_UNLOADED: | 215 | case MS_UNLOADED: |
216 | device->tape_generic_status |= GMT_DR_OPEN(~0); | 216 | device->tape_generic_status |= GMT_DR_OPEN(~0); |
217 | PRINT_INFO("(%s): Tape is unloaded\n", | 217 | dev_info(&device->cdev->dev, "The tape cartridge has been " |
218 | dev_name(&device->cdev->dev)); | 218 | "successfully unloaded\n"); |
219 | break; | 219 | break; |
220 | case MS_LOADED: | 220 | case MS_LOADED: |
221 | device->tape_generic_status &= ~GMT_DR_OPEN(~0); | 221 | device->tape_generic_status &= ~GMT_DR_OPEN(~0); |
222 | PRINT_INFO("(%s): Tape has been mounted\n", | 222 | dev_info(&device->cdev->dev, "A tape cartridge has been " |
223 | dev_name(&device->cdev->dev)); | 223 | "mounted\n"); |
224 | break; | 224 | break; |
225 | default: | 225 | default: |
226 | // print nothing | 226 | // print nothing |
@@ -333,7 +333,6 @@ tape_generic_online(struct tape_device *device, | |||
333 | /* Let the discipline have a go at the device. */ | 333 | /* Let the discipline have a go at the device. */ |
334 | device->discipline = discipline; | 334 | device->discipline = discipline; |
335 | if (!try_module_get(discipline->owner)) { | 335 | if (!try_module_get(discipline->owner)) { |
336 | PRINT_ERR("Cannot get module. Module gone.\n"); | ||
337 | return -EINVAL; | 336 | return -EINVAL; |
338 | } | 337 | } |
339 | 338 | ||
@@ -391,7 +390,6 @@ int | |||
391 | tape_generic_offline(struct tape_device *device) | 390 | tape_generic_offline(struct tape_device *device) |
392 | { | 391 | { |
393 | if (!device) { | 392 | if (!device) { |
394 | PRINT_ERR("tape_generic_offline: no such device\n"); | ||
395 | return -ENODEV; | 393 | return -ENODEV; |
396 | } | 394 | } |
397 | 395 | ||
@@ -413,9 +411,6 @@ tape_generic_offline(struct tape_device *device) | |||
413 | DBF_EVENT(3, "(%08x): Set offline failed " | 411 | DBF_EVENT(3, "(%08x): Set offline failed " |
414 | "- drive in use.\n", | 412 | "- drive in use.\n", |
415 | device->cdev_id); | 413 | device->cdev_id); |
416 | PRINT_WARN("(%s): Set offline failed " | ||
417 | "- drive in use.\n", | ||
418 | dev_name(&device->cdev->dev)); | ||
419 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); | 414 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); |
420 | return -EBUSY; | 415 | return -EBUSY; |
421 | } | 416 | } |
@@ -435,14 +430,11 @@ tape_alloc_device(void) | |||
435 | device = kzalloc(sizeof(struct tape_device), GFP_KERNEL); | 430 | device = kzalloc(sizeof(struct tape_device), GFP_KERNEL); |
436 | if (device == NULL) { | 431 | if (device == NULL) { |
437 | DBF_EXCEPTION(2, "ti:no mem\n"); | 432 | DBF_EXCEPTION(2, "ti:no mem\n"); |
438 | PRINT_INFO ("can't allocate memory for " | ||
439 | "tape info structure\n"); | ||
440 | return ERR_PTR(-ENOMEM); | 433 | return ERR_PTR(-ENOMEM); |
441 | } | 434 | } |
442 | device->modeset_byte = kmalloc(1, GFP_KERNEL | GFP_DMA); | 435 | device->modeset_byte = kmalloc(1, GFP_KERNEL | GFP_DMA); |
443 | if (device->modeset_byte == NULL) { | 436 | if (device->modeset_byte == NULL) { |
444 | DBF_EXCEPTION(2, "ti:no mem\n"); | 437 | DBF_EXCEPTION(2, "ti:no mem\n"); |
445 | PRINT_INFO("can't allocate memory for modeset byte\n"); | ||
446 | kfree(device); | 438 | kfree(device); |
447 | return ERR_PTR(-ENOMEM); | 439 | return ERR_PTR(-ENOMEM); |
448 | } | 440 | } |
@@ -490,7 +482,6 @@ tape_put_device(struct tape_device *device) | |||
490 | } else { | 482 | } else { |
491 | if (remain < 0) { | 483 | if (remain < 0) { |
492 | DBF_EVENT(4, "put device without reference\n"); | 484 | DBF_EVENT(4, "put device without reference\n"); |
493 | PRINT_ERR("put device without reference\n"); | ||
494 | } else { | 485 | } else { |
495 | DBF_EVENT(4, "tape_free_device(%p)\n", device); | 486 | DBF_EVENT(4, "tape_free_device(%p)\n", device); |
496 | kfree(device->modeset_byte); | 487 | kfree(device->modeset_byte); |
@@ -538,8 +529,6 @@ tape_generic_probe(struct ccw_device *cdev) | |||
538 | ret = sysfs_create_group(&cdev->dev.kobj, &tape_attr_group); | 529 | ret = sysfs_create_group(&cdev->dev.kobj, &tape_attr_group); |
539 | if (ret) { | 530 | if (ret) { |
540 | tape_put_device(device); | 531 | tape_put_device(device); |
541 | PRINT_ERR("probe failed for tape device %s\n", | ||
542 | dev_name(&cdev->dev)); | ||
543 | return ret; | 532 | return ret; |
544 | } | 533 | } |
545 | cdev->dev.driver_data = device; | 534 | cdev->dev.driver_data = device; |
@@ -547,7 +536,6 @@ tape_generic_probe(struct ccw_device *cdev) | |||
547 | device->cdev = cdev; | 536 | device->cdev = cdev; |
548 | ccw_device_get_id(cdev, &dev_id); | 537 | ccw_device_get_id(cdev, &dev_id); |
549 | device->cdev_id = devid_to_int(&dev_id); | 538 | device->cdev_id = devid_to_int(&dev_id); |
550 | PRINT_INFO("tape device %s found\n", dev_name(&cdev->dev)); | ||
551 | return ret; | 539 | return ret; |
552 | } | 540 | } |
553 | 541 | ||
@@ -584,7 +572,6 @@ tape_generic_remove(struct ccw_device *cdev) | |||
584 | 572 | ||
585 | device = cdev->dev.driver_data; | 573 | device = cdev->dev.driver_data; |
586 | if (!device) { | 574 | if (!device) { |
587 | PRINT_ERR("No device pointer in tape_generic_remove!\n"); | ||
588 | return; | 575 | return; |
589 | } | 576 | } |
590 | DBF_LH(3, "(%08x): tape_generic_remove(%p)\n", device->cdev_id, cdev); | 577 | DBF_LH(3, "(%08x): tape_generic_remove(%p)\n", device->cdev_id, cdev); |
@@ -615,10 +602,8 @@ tape_generic_remove(struct ccw_device *cdev) | |||
615 | */ | 602 | */ |
616 | DBF_EVENT(3, "(%08x): Drive in use vanished!\n", | 603 | DBF_EVENT(3, "(%08x): Drive in use vanished!\n", |
617 | device->cdev_id); | 604 | device->cdev_id); |
618 | PRINT_WARN("(%s): Drive in use vanished - " | 605 | dev_warn(&device->cdev->dev, "A tape unit was detached" |
619 | "expect trouble!\n", | 606 | " while in use\n"); |
620 | dev_name(&device->cdev->dev)); | ||
621 | PRINT_WARN("State was %i\n", device->tape_state); | ||
622 | tape_state_set(device, TS_NOT_OPER); | 607 | tape_state_set(device, TS_NOT_OPER); |
623 | __tape_discard_requests(device); | 608 | __tape_discard_requests(device); |
624 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); | 609 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); |
@@ -830,30 +815,6 @@ __tape_end_request( | |||
830 | } | 815 | } |
831 | 816 | ||
832 | /* | 817 | /* |
833 | * Write sense data to console/dbf | ||
834 | */ | ||
835 | void | ||
836 | tape_dump_sense(struct tape_device* device, struct tape_request *request, | ||
837 | struct irb *irb) | ||
838 | { | ||
839 | unsigned int *sptr; | ||
840 | |||
841 | PRINT_INFO("-------------------------------------------------\n"); | ||
842 | PRINT_INFO("DSTAT : %02x CSTAT: %02x CPA: %04x\n", | ||
843 | irb->scsw.cmd.dstat, irb->scsw.cmd.cstat, irb->scsw.cmd.cpa); | ||
844 | PRINT_INFO("DEVICE: %s\n", dev_name(&device->cdev->dev)); | ||
845 | if (request != NULL) | ||
846 | PRINT_INFO("OP : %s\n", tape_op_verbose[request->op]); | ||
847 | |||
848 | sptr = (unsigned int *) irb->ecw; | ||
849 | PRINT_INFO("Sense data: %08X %08X %08X %08X \n", | ||
850 | sptr[0], sptr[1], sptr[2], sptr[3]); | ||
851 | PRINT_INFO("Sense data: %08X %08X %08X %08X \n", | ||
852 | sptr[4], sptr[5], sptr[6], sptr[7]); | ||
853 | PRINT_INFO("--------------------------------------------------\n"); | ||
854 | } | ||
855 | |||
856 | /* | ||
857 | * Write sense data to dbf | 818 | * Write sense data to dbf |
858 | */ | 819 | */ |
859 | void | 820 | void |
@@ -1051,8 +1012,6 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1051 | 1012 | ||
1052 | device = (struct tape_device *) cdev->dev.driver_data; | 1013 | device = (struct tape_device *) cdev->dev.driver_data; |
1053 | if (device == NULL) { | 1014 | if (device == NULL) { |
1054 | PRINT_ERR("could not get device structure for %s " | ||
1055 | "in interrupt\n", dev_name(&cdev->dev)); | ||
1056 | return; | 1015 | return; |
1057 | } | 1016 | } |
1058 | request = (struct tape_request *) intparm; | 1017 | request = (struct tape_request *) intparm; |
@@ -1064,13 +1023,13 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1064 | /* FIXME: What to do with the request? */ | 1023 | /* FIXME: What to do with the request? */ |
1065 | switch (PTR_ERR(irb)) { | 1024 | switch (PTR_ERR(irb)) { |
1066 | case -ETIMEDOUT: | 1025 | case -ETIMEDOUT: |
1067 | PRINT_WARN("(%s): Request timed out\n", | 1026 | DBF_LH(1, "(%s): Request timed out\n", |
1068 | dev_name(&cdev->dev)); | 1027 | dev_name(&cdev->dev)); |
1069 | case -EIO: | 1028 | case -EIO: |
1070 | __tape_end_request(device, request, -EIO); | 1029 | __tape_end_request(device, request, -EIO); |
1071 | break; | 1030 | break; |
1072 | default: | 1031 | default: |
1073 | PRINT_ERR("(%s): Unexpected i/o error %li\n", | 1032 | DBF_LH(1, "(%s): Unexpected i/o error %li\n", |
1074 | dev_name(&cdev->dev), | 1033 | dev_name(&cdev->dev), |
1075 | PTR_ERR(irb)); | 1034 | PTR_ERR(irb)); |
1076 | } | 1035 | } |
@@ -1182,8 +1141,6 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1182 | default: | 1141 | default: |
1183 | if (rc > 0) { | 1142 | if (rc > 0) { |
1184 | DBF_EVENT(6, "xunknownrc\n"); | 1143 | DBF_EVENT(6, "xunknownrc\n"); |
1185 | PRINT_ERR("Invalid return code from discipline " | ||
1186 | "interrupt function.\n"); | ||
1187 | __tape_end_request(device, request, -EIO); | 1144 | __tape_end_request(device, request, -EIO); |
1188 | } else { | 1145 | } else { |
1189 | __tape_end_request(device, request, rc); | 1146 | __tape_end_request(device, request, rc); |
@@ -1323,7 +1280,6 @@ EXPORT_SYMBOL(tape_state_set); | |||
1323 | EXPORT_SYMBOL(tape_med_state_set); | 1280 | EXPORT_SYMBOL(tape_med_state_set); |
1324 | EXPORT_SYMBOL(tape_alloc_request); | 1281 | EXPORT_SYMBOL(tape_alloc_request); |
1325 | EXPORT_SYMBOL(tape_free_request); | 1282 | EXPORT_SYMBOL(tape_free_request); |
1326 | EXPORT_SYMBOL(tape_dump_sense); | ||
1327 | EXPORT_SYMBOL(tape_dump_sense_dbf); | 1283 | EXPORT_SYMBOL(tape_dump_sense_dbf); |
1328 | EXPORT_SYMBOL(tape_do_io); | 1284 | EXPORT_SYMBOL(tape_do_io); |
1329 | EXPORT_SYMBOL(tape_do_io_async); | 1285 | EXPORT_SYMBOL(tape_do_io_async); |