diff options
author | Joe Perches <joe@perches.com> | 2010-03-10 18:20:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:29 -0500 |
commit | b46df356de8c63882cfb1ee7501bd9c772a6981b (patch) | |
tree | fff8e1873e24781cda6ad7cf288b82f2d5965ac6 /drivers/block/floppy.c | |
parent | 48c8cee61f22fe5a2ea00488222b3415378469ad (diff) |
drivers/block/floppy.c: use pr_<level>
Convert bare printk to pr_info and pr_cont
Convert printk(KERN_ERR to pr_err
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 353 |
1 files changed, 175 insertions, 178 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 652668d76a8a..dae637abeec3 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -273,7 +273,7 @@ static inline void fallback_on_nodma_alloc(char **addr, size_t l) | |||
273 | return; /* we have the memory */ | 273 | return; /* we have the memory */ |
274 | if (can_use_virtual_dma != 2) | 274 | if (can_use_virtual_dma != 2) |
275 | return; /* no fallback allowed */ | 275 | return; /* no fallback allowed */ |
276 | printk("DMA memory shortage. Temporarily falling back on virtual DMA\n"); | 276 | pr_info("DMA memory shortage. Temporarily falling back on virtual DMA\n"); |
277 | *addr = (char *)nodma_mem_alloc(l); | 277 | *addr = (char *)nodma_mem_alloc(l); |
278 | #else | 278 | #else |
279 | return; | 279 | return; |
@@ -309,7 +309,7 @@ static int initialising = 1; | |||
309 | #define UTESTF(x) test_bit(x##_BIT, &UDRS->flags) | 309 | #define UTESTF(x) test_bit(x##_BIT, &UDRS->flags) |
310 | 310 | ||
311 | #define DPRINT(format, args...) \ | 311 | #define DPRINT(format, args...) \ |
312 | printk(DEVICE_NAME "%d: " format, current_drive, ##args) | 312 | pr_info(DEVICE_NAME "%d: " format, current_drive, ##args) |
313 | 313 | ||
314 | #define PH_HEAD(floppy, head) (((((floppy)->stretch & 2) >> 1) ^ head) << 2) | 314 | #define PH_HEAD(floppy, head) (((((floppy)->stretch & 2) >> 1) ^ head) << 2) |
315 | #define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH) | 315 | #define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH) |
@@ -628,7 +628,7 @@ static inline void set_debugt(void) | |||
628 | static inline void debugt(const char *message) | 628 | static inline void debugt(const char *message) |
629 | { | 629 | { |
630 | if (DP->flags & DEBUGT) | 630 | if (DP->flags & DEBUGT) |
631 | printk("%s dtime=%lu\n", message, jiffies - debugtimer); | 631 | pr_info("%s dtime=%lu\n", message, jiffies - debugtimer); |
632 | } | 632 | } |
633 | #else | 633 | #else |
634 | static inline void set_debugt(void) { } | 634 | static inline void set_debugt(void) { } |
@@ -687,9 +687,7 @@ static void __reschedule_timeout(int drive, const char *message, int marg) | |||
687 | fd_timeout.expires = jiffies + UDP->timeout; | 687 | fd_timeout.expires = jiffies + UDP->timeout; |
688 | add_timer(&fd_timeout); | 688 | add_timer(&fd_timeout); |
689 | if (UDP->flags & FD_DEBUG) { | 689 | if (UDP->flags & FD_DEBUG) { |
690 | DPRINT("reschedule timeout "); | 690 | DPRINT("reschedule timeout %s %d\n", message, marg); |
691 | printk(message, marg); | ||
692 | printk("\n"); | ||
693 | } | 691 | } |
694 | timeout_message = message; | 692 | timeout_message = message; |
695 | } | 693 | } |
@@ -861,7 +859,7 @@ static void set_fdc(int drive) | |||
861 | current_drive = drive; | 859 | current_drive = drive; |
862 | } | 860 | } |
863 | if (fdc != 1 && fdc != 0) { | 861 | if (fdc != 1 && fdc != 0) { |
864 | printk("bad fdc value\n"); | 862 | pr_info("bad fdc value\n"); |
865 | return; | 863 | return; |
866 | } | 864 | } |
867 | set_dor(fdc, ~0, 8); | 865 | set_dor(fdc, ~0, 8); |
@@ -878,8 +876,7 @@ static void set_fdc(int drive) | |||
878 | static int _lock_fdc(int drive, int interruptible, int line) | 876 | static int _lock_fdc(int drive, int interruptible, int line) |
879 | { | 877 | { |
880 | if (!usage_count) { | 878 | if (!usage_count) { |
881 | printk(KERN_ERR | 879 | pr_err("Trying to lock fdc while usage count=0 at line %d\n", |
882 | "Trying to lock fdc while usage count=0 at line %d\n", | ||
883 | line); | 880 | line); |
884 | return -1; | 881 | return -1; |
885 | } | 882 | } |
@@ -1115,16 +1112,16 @@ static void setup_DMA(void) | |||
1115 | if (raw_cmd->length == 0) { | 1112 | if (raw_cmd->length == 0) { |
1116 | int i; | 1113 | int i; |
1117 | 1114 | ||
1118 | printk("zero dma transfer size:"); | 1115 | pr_info("zero dma transfer size:"); |
1119 | for (i = 0; i < raw_cmd->cmd_count; i++) | 1116 | for (i = 0; i < raw_cmd->cmd_count; i++) |
1120 | printk("%x,", raw_cmd->cmd[i]); | 1117 | pr_cont("%x,", raw_cmd->cmd[i]); |
1121 | printk("\n"); | 1118 | pr_cont("\n"); |
1122 | cont->done(0); | 1119 | cont->done(0); |
1123 | FDCS->reset = 1; | 1120 | FDCS->reset = 1; |
1124 | return; | 1121 | return; |
1125 | } | 1122 | } |
1126 | if (((unsigned long)raw_cmd->kernel_data) % 512) { | 1123 | if (((unsigned long)raw_cmd->kernel_data) % 512) { |
1127 | printk("non aligned address: %p\n", raw_cmd->kernel_data); | 1124 | pr_info("non aligned address: %p\n", raw_cmd->kernel_data); |
1128 | cont->done(0); | 1125 | cont->done(0); |
1129 | FDCS->reset = 1; | 1126 | FDCS->reset = 1; |
1130 | return; | 1127 | return; |
@@ -1427,10 +1424,40 @@ static int fdc_dtr(void) | |||
1427 | 1424 | ||
1428 | static void tell_sector(void) | 1425 | static void tell_sector(void) |
1429 | { | 1426 | { |
1430 | printk(": track %d, head %d, sector %d, size %d", | 1427 | pr_cont(": track %d, head %d, sector %d, size %d", |
1431 | R_TRACK, R_HEAD, R_SECTOR, R_SIZECODE); | 1428 | R_TRACK, R_HEAD, R_SECTOR, R_SIZECODE); |
1432 | } /* tell_sector */ | 1429 | } /* tell_sector */ |
1433 | 1430 | ||
1431 | static void print_errors(void) | ||
1432 | { | ||
1433 | DPRINT(""); | ||
1434 | if (ST0 & ST0_ECE) { | ||
1435 | pr_cont("Recalibrate failed!"); | ||
1436 | } else if (ST2 & ST2_CRC) { | ||
1437 | pr_cont("data CRC error"); | ||
1438 | tell_sector(); | ||
1439 | } else if (ST1 & ST1_CRC) { | ||
1440 | pr_cont("CRC error"); | ||
1441 | tell_sector(); | ||
1442 | } else if ((ST1 & (ST1_MAM | ST1_ND)) || | ||
1443 | (ST2 & ST2_MAM)) { | ||
1444 | if (!probing) { | ||
1445 | pr_cont("sector not found"); | ||
1446 | tell_sector(); | ||
1447 | } else | ||
1448 | pr_cont("probe failed..."); | ||
1449 | } else if (ST2 & ST2_WC) { /* seek error */ | ||
1450 | pr_cont("wrong cylinder"); | ||
1451 | } else if (ST2 & ST2_BC) { /* cylinder marked as bad */ | ||
1452 | pr_cont("bad cylinder"); | ||
1453 | } else { | ||
1454 | pr_cont("unknown error. ST[0..2] are: 0x%x 0x%x 0x%x", | ||
1455 | ST0, ST1, ST2); | ||
1456 | tell_sector(); | ||
1457 | } | ||
1458 | pr_cont("\n"); | ||
1459 | } | ||
1460 | |||
1434 | /* | 1461 | /* |
1435 | * OK, this error interpreting routine is called after a | 1462 | * OK, this error interpreting routine is called after a |
1436 | * DMA read/write has succeeded | 1463 | * DMA read/write has succeeded |
@@ -1466,33 +1493,7 @@ static int interpret_errors(void) | |||
1466 | DPRINT("Over/Underrun - retrying\n"); | 1493 | DPRINT("Over/Underrun - retrying\n"); |
1467 | bad = 0; | 1494 | bad = 0; |
1468 | } else if (*errors >= DP->max_errors.reporting) { | 1495 | } else if (*errors >= DP->max_errors.reporting) { |
1469 | DPRINT(""); | 1496 | print_errors(); |
1470 | if (ST0 & ST0_ECE) { | ||
1471 | printk("Recalibrate failed!"); | ||
1472 | } else if (ST2 & ST2_CRC) { | ||
1473 | printk("data CRC error"); | ||
1474 | tell_sector(); | ||
1475 | } else if (ST1 & ST1_CRC) { | ||
1476 | printk("CRC error"); | ||
1477 | tell_sector(); | ||
1478 | } else if ((ST1 & (ST1_MAM | ST1_ND)) | ||
1479 | || (ST2 & ST2_MAM)) { | ||
1480 | if (!probing) { | ||
1481 | printk("sector not found"); | ||
1482 | tell_sector(); | ||
1483 | } else | ||
1484 | printk("probe failed..."); | ||
1485 | } else if (ST2 & ST2_WC) { /* seek error */ | ||
1486 | printk("wrong cylinder"); | ||
1487 | } else if (ST2 & ST2_BC) { /* cylinder marked as bad */ | ||
1488 | printk("bad cylinder"); | ||
1489 | } else { | ||
1490 | printk | ||
1491 | ("unknown error. ST[0..2] are: 0x%x 0x%x 0x%x", | ||
1492 | ST0, ST1, ST2); | ||
1493 | tell_sector(); | ||
1494 | } | ||
1495 | printk("\n"); | ||
1496 | } | 1497 | } |
1497 | if (ST2 & ST2_WC || ST2 & ST2_BC) | 1498 | if (ST2 & ST2_WC || ST2 & ST2_BC) |
1498 | /* wrong cylinder => recal */ | 1499 | /* wrong cylinder => recal */ |
@@ -1591,8 +1592,7 @@ static void seek_interrupt(void) | |||
1591 | if (DRS->track >= 0 && DRS->track != ST1 && !blind_seek) { | 1592 | if (DRS->track >= 0 && DRS->track != ST1 && !blind_seek) { |
1592 | #ifdef DCL_DEBUG | 1593 | #ifdef DCL_DEBUG |
1593 | if (DP->flags & FD_DEBUG) { | 1594 | if (DP->flags & FD_DEBUG) { |
1594 | DPRINT | 1595 | DPRINT("clearing NEWCHANGE flag because of effective seek\n"); |
1595 | ("clearing NEWCHANGE flag because of effective seek\n"); | ||
1596 | DPRINT("jiffies=%lu\n", jiffies); | 1596 | DPRINT("jiffies=%lu\n", jiffies); |
1597 | } | 1597 | } |
1598 | #endif | 1598 | #endif |
@@ -1712,10 +1712,8 @@ static void recal_interrupt(void) | |||
1712 | * be already at track 0.) Clear the | 1712 | * be already at track 0.) Clear the |
1713 | * new change flag */ | 1713 | * new change flag */ |
1714 | #ifdef DCL_DEBUG | 1714 | #ifdef DCL_DEBUG |
1715 | if (DP->flags & FD_DEBUG) { | 1715 | if (DP->flags & FD_DEBUG) |
1716 | DPRINT | 1716 | DPRINT("clearing NEWCHANGE flag because of second recalibrate\n"); |
1717 | ("clearing NEWCHANGE flag because of second recalibrate\n"); | ||
1718 | } | ||
1719 | #endif | 1717 | #endif |
1720 | 1718 | ||
1721 | CLEARF(FD_DISK_NEWCHANGE); | 1719 | CLEARF(FD_DISK_NEWCHANGE); |
@@ -1744,8 +1742,8 @@ static void print_result(char *message, int inr) | |||
1744 | DPRINT("%s ", message); | 1742 | DPRINT("%s ", message); |
1745 | if (inr >= 0) | 1743 | if (inr >= 0) |
1746 | for (i = 0; i < inr; i++) | 1744 | for (i = 0; i < inr; i++) |
1747 | printk("repl[%d]=%x ", i, reply_buffer[i]); | 1745 | pr_cont("repl[%d]=%x ", i, reply_buffer[i]); |
1748 | printk("\n"); | 1746 | pr_cont("\n"); |
1749 | } | 1747 | } |
1750 | 1748 | ||
1751 | /* interrupt handler. Note that this can be called externally on the Sparc */ | 1749 | /* interrupt handler. Note that this can be called externally on the Sparc */ |
@@ -1766,9 +1764,9 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id) | |||
1766 | do_floppy = NULL; | 1764 | do_floppy = NULL; |
1767 | if (fdc >= N_FDC || FDCS->address == -1) { | 1765 | if (fdc >= N_FDC || FDCS->address == -1) { |
1768 | /* we don't even know which FDC is the culprit */ | 1766 | /* we don't even know which FDC is the culprit */ |
1769 | printk("DOR0=%x\n", fdc_state[0].dor); | 1767 | pr_info("DOR0=%x\n", fdc_state[0].dor); |
1770 | printk("floppy interrupt on bizarre fdc %d\n", fdc); | 1768 | pr_info("floppy interrupt on bizarre fdc %d\n", fdc); |
1771 | printk("handler=%p\n", handler); | 1769 | pr_info("handler=%p\n", handler); |
1772 | is_alive("bizarre fdc"); | 1770 | is_alive("bizarre fdc"); |
1773 | return IRQ_NONE; | 1771 | return IRQ_NONE; |
1774 | } | 1772 | } |
@@ -1826,7 +1824,7 @@ static void reset_interrupt(void) | |||
1826 | debugt("reset interrupt:"); | 1824 | debugt("reset interrupt:"); |
1827 | result(); /* get the status ready for set_fdc */ | 1825 | result(); /* get the status ready for set_fdc */ |
1828 | if (FDCS->reset) { | 1826 | if (FDCS->reset) { |
1829 | printk("reset set in interrupt, calling %p\n", cont->error); | 1827 | pr_info("reset set in interrupt, calling %p\n", cont->error); |
1830 | cont->error(); /* a reset just after a reset. BAD! */ | 1828 | cont->error(); /* a reset just after a reset. BAD! */ |
1831 | } | 1829 | } |
1832 | cont->redo(); | 1830 | cont->redo(); |
@@ -1864,46 +1862,44 @@ static void show_floppy(void) | |||
1864 | { | 1862 | { |
1865 | int i; | 1863 | int i; |
1866 | 1864 | ||
1867 | printk("\n"); | 1865 | pr_info("\n"); |
1868 | printk("floppy driver state\n"); | 1866 | pr_info("floppy driver state\n"); |
1869 | printk("-------------------\n"); | 1867 | pr_info("-------------------\n"); |
1870 | printk("now=%lu last interrupt=%lu diff=%lu last called handler=%p\n", | 1868 | pr_info("now=%lu last interrupt=%lu diff=%lu last called handler=%p\n", |
1871 | jiffies, interruptjiffies, jiffies - interruptjiffies, | 1869 | jiffies, interruptjiffies, jiffies - interruptjiffies, |
1872 | lasthandler); | 1870 | lasthandler); |
1873 | 1871 | ||
1874 | #ifdef FLOPPY_SANITY_CHECK | 1872 | #ifdef FLOPPY_SANITY_CHECK |
1875 | printk("timeout_message=%s\n", timeout_message); | 1873 | pr_info("timeout_message=%s\n", timeout_message); |
1876 | printk("last output bytes:\n"); | 1874 | pr_info("last output bytes:\n"); |
1877 | for (i = 0; i < OLOGSIZE; i++) | 1875 | for (i = 0; i < OLOGSIZE; i++) |
1878 | printk("%2x %2x %lu\n", | 1876 | pr_info("%2x %2x %lu\n", |
1879 | output_log[(i + output_log_pos) % OLOGSIZE].data, | 1877 | output_log[(i + output_log_pos) % OLOGSIZE].data, |
1880 | output_log[(i + output_log_pos) % OLOGSIZE].status, | 1878 | output_log[(i + output_log_pos) % OLOGSIZE].status, |
1881 | output_log[(i + output_log_pos) % OLOGSIZE].jiffies); | 1879 | output_log[(i + output_log_pos) % OLOGSIZE].jiffies); |
1882 | printk("last result at %lu\n", resultjiffies); | 1880 | pr_info("last result at %lu\n", resultjiffies); |
1883 | printk("last redo_fd_request at %lu\n", lastredo); | 1881 | pr_info("last redo_fd_request at %lu\n", lastredo); |
1884 | for (i = 0; i < resultsize; i++) { | 1882 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, |
1885 | printk("%2x ", reply_buffer[i]); | 1883 | reply_buffer, resultsize, true); |
1886 | } | ||
1887 | printk("\n"); | ||
1888 | #endif | 1884 | #endif |
1889 | 1885 | ||
1890 | printk("status=%x\n", fd_inb(FD_STATUS)); | 1886 | pr_info("status=%x\n", fd_inb(FD_STATUS)); |
1891 | printk("fdc_busy=%lu\n", fdc_busy); | 1887 | pr_info("fdc_busy=%lu\n", fdc_busy); |
1892 | if (do_floppy) | 1888 | if (do_floppy) |
1893 | printk("do_floppy=%p\n", do_floppy); | 1889 | pr_info("do_floppy=%p\n", do_floppy); |
1894 | if (work_pending(&floppy_work)) | 1890 | if (work_pending(&floppy_work)) |
1895 | printk("floppy_work.func=%p\n", floppy_work.func); | 1891 | pr_info("floppy_work.func=%p\n", floppy_work.func); |
1896 | if (timer_pending(&fd_timer)) | 1892 | if (timer_pending(&fd_timer)) |
1897 | printk("fd_timer.function=%p\n", fd_timer.function); | 1893 | pr_info("fd_timer.function=%p\n", fd_timer.function); |
1898 | if (timer_pending(&fd_timeout)) { | 1894 | if (timer_pending(&fd_timeout)) { |
1899 | printk("timer_function=%p\n", fd_timeout.function); | 1895 | pr_info("timer_function=%p\n", fd_timeout.function); |
1900 | printk("expires=%lu\n", fd_timeout.expires - jiffies); | 1896 | pr_info("expires=%lu\n", fd_timeout.expires - jiffies); |
1901 | printk("now=%lu\n", jiffies); | 1897 | pr_info("now=%lu\n", jiffies); |
1902 | } | 1898 | } |
1903 | printk("cont=%p\n", cont); | 1899 | pr_info("cont=%p\n", cont); |
1904 | printk("current_req=%p\n", current_req); | 1900 | pr_info("current_req=%p\n", current_req); |
1905 | printk("command_status=%d\n", command_status); | 1901 | pr_info("command_status=%d\n", command_status); |
1906 | printk("\n"); | 1902 | pr_info("\n"); |
1907 | } | 1903 | } |
1908 | 1904 | ||
1909 | static void floppy_shutdown(unsigned long data) | 1905 | static void floppy_shutdown(unsigned long data) |
@@ -1929,7 +1925,7 @@ static void floppy_shutdown(unsigned long data) | |||
1929 | cont->done(0); | 1925 | cont->done(0); |
1930 | cont->redo(); /* this will recall reset when needed */ | 1926 | cont->redo(); /* this will recall reset when needed */ |
1931 | } else { | 1927 | } else { |
1932 | printk("no cont in shutdown!\n"); | 1928 | pr_info("no cont in shutdown!\n"); |
1933 | process_fd_request(); | 1929 | process_fd_request(); |
1934 | } | 1930 | } |
1935 | is_alive("floppy shutdown"); | 1931 | is_alive("floppy shutdown"); |
@@ -2329,10 +2325,10 @@ static void request_done(int uptodate) | |||
2329 | int block; | 2325 | int block; |
2330 | 2326 | ||
2331 | probing = 0; | 2327 | probing = 0; |
2332 | reschedule_timeout(MAXTIMEOUT, "request done %d", uptodate); | 2328 | reschedule_timeout(MAXTIMEOUT, "request done", uptodate); |
2333 | 2329 | ||
2334 | if (!req) { | 2330 | if (!req) { |
2335 | printk("floppy.c: no request in request_done\n"); | 2331 | pr_info("floppy.c: no request in request_done\n"); |
2336 | return; | 2332 | return; |
2337 | } | 2333 | } |
2338 | 2334 | ||
@@ -2405,13 +2401,13 @@ static void rw_interrupt(void) | |||
2405 | DIV_ROUND_UP(in_sector_offset + current_count_sectors, ssize)) { | 2401 | DIV_ROUND_UP(in_sector_offset + current_count_sectors, ssize)) { |
2406 | DPRINT("long rw: %x instead of %lx\n", | 2402 | DPRINT("long rw: %x instead of %lx\n", |
2407 | nr_sectors, current_count_sectors); | 2403 | nr_sectors, current_count_sectors); |
2408 | printk("rs=%d s=%d\n", R_SECTOR, SECTOR); | 2404 | pr_info("rs=%d s=%d\n", R_SECTOR, SECTOR); |
2409 | printk("rh=%d h=%d\n", R_HEAD, HEAD); | 2405 | pr_info("rh=%d h=%d\n", R_HEAD, HEAD); |
2410 | printk("rt=%d t=%d\n", R_TRACK, TRACK); | 2406 | pr_info("rt=%d t=%d\n", R_TRACK, TRACK); |
2411 | printk("heads=%d eoc=%d\n", heads, eoc); | 2407 | pr_info("heads=%d eoc=%d\n", heads, eoc); |
2412 | printk("spt=%d st=%d ss=%d\n", SECT_PER_TRACK, | 2408 | pr_info("spt=%d st=%d ss=%d\n", |
2413 | fsector_t, ssize); | 2409 | SECT_PER_TRACK, fsector_t, ssize); |
2414 | printk("in_sector_offset=%d\n", in_sector_offset); | 2410 | pr_info("in_sector_offset=%d\n", in_sector_offset); |
2415 | } | 2411 | } |
2416 | #endif | 2412 | #endif |
2417 | 2413 | ||
@@ -2521,14 +2517,14 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2) | |||
2521 | #ifdef FLOPPY_SANITY_CHECK | 2517 | #ifdef FLOPPY_SANITY_CHECK |
2522 | if (remaining > blk_rq_bytes(current_req) && CT(COMMAND) == FD_WRITE) { | 2518 | if (remaining > blk_rq_bytes(current_req) && CT(COMMAND) == FD_WRITE) { |
2523 | DPRINT("in copy buffer\n"); | 2519 | DPRINT("in copy buffer\n"); |
2524 | printk("current_count_sectors=%ld\n", current_count_sectors); | 2520 | pr_info("current_count_sectors=%ld\n", current_count_sectors); |
2525 | printk("remaining=%d\n", remaining >> 9); | 2521 | pr_info("remaining=%d\n", remaining >> 9); |
2526 | printk("current_req->nr_sectors=%u\n", | 2522 | pr_info("current_req->nr_sectors=%u\n", |
2527 | blk_rq_sectors(current_req)); | 2523 | blk_rq_sectors(current_req)); |
2528 | printk("current_req->current_nr_sectors=%u\n", | 2524 | pr_info("current_req->current_nr_sectors=%u\n", |
2529 | blk_rq_cur_sectors(current_req)); | 2525 | blk_rq_cur_sectors(current_req)); |
2530 | printk("max_sector=%d\n", max_sector); | 2526 | pr_info("max_sector=%d\n", max_sector); |
2531 | printk("ssize=%d\n", ssize); | 2527 | pr_info("ssize=%d\n", ssize); |
2532 | } | 2528 | } |
2533 | #endif | 2529 | #endif |
2534 | 2530 | ||
@@ -2551,16 +2547,15 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2) | |||
2551 | floppy_track_buffer + (max_buffer_sectors << 10) || | 2547 | floppy_track_buffer + (max_buffer_sectors << 10) || |
2552 | dma_buffer < floppy_track_buffer) { | 2548 | dma_buffer < floppy_track_buffer) { |
2553 | DPRINT("buffer overrun in copy buffer %d\n", | 2549 | DPRINT("buffer overrun in copy buffer %d\n", |
2554 | (int)((floppy_track_buffer - | 2550 | (int)((floppy_track_buffer - dma_buffer) >> 9)); |
2555 | dma_buffer) >> 9)); | 2551 | pr_info("fsector_t=%d buffer_min=%d\n", |
2556 | printk("fsector_t=%d buffer_min=%d\n", | 2552 | fsector_t, buffer_min); |
2557 | fsector_t, buffer_min); | 2553 | pr_info("current_count_sectors=%ld\n", |
2558 | printk("current_count_sectors=%ld\n", | 2554 | current_count_sectors); |
2559 | current_count_sectors); | ||
2560 | if (CT(COMMAND) == FD_READ) | 2555 | if (CT(COMMAND) == FD_READ) |
2561 | printk("read\n"); | 2556 | pr_info("read\n"); |
2562 | if (CT(COMMAND) == FD_WRITE) | 2557 | if (CT(COMMAND) == FD_WRITE) |
2563 | printk("write\n"); | 2558 | pr_info("write\n"); |
2564 | break; | 2559 | break; |
2565 | } | 2560 | } |
2566 | if (((unsigned long)buffer) % 512) | 2561 | if (((unsigned long)buffer) % 512) |
@@ -2602,8 +2597,8 @@ static void virtualdmabug_workaround(void) | |||
2602 | end_sector = SECTOR + hard_sectors - 1; | 2597 | end_sector = SECTOR + hard_sectors - 1; |
2603 | #ifdef FLOPPY_SANITY_CHECK | 2598 | #ifdef FLOPPY_SANITY_CHECK |
2604 | if (end_sector > SECT_PER_TRACK) { | 2599 | if (end_sector > SECT_PER_TRACK) { |
2605 | printk("too many sectors %d > %d\n", | 2600 | pr_info("too many sectors %d > %d\n", |
2606 | end_sector, SECT_PER_TRACK); | 2601 | end_sector, SECT_PER_TRACK); |
2607 | return; | 2602 | return; |
2608 | } | 2603 | } |
2609 | #endif | 2604 | #endif |
@@ -2632,7 +2627,7 @@ static int make_raw_rw_request(void) | |||
2632 | int ssize; | 2627 | int ssize; |
2633 | 2628 | ||
2634 | if (max_buffer_sectors == 0) { | 2629 | if (max_buffer_sectors == 0) { |
2635 | printk("VFS: Block I/O scheduled on unopened device\n"); | 2630 | pr_info("VFS: Block I/O scheduled on unopened device\n"); |
2636 | return 0; | 2631 | return 0; |
2637 | } | 2632 | } |
2638 | 2633 | ||
@@ -2853,19 +2848,19 @@ static int make_raw_rw_request(void) | |||
2853 | DPRINT("fractionary current count b=%lx s=%lx\n", | 2848 | DPRINT("fractionary current count b=%lx s=%lx\n", |
2854 | raw_cmd->length, current_count_sectors); | 2849 | raw_cmd->length, current_count_sectors); |
2855 | if (raw_cmd->kernel_data != current_req->buffer) | 2850 | if (raw_cmd->kernel_data != current_req->buffer) |
2856 | printk("addr=%d, length=%ld\n", | 2851 | pr_info("addr=%d, length=%ld\n", |
2857 | (int)((raw_cmd->kernel_data - | 2852 | (int)((raw_cmd->kernel_data - |
2858 | floppy_track_buffer) >> 9), | 2853 | floppy_track_buffer) >> 9), |
2859 | current_count_sectors); | 2854 | current_count_sectors); |
2860 | printk("st=%d ast=%d mse=%d msi=%d\n", | 2855 | pr_info("st=%d ast=%d mse=%d msi=%d\n", |
2861 | fsector_t, aligned_sector_t, max_sector, max_size); | 2856 | fsector_t, aligned_sector_t, max_sector, max_size); |
2862 | printk("ssize=%x SIZECODE=%d\n", ssize, SIZECODE); | 2857 | pr_info("ssize=%x SIZECODE=%d\n", ssize, SIZECODE); |
2863 | printk("command=%x SECTOR=%d HEAD=%d, TRACK=%d\n", | 2858 | pr_info("command=%x SECTOR=%d HEAD=%d, TRACK=%d\n", |
2864 | COMMAND, SECTOR, HEAD, TRACK); | 2859 | COMMAND, SECTOR, HEAD, TRACK); |
2865 | printk("buffer drive=%d\n", buffer_drive); | 2860 | pr_info("buffer drive=%d\n", buffer_drive); |
2866 | printk("buffer track=%d\n", buffer_track); | 2861 | pr_info("buffer track=%d\n", buffer_track); |
2867 | printk("buffer_min=%d\n", buffer_min); | 2862 | pr_info("buffer_min=%d\n", buffer_min); |
2868 | printk("buffer_max=%d\n", buffer_max); | 2863 | pr_info("buffer_max=%d\n", buffer_max); |
2869 | return 0; | 2864 | return 0; |
2870 | } | 2865 | } |
2871 | 2866 | ||
@@ -2876,14 +2871,14 @@ static int make_raw_rw_request(void) | |||
2876 | raw_cmd->kernel_data + raw_cmd->length > | 2871 | raw_cmd->kernel_data + raw_cmd->length > |
2877 | floppy_track_buffer + (max_buffer_sectors << 10)) { | 2872 | floppy_track_buffer + (max_buffer_sectors << 10)) { |
2878 | DPRINT("buffer overrun in schedule dma\n"); | 2873 | DPRINT("buffer overrun in schedule dma\n"); |
2879 | printk("fsector_t=%d buffer_min=%d current_count=%ld\n", | 2874 | pr_info("fsector_t=%d buffer_min=%d current_count=%ld\n", |
2880 | fsector_t, buffer_min, raw_cmd->length >> 9); | 2875 | fsector_t, buffer_min, raw_cmd->length >> 9); |
2881 | printk("current_count_sectors=%ld\n", | 2876 | pr_info("current_count_sectors=%ld\n", |
2882 | current_count_sectors); | 2877 | current_count_sectors); |
2883 | if (CT(COMMAND) == FD_READ) | 2878 | if (CT(COMMAND) == FD_READ) |
2884 | printk("read\n"); | 2879 | pr_info("read\n"); |
2885 | if (CT(COMMAND) == FD_WRITE) | 2880 | if (CT(COMMAND) == FD_WRITE) |
2886 | printk("write\n"); | 2881 | pr_info("write\n"); |
2887 | return 0; | 2882 | return 0; |
2888 | } | 2883 | } |
2889 | } else if (raw_cmd->length > blk_rq_bytes(current_req) || | 2884 | } else if (raw_cmd->length > blk_rq_bytes(current_req) || |
@@ -2892,8 +2887,8 @@ static int make_raw_rw_request(void) | |||
2892 | return 0; | 2887 | return 0; |
2893 | } else if (raw_cmd->length < current_count_sectors << 9) { | 2888 | } else if (raw_cmd->length < current_count_sectors << 9) { |
2894 | DPRINT("more sectors than bytes\n"); | 2889 | DPRINT("more sectors than bytes\n"); |
2895 | printk("bytes=%ld\n", raw_cmd->length >> 9); | 2890 | pr_info("bytes=%ld\n", raw_cmd->length >> 9); |
2896 | printk("sectors=%ld\n", current_count_sectors); | 2891 | pr_info("sectors=%ld\n", current_count_sectors); |
2897 | } | 2892 | } |
2898 | if (raw_cmd->length == 0) { | 2893 | if (raw_cmd->length == 0) { |
2899 | DPRINT("zero dma transfer attempted from make_raw_request\n"); | 2894 | DPRINT("zero dma transfer attempted from make_raw_request\n"); |
@@ -2990,16 +2985,16 @@ static void process_fd_request(void) | |||
2990 | static void do_fd_request(struct request_queue * q) | 2985 | static void do_fd_request(struct request_queue * q) |
2991 | { | 2986 | { |
2992 | if (max_buffer_sectors == 0) { | 2987 | if (max_buffer_sectors == 0) { |
2993 | printk("VFS: do_fd_request called on non-open device\n"); | 2988 | pr_info("VFS: do_fd_request called on non-open device\n"); |
2994 | return; | 2989 | return; |
2995 | } | 2990 | } |
2996 | 2991 | ||
2997 | if (usage_count == 0) { | 2992 | if (usage_count == 0) { |
2998 | printk("warning: usage count=0, current_req=%p exiting\n", | 2993 | pr_info("warning: usage count=0, current_req=%p exiting\n", |
2999 | current_req); | 2994 | current_req); |
3000 | printk("sect=%ld type=%x flags=%x\n", | 2995 | pr_info("sect=%ld type=%x flags=%x\n", |
3001 | (long)blk_rq_pos(current_req), current_req->cmd_type, | 2996 | (long)blk_rq_pos(current_req), current_req->cmd_type, |
3002 | current_req->cmd_flags); | 2997 | current_req->cmd_flags); |
3003 | return; | 2998 | return; |
3004 | } | 2999 | } |
3005 | if (test_bit(0, &fdc_busy)) { | 3000 | if (test_bit(0, &fdc_busy)) { |
@@ -3047,7 +3042,7 @@ static int poll_drive(int interruptible, int flag) | |||
3047 | 3042 | ||
3048 | static void reset_intr(void) | 3043 | static void reset_intr(void) |
3049 | { | 3044 | { |
3050 | printk("weird, reset interrupt called\n"); | 3045 | pr_info("weird, reset interrupt called\n"); |
3051 | } | 3046 | } |
3052 | 3047 | ||
3053 | static struct cont_t reset_cont = { | 3048 | static struct cont_t reset_cont = { |
@@ -3426,7 +3421,7 @@ static inline int normalize_ioctl(int *cmd, int *size) | |||
3426 | *size = _IOC_SIZE(*cmd); | 3421 | *size = _IOC_SIZE(*cmd); |
3427 | *cmd = ioctl_table[i]; | 3422 | *cmd = ioctl_table[i]; |
3428 | if (*size > _IOC_SIZE(*cmd)) { | 3423 | if (*size > _IOC_SIZE(*cmd)) { |
3429 | printk("ioctl not yet supported\n"); | 3424 | pr_info("ioctl not yet supported\n"); |
3430 | return -EFAULT; | 3425 | return -EFAULT; |
3431 | } | 3426 | } |
3432 | return 0; | 3427 | return 0; |
@@ -3634,7 +3629,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
3634 | 3629 | ||
3635 | static void __init config_types(void) | 3630 | static void __init config_types(void) |
3636 | { | 3631 | { |
3637 | int first = 1; | 3632 | bool has_drive = false; |
3638 | int drive; | 3633 | int drive; |
3639 | 3634 | ||
3640 | /* read drive info out of physical CMOS */ | 3635 | /* read drive info out of physical CMOS */ |
@@ -3666,17 +3661,22 @@ static void __init config_types(void) | |||
3666 | name = temparea; | 3661 | name = temparea; |
3667 | } | 3662 | } |
3668 | if (name) { | 3663 | if (name) { |
3669 | const char *prepend = ","; | 3664 | const char *prepend; |
3670 | if (first) { | 3665 | if (!has_drive) { |
3671 | prepend = KERN_INFO "Floppy drive(s):"; | 3666 | prepend = ""; |
3672 | first = 0; | 3667 | has_drive = true; |
3668 | pr_info("Floppy drive(s):"); | ||
3669 | } else { | ||
3670 | prepend = ","; | ||
3673 | } | 3671 | } |
3674 | printk("%s fd%d is %s", prepend, drive, name); | 3672 | |
3673 | pr_cont("%s fd%d is %s", prepend, drive, name); | ||
3675 | } | 3674 | } |
3676 | *UDP = *params; | 3675 | *UDP = *params; |
3677 | } | 3676 | } |
3678 | if (!first) | 3677 | |
3679 | printk("\n"); | 3678 | if (has_drive) |
3679 | pr_cont("\n"); | ||
3680 | } | 3680 | } |
3681 | 3681 | ||
3682 | static int floppy_release(struct gendisk *disk, fmode_t mode) | 3682 | static int floppy_release(struct gendisk *disk, fmode_t mode) |
@@ -3891,7 +3891,7 @@ static int floppy_revalidate(struct gendisk *disk) | |||
3891 | if (UTESTF(FD_DISK_CHANGED) || | 3891 | if (UTESTF(FD_DISK_CHANGED) || |
3892 | UTESTF(FD_VERIFY) || test_bit(drive, &fake_change) || NO_GEOM) { | 3892 | UTESTF(FD_VERIFY) || test_bit(drive, &fake_change) || NO_GEOM) { |
3893 | if (usage_count == 0) { | 3893 | if (usage_count == 0) { |
3894 | printk("VFS: revalidate called on non-open device.\n"); | 3894 | pr_info("VFS: revalidate called on non-open device.\n"); |
3895 | return -EFAULT; | 3895 | return -EFAULT; |
3896 | } | 3896 | } |
3897 | lock_fdc(drive, 0); | 3897 | lock_fdc(drive, 0); |
@@ -3948,18 +3948,17 @@ static char __init get_fdc_version(void) | |||
3948 | if ((r = result()) <= 0x00) | 3948 | if ((r = result()) <= 0x00) |
3949 | return FDC_NONE; /* No FDC present ??? */ | 3949 | return FDC_NONE; /* No FDC present ??? */ |
3950 | if ((r == 1) && (reply_buffer[0] == 0x80)) { | 3950 | if ((r == 1) && (reply_buffer[0] == 0x80)) { |
3951 | printk(KERN_INFO "FDC %d is an 8272A\n", fdc); | 3951 | pr_info("FDC %d is an 8272A\n", fdc); |
3952 | return FDC_8272A; /* 8272a/765 don't know DUMPREGS */ | 3952 | return FDC_8272A; /* 8272a/765 don't know DUMPREGS */ |
3953 | } | 3953 | } |
3954 | if (r != 10) { | 3954 | if (r != 10) { |
3955 | printk | 3955 | pr_info("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n", |
3956 | ("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n", | 3956 | fdc, r); |
3957 | fdc, r); | ||
3958 | return FDC_UNKNOWN; | 3957 | return FDC_UNKNOWN; |
3959 | } | 3958 | } |
3960 | 3959 | ||
3961 | if (!fdc_configure()) { | 3960 | if (!fdc_configure()) { |
3962 | printk(KERN_INFO "FDC %d is an 82072\n", fdc); | 3961 | pr_info("FDC %d is an 82072\n", fdc); |
3963 | return FDC_82072; /* 82072 doesn't know CONFIGURE */ | 3962 | return FDC_82072; /* 82072 doesn't know CONFIGURE */ |
3964 | } | 3963 | } |
3965 | 3964 | ||
@@ -3967,52 +3966,50 @@ static char __init get_fdc_version(void) | |||
3967 | if (need_more_output() == MORE_OUTPUT) { | 3966 | if (need_more_output() == MORE_OUTPUT) { |
3968 | output_byte(0); | 3967 | output_byte(0); |
3969 | } else { | 3968 | } else { |
3970 | printk(KERN_INFO "FDC %d is an 82072A\n", fdc); | 3969 | pr_info("FDC %d is an 82072A\n", fdc); |
3971 | return FDC_82072A; /* 82072A as found on Sparcs. */ | 3970 | return FDC_82072A; /* 82072A as found on Sparcs. */ |
3972 | } | 3971 | } |
3973 | 3972 | ||
3974 | output_byte(FD_UNLOCK); | 3973 | output_byte(FD_UNLOCK); |
3975 | r = result(); | 3974 | r = result(); |
3976 | if ((r == 1) && (reply_buffer[0] == 0x80)) { | 3975 | if ((r == 1) && (reply_buffer[0] == 0x80)) { |
3977 | printk(KERN_INFO "FDC %d is a pre-1991 82077\n", fdc); | 3976 | pr_info("FDC %d is a pre-1991 82077\n", fdc); |
3978 | return FDC_82077_ORIG; /* Pre-1991 82077, doesn't know | 3977 | return FDC_82077_ORIG; /* Pre-1991 82077, doesn't know |
3979 | * LOCK/UNLOCK */ | 3978 | * LOCK/UNLOCK */ |
3980 | } | 3979 | } |
3981 | if ((r != 1) || (reply_buffer[0] != 0x00)) { | 3980 | if ((r != 1) || (reply_buffer[0] != 0x00)) { |
3982 | printk("FDC %d init: UNLOCK: unexpected return of %d bytes.\n", | 3981 | pr_info("FDC %d init: UNLOCK: unexpected return of %d bytes.\n", |
3983 | fdc, r); | 3982 | fdc, r); |
3984 | return FDC_UNKNOWN; | 3983 | return FDC_UNKNOWN; |
3985 | } | 3984 | } |
3986 | output_byte(FD_PARTID); | 3985 | output_byte(FD_PARTID); |
3987 | r = result(); | 3986 | r = result(); |
3988 | if (r != 1) { | 3987 | if (r != 1) { |
3989 | printk("FDC %d init: PARTID: unexpected return of %d bytes.\n", | 3988 | pr_info("FDC %d init: PARTID: unexpected return of %d bytes.\n", |
3990 | fdc, r); | 3989 | fdc, r); |
3991 | return FDC_UNKNOWN; | 3990 | return FDC_UNKNOWN; |
3992 | } | 3991 | } |
3993 | if (reply_buffer[0] == 0x80) { | 3992 | if (reply_buffer[0] == 0x80) { |
3994 | printk(KERN_INFO "FDC %d is a post-1991 82077\n", fdc); | 3993 | pr_info("FDC %d is a post-1991 82077\n", fdc); |
3995 | return FDC_82077; /* Revised 82077AA passes all the tests */ | 3994 | return FDC_82077; /* Revised 82077AA passes all the tests */ |
3996 | } | 3995 | } |
3997 | switch (reply_buffer[0] >> 5) { | 3996 | switch (reply_buffer[0] >> 5) { |
3998 | case 0x0: | 3997 | case 0x0: |
3999 | /* Either a 82078-1 or a 82078SL running at 5Volt */ | 3998 | /* Either a 82078-1 or a 82078SL running at 5Volt */ |
4000 | printk(KERN_INFO "FDC %d is an 82078.\n", fdc); | 3999 | pr_info("FDC %d is an 82078.\n", fdc); |
4001 | return FDC_82078; | 4000 | return FDC_82078; |
4002 | case 0x1: | 4001 | case 0x1: |
4003 | printk(KERN_INFO "FDC %d is a 44pin 82078\n", fdc); | 4002 | pr_info("FDC %d is a 44pin 82078\n", fdc); |
4004 | return FDC_82078; | 4003 | return FDC_82078; |
4005 | case 0x2: | 4004 | case 0x2: |
4006 | printk(KERN_INFO "FDC %d is a S82078B\n", fdc); | 4005 | pr_info("FDC %d is a S82078B\n", fdc); |
4007 | return FDC_S82078B; | 4006 | return FDC_S82078B; |
4008 | case 0x3: | 4007 | case 0x3: |
4009 | printk(KERN_INFO "FDC %d is a National Semiconductor PC87306\n", | 4008 | pr_info("FDC %d is a National Semiconductor PC87306\n", fdc); |
4010 | fdc); | ||
4011 | return FDC_87306; | 4009 | return FDC_87306; |
4012 | default: | 4010 | default: |
4013 | printk(KERN_INFO | 4011 | pr_info("FDC %d init: 82078 variant with unknown PARTID=%d.\n", |
4014 | "FDC %d init: 82078 variant with unknown PARTID=%d.\n", | 4012 | fdc, reply_buffer[0] >> 5); |
4015 | fdc, reply_buffer[0] >> 5); | ||
4016 | return FDC_82078_UNKN; | 4013 | return FDC_82078_UNKN; |
4017 | } | 4014 | } |
4018 | } /* get_fdc_version */ | 4015 | } /* get_fdc_version */ |
@@ -4140,8 +4137,8 @@ static int __init floppy_setup(char *str) | |||
4140 | 4137 | ||
4141 | DPRINT("allowed options are:"); | 4138 | DPRINT("allowed options are:"); |
4142 | for (i = 0; i < ARRAY_SIZE(config_params); i++) | 4139 | for (i = 0; i < ARRAY_SIZE(config_params); i++) |
4143 | printk(" %s", config_params[i].name); | 4140 | pr_cont(" %s", config_params[i].name); |
4144 | printk("\n"); | 4141 | pr_cont("\n"); |
4145 | } else | 4142 | } else |
4146 | DPRINT("botched floppy option\n"); | 4143 | DPRINT("botched floppy option\n"); |
4147 | DPRINT("Read Documentation/blockdev/floppy.txt\n"); | 4144 | DPRINT("Read Documentation/blockdev/floppy.txt\n"); |
@@ -4563,15 +4560,15 @@ static void floppy_release_irq_and_dma(void) | |||
4563 | #ifndef __sparc__ | 4560 | #ifndef __sparc__ |
4564 | for (drive = 0; drive < N_FDC * 4; drive++) | 4561 | for (drive = 0; drive < N_FDC * 4; drive++) |
4565 | if (timer_pending(motor_off_timer + drive)) | 4562 | if (timer_pending(motor_off_timer + drive)) |
4566 | printk("motor off timer %d still active\n", drive); | 4563 | pr_info("motor off timer %d still active\n", drive); |
4567 | #endif | 4564 | #endif |
4568 | 4565 | ||
4569 | if (timer_pending(&fd_timeout)) | 4566 | if (timer_pending(&fd_timeout)) |
4570 | printk("floppy timer still active:%s\n", timeout_message); | 4567 | pr_info("floppy timer still active:%s\n", timeout_message); |
4571 | if (timer_pending(&fd_timer)) | 4568 | if (timer_pending(&fd_timer)) |
4572 | printk("auxiliary floppy timer still active\n"); | 4569 | pr_info("auxiliary floppy timer still active\n"); |
4573 | if (work_pending(&floppy_work)) | 4570 | if (work_pending(&floppy_work)) |
4574 | printk("work still pending\n"); | 4571 | pr_info("work still pending\n"); |
4575 | #endif | 4572 | #endif |
4576 | old_fdc = fdc; | 4573 | old_fdc = fdc; |
4577 | for (fdc = 0; fdc < N_FDC; fdc++) | 4574 | for (fdc = 0; fdc < N_FDC; fdc++) |