diff options
Diffstat (limited to 'drivers/cdrom/cdrom.c')
-rw-r--r-- | drivers/cdrom/cdrom.c | 46 |
1 files changed, 26 insertions, 20 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[] = { | |||
314 | static const char *mrw_address_space[] = { "DMA", "GAA" }; | 316 | static 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 ) \ | 320 | do { \ |
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...) \ |
326 | do { \ | ||
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); |
3493 | done: | 3499 | done: |
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 | ||
3666 | static void __exit cdrom_exit(void) | 3672 | static 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 | ||