diff options
author | Joe Perches <joe@perches.com> | 2010-07-01 02:24:32 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:23:44 -0400 |
commit | e597cd09f711b28b8466ebdc2f12e55b44fa81e4 (patch) | |
tree | d5a26dfcf92e2282537fc0ab9ebf3a977129650f /drivers/cdrom/gdrom.c | |
parent | 3ffb52e73b47d6ad86b645942ff49035efdbcd31 (diff) |
drivers/cdrom: use pr_<level>
- add pr_fmt.
- convert printks to pr_<level>
- add if (0) and printf argument checking to cdinfo
- coalesce consecutive printks to single pr_
- fix a typo "back ground" to "background"
- convert printks without level to pr_info
- remove VIOCD_ prefixes and use pr_fmt/pr_<level>
- add a missing newline to an OS/400 message
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Folded in tab indentation fix from Andrew.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/cdrom/gdrom.c')
-rw-r--r-- | drivers/cdrom/gdrom.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 7c05ddc63ae8..5219b57deb36 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/init.h> | 24 | #include <linux/init.h> |
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
24 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
@@ -339,8 +341,7 @@ static int gdrom_get_last_session(struct cdrom_device_info *cd_info, | |||
339 | tocuse = 0; | 341 | tocuse = 0; |
340 | err = gdrom_readtoc_cmd(gd.toc, 0); | 342 | err = gdrom_readtoc_cmd(gd.toc, 0); |
341 | if (err) { | 343 | if (err) { |
342 | printk(KERN_INFO "GDROM: Could not get CD " | 344 | pr_info("Could not get CD table of contents\n"); |
343 | "table of contents\n"); | ||
344 | return -ENXIO; | 345 | return -ENXIO; |
345 | } | 346 | } |
346 | } | 347 | } |
@@ -357,8 +358,7 @@ static int gdrom_get_last_session(struct cdrom_device_info *cd_info, | |||
357 | } while (track >= fentry); | 358 | } while (track >= fentry); |
358 | 359 | ||
359 | if ((track > 100) || (track < get_entry_track(gd.toc->first))) { | 360 | if ((track > 100) || (track < get_entry_track(gd.toc->first))) { |
360 | printk(KERN_INFO "GDROM: No data on the last " | 361 | pr_info("No data on the last session of the CD\n"); |
361 | "session of the CD\n"); | ||
362 | gdrom_getsense(NULL); | 362 | gdrom_getsense(NULL); |
363 | return -ENXIO; | 363 | return -ENXIO; |
364 | } | 364 | } |
@@ -451,14 +451,14 @@ static int gdrom_getsense(short *bufstring) | |||
451 | goto cleanup_sense; | 451 | goto cleanup_sense; |
452 | insw(GDROM_DATA_REG, &sense, sense_command->buflen/2); | 452 | insw(GDROM_DATA_REG, &sense, sense_command->buflen/2); |
453 | if (sense[1] & 40) { | 453 | if (sense[1] & 40) { |
454 | printk(KERN_INFO "GDROM: Drive not ready - command aborted\n"); | 454 | pr_info("Drive not ready - command aborted\n"); |
455 | goto cleanup_sense; | 455 | goto cleanup_sense; |
456 | } | 456 | } |
457 | sense_key = sense[1] & 0x0F; | 457 | sense_key = sense[1] & 0x0F; |
458 | if (sense_key < ARRAY_SIZE(sense_texts)) | 458 | if (sense_key < ARRAY_SIZE(sense_texts)) |
459 | printk(KERN_INFO "GDROM: %s\n", sense_texts[sense_key].text); | 459 | pr_info("%s\n", sense_texts[sense_key].text); |
460 | else | 460 | else |
461 | printk(KERN_ERR "GDROM: Unknown sense key: %d\n", sense_key); | 461 | pr_err("Unknown sense key: %d\n", sense_key); |
462 | if (bufstring) /* return addional sense data */ | 462 | if (bufstring) /* return addional sense data */ |
463 | memcpy(bufstring, &sense[4], 2); | 463 | memcpy(bufstring, &sense[4], 2); |
464 | if (sense_key < 2) | 464 | if (sense_key < 2) |
@@ -644,13 +644,12 @@ static void gdrom_request(struct request_queue *rq) | |||
644 | 644 | ||
645 | while ((req = blk_fetch_request(rq)) != NULL) { | 645 | while ((req = blk_fetch_request(rq)) != NULL) { |
646 | if (req->cmd_type != REQ_TYPE_FS) { | 646 | if (req->cmd_type != REQ_TYPE_FS) { |
647 | printk(KERN_DEBUG "GDROM: Non-fs request ignored\n"); | 647 | printk(KERN_DEBUG "gdrom: Non-fs request ignored\n"); |
648 | __blk_end_request_all(req, -EIO); | 648 | __blk_end_request_all(req, -EIO); |
649 | continue; | 649 | continue; |
650 | } | 650 | } |
651 | if (rq_data_dir(req) != READ) { | 651 | if (rq_data_dir(req) != READ) { |
652 | printk(KERN_NOTICE "GDROM: Read only device -"); | 652 | pr_notice("Read only device - write request ignored\n"); |
653 | printk(" write request ignored\n"); | ||
654 | __blk_end_request_all(req, -EIO); | 653 | __blk_end_request_all(req, -EIO); |
655 | continue; | 654 | continue; |
656 | } | 655 | } |
@@ -685,7 +684,7 @@ static int __devinit gdrom_outputversion(void) | |||
685 | firmw_ver = kstrndup(id->firmver, 16, GFP_KERNEL); | 684 | firmw_ver = kstrndup(id->firmver, 16, GFP_KERNEL); |
686 | if (!firmw_ver) | 685 | if (!firmw_ver) |
687 | goto free_manuf_name; | 686 | goto free_manuf_name; |
688 | printk(KERN_INFO "GDROM: %s from %s with firmware %s\n", | 687 | pr_info("%s from %s with firmware %s\n", |
689 | model_name, manuf_name, firmw_ver); | 688 | model_name, manuf_name, firmw_ver); |
690 | err = 0; | 689 | err = 0; |
691 | kfree(firmw_ver); | 690 | kfree(firmw_ver); |
@@ -757,7 +756,7 @@ static int __devinit probe_gdrom(struct platform_device *devptr) | |||
757 | int err; | 756 | int err; |
758 | /* Start the device */ | 757 | /* Start the device */ |
759 | if (gdrom_execute_diagnostic() != 1) { | 758 | if (gdrom_execute_diagnostic() != 1) { |
760 | printk(KERN_WARNING "GDROM: ATA Probe for GDROM failed.\n"); | 759 | pr_warning("ATA Probe for GDROM failed\n"); |
761 | return -ENODEV; | 760 | return -ENODEV; |
762 | } | 761 | } |
763 | /* Print out firmware ID */ | 762 | /* Print out firmware ID */ |
@@ -767,7 +766,7 @@ static int __devinit probe_gdrom(struct platform_device *devptr) | |||
767 | gdrom_major = register_blkdev(0, GDROM_DEV_NAME); | 766 | gdrom_major = register_blkdev(0, GDROM_DEV_NAME); |
768 | if (gdrom_major <= 0) | 767 | if (gdrom_major <= 0) |
769 | return gdrom_major; | 768 | return gdrom_major; |
770 | printk(KERN_INFO "GDROM: Registered with major number %d\n", | 769 | pr_info("Registered with major number %d\n", |
771 | gdrom_major); | 770 | gdrom_major); |
772 | /* Specify basic properties of drive */ | 771 | /* Specify basic properties of drive */ |
773 | gd.cd_info = kzalloc(sizeof(struct cdrom_device_info), GFP_KERNEL); | 772 | gd.cd_info = kzalloc(sizeof(struct cdrom_device_info), GFP_KERNEL); |
@@ -818,7 +817,7 @@ probe_fail_no_disk: | |||
818 | unregister_blkdev(gdrom_major, GDROM_DEV_NAME); | 817 | unregister_blkdev(gdrom_major, GDROM_DEV_NAME); |
819 | gdrom_major = 0; | 818 | gdrom_major = 0; |
820 | probe_fail_no_mem: | 819 | probe_fail_no_mem: |
821 | printk(KERN_WARNING "GDROM: Probe failed - error is 0x%X\n", err); | 820 | pr_warning("Probe failed - error is 0x%X\n", err); |
822 | return err; | 821 | return err; |
823 | } | 822 | } |
824 | 823 | ||