aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-07-01 02:24:32 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:23:44 -0400
commite597cd09f711b28b8466ebdc2f12e55b44fa81e4 (patch)
treed5a26dfcf92e2282537fc0ab9ebf3a977129650f /drivers/cdrom
parent3ffb52e73b47d6ad86b645942ff49035efdbcd31 (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')
-rw-r--r--drivers/cdrom/cdrom.c46
-rw-r--r--drivers/cdrom/gdrom.c27
-rw-r--r--drivers/cdrom/viocd.c83
3 files changed, 73 insertions, 83 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index e3749d0ba68b..af13c62dc473 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -242,6 +242,8 @@
242 242
243-------------------------------------------------------------------------*/ 243-------------------------------------------------------------------------*/
244 244
245#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
246
245#define REVISION "Revision: 3.20" 247#define REVISION "Revision: 3.20"
246#define VERSION "Id: cdrom.c 3.20 2003/12/17" 248#define VERSION "Id: cdrom.c 3.20 2003/12/17"
247 249
@@ -314,11 +316,17 @@ static const char *mrw_format_status[] = {
314static const char *mrw_address_space[] = { "DMA", "GAA" }; 316static const char *mrw_address_space[] = { "DMA", "GAA" };
315 317
316#if (ERRLOGMASK!=CD_NOTHING) 318#if (ERRLOGMASK!=CD_NOTHING)
317#define cdinfo(type, fmt, args...) \ 319#define cdinfo(type, fmt, args...) \
318 if ((ERRLOGMASK & type) || debug==1 ) \ 320do { \
319 printk(KERN_INFO "cdrom: " fmt, ## args) 321 if ((ERRLOGMASK & type) || debug == 1) \
322 pr_info(fmt, ##args); \
323} while (0)
320#else 324#else
321#define cdinfo(type, fmt, args...) 325#define cdinfo(type, fmt, args...) \
326do { \
327 if (0 && (ERRLOGMASK & type) || debug == 1) \
328 pr_info(fmt, ##args); \
329} while (0)
322#endif 330#endif
323 331
324/* These are used to simplify getting data in from and back to user land */ 332/* These are used to simplify getting data in from and back to user land */
@@ -395,7 +403,7 @@ int register_cdrom(struct cdrom_device_info *cdi)
395 if (cdo->open == NULL || cdo->release == NULL) 403 if (cdo->open == NULL || cdo->release == NULL)
396 return -EINVAL; 404 return -EINVAL;
397 if (!banner_printed) { 405 if (!banner_printed) {
398 printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n"); 406 pr_info("Uniform CD-ROM driver " REVISION "\n");
399 banner_printed = 1; 407 banner_printed = 1;
400 cdrom_sysctl_register(); 408 cdrom_sysctl_register();
401 } 409 }
@@ -546,7 +554,7 @@ static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
546 unsigned char buffer[12]; 554 unsigned char buffer[12];
547 int ret; 555 int ret;
548 556
549 printk(KERN_INFO "cdrom: %sstarting format\n", cont ? "Re" : ""); 557 pr_info("%sstarting format\n", cont ? "Re" : "");
550 558
551 /* 559 /*
552 * FmtData bit set (bit 4), format type is 1 560 * FmtData bit set (bit 4), format type is 1
@@ -576,7 +584,7 @@ static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
576 584
577 ret = cdi->ops->generic_packet(cdi, &cgc); 585 ret = cdi->ops->generic_packet(cdi, &cgc);
578 if (ret) 586 if (ret)
579 printk(KERN_INFO "cdrom: bgformat failed\n"); 587 pr_info("bgformat failed\n");
580 588
581 return ret; 589 return ret;
582} 590}
@@ -622,8 +630,7 @@ static int cdrom_mrw_exit(struct cdrom_device_info *cdi)
622 630
623 ret = 0; 631 ret = 0;
624 if (di.mrw_status == CDM_MRW_BGFORMAT_ACTIVE) { 632 if (di.mrw_status == CDM_MRW_BGFORMAT_ACTIVE) {
625 printk(KERN_INFO "cdrom: issuing MRW back ground " 633 pr_info("issuing MRW background format suspend\n");
626 "format suspend\n");
627 ret = cdrom_mrw_bgformat_susp(cdi, 0); 634 ret = cdrom_mrw_bgformat_susp(cdi, 0);
628 } 635 }
629 636
@@ -658,7 +665,8 @@ static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space)
658 if ((ret = cdrom_mode_select(cdi, &cgc))) 665 if ((ret = cdrom_mode_select(cdi, &cgc)))
659 return ret; 666 return ret;
660 667
661 printk(KERN_INFO "cdrom: %s: mrw address space %s selected\n", cdi->name, mrw_address_space[space]); 668 pr_info("%s: mrw address space %s selected\n",
669 cdi->name, mrw_address_space[space]);
662 return 0; 670 return 0;
663} 671}
664 672
@@ -762,7 +770,7 @@ static int cdrom_mrw_open_write(struct cdrom_device_info *cdi)
762 * always reset to DMA lba space on open 770 * always reset to DMA lba space on open
763 */ 771 */
764 if (cdrom_mrw_set_lba_space(cdi, MRW_LBA_DMA)) { 772 if (cdrom_mrw_set_lba_space(cdi, MRW_LBA_DMA)) {
765 printk(KERN_ERR "cdrom: failed setting lba address space\n"); 773 pr_err("failed setting lba address space\n");
766 return 1; 774 return 1;
767 } 775 }
768 776
@@ -781,8 +789,7 @@ static int cdrom_mrw_open_write(struct cdrom_device_info *cdi)
781 * 3 - MRW formatting complete 789 * 3 - MRW formatting complete
782 */ 790 */
783 ret = 0; 791 ret = 0;
784 printk(KERN_INFO "cdrom open: mrw_status '%s'\n", 792 pr_info("open: mrw_status '%s'\n", mrw_format_status[di.mrw_status]);
785 mrw_format_status[di.mrw_status]);
786 if (!di.mrw_status) 793 if (!di.mrw_status)
787 ret = 1; 794 ret = 1;
788 else if (di.mrw_status == CDM_MRW_BGFORMAT_INACTIVE && 795 else if (di.mrw_status == CDM_MRW_BGFORMAT_INACTIVE &&
@@ -932,8 +939,7 @@ static void cdrom_dvd_rw_close_write(struct cdrom_device_info *cdi)
932 return; 939 return;
933 } 940 }
934 941
935 printk(KERN_INFO "cdrom: %s: dirty DVD+RW media, \"finalizing\"\n", 942 pr_info("%s: dirty DVD+RW media, \"finalizing\"\n", cdi->name);
936 cdi->name);
937 943
938 init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); 944 init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE);
939 cgc.cmd[0] = GPCMD_FLUSH_CACHE; 945 cgc.cmd[0] = GPCMD_FLUSH_CACHE;
@@ -2176,7 +2182,7 @@ retry:
2176 * frame dma, so drop to single frame dma if we need to 2182 * frame dma, so drop to single frame dma if we need to
2177 */ 2183 */
2178 if (cdi->cdda_method == CDDA_BPC_FULL && nframes > 1) { 2184 if (cdi->cdda_method == CDDA_BPC_FULL && nframes > 1) {
2179 printk("cdrom: dropping to single frame dma\n"); 2185 pr_info("dropping to single frame dma\n");
2180 cdi->cdda_method = CDDA_BPC_SINGLE; 2186 cdi->cdda_method = CDDA_BPC_SINGLE;
2181 goto retry; 2187 goto retry;
2182 } 2188 }
@@ -2189,7 +2195,7 @@ retry:
2189 if (cdi->last_sense != 0x04 && cdi->last_sense != 0x0b) 2195 if (cdi->last_sense != 0x04 && cdi->last_sense != 0x0b)
2190 return ret; 2196 return ret;
2191 2197
2192 printk("cdrom: dropping to old style cdda (sense=%x)\n", cdi->last_sense); 2198 pr_info("dropping to old style cdda (sense=%x)\n", cdi->last_sense);
2193 cdi->cdda_method = CDDA_OLD; 2199 cdi->cdda_method = CDDA_OLD;
2194 return cdrom_read_cdda_old(cdi, ubuf, lba, nframes); 2200 return cdrom_read_cdda_old(cdi, ubuf, lba, nframes);
2195} 2201}
@@ -3401,7 +3407,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
3401 "\t%d", CDROM_CAN(val) != 0); 3407 "\t%d", CDROM_CAN(val) != 0);
3402 break; 3408 break;
3403 default: 3409 default:
3404 printk(KERN_INFO "cdrom: invalid option%d\n", option); 3410 pr_info("invalid option%d\n", option);
3405 return 1; 3411 return 1;
3406 } 3412 }
3407 if (!ret) 3413 if (!ret)
@@ -3491,7 +3497,7 @@ doit:
3491 mutex_unlock(&cdrom_mutex); 3497 mutex_unlock(&cdrom_mutex);
3492 return proc_dostring(ctl, write, buffer, lenp, ppos); 3498 return proc_dostring(ctl, write, buffer, lenp, ppos);
3493done: 3499done:
3494 printk(KERN_INFO "cdrom: info buffer too small\n"); 3500 pr_info("info buffer too small\n");
3495 goto doit; 3501 goto doit;
3496} 3502}
3497 3503
@@ -3665,7 +3671,7 @@ static int __init cdrom_init(void)
3665 3671
3666static void __exit cdrom_exit(void) 3672static void __exit cdrom_exit(void)
3667{ 3673{
3668 printk(KERN_INFO "Uniform CD-ROM driver unloaded\n"); 3674 pr_info("Uniform CD-ROM driver unloaded\n");
3669 cdrom_sysctl_unregister(); 3675 cdrom_sysctl_unregister();
3670} 3676}
3671 3677
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;
820probe_fail_no_mem: 819probe_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
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index 14e420168764..1fa6628d150b 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -31,6 +31,8 @@
31 * the OS/400 partition. 31 * the OS/400 partition.
32 */ 32 */
33 33
34#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
35
34#include <linux/major.h> 36#include <linux/major.h>
35#include <linux/blkdev.h> 37#include <linux/blkdev.h>
36#include <linux/cdrom.h> 38#include <linux/cdrom.h>
@@ -53,9 +55,6 @@
53 55
54#define VIOCD_VERS "1.06" 56#define VIOCD_VERS "1.06"
55 57
56#define VIOCD_KERN_WARNING KERN_WARNING "viocd: "
57#define VIOCD_KERN_INFO KERN_INFO "viocd: "
58
59/* 58/*
60 * Should probably make this a module parameter....sigh 59 * Should probably make this a module parameter....sigh
61 */ 60 */
@@ -202,9 +201,8 @@ static int viocd_open(struct cdrom_device_info *cdi, int purpose)
202 (u64)&we, VIOVERSION << 16, ((u64)device_no << 48), 201 (u64)&we, VIOVERSION << 16, ((u64)device_no << 48),
203 0, 0, 0); 202 0, 0, 0);
204 if (hvrc != 0) { 203 if (hvrc != 0) {
205 printk(VIOCD_KERN_WARNING 204 pr_warning("bad rc on HvCallEvent_signalLpEventFast %d\n",
206 "bad rc on HvCallEvent_signalLpEventFast %d\n", 205 (int)hvrc);
207 (int)hvrc);
208 return -EIO; 206 return -EIO;
209 } 207 }
210 208
@@ -213,8 +211,8 @@ static int viocd_open(struct cdrom_device_info *cdi, int purpose)
213 if (we.rc) { 211 if (we.rc) {
214 const struct vio_error_entry *err = 212 const struct vio_error_entry *err =
215 vio_lookup_rc(viocd_err_table, we.sub_result); 213 vio_lookup_rc(viocd_err_table, we.sub_result);
216 printk(VIOCD_KERN_WARNING "bad rc %d:0x%04X on open: %s\n", 214 pr_warning("bad rc %d:0x%04X on open: %s\n",
217 we.rc, we.sub_result, err->msg); 215 we.rc, we.sub_result, err->msg);
218 return -err->errno; 216 return -err->errno;
219 } 217 }
220 218
@@ -234,9 +232,8 @@ static void viocd_release(struct cdrom_device_info *cdi)
234 viopath_targetinst(viopath_hostLp), 0, 232 viopath_targetinst(viopath_hostLp), 0,
235 VIOVERSION << 16, ((u64)device_no << 48), 0, 0, 0); 233 VIOVERSION << 16, ((u64)device_no << 48), 0, 0, 0);
236 if (hvrc != 0) 234 if (hvrc != 0)
237 printk(VIOCD_KERN_WARNING 235 pr_warning("bad rc on HvCallEvent_signalLpEventFast %d\n",
238 "bad rc on HvCallEvent_signalLpEventFast %d\n", 236 (int)hvrc);
239 (int)hvrc);
240} 237}
241 238
242/* Send a read or write request to OS/400 */ 239/* Send a read or write request to OS/400 */
@@ -262,13 +259,12 @@ static int send_request(struct request *req)
262 259
263 sg_init_table(&sg, 1); 260 sg_init_table(&sg, 1);
264 if (blk_rq_map_sg(req->q, req, &sg) == 0) { 261 if (blk_rq_map_sg(req->q, req, &sg) == 0) {
265 printk(VIOCD_KERN_WARNING 262 pr_warning("error setting up scatter/gather list\n");
266 "error setting up scatter/gather list\n");
267 return -1; 263 return -1;
268 } 264 }
269 265
270 if (dma_map_sg(diskinfo->dev, &sg, 1, direction) == 0) { 266 if (dma_map_sg(diskinfo->dev, &sg, 1, direction) == 0) {
271 printk(VIOCD_KERN_WARNING "error allocating sg tce\n"); 267 pr_warning("error allocating sg tce\n");
272 return -1; 268 return -1;
273 } 269 }
274 dmaaddr = sg_dma_address(&sg); 270 dmaaddr = sg_dma_address(&sg);
@@ -284,7 +280,7 @@ static int send_request(struct request *req)
284 ((u64)DEVICE_NR(diskinfo) << 48) | dmaaddr, 280 ((u64)DEVICE_NR(diskinfo) << 48) | dmaaddr,
285 (u64)blk_rq_pos(req) * 512, len, 0); 281 (u64)blk_rq_pos(req) * 512, len, 0);
286 if (hvrc != HvLpEvent_Rc_Good) { 282 if (hvrc != HvLpEvent_Rc_Good) {
287 printk(VIOCD_KERN_WARNING "hv error on op %d\n", (int)hvrc); 283 pr_warning("hv error on op %d\n", (int)hvrc);
288 return -1; 284 return -1;
289 } 285 }
290 286
@@ -301,8 +297,7 @@ static void do_viocd_request(struct request_queue *q)
301 if (req->cmd_type != REQ_TYPE_FS) 297 if (req->cmd_type != REQ_TYPE_FS)
302 __blk_end_request_all(req, -EIO); 298 __blk_end_request_all(req, -EIO);
303 else if (send_request(req) < 0) { 299 else if (send_request(req) < 0) {
304 printk(VIOCD_KERN_WARNING 300 pr_warning("unable to send message to OS/400!\n");
305 "unable to send message to OS/400!");
306 __blk_end_request_all(req, -EIO); 301 __blk_end_request_all(req, -EIO);
307 } else 302 } else
308 rwreq++; 303 rwreq++;
@@ -327,8 +322,8 @@ static int viocd_media_changed(struct cdrom_device_info *cdi, int disc_nr)
327 (u64)&we, VIOVERSION << 16, ((u64)device_no << 48), 322 (u64)&we, VIOVERSION << 16, ((u64)device_no << 48),
328 0, 0, 0); 323 0, 0, 0);
329 if (hvrc != 0) { 324 if (hvrc != 0) {
330 printk(VIOCD_KERN_WARNING "bad rc on HvCallEvent_signalLpEventFast %d\n", 325 pr_warning("bad rc on HvCallEvent_signalLpEventFast %d\n",
331 (int)hvrc); 326 (int)hvrc);
332 return -EIO; 327 return -EIO;
333 } 328 }
334 329
@@ -338,9 +333,8 @@ static int viocd_media_changed(struct cdrom_device_info *cdi, int disc_nr)
338 if (we.rc) { 333 if (we.rc) {
339 const struct vio_error_entry *err = 334 const struct vio_error_entry *err =
340 vio_lookup_rc(viocd_err_table, we.sub_result); 335 vio_lookup_rc(viocd_err_table, we.sub_result);
341 printk(VIOCD_KERN_WARNING 336 pr_warning("bad rc %d:0x%04X on check_change: %s; Assuming no change\n",
342 "bad rc %d:0x%04X on check_change: %s; Assuming no change\n", 337 we.rc, we.sub_result, err->msg);
343 we.rc, we.sub_result, err->msg);
344 return 0; 338 return 0;
345 } 339 }
346 340
@@ -367,8 +361,8 @@ static int viocd_lock_door(struct cdrom_device_info *cdi, int locking)
367 (u64)&we, VIOVERSION << 16, 361 (u64)&we, VIOVERSION << 16,
368 (device_no << 48) | (flags << 32), 0, 0, 0); 362 (device_no << 48) | (flags << 32), 0, 0, 0);
369 if (hvrc != 0) { 363 if (hvrc != 0) {
370 printk(VIOCD_KERN_WARNING "bad rc on HvCallEvent_signalLpEventFast %d\n", 364 pr_warning("bad rc on HvCallEvent_signalLpEventFast %d\n",
371 (int)hvrc); 365 (int)hvrc);
372 return -EIO; 366 return -EIO;
373 } 367 }
374 368
@@ -455,8 +449,7 @@ static void vio_handle_cd_event(struct HvLpEvent *event)
455 return; 449 return;
456 /* First, we should NEVER get an int here...only acks */ 450 /* First, we should NEVER get an int here...only acks */
457 if (hvlpevent_is_int(event)) { 451 if (hvlpevent_is_int(event)) {
458 printk(VIOCD_KERN_WARNING 452 pr_warning("Yikes! got an int in viocd event handler!\n");
459 "Yikes! got an int in viocd event handler!\n");
460 if (hvlpevent_need_ack(event)) { 453 if (hvlpevent_need_ack(event)) {
461 event->xRc = HvLpEvent_Rc_InvalidSubtype; 454 event->xRc = HvLpEvent_Rc_InvalidSubtype;
462 HvCallEvent_ackLpEvent(event); 455 HvCallEvent_ackLpEvent(event);
@@ -510,10 +503,9 @@ return_complete:
510 const struct vio_error_entry *err = 503 const struct vio_error_entry *err =
511 vio_lookup_rc(viocd_err_table, 504 vio_lookup_rc(viocd_err_table,
512 bevent->sub_result); 505 bevent->sub_result);
513 printk(VIOCD_KERN_WARNING "request %p failed " 506 pr_warning("request %p failed with rc %d:0x%04X: %s\n",
514 "with rc %d:0x%04X: %s\n", 507 req, event->xRc,
515 req, event->xRc, 508 bevent->sub_result, err->msg);
516 bevent->sub_result, err->msg);
517 __blk_end_request_all(req, -EIO); 509 __blk_end_request_all(req, -EIO);
518 } else 510 } else
519 __blk_end_request_all(req, 0); 511 __blk_end_request_all(req, 0);
@@ -524,9 +516,8 @@ return_complete:
524 break; 516 break;
525 517
526 default: 518 default:
527 printk(VIOCD_KERN_WARNING 519 pr_warning("message with invalid subtype %0x04X!\n",
528 "message with invalid subtype %0x04X!\n", 520 event->xSubtype & VIOMINOR_SUBTYPE_MASK);
529 event->xSubtype & VIOMINOR_SUBTYPE_MASK);
530 if (hvlpevent_need_ack(event)) { 521 if (hvlpevent_need_ack(event)) {
531 event->xRc = HvLpEvent_Rc_InvalidSubtype; 522 event->xRc = HvLpEvent_Rc_InvalidSubtype;
532 HvCallEvent_ackLpEvent(event); 523 HvCallEvent_ackLpEvent(event);
@@ -593,23 +584,19 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
593 sprintf(c->name, VIOCD_DEVICE "%c", 'a' + deviceno); 584 sprintf(c->name, VIOCD_DEVICE "%c", 'a' + deviceno);
594 585
595 if (register_cdrom(c) != 0) { 586 if (register_cdrom(c) != 0) {
596 printk(VIOCD_KERN_WARNING "Cannot register viocd CD-ROM %s!\n", 587 pr_warning("Cannot register viocd CD-ROM %s!\n", c->name);
597 c->name);
598 goto out; 588 goto out;
599 } 589 }
600 printk(VIOCD_KERN_INFO "cd %s is iSeries resource %10.10s " 590 pr_info("cd %s is iSeries resource %10.10s type %4.4s, model %3.3s\n",
601 "type %4.4s, model %3.3s\n", 591 c->name, d->rsrcname, d->type, d->model);
602 c->name, d->rsrcname, d->type, d->model);
603 q = blk_init_queue(do_viocd_request, &viocd_reqlock); 592 q = blk_init_queue(do_viocd_request, &viocd_reqlock);
604 if (q == NULL) { 593 if (q == NULL) {
605 printk(VIOCD_KERN_WARNING "Cannot allocate queue for %s!\n", 594 pr_warning("Cannot allocate queue for %s!\n", c->name);
606 c->name);
607 goto out_unregister_cdrom; 595 goto out_unregister_cdrom;
608 } 596 }
609 gendisk = alloc_disk(1); 597 gendisk = alloc_disk(1);
610 if (gendisk == NULL) { 598 if (gendisk == NULL) {
611 printk(VIOCD_KERN_WARNING "Cannot create gendisk for %s!\n", 599 pr_warning("Cannot create gendisk for %s!\n", c->name);
612 c->name);
613 goto out_cleanup_queue; 600 goto out_cleanup_queue;
614 } 601 }
615 gendisk->major = VIOCD_MAJOR; 602 gendisk->major = VIOCD_MAJOR;
@@ -682,21 +669,19 @@ static int __init viocd_init(void)
682 return -ENODEV; 669 return -ENODEV;
683 } 670 }
684 671
685 printk(VIOCD_KERN_INFO "vers " VIOCD_VERS ", hosting partition %d\n", 672 pr_info("vers " VIOCD_VERS ", hosting partition %d\n", viopath_hostLp);
686 viopath_hostLp);
687 673
688 if (register_blkdev(VIOCD_MAJOR, VIOCD_DEVICE) != 0) { 674 if (register_blkdev(VIOCD_MAJOR, VIOCD_DEVICE) != 0) {
689 printk(VIOCD_KERN_WARNING "Unable to get major %d for %s\n", 675 pr_warning("Unable to get major %d for %s\n",
690 VIOCD_MAJOR, VIOCD_DEVICE); 676 VIOCD_MAJOR, VIOCD_DEVICE);
691 return -EIO; 677 return -EIO;
692 } 678 }
693 679
694 ret = viopath_open(viopath_hostLp, viomajorsubtype_cdio, 680 ret = viopath_open(viopath_hostLp, viomajorsubtype_cdio,
695 MAX_CD_REQ + 2); 681 MAX_CD_REQ + 2);
696 if (ret) { 682 if (ret) {
697 printk(VIOCD_KERN_WARNING 683 pr_warning("error opening path to host partition %d\n",
698 "error opening path to host partition %d\n", 684 viopath_hostLp);
699 viopath_hostLp);
700 goto out_unregister; 685 goto out_unregister;
701 } 686 }
702 687