aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-02-07 03:16:33 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:33 -0500
commit68562b79217ce04a30aaf781de1e6dfa84e73fbe (patch)
tree0bfdf7b46ee40c48b0ded04af174c1f254336d48 /drivers
parent48a67f5da1e605c0ec0534cb003ca0cd114f3d1b (diff)
Char: rocket, printk cleanup
- add KERN_ level to each print - change some levels appropriately - add \n at the ends where missing - change two complex printks into dev_info, where the original info is printed automatically Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/rocket.c89
-rw-r--r--drivers/char/rocket_int.h6
2 files changed, 51 insertions, 44 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 7a63f570e953..ffb34c43a1c2 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -305,8 +305,8 @@ static inline int rocket_paranoia_check(struct r_port *info,
305 if (!info) 305 if (!info)
306 return 1; 306 return 1;
307 if (info->magic != RPORT_MAGIC) { 307 if (info->magic != RPORT_MAGIC) {
308 printk(KERN_INFO "Warning: bad magic number for rocketport struct in %s\n", 308 printk(KERN_WARNING "Warning: bad magic number for rocketport "
309 routine); 309 "struct in %s\n", routine);
310 return 1; 310 return 1;
311 } 311 }
312#endif 312#endif
@@ -328,7 +328,7 @@ static void rp_do_receive(struct r_port *info,
328 328
329 ToRecv = sGetRxCnt(cp); 329 ToRecv = sGetRxCnt(cp);
330#ifdef ROCKET_DEBUG_INTR 330#ifdef ROCKET_DEBUG_INTR
331 printk(KERN_INFO "rp_do_receive(%d)...", ToRecv); 331 printk(KERN_INFO "rp_do_receive(%d)...\n", ToRecv);
332#endif 332#endif
333 if (ToRecv == 0) 333 if (ToRecv == 0)
334 return; 334 return;
@@ -341,7 +341,7 @@ static void rp_do_receive(struct r_port *info,
341 if (ChanStatus & (RXFOVERFL | RXBREAK | RXFRAME | RXPARITY)) { 341 if (ChanStatus & (RXFOVERFL | RXBREAK | RXFRAME | RXPARITY)) {
342 if (!(ChanStatus & STATMODE)) { 342 if (!(ChanStatus & STATMODE)) {
343#ifdef ROCKET_DEBUG_RECEIVE 343#ifdef ROCKET_DEBUG_RECEIVE
344 printk(KERN_INFO "Entering STATMODE..."); 344 printk(KERN_INFO "Entering STATMODE...\n");
345#endif 345#endif
346 ChanStatus |= STATMODE; 346 ChanStatus |= STATMODE;
347 sEnRxStatusMode(cp); 347 sEnRxStatusMode(cp);
@@ -355,15 +355,15 @@ static void rp_do_receive(struct r_port *info,
355 */ 355 */
356 if (ChanStatus & STATMODE) { 356 if (ChanStatus & STATMODE) {
357#ifdef ROCKET_DEBUG_RECEIVE 357#ifdef ROCKET_DEBUG_RECEIVE
358 printk(KERN_INFO "Ignore %x, read %x...", info->ignore_status_mask, 358 printk(KERN_INFO "Ignore %x, read %x...\n",
359 info->read_status_mask); 359 info->ignore_status_mask, info->read_status_mask);
360#endif 360#endif
361 while (ToRecv) { 361 while (ToRecv) {
362 char flag; 362 char flag;
363 363
364 CharNStat = sInW(sGetTxRxDataIO(cp)); 364 CharNStat = sInW(sGetTxRxDataIO(cp));
365#ifdef ROCKET_DEBUG_RECEIVE 365#ifdef ROCKET_DEBUG_RECEIVE
366 printk(KERN_INFO "%x...", CharNStat); 366 printk(KERN_INFO "%x...\n", CharNStat);
367#endif 367#endif
368 if (CharNStat & STMBREAKH) 368 if (CharNStat & STMBREAKH)
369 CharNStat &= ~(STMFRAMEH | STMPARITYH); 369 CharNStat &= ~(STMFRAMEH | STMPARITYH);
@@ -435,12 +435,13 @@ static void rp_do_transmit(struct r_port *info)
435 unsigned long flags; 435 unsigned long flags;
436 436
437#ifdef ROCKET_DEBUG_INTR 437#ifdef ROCKET_DEBUG_INTR
438 printk(KERN_INFO "rp_do_transmit "); 438 printk(KERN_DEBUG "%s\n", __func__);
439#endif 439#endif
440 if (!info) 440 if (!info)
441 return; 441 return;
442 if (!info->tty) { 442 if (!info->tty) {
443 printk(KERN_INFO "rp: WARNING rp_do_transmit called with info->tty==NULL\n"); 443 printk(KERN_WARNING "rp: WARNING %s called with "
444 "info->tty==NULL\n", __func__);
444 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); 445 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
445 return; 446 return;
446 } 447 }
@@ -464,7 +465,7 @@ static void rp_do_transmit(struct r_port *info)
464 info->xmit_cnt -= c; 465 info->xmit_cnt -= c;
465 info->xmit_fifo_room -= c; 466 info->xmit_fifo_room -= c;
466#ifdef ROCKET_DEBUG_INTR 467#ifdef ROCKET_DEBUG_INTR
467 printk(KERN_INFO "tx %d chars...", c); 468 printk(KERN_INFO "tx %d chars...\n", c);
468#endif 469#endif
469 } 470 }
470 471
@@ -481,7 +482,7 @@ static void rp_do_transmit(struct r_port *info)
481 spin_unlock_irqrestore(&info->slock, flags); 482 spin_unlock_irqrestore(&info->slock, flags);
482 483
483#ifdef ROCKET_DEBUG_INTR 484#ifdef ROCKET_DEBUG_INTR
484 printk(KERN_INFO "(%d,%d,%d,%d)...", info->xmit_cnt, info->xmit_head, 485 printk(KERN_DEBUG "(%d,%d,%d,%d)...\n", info->xmit_cnt, info->xmit_head,
485 info->xmit_tail, info->xmit_fifo_room); 486 info->xmit_tail, info->xmit_fifo_room);
486#endif 487#endif
487} 488}
@@ -501,11 +502,13 @@ static void rp_handle_port(struct r_port *info)
501 return; 502 return;
502 503
503 if ((info->flags & ROCKET_INITIALIZED) == 0) { 504 if ((info->flags & ROCKET_INITIALIZED) == 0) {
504 printk(KERN_INFO "rp: WARNING: rp_handle_port called with info->flags & NOT_INIT\n"); 505 printk(KERN_WARNING "rp: WARNING: rp_handle_port called with "
506 "info->flags & NOT_INIT\n");
505 return; 507 return;
506 } 508 }
507 if (!info->tty) { 509 if (!info->tty) {
508 printk(KERN_INFO "rp: WARNING: rp_handle_port called with info->tty==NULL\n"); 510 printk(KERN_WARNING "rp: WARNING: rp_handle_port called with "
511 "info->tty==NULL\n");
509 return; 512 return;
510 } 513 }
511 cp = &info->channel; 514 cp = &info->channel;
@@ -513,7 +516,7 @@ static void rp_handle_port(struct r_port *info)
513 516
514 IntMask = sGetChanIntID(cp) & info->intmask; 517 IntMask = sGetChanIntID(cp) & info->intmask;
515#ifdef ROCKET_DEBUG_INTR 518#ifdef ROCKET_DEBUG_INTR
516 printk(KERN_INFO "rp_interrupt %02x...", IntMask); 519 printk(KERN_INFO "rp_interrupt %02x...\n", IntMask);
517#endif 520#endif
518 ChanStatus = sGetChanStatus(cp); 521 ChanStatus = sGetChanStatus(cp);
519 if (IntMask & RXF_TRIG) { /* Rx FIFO trigger level */ 522 if (IntMask & RXF_TRIG) { /* Rx FIFO trigger level */
@@ -521,7 +524,7 @@ static void rp_handle_port(struct r_port *info)
521 } 524 }
522 if (IntMask & DELTA_CD) { /* CD change */ 525 if (IntMask & DELTA_CD) { /* CD change */
523#if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_INTR) || defined(ROCKET_DEBUG_HANGUP)) 526#if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_INTR) || defined(ROCKET_DEBUG_HANGUP))
524 printk(KERN_INFO "ttyR%d CD now %s...", info->line, 527 printk(KERN_INFO "ttyR%d CD now %s...\n", info->line,
525 (ChanStatus & CD_ACT) ? "on" : "off"); 528 (ChanStatus & CD_ACT) ? "on" : "off");
526#endif 529#endif
527 if (!(ChanStatus & CD_ACT) && info->cd_status) { 530 if (!(ChanStatus & CD_ACT) && info->cd_status) {
@@ -638,7 +641,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
638 /* Get a r_port struct for the port, fill it in and save it globally, indexed by line number */ 641 /* Get a r_port struct for the port, fill it in and save it globally, indexed by line number */
639 info = kzalloc(sizeof (struct r_port), GFP_KERNEL); 642 info = kzalloc(sizeof (struct r_port), GFP_KERNEL);
640 if (!info) { 643 if (!info) {
641 printk(KERN_INFO "Couldn't allocate info struct for line #%d\n", line); 644 printk(KERN_ERR "Couldn't allocate info struct for line #%d\n",
645 line);
642 return; 646 return;
643 } 647 }
644 648
@@ -668,7 +672,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
668 672
669 info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR; 673 info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR;
670 if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) { 674 if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) {
671 printk(KERN_INFO "RocketPort sInitChan(%d, %d, %d) failed!\n", board, aiop, chan); 675 printk(KERN_ERR "RocketPort sInitChan(%d, %d, %d) failed!\n",
676 board, aiop, chan);
672 kfree(info); 677 kfree(info);
673 return; 678 return;
674 } 679 }
@@ -1007,7 +1012,8 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
1007 atomic_inc(&rp_num_ports_open); 1012 atomic_inc(&rp_num_ports_open);
1008 1013
1009#ifdef ROCKET_DEBUG_OPEN 1014#ifdef ROCKET_DEBUG_OPEN
1010 printk(KERN_INFO "rocket mod++ = %d...", atomic_read(&rp_num_ports_open)); 1015 printk(KERN_INFO "rocket mod++ = %d...\n",
1016 atomic_read(&rp_num_ports_open));
1011#endif 1017#endif
1012 } 1018 }
1013#ifdef ROCKET_DEBUG_OPEN 1019#ifdef ROCKET_DEBUG_OPEN
@@ -1103,13 +1109,13 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1103 * one, we've got real problems, since it means the 1109 * one, we've got real problems, since it means the
1104 * serial port won't be shutdown. 1110 * serial port won't be shutdown.
1105 */ 1111 */
1106 printk(KERN_INFO "rp_close: bad serial port count; tty->count is 1, " 1112 printk(KERN_WARNING "rp_close: bad serial port count; "
1107 "info->count is %d\n", info->count); 1113 "tty->count is 1, info->count is %d\n", info->count);
1108 info->count = 1; 1114 info->count = 1;
1109 } 1115 }
1110 if (--info->count < 0) { 1116 if (--info->count < 0) {
1111 printk(KERN_INFO "rp_close: bad serial port count for ttyR%d: %d\n", 1117 printk(KERN_WARNING "rp_close: bad serial port count for "
1112 info->line, info->count); 1118 "ttyR%d: %d\n", info->line, info->count);
1113 info->count = 0; 1119 info->count = 0;
1114 } 1120 }
1115 if (info->count) { 1121 if (info->count) {
@@ -1184,7 +1190,8 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
1184 atomic_dec(&rp_num_ports_open); 1190 atomic_dec(&rp_num_ports_open);
1185 1191
1186#ifdef ROCKET_DEBUG_OPEN 1192#ifdef ROCKET_DEBUG_OPEN
1187 printk(KERN_INFO "rocket mod-- = %d...", atomic_read(&rp_num_ports_open)); 1193 printk(KERN_INFO "rocket mod-- = %d...\n",
1194 atomic_read(&rp_num_ports_open));
1188 printk(KERN_INFO "rp_close ttyR%d complete shutdown\n", info->line); 1195 printk(KERN_INFO "rp_close ttyR%d complete shutdown\n", info->line);
1189#endif 1196#endif
1190 1197
@@ -1569,9 +1576,9 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout)
1569 1576
1570 orig_jiffies = jiffies; 1577 orig_jiffies = jiffies;
1571#ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT 1578#ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT
1572 printk(KERN_INFO "In RP_wait_until_sent(%d) (jiff=%lu)...", timeout, 1579 printk(KERN_INFO "In RP_wait_until_sent(%d) (jiff=%lu)...\n", timeout,
1573 jiffies); 1580 jiffies);
1574 printk(KERN_INFO "cps=%d...", info->cps); 1581 printk(KERN_INFO "cps=%d...\n", info->cps);
1575#endif 1582#endif
1576 while (1) { 1583 while (1) {
1577 txcnt = sGetTxCnt(cp); 1584 txcnt = sGetTxCnt(cp);
@@ -1592,7 +1599,8 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout)
1592 if (check_time == 0) 1599 if (check_time == 0)
1593 check_time = 1; 1600 check_time = 1;
1594#ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT 1601#ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT
1595 printk(KERN_INFO "txcnt = %d (jiff=%lu,check=%d)...", txcnt, jiffies, check_time); 1602 printk(KERN_INFO "txcnt = %d (jiff=%lu,check=%d)...\n", txcnt,
1603 jiffies, check_time);
1596#endif 1604#endif
1597 msleep_interruptible(jiffies_to_msecs(check_time)); 1605 msleep_interruptible(jiffies_to_msecs(check_time));
1598 if (signal_pending(current)) 1606 if (signal_pending(current))
@@ -1616,7 +1624,7 @@ static void rp_hangup(struct tty_struct *tty)
1616 return; 1624 return;
1617 1625
1618#if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_HANGUP)) 1626#if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_HANGUP))
1619 printk(KERN_INFO "rp_hangup of ttyR%d...", info->line); 1627 printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line);
1620#endif 1628#endif
1621 rp_flush_buffer(tty); 1629 rp_flush_buffer(tty);
1622 if (info->flags & ROCKET_CLOSING) 1630 if (info->flags & ROCKET_CLOSING)
@@ -1664,7 +1672,7 @@ static void rp_put_char(struct tty_struct *tty, unsigned char ch)
1664 mutex_lock(&info->write_mtx); 1672 mutex_lock(&info->write_mtx);
1665 1673
1666#ifdef ROCKET_DEBUG_WRITE 1674#ifdef ROCKET_DEBUG_WRITE
1667 printk(KERN_INFO "rp_put_char %c...", ch); 1675 printk(KERN_INFO "rp_put_char %c...\n", ch);
1668#endif 1676#endif
1669 1677
1670 spin_lock_irqsave(&info->slock, flags); 1678 spin_lock_irqsave(&info->slock, flags);
@@ -1709,7 +1717,7 @@ static int rp_write(struct tty_struct *tty,
1709 return -ERESTARTSYS; 1717 return -ERESTARTSYS;
1710 1718
1711#ifdef ROCKET_DEBUG_WRITE 1719#ifdef ROCKET_DEBUG_WRITE
1712 printk(KERN_INFO "rp_write %d chars...", count); 1720 printk(KERN_INFO "rp_write %d chars...\n", count);
1713#endif 1721#endif
1714 cp = &info->channel; 1722 cp = &info->channel;
1715 1723
@@ -1798,7 +1806,7 @@ static int rp_write_room(struct tty_struct *tty)
1798 if (ret < 0) 1806 if (ret < 0)
1799 ret = 0; 1807 ret = 0;
1800#ifdef ROCKET_DEBUG_WRITE 1808#ifdef ROCKET_DEBUG_WRITE
1801 printk(KERN_INFO "rp_write_room returns %d...", ret); 1809 printk(KERN_INFO "rp_write_room returns %d...\n", ret);
1802#endif 1810#endif
1803 return ret; 1811 return ret;
1804} 1812}
@@ -1818,7 +1826,7 @@ static int rp_chars_in_buffer(struct tty_struct *tty)
1818 cp = &info->channel; 1826 cp = &info->channel;
1819 1827
1820#ifdef ROCKET_DEBUG_WRITE 1828#ifdef ROCKET_DEBUG_WRITE
1821 printk(KERN_INFO "rp_chars_in_buffer returns %d...", info->xmit_cnt); 1829 printk(KERN_INFO "rp_chars_in_buffer returns %d...\n", info->xmit_cnt);
1822#endif 1830#endif
1823 return info->xmit_cnt; 1831 return info->xmit_cnt;
1824} 1832}
@@ -2161,14 +2169,11 @@ static __init int register_PCI(int i, struct pci_dev *dev)
2161 for (aiop = 0; aiop < max_num_aiops; aiop++) 2169 for (aiop = 0; aiop < max_num_aiops; aiop++)
2162 ctlp->AiopNumChan[aiop] = ports_per_aiop; 2170 ctlp->AiopNumChan[aiop] = ports_per_aiop;
2163 2171
2164 printk("Comtrol PCI controller #%d ID 0x%x found in bus:slot:fn %s at address %04lx, " 2172 dev_info(&dev->dev, "comtrol PCI controller #%d found at "
2165 "%d AIOP(s) (%s)\n", i, dev->device, pci_name(dev), 2173 "address %04lx, %d AIOP(s) (%s), creating ttyR%d - %ld\n",
2166 rcktpt_io_addr[i], num_aiops, rocketModel[i].modelString); 2174 i, rcktpt_io_addr[i], num_aiops, rocketModel[i].modelString,
2167 printk(KERN_INFO "Installing %s, creating /dev/ttyR%d - %ld\n", 2175 rocketModel[i].startingPortNumber,
2168 rocketModel[i].modelString, 2176 rocketModel[i].startingPortNumber + rocketModel[i].numPorts-1);
2169 rocketModel[i].startingPortNumber,
2170 rocketModel[i].startingPortNumber +
2171 rocketModel[i].numPorts - 1);
2172 2177
2173 if (num_aiops <= 0) { 2178 if (num_aiops <= 0) {
2174 rcktpt_io_addr[i] = 0; 2179 rcktpt_io_addr[i] = 0;
@@ -2240,7 +2245,9 @@ static int __init init_ISA(int i)
2240 2245
2241 /* Reserve the IO region */ 2246 /* Reserve the IO region */
2242 if (!request_region(rcktpt_io_addr[i], 64, "Comtrol RocketPort")) { 2247 if (!request_region(rcktpt_io_addr[i], 64, "Comtrol RocketPort")) {
2243 printk(KERN_INFO "Unable to reserve IO region for configured ISA RocketPort at address 0x%lx, board not installed...\n", rcktpt_io_addr[i]); 2248 printk(KERN_ERR "Unable to reserve IO region for configured "
2249 "ISA RocketPort at address 0x%lx, board not "
2250 "installed...\n", rcktpt_io_addr[i]);
2244 rcktpt_io_addr[i] = 0; 2251 rcktpt_io_addr[i] = 0;
2245 return (0); 2252 return (0);
2246 } 2253 }
@@ -2480,7 +2487,7 @@ static void rp_cleanup_module(void)
2480 2487
2481 retval = tty_unregister_driver(rocket_driver); 2488 retval = tty_unregister_driver(rocket_driver);
2482 if (retval) 2489 if (retval)
2483 printk(KERN_INFO "Error %d while trying to unregister " 2490 printk(KERN_ERR "Error %d while trying to unregister "
2484 "rocketport driver\n", -retval); 2491 "rocketport driver\n", -retval);
2485 2492
2486 for (i = 0; i < MAX_RP_PORTS; i++) 2493 for (i = 0; i < MAX_RP_PORTS; i++)
diff --git a/drivers/char/rocket_int.h b/drivers/char/rocket_int.h
index 55b8f2d71a96..c3aab522a456 100644
--- a/drivers/char/rocket_int.h
+++ b/drivers/char/rocket_int.h
@@ -42,7 +42,7 @@ typedef unsigned int DWordIO_t;
42static inline void sOutB(unsigned short port, unsigned char value) 42static inline void sOutB(unsigned short port, unsigned char value)
43{ 43{
44#ifdef ROCKET_DEBUG_IO 44#ifdef ROCKET_DEBUG_IO
45 printk("sOutB(%x, %x)...", port, value); 45 printk(KERN_DEBUG "sOutB(%x, %x)...\n", port, value);
46#endif 46#endif
47 outb_p(value, port); 47 outb_p(value, port);
48} 48}
@@ -50,7 +50,7 @@ static inline void sOutB(unsigned short port, unsigned char value)
50static inline void sOutW(unsigned short port, unsigned short value) 50static inline void sOutW(unsigned short port, unsigned short value)
51{ 51{
52#ifdef ROCKET_DEBUG_IO 52#ifdef ROCKET_DEBUG_IO
53 printk("sOutW(%x, %x)...", port, value); 53 printk(KERN_DEBUG "sOutW(%x, %x)...\n", port, value);
54#endif 54#endif
55 outw_p(value, port); 55 outw_p(value, port);
56} 56}
@@ -58,7 +58,7 @@ static inline void sOutW(unsigned short port, unsigned short value)
58static inline void sOutDW(unsigned short port, unsigned long value) 58static inline void sOutDW(unsigned short port, unsigned long value)
59{ 59{
60#ifdef ROCKET_DEBUG_IO 60#ifdef ROCKET_DEBUG_IO
61 printk("sOutDW(%x, %lx)...", port, value); 61 printk(KERN_DEBUG "sOutDW(%x, %lx)...\n", port, value);
62#endif 62#endif
63 outl_p(cpu_to_le32(value), port); 63 outl_p(cpu_to_le32(value), port);
64} 64}