aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-05-08 03:36:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:24 -0400
commit217191910c0286e0b3c7e3011630273695253da3 (patch)
treeb084e37790f848262842bbeef8027b6ba609a5ea
parent80fada50ec10172ef655882701f1c8abadd87d57 (diff)
Char: cyclades, printk cleanups
- add printk KERN_ levels to each printk - substitute printk with dev_* when device struct is available Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/cyclades.c530
1 files changed, 220 insertions, 310 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index c12dbb1f5682..7a1530012227 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -860,21 +860,21 @@ static inline int serial_paranoia_check(struct cyclades_port *info,
860{ 860{
861#ifdef SERIAL_PARANOIA_CHECK 861#ifdef SERIAL_PARANOIA_CHECK
862 if (!info) { 862 if (!info) {
863 printk("cyc Warning: null cyclades_port for (%s) in %s\n", 863 printk(KERN_WARNING "cyc Warning: null cyclades_port for (%s) "
864 name, routine); 864 "in %s\n", name, routine);
865 return 1; 865 return 1;
866 } 866 }
867 867
868 if ((long)info < (long)(&cy_port[0]) || 868 if ((long)info < (long)(&cy_port[0]) ||
869 (long)(&cy_port[NR_PORTS]) < (long)info) { 869 (long)(&cy_port[NR_PORTS]) < (long)info) {
870 printk("cyc Warning: cyclades_port out of range for (%s) in " 870 printk(KERN_WARNING "cyc Warning: cyclades_port out of range "
871 "%s\n", name, routine); 871 "for (%s) in %s\n", name, routine);
872 return 1; 872 return 1;
873 } 873 }
874 874
875 if (info->magic != CYCLADES_MAGIC) { 875 if (info->magic != CYCLADES_MAGIC) {
876 printk("cyc Warning: bad magic number for serial struct (%s) " 876 printk(KERN_WARNING "cyc Warning: bad magic number for serial "
877 "in %s\n", name, routine); 877 "struct (%s) in %s\n", name, routine);
878 return 1; 878 return 1;
879 } 879 }
880#endif 880#endif
@@ -1047,7 +1047,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
1047 1047
1048 if (status & CySRReceive) { /* reception interrupt */ 1048 if (status & CySRReceive) { /* reception interrupt */
1049#ifdef CY_DEBUG_INTERRUPTS 1049#ifdef CY_DEBUG_INTERRUPTS
1050 printk("cyy_interrupt: rcvd intr, chip %d\n\r", chip); 1050 printk(KERN_DEBUG "cyy_interrupt: rcvd intr, chip %d\n", chip);
1051#endif 1051#endif
1052 /* determine the channel & change to that context */ 1052 /* determine the channel & change to that context */
1053 spin_lock(&cinfo->card_lock); 1053 spin_lock(&cinfo->card_lock);
@@ -1212,7 +1212,7 @@ static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
1212 is empty, we know we can always stuff a dozen 1212 is empty, we know we can always stuff a dozen
1213 characters. */ 1213 characters. */
1214#ifdef CY_DEBUG_INTERRUPTS 1214#ifdef CY_DEBUG_INTERRUPTS
1215 printk("cyy_interrupt: xmit intr, chip %d\n\r", chip); 1215 printk(KERN_DEBUG "cyy_interrupt: xmit intr, chip %d\n", chip);
1216#endif 1216#endif
1217 1217
1218 /* determine the channel & change to that context */ 1218 /* determine the channel & change to that context */
@@ -1436,7 +1436,7 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
1436 1436
1437 if ((cinfo = (struct cyclades_card *)dev_id) == 0) { 1437 if ((cinfo = (struct cyclades_card *)dev_id) == 0) {
1438#ifdef CY_DEBUG_INTERRUPTS 1438#ifdef CY_DEBUG_INTERRUPTS
1439 printk("cyy_interrupt: spurious interrupt %d\n\r", irq); 1439 printk(KERN_DEBUG "cyy_interrupt: spurious interrupt %d\n",irq);
1440#endif 1440#endif
1441 return IRQ_NONE; /* spurious interrupt */ 1441 return IRQ_NONE; /* spurious interrupt */
1442 } 1442 }
@@ -1820,8 +1820,8 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
1820 case C_CM_INTBACK2: 1820 case C_CM_INTBACK2:
1821 /* Reception Interrupt */ 1821 /* Reception Interrupt */
1822#ifdef CY_DEBUG_INTERRUPTS 1822#ifdef CY_DEBUG_INTERRUPTS
1823 printk("cyz_interrupt: rcvd intr, card %d, " 1823 printk(KERN_DEBUG "cyz_interrupt: rcvd intr, card %d, "
1824 "port %ld\n\r", info->card, channel); 1824 "port %ld\n", info->card, channel);
1825#endif 1825#endif
1826 cyz_handle_rx(info, ch_ctrl, buf_ctrl); 1826 cyz_handle_rx(info, ch_ctrl, buf_ctrl);
1827 break; 1827 break;
@@ -1830,8 +1830,8 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
1830 case C_CM_INTBACK: 1830 case C_CM_INTBACK:
1831 /* Transmission Interrupt */ 1831 /* Transmission Interrupt */
1832#ifdef CY_DEBUG_INTERRUPTS 1832#ifdef CY_DEBUG_INTERRUPTS
1833 printk("cyz_interrupt: xmit intr, card %d, " 1833 printk(KERN_DEBUG "cyz_interrupt: xmit intr, card %d, "
1834 "port %ld\n\r", info->card, channel); 1834 "port %ld\n", info->card, channel);
1835#endif 1835#endif
1836 cyz_handle_tx(info, ch_ctrl, buf_ctrl); 1836 cyz_handle_tx(info, ch_ctrl, buf_ctrl);
1837 break; 1837 break;
@@ -1856,14 +1856,15 @@ static irqreturn_t cyz_interrupt(int irq, void *dev_id)
1856 1856
1857 if ((cinfo = (struct cyclades_card *)dev_id) == 0) { 1857 if ((cinfo = (struct cyclades_card *)dev_id) == 0) {
1858#ifdef CY_DEBUG_INTERRUPTS 1858#ifdef CY_DEBUG_INTERRUPTS
1859 printk("cyz_interrupt: spurious interrupt %d\n\r", irq); 1859 printk(KERN_DEBUG "cyz_interrupt: spurious interrupt %d\n",irq);
1860#endif 1860#endif
1861 return IRQ_NONE; /* spurious interrupt */ 1861 return IRQ_NONE; /* spurious interrupt */
1862 } 1862 }
1863 1863
1864 if (!ISZLOADED(*cinfo)) { 1864 if (!ISZLOADED(*cinfo)) {
1865#ifdef CY_DEBUG_INTERRUPTS 1865#ifdef CY_DEBUG_INTERRUPTS
1866 printk("cyz_interrupt: board not yet loaded (IRQ%d).\n\r", irq); 1866 printk(KERN_DEBUG "cyz_interrupt: board not yet loaded "
1867 "(IRQ%d).\n", irq);
1867#endif 1868#endif
1868 return IRQ_NONE; 1869 return IRQ_NONE;
1869 } 1870 }
@@ -1885,7 +1886,7 @@ static void cyz_rx_restart(unsigned long arg)
1885 CY_LOCK(info, flags); 1886 CY_LOCK(info, flags);
1886 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_INTBACK2, 0L); 1887 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_INTBACK2, 0L);
1887 if (retval != 0) { 1888 if (retval != 0) {
1888 printk("cyc:cyz_rx_restart retval on ttyC%d was %x\n", 1889 printk(KERN_ERR "cyc:cyz_rx_restart retval on ttyC%d was %x\n",
1889 info->line, retval); 1890 info->line, retval);
1890 } 1891 }
1891 cyz_rx_full_timer[info->line].function = NULL; 1892 cyz_rx_full_timer[info->line].function = NULL;
@@ -2000,10 +2001,9 @@ static int startup(struct cyclades_port *info)
2000 (cy_chip_offset[chip] << index); 2001 (cy_chip_offset[chip] << index);
2001 2002
2002#ifdef CY_DEBUG_OPEN 2003#ifdef CY_DEBUG_OPEN
2003 printk("cyc startup card %d, chip %d, channel %d, " 2004 printk(KERN_DEBUG "cyc startup card %d, chip %d, channel %d, "
2004 "base_addr %lx\n", 2005 "base_addr %p\n",
2005 card, chip, channel, (long)base_addr); 2006 card, chip, channel, base_addr);
2006 /**/
2007#endif 2007#endif
2008 CY_LOCK(info, flags); 2008 CY_LOCK(info, flags);
2009 2009
@@ -2021,8 +2021,8 @@ static int startup(struct cyclades_port *info)
2021 cy_writeb(base_addr + (CyMSVR2 << index), CyDTR); 2021 cy_writeb(base_addr + (CyMSVR2 << index), CyDTR);
2022 2022
2023#ifdef CY_DEBUG_DTR 2023#ifdef CY_DEBUG_DTR
2024 printk("cyc:startup raising DTR\n"); 2024 printk(KERN_DEBUG "cyc:startup raising DTR\n");
2025 printk(" status: 0x%x, 0x%x\n", 2025 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
2026 readb(base_addr + (CyMSVR1 << index)), 2026 readb(base_addr + (CyMSVR1 << index)),
2027 readb(base_addr + (CyMSVR2 << index))); 2027 readb(base_addr + (CyMSVR2 << index)));
2028#endif 2028#endif
@@ -2063,9 +2063,8 @@ static int startup(struct cyclades_port *info)
2063 ch_ctrl = zfw_ctrl->ch_ctrl; 2063 ch_ctrl = zfw_ctrl->ch_ctrl;
2064 2064
2065#ifdef CY_DEBUG_OPEN 2065#ifdef CY_DEBUG_OPEN
2066 printk("cyc startup Z card %d, channel %d, base_addr %lx\n", 2066 printk(KERN_DEBUG "cyc startup Z card %d, channel %d, "
2067 card, channel, (long)base_addr); 2067 "base_addr %p\n", card, channel, base_addr);
2068 /**/
2069#endif 2068#endif
2070 CY_LOCK(info, flags); 2069 CY_LOCK(info, flags);
2071 2070
@@ -2091,16 +2090,16 @@ static int startup(struct cyclades_port *info)
2091 2090
2092 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_IOCTL, 0L); 2091 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_IOCTL, 0L);
2093 if (retval != 0) { 2092 if (retval != 0) {
2094 printk("cyc:startup(1) retval on ttyC%d was %x\n", 2093 printk(KERN_ERR "cyc:startup(1) retval on ttyC%d was "
2095 info->line, retval); 2094 "%x\n", info->line, retval);
2096 } 2095 }
2097 2096
2098 /* Flush RX buffers before raising DTR and RTS */ 2097 /* Flush RX buffers before raising DTR and RTS */
2099 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_FLUSH_RX, 2098 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_FLUSH_RX,
2100 0L); 2099 0L);
2101 if (retval != 0) { 2100 if (retval != 0) {
2102 printk("cyc:startup(2) retval on ttyC%d was %x\n", 2101 printk(KERN_ERR "cyc:startup(2) retval on ttyC%d was "
2103 info->line, retval); 2102 "%x\n", info->line, retval);
2104 } 2103 }
2105 2104
2106 /* set timeout !!! */ 2105 /* set timeout !!! */
@@ -2111,11 +2110,11 @@ static int startup(struct cyclades_port *info)
2111 retval = cyz_issue_cmd(&cy_card[info->card], channel, 2110 retval = cyz_issue_cmd(&cy_card[info->card], channel,
2112 C_CM_IOCTLM, 0L); 2111 C_CM_IOCTLM, 0L);
2113 if (retval != 0) { 2112 if (retval != 0) {
2114 printk("cyc:startup(3) retval on ttyC%d was %x\n", 2113 printk(KERN_ERR "cyc:startup(3) retval on ttyC%d was "
2115 info->line, retval); 2114 "%x\n", info->line, retval);
2116 } 2115 }
2117#ifdef CY_DEBUG_DTR 2116#ifdef CY_DEBUG_DTR
2118 printk("cyc:startup raising Z DTR\n"); 2117 printk(KERN_DEBUG "cyc:startup raising Z DTR\n");
2119#endif 2118#endif
2120 2119
2121 /* enable send, recv, modem !!! */ 2120 /* enable send, recv, modem !!! */
@@ -2135,7 +2134,7 @@ static int startup(struct cyclades_port *info)
2135 } 2134 }
2136 2135
2137#ifdef CY_DEBUG_OPEN 2136#ifdef CY_DEBUG_OPEN
2138 printk(" cyc startup done\n"); 2137 printk(KERN_DEBUG "cyc startup done\n");
2139#endif 2138#endif
2140 return 0; 2139 return 0;
2141 2140
@@ -2172,8 +2171,8 @@ static void start_xmit(struct cyclades_port *info)
2172 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_INTBACK, 2171 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_INTBACK,
2173 0L); 2172 0L);
2174 if (retval != 0) { 2173 if (retval != 0) {
2175 printk("cyc:start_xmit retval on ttyC%d was %x\n", 2174 printk(KERN_ERR "cyc:start_xmit retval on ttyC%d was "
2176 info->line, retval); 2175 "%x\n", info->line, retval);
2177 } 2176 }
2178 CY_UNLOCK(info, flags); 2177 CY_UNLOCK(info, flags);
2179#else /* CONFIG_CYZ_INTR */ 2178#else /* CONFIG_CYZ_INTR */
@@ -2206,9 +2205,9 @@ static void shutdown(struct cyclades_port *info)
2206 (cy_chip_offset[chip] << index); 2205 (cy_chip_offset[chip] << index);
2207 2206
2208#ifdef CY_DEBUG_OPEN 2207#ifdef CY_DEBUG_OPEN
2209 printk("cyc shutdown Y card %d, chip %d, channel %d, " 2208 printk(KERN_DEBUG "cyc shutdown Y card %d, chip %d, "
2210 "base_addr %lx\n", 2209 "channel %d, base_addr %p\n",
2211 card, chip, channel, (long)base_addr); 2210 card, chip, channel, base_addr);
2212#endif 2211#endif
2213 2212
2214 CY_LOCK(info, flags); 2213 CY_LOCK(info, flags);
@@ -2227,8 +2226,8 @@ static void shutdown(struct cyclades_port *info)
2227 cy_writeb(base_addr + (CyMSVR1 << index), ~CyRTS); 2226 cy_writeb(base_addr + (CyMSVR1 << index), ~CyRTS);
2228 cy_writeb(base_addr + (CyMSVR2 << index), ~CyDTR); 2227 cy_writeb(base_addr + (CyMSVR2 << index), ~CyDTR);
2229#ifdef CY_DEBUG_DTR 2228#ifdef CY_DEBUG_DTR
2230 printk("cyc shutdown dropping DTR\n"); 2229 printk(KERN_DEBUG "cyc shutdown dropping DTR\n");
2231 printk(" status: 0x%x, 0x%x\n", 2230 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
2232 readb(base_addr + (CyMSVR1 << index)), 2231 readb(base_addr + (CyMSVR1 << index)),
2233 readb(base_addr + (CyMSVR2 << index))); 2232 readb(base_addr + (CyMSVR2 << index)));
2234#endif 2233#endif
@@ -2251,8 +2250,8 @@ static void shutdown(struct cyclades_port *info)
2251 2250
2252 base_addr = cy_card[card].base_addr; 2251 base_addr = cy_card[card].base_addr;
2253#ifdef CY_DEBUG_OPEN 2252#ifdef CY_DEBUG_OPEN
2254 printk("cyc shutdown Z card %d, channel %d, base_addr %lx\n", 2253 printk(KERN_DEBUG "cyc shutdown Z card %d, channel %d, "
2255 card, channel, (long)base_addr); 2254 "base_addr %p\n", card, channel, base_addr);
2256#endif 2255#endif
2257 2256
2258 firm_id = base_addr + ID_ADDRESS; 2257 firm_id = base_addr + ID_ADDRESS;
@@ -2281,11 +2280,11 @@ static void shutdown(struct cyclades_port *info)
2281 retval = cyz_issue_cmd(&cy_card[info->card], channel, 2280 retval = cyz_issue_cmd(&cy_card[info->card], channel,
2282 C_CM_IOCTLM, 0L); 2281 C_CM_IOCTLM, 0L);
2283 if (retval != 0) { 2282 if (retval != 0) {
2284 printk("cyc:shutdown retval on ttyC%d was %x\n", 2283 printk(KERN_ERR"cyc:shutdown retval on ttyC%d "
2285 info->line, retval); 2284 "was %x\n", info->line, retval);
2286 } 2285 }
2287#ifdef CY_DEBUG_DTR 2286#ifdef CY_DEBUG_DTR
2288 printk("cyc:shutdown dropping Z DTR\n"); 2287 printk(KERN_DEBUG "cyc:shutdown dropping Z DTR\n");
2289#endif 2288#endif
2290 } 2289 }
2291 2290
@@ -2298,7 +2297,7 @@ static void shutdown(struct cyclades_port *info)
2298 } 2297 }
2299 2298
2300#ifdef CY_DEBUG_OPEN 2299#ifdef CY_DEBUG_OPEN
2301 printk(" cyc shutdown done\n"); 2300 printk(KERN_DEBUG "cyc shutdown done\n");
2302#endif 2301#endif
2303} /* shutdown */ 2302} /* shutdown */
2304 2303
@@ -2352,17 +2351,16 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
2352 retval = 0; 2351 retval = 0;
2353 add_wait_queue(&info->open_wait, &wait); 2352 add_wait_queue(&info->open_wait, &wait);
2354#ifdef CY_DEBUG_OPEN 2353#ifdef CY_DEBUG_OPEN
2355 printk("cyc block_til_ready before block: ttyC%d, count = %d\n", 2354 printk(KERN_DEBUG "cyc block_til_ready before block: ttyC%d, "
2356 info->line, info->count); 2355 "count = %d\n", info->line, info->count);
2357 /**/
2358#endif 2356#endif
2359 CY_LOCK(info, flags); 2357 CY_LOCK(info, flags);
2360 if (!tty_hung_up_p(filp)) 2358 if (!tty_hung_up_p(filp))
2361 info->count--; 2359 info->count--;
2362 CY_UNLOCK(info, flags); 2360 CY_UNLOCK(info, flags);
2363#ifdef CY_DEBUG_COUNT 2361#ifdef CY_DEBUG_COUNT
2364 printk("cyc block_til_ready: (%d): decrementing count to %d\n", 2362 printk(KERN_DEBUG "cyc block_til_ready: (%d): decrementing count to "
2365 current->pid, info->count); 2363 "%d\n", current->pid, info->count);
2366#endif 2364#endif
2367 info->blocked_open++; 2365 info->blocked_open++;
2368 2366
@@ -2382,8 +2380,9 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
2382 cy_writeb(base_addr + (CyMSVR2 << index), 2380 cy_writeb(base_addr + (CyMSVR2 << index),
2383 CyDTR); 2381 CyDTR);
2384#ifdef CY_DEBUG_DTR 2382#ifdef CY_DEBUG_DTR
2385 printk("cyc:block_til_ready raising DTR\n"); 2383 printk(KERN_DEBUG "cyc:block_til_ready raising "
2386 printk(" status: 0x%x, 0x%x\n", 2384 "DTR\n");
2385 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
2387 readb(base_addr + (CyMSVR1 << index)), 2386 readb(base_addr + (CyMSVR1 << index)),
2388 readb(base_addr + (CyMSVR2 << index))); 2387 readb(base_addr + (CyMSVR2 << index)));
2389#endif 2388#endif
@@ -2414,10 +2413,9 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
2414 break; 2413 break;
2415 } 2414 }
2416#ifdef CY_DEBUG_OPEN 2415#ifdef CY_DEBUG_OPEN
2417 printk("cyc block_til_ready blocking: ttyC%d, " 2416 printk(KERN_DEBUG "cyc block_til_ready blocking: "
2418 "count = %d\n", 2417 "ttyC%d, count = %d\n",
2419 info->line, info->count); 2418 info->line, info->count);
2420 /**/
2421#endif 2419#endif
2422 schedule(); 2420 schedule();
2423 } 2421 }
@@ -2448,12 +2446,13 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
2448 retval = cyz_issue_cmd(&cy_card[info->card], 2446 retval = cyz_issue_cmd(&cy_card[info->card],
2449 channel, C_CM_IOCTLM, 0L); 2447 channel, C_CM_IOCTLM, 0L);
2450 if (retval != 0) { 2448 if (retval != 0) {
2451 printk("cyc:block_til_ready retval on " 2449 printk(KERN_ERR "cyc:block_til_ready "
2452 "ttyC%d was %x\n", 2450 "retval on ttyC%d was %x\n",
2453 info->line, retval); 2451 info->line, retval);
2454 } 2452 }
2455#ifdef CY_DEBUG_DTR 2453#ifdef CY_DEBUG_DTR
2456 printk("cyc:block_til_ready raising Z DTR\n"); 2454 printk(KERN_DEBUG "cyc:block_til_ready raising "
2455 "Z DTR\n");
2457#endif 2456#endif
2458 } 2457 }
2459 2458
@@ -2474,10 +2473,9 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
2474 break; 2473 break;
2475 } 2474 }
2476#ifdef CY_DEBUG_OPEN 2475#ifdef CY_DEBUG_OPEN
2477 printk("cyc block_til_ready blocking: ttyC%d, " 2476 printk(KERN_DEBUG "cyc block_til_ready blocking: "
2478 "count = %d\n", 2477 "ttyC%d, count = %d\n",
2479 info->line, info->count); 2478 info->line, info->count);
2480 /**/
2481#endif 2479#endif
2482 schedule(); 2480 schedule();
2483 } 2481 }
@@ -2487,15 +2485,14 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
2487 if (!tty_hung_up_p(filp)) { 2485 if (!tty_hung_up_p(filp)) {
2488 info->count++; 2486 info->count++;
2489#ifdef CY_DEBUG_COUNT 2487#ifdef CY_DEBUG_COUNT
2490 printk("cyc:block_til_ready (%d): incrementing count to %d\n", 2488 printk(KERN_DEBUG "cyc:block_til_ready (%d): incrementing "
2491 current->pid, info->count); 2489 "count to %d\n", current->pid, info->count);
2492#endif 2490#endif
2493 } 2491 }
2494 info->blocked_open--; 2492 info->blocked_open--;
2495#ifdef CY_DEBUG_OPEN 2493#ifdef CY_DEBUG_OPEN
2496 printk("cyc:block_til_ready after blocking: ttyC%d, count = %d\n", 2494 printk(KERN_DEBUG "cyc:block_til_ready after blocking: ttyC%d, "
2497 info->line, info->count); 2495 "count = %d\n", info->line, info->count);
2498 /**/
2499#endif 2496#endif
2500 if (retval) 2497 if (retval)
2501 return retval; 2498 return retval;
@@ -2535,12 +2532,13 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
2535 Z_FPGA_CHECK(*cinfo)) && 2532 Z_FPGA_CHECK(*cinfo)) &&
2536 (ZFIRM_HLT == readl( 2533 (ZFIRM_HLT == readl(
2537 &firm_id->signature))) { 2534 &firm_id->signature))) {
2538 printk("cyc:Cyclades-Z Error: you need an " 2535 printk(KERN_ERR "cyc:Cyclades-Z Error: you "
2539 "external power supply for this number " 2536 "need an external power supply for "
2540 "of ports.\n\rFirmware halted.\r\n"); 2537 "this number of ports.\nFirmware "
2538 "halted.\n");
2541 } else { 2539 } else {
2542 printk("cyc:Cyclades-Z firmware not yet " 2540 printk(KERN_ERR "cyc:Cyclades-Z firmware not "
2543 "loaded\n"); 2541 "yet loaded\n");
2544 } 2542 }
2545 return -ENODEV; 2543 return -ENODEV;
2546 } 2544 }
@@ -2566,8 +2564,8 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
2566 retval = cyz_issue_cmd(cinfo, 0, 2564 retval = cyz_issue_cmd(cinfo, 0,
2567 C_CM_IRQ_ENBL, 0L); 2565 C_CM_IRQ_ENBL, 0L);
2568 if (retval != 0) { 2566 if (retval != 0) {
2569 printk("cyc:IRQ enable retval was %x\n", 2567 printk(KERN_ERR "cyc:IRQ enable retval "
2570 retval); 2568 "was %x\n", retval);
2571 } 2569 }
2572 cinfo->nports = 2570 cinfo->nports =
2573 (int)readl(&board_ctrl->n_channel); 2571 (int)readl(&board_ctrl->n_channel);
@@ -2580,7 +2578,7 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
2580 return -ENODEV; 2578 return -ENODEV;
2581 } 2579 }
2582#ifdef CY_DEBUG_OTHER 2580#ifdef CY_DEBUG_OTHER
2583 printk("cyc:cy_open ttyC%d\n", info->line); /* */ 2581 printk(KERN_DEBUG "cyc:cy_open ttyC%d\n", info->line);
2584#endif 2582#endif
2585 tty->driver_data = info; 2583 tty->driver_data = info;
2586 info->tty = tty; 2584 info->tty = tty;
@@ -2588,12 +2586,12 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
2588 return -ENODEV; 2586 return -ENODEV;
2589 } 2587 }
2590#ifdef CY_DEBUG_OPEN 2588#ifdef CY_DEBUG_OPEN
2591 printk("cyc:cy_open ttyC%d, count = %d\n", info->line, info->count); 2589 printk(KERN_DEBUG "cyc:cy_open ttyC%d, count = %d\n", info->line,
2592 /**/ 2590 info->count);
2593#endif 2591#endif
2594 info->count++; 2592 info->count++;
2595#ifdef CY_DEBUG_COUNT 2593#ifdef CY_DEBUG_COUNT
2596 printk("cyc:cy_open (%d): incrementing count to %d\n", 2594 printk(KERN_DEBUG "cyc:cy_open (%d): incrementing count to %d\n",
2597 current->pid, info->count); 2595 current->pid, info->count);
2598#endif 2596#endif
2599 2597
@@ -2617,8 +2615,8 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
2617 retval = block_til_ready(tty, filp, info); 2615 retval = block_til_ready(tty, filp, info);
2618 if (retval) { 2616 if (retval) {
2619#ifdef CY_DEBUG_OPEN 2617#ifdef CY_DEBUG_OPEN
2620 printk("cyc:cy_open returning after block_til_ready with %d\n", 2618 printk(KERN_DEBUG "cyc:cy_open returning after block_til_ready "
2621 retval); 2619 "with %d\n", retval);
2622#endif 2620#endif
2623 return retval; 2621 return retval;
2624 } 2622 }
@@ -2626,8 +2624,7 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
2626 info->throttle = 0; 2624 info->throttle = 0;
2627 2625
2628#ifdef CY_DEBUG_OPEN 2626#ifdef CY_DEBUG_OPEN
2629 printk(" cyc:cy_open done\n"); 2627 printk(KERN_DEBUG "cyc:cy_open done\n");
2630 /**/
2631#endif 2628#endif
2632 return 0; 2629 return 0;
2633} /* cy_open */ 2630} /* cy_open */
@@ -2678,8 +2675,8 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
2678 if (!timeout || timeout > 2 * info->timeout) 2675 if (!timeout || timeout > 2 * info->timeout)
2679 timeout = 2 * info->timeout; 2676 timeout = 2 * info->timeout;
2680#ifdef CY_DEBUG_WAIT_UNTIL_SENT 2677#ifdef CY_DEBUG_WAIT_UNTIL_SENT
2681 printk("In cy_wait_until_sent(%d) check=%lu...", timeout, char_time); 2678 printk(KERN_DEBUG "In cy_wait_until_sent(%d) check=%d, jiff=%lu...",
2682 printk("jiff=%lu...", jiffies); 2679 timeout, char_time, jiffies);
2683#endif 2680#endif
2684 card = info->card; 2681 card = info->card;
2685 channel = (info->line) - (cy_card[card].first_line); 2682 channel = (info->line) - (cy_card[card].first_line);
@@ -2691,7 +2688,7 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
2691 cy_card[card].base_addr + (cy_chip_offset[chip] << index); 2688 cy_card[card].base_addr + (cy_chip_offset[chip] << index);
2692 while (readb(base_addr + (CySRER << index)) & CyTxRdy) { 2689 while (readb(base_addr + (CySRER << index)) & CyTxRdy) {
2693#ifdef CY_DEBUG_WAIT_UNTIL_SENT 2690#ifdef CY_DEBUG_WAIT_UNTIL_SENT
2694 printk("Not clean (jiff=%lu)...", jiffies); 2691 printk(KERN_DEBUG "Not clean (jiff=%lu)...", jiffies);
2695#endif 2692#endif
2696 if (msleep_interruptible(jiffies_to_msecs(char_time))) 2693 if (msleep_interruptible(jiffies_to_msecs(char_time)))
2697 break; 2694 break;
@@ -2705,7 +2702,7 @@ static void cy_wait_until_sent(struct tty_struct *tty, int timeout)
2705 /* Run one more char cycle */ 2702 /* Run one more char cycle */
2706 msleep_interruptible(jiffies_to_msecs(char_time * 5)); 2703 msleep_interruptible(jiffies_to_msecs(char_time * 5));
2707#ifdef CY_DEBUG_WAIT_UNTIL_SENT 2704#ifdef CY_DEBUG_WAIT_UNTIL_SENT
2708 printk("Clean (jiff=%lu)...done\n", jiffies); 2705 printk(KERN_DEBUG "Clean (jiff=%lu)...done\n", jiffies);
2709#endif 2706#endif
2710} 2707}
2711 2708
@@ -2718,7 +2715,7 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
2718 unsigned long flags; 2715 unsigned long flags;
2719 2716
2720#ifdef CY_DEBUG_OTHER 2717#ifdef CY_DEBUG_OTHER
2721 printk("cyc:cy_close ttyC%d\n", info->line); 2718 printk(KERN_DEBUG "cyc:cy_close ttyC%d\n", info->line);
2722#endif 2719#endif
2723 2720
2724 if (!info || serial_paranoia_check(info, tty->name, "cy_close")) { 2721 if (!info || serial_paranoia_check(info, tty->name, "cy_close")) {
@@ -2732,7 +2729,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
2732 return; 2729 return;
2733 } 2730 }
2734#ifdef CY_DEBUG_OPEN 2731#ifdef CY_DEBUG_OPEN
2735 printk("cyc:cy_close ttyC%d, count = %d\n", info->line, info->count); 2732 printk(KERN_DEBUG "cyc:cy_close ttyC%d, count = %d\n", info->line,
2733 info->count);
2736#endif 2734#endif
2737 if ((tty->count == 1) && (info->count != 1)) { 2735 if ((tty->count == 1) && (info->count != 1)) {
2738 /* 2736 /*
@@ -2742,17 +2740,17 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
2742 * one, we've got real problems, since it means the 2740 * one, we've got real problems, since it means the
2743 * serial port won't be shutdown. 2741 * serial port won't be shutdown.
2744 */ 2742 */
2745 printk("cyc:cy_close: bad serial port count; tty->count is 1, " 2743 printk(KERN_ERR "cyc:cy_close: bad serial port count; "
2746 "info->count is %d\n", info->count); 2744 "tty->count is 1, info->count is %d\n", info->count);
2747 info->count = 1; 2745 info->count = 1;
2748 } 2746 }
2749#ifdef CY_DEBUG_COUNT 2747#ifdef CY_DEBUG_COUNT
2750 printk("cyc:cy_close at (%d): decrementing count to %d\n", 2748 printk(KERN_DEBUG "cyc:cy_close at (%d): decrementing count to %d\n",
2751 current->pid, info->count - 1); 2749 current->pid, info->count - 1);
2752#endif 2750#endif
2753 if (--info->count < 0) { 2751 if (--info->count < 0) {
2754#ifdef CY_DEBUG_COUNT 2752#ifdef CY_DEBUG_COUNT
2755 printk("cyc:cyc_close setting count to 0\n"); 2753 printk(KERN_DEBUG "cyc:cyc_close setting count to 0\n");
2756#endif 2754#endif
2757 info->count = 0; 2755 info->count = 0;
2758 } 2756 }
@@ -2805,8 +2803,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
2805 retval = cyz_issue_cmd(&cy_card[info->card], channel, 2803 retval = cyz_issue_cmd(&cy_card[info->card], channel,
2806 C_CM_IOCTLW, 0L); 2804 C_CM_IOCTLW, 0L);
2807 if (retval != 0) { 2805 if (retval != 0) {
2808 printk("cyc:cy_close retval on ttyC%d was %x\n", 2806 printk(KERN_DEBUG "cyc:cy_close retval on "
2809 info->line, retval); 2807 "ttyC%d was %x\n", info->line, retval);
2810 } 2808 }
2811 CY_UNLOCK(info, flags); 2809 CY_UNLOCK(info, flags);
2812 interruptible_sleep_on(&info->shutdown_wait); 2810 interruptible_sleep_on(&info->shutdown_wait);
@@ -2838,7 +2836,7 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
2838 wake_up_interruptible(&info->close_wait); 2836 wake_up_interruptible(&info->close_wait);
2839 2837
2840#ifdef CY_DEBUG_OTHER 2838#ifdef CY_DEBUG_OTHER
2841 printk(" cyc:cy_close done\n"); 2839 printk(KERN_DEBUG "cyc:cy_close done\n");
2842#endif 2840#endif
2843 2841
2844 CY_UNLOCK(info, flags); 2842 CY_UNLOCK(info, flags);
@@ -2864,7 +2862,7 @@ static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count)
2864 int c, ret = 0; 2862 int c, ret = 0;
2865 2863
2866#ifdef CY_DEBUG_IO 2864#ifdef CY_DEBUG_IO
2867 printk("cyc:cy_write ttyC%d\n", info->line); /* */ 2865 printk(KERN_DEBUG "cyc:cy_write ttyC%d\n", info->line);
2868#endif 2866#endif
2869 2867
2870 if (serial_paranoia_check(info, tty->name, "cy_write")) { 2868 if (serial_paranoia_check(info, tty->name, "cy_write")) {
@@ -2914,7 +2912,7 @@ static void cy_put_char(struct tty_struct *tty, unsigned char ch)
2914 unsigned long flags; 2912 unsigned long flags;
2915 2913
2916#ifdef CY_DEBUG_IO 2914#ifdef CY_DEBUG_IO
2917 printk("cyc:cy_put_char ttyC%d\n", info->line); 2915 printk(KERN_DEBUG "cyc:cy_put_char ttyC%d\n", info->line);
2918#endif 2916#endif
2919 2917
2920 if (serial_paranoia_check(info, tty->name, "cy_put_char")) 2918 if (serial_paranoia_check(info, tty->name, "cy_put_char"))
@@ -2946,7 +2944,7 @@ static void cy_flush_chars(struct tty_struct *tty)
2946 struct cyclades_port *info = tty->driver_data; 2944 struct cyclades_port *info = tty->driver_data;
2947 2945
2948#ifdef CY_DEBUG_IO 2946#ifdef CY_DEBUG_IO
2949 printk("cyc:cy_flush_chars ttyC%d\n", info->line); /* */ 2947 printk(KERN_DEBUG "cyc:cy_flush_chars ttyC%d\n", info->line);
2950#endif 2948#endif
2951 2949
2952 if (serial_paranoia_check(info, tty->name, "cy_flush_chars")) 2950 if (serial_paranoia_check(info, tty->name, "cy_flush_chars"))
@@ -2971,7 +2969,7 @@ static int cy_write_room(struct tty_struct *tty)
2971 int ret; 2969 int ret;
2972 2970
2973#ifdef CY_DEBUG_IO 2971#ifdef CY_DEBUG_IO
2974 printk("cyc:cy_write_room ttyC%d\n", info->line); /* */ 2972 printk(KERN_DEBUG "cyc:cy_write_room ttyC%d\n", info->line);
2975#endif 2973#endif
2976 2974
2977 if (serial_paranoia_check(info, tty->name, "cy_write_room")) 2975 if (serial_paranoia_check(info, tty->name, "cy_write_room"))
@@ -2997,7 +2995,8 @@ static int cy_chars_in_buffer(struct tty_struct *tty)
2997 if (!IS_CYC_Z(cy_card[card])) { 2995 if (!IS_CYC_Z(cy_card[card])) {
2998#endif /* Z_EXT_CHARS_IN_BUFFER */ 2996#endif /* Z_EXT_CHARS_IN_BUFFER */
2999#ifdef CY_DEBUG_IO 2997#ifdef CY_DEBUG_IO
3000 printk("cyc:cy_chars_in_buffer ttyC%d %d\n", info->line, info->xmit_cnt); /* */ 2998 printk(KERN_DEBUG "cyc:cy_chars_in_buffer ttyC%d %d\n",
2999 info->line, info->xmit_cnt);
3001#endif 3000#endif
3002 return info->xmit_cnt; 3001 return info->xmit_cnt;
3003#ifdef Z_EXT_CHARS_IN_BUFFER 3002#ifdef Z_EXT_CHARS_IN_BUFFER
@@ -3023,7 +3022,8 @@ static int cy_chars_in_buffer(struct tty_struct *tty)
3023 else 3022 else
3024 char_count = tx_put - tx_get + tx_bufsize; 3023 char_count = tx_put - tx_get + tx_bufsize;
3025#ifdef CY_DEBUG_IO 3024#ifdef CY_DEBUG_IO
3026 printk("cyc:cy_chars_in_buffer ttyC%d %d\n", info->line, info->xmit_cnt + char_count); /* */ 3025 printk(KERN_DEBUG "cyc:cy_chars_in_buffer ttyC%d %d\n",
3026 info->line, info->xmit_cnt + char_count);
3027#endif 3027#endif
3028 return info->xmit_cnt + char_count; 3028 return info->xmit_cnt + char_count;
3029 } 3029 }
@@ -3296,8 +3296,8 @@ static void set_line_char(struct cyclades_port *info)
3296 ~CyDTR); 3296 ~CyDTR);
3297 } 3297 }
3298#ifdef CY_DEBUG_DTR 3298#ifdef CY_DEBUG_DTR
3299 printk("cyc:set_line_char dropping DTR\n"); 3299 printk(KERN_DEBUG "cyc:set_line_char dropping DTR\n");
3300 printk(" status: 0x%x, 0x%x\n", 3300 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
3301 readb(base_addr + (CyMSVR1 << index)), 3301 readb(base_addr + (CyMSVR1 << index)),
3302 readb(base_addr + (CyMSVR2 << index))); 3302 readb(base_addr + (CyMSVR2 << index)));
3303#endif 3303#endif
@@ -3310,8 +3310,8 @@ static void set_line_char(struct cyclades_port *info)
3310 CyDTR); 3310 CyDTR);
3311 } 3311 }
3312#ifdef CY_DEBUG_DTR 3312#ifdef CY_DEBUG_DTR
3313 printk("cyc:set_line_char raising DTR\n"); 3313 printk(KERN_DEBUG "cyc:set_line_char raising DTR\n");
3314 printk(" status: 0x%x, 0x%x\n", 3314 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
3315 readb(base_addr + (CyMSVR1 << index)), 3315 readb(base_addr + (CyMSVR1 << index)),
3316 readb(base_addr + (CyMSVR2 << index))); 3316 readb(base_addr + (CyMSVR2 << index)));
3317#endif 3317#endif
@@ -3426,8 +3426,8 @@ static void set_line_char(struct cyclades_port *info)
3426 3426
3427 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_IOCTL, 0L); 3427 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_IOCTL, 0L);
3428 if (retval != 0) { 3428 if (retval != 0) {
3429 printk("cyc:set_line_char retval on ttyC%d was %x\n", 3429 printk(KERN_ERR "cyc:set_line_char retval on ttyC%d "
3430 info->line, retval); 3430 "was %x\n", info->line, retval);
3431 } 3431 }
3432 3432
3433 /* CD sensitivity */ 3433 /* CD sensitivity */
@@ -3441,20 +3441,20 @@ static void set_line_char(struct cyclades_port *info)
3441 cy_writel(&ch_ctrl->rs_control, 3441 cy_writel(&ch_ctrl->rs_control,
3442 readl(&ch_ctrl->rs_control) & ~C_RS_DTR); 3442 readl(&ch_ctrl->rs_control) & ~C_RS_DTR);
3443#ifdef CY_DEBUG_DTR 3443#ifdef CY_DEBUG_DTR
3444 printk("cyc:set_line_char dropping Z DTR\n"); 3444 printk(KERN_DEBUG "cyc:set_line_char dropping Z DTR\n");
3445#endif 3445#endif
3446 } else { 3446 } else {
3447 cy_writel(&ch_ctrl->rs_control, 3447 cy_writel(&ch_ctrl->rs_control,
3448 readl(&ch_ctrl->rs_control) | C_RS_DTR); 3448 readl(&ch_ctrl->rs_control) | C_RS_DTR);
3449#ifdef CY_DEBUG_DTR 3449#ifdef CY_DEBUG_DTR
3450 printk("cyc:set_line_char raising Z DTR\n"); 3450 printk(KERN_DEBUG "cyc:set_line_char raising Z DTR\n");
3451#endif 3451#endif
3452 } 3452 }
3453 3453
3454 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_IOCTLM,0L); 3454 retval = cyz_issue_cmd(&cy_card[card], channel, C_CM_IOCTLM,0L);
3455 if (retval != 0) { 3455 if (retval != 0) {
3456 printk("cyc:set_line_char(2) retval on ttyC%d was %x\n", 3456 printk(KERN_ERR "cyc:set_line_char(2) retval on ttyC%d "
3457 info->line, retval); 3457 "was %x\n", info->line, retval);
3458 } 3458 }
3459 3459
3460 if (info->tty) { 3460 if (info->tty) {
@@ -3702,8 +3702,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
3702 CyDTR); 3702 CyDTR);
3703 } 3703 }
3704#ifdef CY_DEBUG_DTR 3704#ifdef CY_DEBUG_DTR
3705 printk("cyc:set_modem_info raising DTR\n"); 3705 printk(KERN_DEBUG "cyc:set_modem_info raising DTR\n");
3706 printk(" status: 0x%x, 0x%x\n", 3706 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
3707 readb(base_addr + (CyMSVR1 << index)), 3707 readb(base_addr + (CyMSVR1 << index)),
3708 readb(base_addr + (CyMSVR2 << index))); 3708 readb(base_addr + (CyMSVR2 << index)));
3709#endif 3709#endif
@@ -3722,8 +3722,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
3722 } 3722 }
3723 3723
3724#ifdef CY_DEBUG_DTR 3724#ifdef CY_DEBUG_DTR
3725 printk("cyc:set_modem_info dropping DTR\n"); 3725 printk(KERN_DEBUG "cyc:set_modem_info dropping DTR\n");
3726 printk(" status: 0x%x, 0x%x\n", 3726 printk(KERN_DEBUG " status: 0x%x, 0x%x\n",
3727 readb(base_addr + (CyMSVR1 << index)), 3727 readb(base_addr + (CyMSVR1 << index)),
3728 readb(base_addr + (CyMSVR2 << index))); 3728 readb(base_addr + (CyMSVR2 << index)));
3729#endif 3729#endif
@@ -3759,7 +3759,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
3759 readl(&ch_ctrl[channel].rs_control) | 3759 readl(&ch_ctrl[channel].rs_control) |
3760 C_RS_DTR); 3760 C_RS_DTR);
3761#ifdef CY_DEBUG_DTR 3761#ifdef CY_DEBUG_DTR
3762 printk("cyc:set_modem_info raising Z DTR\n"); 3762 printk(KERN_DEBUG "cyc:set_modem_info raising "
3763 "Z DTR\n");
3763#endif 3764#endif
3764 CY_UNLOCK(info, flags); 3765 CY_UNLOCK(info, flags);
3765 } 3766 }
@@ -3769,7 +3770,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
3769 readl(&ch_ctrl[channel].rs_control) & 3770 readl(&ch_ctrl[channel].rs_control) &
3770 ~C_RS_DTR); 3771 ~C_RS_DTR);
3771#ifdef CY_DEBUG_DTR 3772#ifdef CY_DEBUG_DTR
3772 printk("cyc:set_modem_info clearing Z DTR\n"); 3773 printk(KERN_DEBUG "cyc:set_modem_info clearing "
3774 "Z DTR\n");
3773#endif 3775#endif
3774 CY_UNLOCK(info, flags); 3776 CY_UNLOCK(info, flags);
3775 } 3777 }
@@ -3780,8 +3782,8 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
3780 retval = cyz_issue_cmd(&cy_card[info->card], 3782 retval = cyz_issue_cmd(&cy_card[info->card],
3781 channel, C_CM_IOCTLM, 0L); 3783 channel, C_CM_IOCTLM, 0L);
3782 if (retval != 0) { 3784 if (retval != 0) {
3783 printk("cyc:set_modem_info retval on ttyC%d was %x\n", 3785 printk(KERN_ERR "cyc:set_modem_info retval on ttyC%d "
3784 info->line, retval); 3786 "was %x\n", info->line, retval);
3785 } 3787 }
3786 CY_UNLOCK(info, flags); 3788 CY_UNLOCK(info, flags);
3787 } 3789 }
@@ -3831,16 +3833,17 @@ static void cy_break(struct tty_struct *tty, int break_state)
3831 info->line - cy_card[info->card].first_line, 3833 info->line - cy_card[info->card].first_line,
3832 C_CM_SET_BREAK, 0L); 3834 C_CM_SET_BREAK, 0L);
3833 if (retval != 0) { 3835 if (retval != 0) {
3834 printk("cyc:cy_break (set) retval on ttyC%d " 3836 printk(KERN_ERR "cyc:cy_break (set) retval on "
3835 "was %x\n", info->line, retval); 3837 "ttyC%d was %x\n", info->line, retval);
3836 } 3838 }
3837 } else { 3839 } else {
3838 retval = cyz_issue_cmd(&cy_card[info->card], 3840 retval = cyz_issue_cmd(&cy_card[info->card],
3839 info->line - cy_card[info->card].first_line, 3841 info->line - cy_card[info->card].first_line,
3840 C_CM_CLR_BREAK, 0L); 3842 C_CM_CLR_BREAK, 0L);
3841 if (retval != 0) { 3843 if (retval != 0) {
3842 printk("cyc:cy_break (clr) retval on ttyC%d " 3844 printk(KERN_DEBUG "cyc:cy_break (clr) retval "
3843 "was %x\n", info->line, retval); 3845 "on ttyC%d was %x\n", info->line,
3846 retval);
3844 } 3847 }
3845 } 3848 }
3846 } 3849 }
@@ -4004,7 +4007,8 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
4004 return -ENODEV; 4007 return -ENODEV;
4005 4008
4006#ifdef CY_DEBUG_OTHER 4009#ifdef CY_DEBUG_OTHER
4007 printk("cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n", info->line, cmd, arg); /* */ 4010 printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n",
4011 info->line, cmd, arg);
4008#endif 4012#endif
4009 4013
4010 switch (cmd) { 4014 switch (cmd) {
@@ -4164,7 +4168,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
4164 } 4168 }
4165 4169
4166#ifdef CY_DEBUG_OTHER 4170#ifdef CY_DEBUG_OTHER
4167 printk(" cyc:cy_ioctl done\n"); 4171 printk(KERN_DEBUG "cyc:cy_ioctl done\n");
4168#endif 4172#endif
4169 4173
4170 return ret_val; 4174 return ret_val;
@@ -4181,7 +4185,7 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
4181 struct cyclades_port *info = tty->driver_data; 4185 struct cyclades_port *info = tty->driver_data;
4182 4186
4183#ifdef CY_DEBUG_OTHER 4187#ifdef CY_DEBUG_OTHER
4184 printk("cyc:cy_set_termios ttyC%d\n", info->line); 4188 printk(KERN_DEBUG "cyc:cy_set_termios ttyC%d\n", info->line);
4185#endif 4189#endif
4186 4190
4187 if (tty->termios->c_cflag == old_termios->c_cflag && 4191 if (tty->termios->c_cflag == old_termios->c_cflag &&
@@ -4251,7 +4255,7 @@ static void cy_throttle(struct tty_struct *tty)
4251#ifdef CY_DEBUG_THROTTLE 4255#ifdef CY_DEBUG_THROTTLE
4252 char buf[64]; 4256 char buf[64];
4253 4257
4254 printk("cyc:throttle %s: %d....ttyC%d\n", tty_name(tty, buf), 4258 printk(KERN_DEBUG "cyc:throttle %s: %ld...ttyC%d\n", tty_name(tty, buf),
4255 tty->ldisc.chars_in_buffer(tty), info->line); 4259 tty->ldisc.chars_in_buffer(tty), info->line);
4256#endif 4260#endif
4257 4261
@@ -4309,8 +4313,8 @@ static void cy_unthrottle(struct tty_struct *tty)
4309#ifdef CY_DEBUG_THROTTLE 4313#ifdef CY_DEBUG_THROTTLE
4310 char buf[64]; 4314 char buf[64];
4311 4315
4312 printk("cyc:unthrottle %s: %d....ttyC%d\n", tty_name(tty, buf), 4316 printk(KERN_DEBUG "cyc:unthrottle %s: %ld...ttyC%d\n",
4313 tty->ldisc.chars_in_buffer(tty), info->line); 4317 tty_name(tty, buf), tty->ldisc.chars_in_buffer(tty),info->line);
4314#endif 4318#endif
4315 4319
4316 if (serial_paranoia_check(info, tty->name, "cy_unthrottle")) { 4320 if (serial_paranoia_check(info, tty->name, "cy_unthrottle")) {
@@ -4363,7 +4367,7 @@ static void cy_stop(struct tty_struct *tty)
4363 unsigned long flags; 4367 unsigned long flags;
4364 4368
4365#ifdef CY_DEBUG_OTHER 4369#ifdef CY_DEBUG_OTHER
4366 printk("cyc:cy_stop ttyC%d\n", info->line); /* */ 4370 printk(KERN_DEBUG "cyc:cy_stop ttyC%d\n", info->line);
4367#endif 4371#endif
4368 4372
4369 if (serial_paranoia_check(info, tty->name, "cy_stop")) 4373 if (serial_paranoia_check(info, tty->name, "cy_stop"))
@@ -4398,7 +4402,7 @@ static void cy_start(struct tty_struct *tty)
4398 unsigned long flags; 4402 unsigned long flags;
4399 4403
4400#ifdef CY_DEBUG_OTHER 4404#ifdef CY_DEBUG_OTHER
4401 printk("cyc:cy_start ttyC%d\n", info->line); /* */ 4405 printk(KERN_DEBUG "cyc:cy_start ttyC%d\n", info->line);
4402#endif 4406#endif
4403 4407
4404 if (serial_paranoia_check(info, tty->name, "cy_start")) 4408 if (serial_paranoia_check(info, tty->name, "cy_start"))
@@ -4430,7 +4434,7 @@ static void cy_flush_buffer(struct tty_struct *tty)
4430 unsigned long flags; 4434 unsigned long flags;
4431 4435
4432#ifdef CY_DEBUG_IO 4436#ifdef CY_DEBUG_IO
4433 printk("cyc:cy_flush_buffer ttyC%d\n", info->line); /* */ 4437 printk(KERN_DEBUG "cyc:cy_flush_buffer ttyC%d\n", info->line);
4434#endif 4438#endif
4435 4439
4436 if (serial_paranoia_check(info, tty->name, "cy_flush_buffer")) 4440 if (serial_paranoia_check(info, tty->name, "cy_flush_buffer"))
@@ -4449,8 +4453,8 @@ static void cy_flush_buffer(struct tty_struct *tty)
4449 retval = 4453 retval =
4450 cyz_issue_cmd(&cy_card[card], channel, C_CM_FLUSH_TX, 0L); 4454 cyz_issue_cmd(&cy_card[card], channel, C_CM_FLUSH_TX, 0L);
4451 if (retval != 0) { 4455 if (retval != 0) {
4452 printk("cyc: flush_buffer retval on ttyC%d was %x\n", 4456 printk(KERN_ERR "cyc: flush_buffer retval on ttyC%d "
4453 info->line, retval); 4457 "was %x\n", info->line, retval);
4454 } 4458 }
4455 CY_UNLOCK(info, flags); 4459 CY_UNLOCK(info, flags);
4456 } 4460 }
@@ -4465,7 +4469,7 @@ static void cy_hangup(struct tty_struct *tty)
4465 struct cyclades_port *info = tty->driver_data; 4469 struct cyclades_port *info = tty->driver_data;
4466 4470
4467#ifdef CY_DEBUG_OTHER 4471#ifdef CY_DEBUG_OTHER
4468 printk("cyc:cy_hangup ttyC%d\n", info->line); /* */ 4472 printk(KERN_DEBUG "cyc:cy_hangup ttyC%d\n", info->line);
4469#endif 4473#endif
4470 4474
4471 if (serial_paranoia_check(info, tty->name, "cy_hangup")) 4475 if (serial_paranoia_check(info, tty->name, "cy_hangup"))
@@ -4476,7 +4480,8 @@ static void cy_hangup(struct tty_struct *tty)
4476 info->event = 0; 4480 info->event = 0;
4477 info->count = 0; 4481 info->count = 0;
4478#ifdef CY_DEBUG_COUNT 4482#ifdef CY_DEBUG_COUNT
4479 printk("cyc:cy_hangup (%d): setting count to 0\n", current->pid); 4483 printk(KERN_DEBUG "cyc:cy_hangup (%d): setting count to 0\n",
4484 current->pid);
4480#endif 4485#endif
4481 info->tty = NULL; 4486 info->tty = NULL;
4482 info->flags &= ~ASYNC_NORMAL_ACTIVE; 4487 info->flags &= ~ASYNC_NORMAL_ACTIVE;
@@ -4569,7 +4574,7 @@ static void __devinit cy_init_card(struct cyclades_card *cinfo,
4569 if (!timer_pending(&cyz_timerlist)) { 4574 if (!timer_pending(&cyz_timerlist)) {
4570 mod_timer(&cyz_timerlist, jiffies + 1); 4575 mod_timer(&cyz_timerlist, jiffies + 1);
4571#ifdef CY_PCI_DEBUG 4576#ifdef CY_PCI_DEBUG
4572 printk("Cyclades-Z polling initialized\n"); 4577 printk(KERN_DEBUG "Cyclades-Z polling initialized\n");
4573#endif 4578#endif
4574 } 4579 }
4575#endif /* CONFIG_CYZ_INTR */ 4580#endif /* CONFIG_CYZ_INTR */
@@ -4778,18 +4783,17 @@ static int __init cy_detect_isa(void)
4778 /* find out the board's irq by probing */ 4783 /* find out the board's irq by probing */
4779 cy_isa_irq = detect_isa_irq(cy_isa_address); 4784 cy_isa_irq = detect_isa_irq(cy_isa_address);
4780 if (cy_isa_irq == 0) { 4785 if (cy_isa_irq == 0) {
4781 printk("Cyclom-Y/ISA found at 0x%lx ", 4786 printk(KERN_ERR "Cyclom-Y/ISA found at 0x%lx, but the "
4787 "IRQ could not be detected.\n",
4782 (unsigned long)cy_isa_address); 4788 (unsigned long)cy_isa_address);
4783 printk("but the IRQ could not be detected.\n");
4784 continue; 4789 continue;
4785 } 4790 }
4786 4791
4787 if ((cy_next_channel + cy_isa_nchan) > NR_PORTS) { 4792 if ((cy_next_channel + cy_isa_nchan) > NR_PORTS) {
4788 printk("Cyclom-Y/ISA found at 0x%lx ", 4793 printk(KERN_ERR "Cyclom-Y/ISA found at 0x%lx, but no "
4794 "more channels are available. Change NR_PORTS "
4795 "in cyclades.c and recompile kernel.\n",
4789 (unsigned long)cy_isa_address); 4796 (unsigned long)cy_isa_address);
4790 printk("but no more channels are available.\n");
4791 printk("Change NR_PORTS in cyclades.c and recompile "
4792 "kernel.\n");
4793 return nboard; 4797 return nboard;
4794 } 4798 }
4795 /* fill the next cy_card structure available */ 4799 /* fill the next cy_card structure available */
@@ -4798,20 +4802,19 @@ static int __init cy_detect_isa(void)
4798 break; 4802 break;
4799 } 4803 }
4800 if (j == NR_CARDS) { /* no more cy_cards available */ 4804 if (j == NR_CARDS) { /* no more cy_cards available */
4801 printk("Cyclom-Y/ISA found at 0x%lx ", 4805 printk(KERN_ERR "Cyclom-Y/ISA found at 0x%lx, but no "
4806 "more cards can be used. Change NR_CARDS in "
4807 "cyclades.c and recompile kernel.\n",
4802 (unsigned long)cy_isa_address); 4808 (unsigned long)cy_isa_address);
4803 printk("but no more cards can be used .\n");
4804 printk("Change NR_CARDS in cyclades.c and recompile "
4805 "kernel.\n");
4806 return nboard; 4809 return nboard;
4807 } 4810 }
4808 4811
4809 /* allocate IRQ */ 4812 /* allocate IRQ */
4810 if (request_irq(cy_isa_irq, cyy_interrupt, 4813 if (request_irq(cy_isa_irq, cyy_interrupt,
4811 IRQF_DISABLED, "Cyclom-Y", &cy_card[j])) { 4814 IRQF_DISABLED, "Cyclom-Y", &cy_card[j])) {
4812 printk("Cyclom-Y/ISA found at 0x%lx ", 4815 printk(KERN_ERR "Cyclom-Y/ISA found at 0x%lx, but "
4813 (unsigned long)cy_isa_address); 4816 "could not allocate IRQ#%d.\n",
4814 printk("but could not allocate IRQ#%d.\n", cy_isa_irq); 4817 (unsigned long)cy_isa_address, cy_isa_irq);
4815 return nboard; 4818 return nboard;
4816 } 4819 }
4817 4820
@@ -4825,13 +4828,12 @@ static int __init cy_detect_isa(void)
4825 cy_init_card(&cy_card[j], j); 4828 cy_init_card(&cy_card[j], j);
4826 nboard++; 4829 nboard++;
4827 4830
4828 /* print message */ 4831 printk(KERN_INFO "Cyclom-Y/ISA #%d: 0x%lx-0x%lx, IRQ%d found: "
4829 printk("Cyclom-Y/ISA #%d: 0x%lx-0x%lx, IRQ%d, ", 4832 "%d channels starting from port %d\n",
4830 j + 1, (unsigned long)cy_isa_address, 4833 j + 1, (unsigned long)cy_isa_address,
4831 (unsigned long)(cy_isa_address + (CyISA_Ywin - 1)), 4834 (unsigned long)(cy_isa_address + (CyISA_Ywin - 1)),
4832 cy_isa_irq); 4835 cy_isa_irq, cy_isa_nchan, cy_next_channel);
4833 printk("%d channels starting from port %d.\n", 4836
4834 cy_isa_nchan, cy_next_channel);
4835 for (j = cy_next_channel; 4837 for (j = cy_next_channel;
4836 j < cy_next_channel + cy_isa_nchan; j++) 4838 j < cy_next_channel + cy_isa_nchan; j++)
4837 tty_register_device(cy_serial_driver, j, NULL); 4839 tty_register_device(cy_serial_driver, j, NULL);
@@ -4869,20 +4871,15 @@ static int __devinit cy_init_Ze(unsigned long cy_pci_phys0,
4869 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ze_win); 4871 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ze_win);
4870 4872
4871 readl(&cy_pci_addr0->mail_box_0); 4873 readl(&cy_pci_addr0->mail_box_0);
4872#ifdef CY_PCI_DEBUG 4874 dev_dbg(&pdev->dev, "new Cyclades-Z board. FPGA not loaded\n");
4873 printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n", 4875
4874 (ulong)cy_pci_addr2, (ulong)cy_pci_addr0);
4875 printk("Cyclades-Z/PCI: New Cyclades-Z board. FPGA not "
4876 "loaded\n");
4877#endif
4878 /* This must be the new Cyclades-Ze/PCI. */ 4876 /* This must be the new Cyclades-Ze/PCI. */
4879 cy_pci_nchan = ZE_V1_NPORTS; 4877 cy_pci_nchan = ZE_V1_NPORTS;
4880 4878
4881 if ((cy_next_channel + cy_pci_nchan) > NR_PORTS) { 4879 if ((cy_next_channel + cy_pci_nchan) > NR_PORTS) {
4882 printk("Cyclades-Ze/PCI found at 0x%lx but no channels " 4880 dev_err(&pdev->dev, "Cyclades-Ze/PCI found, but no channels "
4883 "are available.\nChange NR_PORTS in cyclades.c " 4881 "are available.\nChange NR_PORTS in cyclades.c "
4884 "and recompile kernel.\n", 4882 "and recompile kernel.\n");
4885 (ulong) cy_pci_phys2);
4886 return -EIO; 4883 return -EIO;
4887 } 4884 }
4888 4885
@@ -4892,10 +4889,9 @@ static int __devinit cy_init_Ze(unsigned long cy_pci_phys0,
4892 break; 4889 break;
4893 } 4890 }
4894 if (j == NR_CARDS) { /* no more cy_cards available */ 4891 if (j == NR_CARDS) { /* no more cy_cards available */
4895 printk("Cyclades-Ze/PCI found at 0x%lx but no more " 4892 dev_err(&pdev->dev, "Cyclades-Ze/PCI found, but no more "
4896 "cards can be used.\nChange NR_CARDS in " 4893 "cards can be used.\nChange NR_CARDS in "
4897 "cyclades.c and recompile kernel.\n", 4894 "cyclades.c and recompile kernel.\n");
4898 (ulong) cy_pci_phys2);
4899 return -EIO; 4895 return -EIO;
4900 } 4896 }
4901#ifdef CONFIG_CYZ_INTR 4897#ifdef CONFIG_CYZ_INTR
@@ -4904,10 +4900,7 @@ static int __devinit cy_init_Ze(unsigned long cy_pci_phys0,
4904 if (request_irq(cy_pci_irq, cyz_interrupt, 4900 if (request_irq(cy_pci_irq, cyz_interrupt,
4905 IRQF_SHARED, "Cyclades-Z", 4901 IRQF_SHARED, "Cyclades-Z",
4906 &cy_card[j])) { 4902 &cy_card[j])) {
4907 printk("Cyclom-Ze/PCI found at 0x%lx ", 4903 dev_err(&pdev->dev, "could not allocate IRQ.\n");
4908 (ulong) cy_pci_phys2);
4909 printk("but could not allocate IRQ%d.\n",
4910 cy_pci_irq);
4911 return -EIO; 4904 return -EIO;
4912 } 4905 }
4913 } 4906 }
@@ -4923,21 +4916,9 @@ static int __devinit cy_init_Ze(unsigned long cy_pci_phys0,
4923 cy_init_card(&cy_card[j], j); 4916 cy_init_card(&cy_card[j], j);
4924 pci_set_drvdata(pdev, &cy_card[j]); 4917 pci_set_drvdata(pdev, &cy_card[j]);
4925 4918
4926 /* print message */ 4919 dev_info(&pdev->dev, "Cyclades-Ze/PCI #%d found: %d channels starting "
4927#ifdef CONFIG_CYZ_INTR 4920 "from port %d.\n", j + 1, cy_pci_nchan, cy_next_channel);
4928 /* don't report IRQ if board is no IRQ */
4929 if ((cy_pci_irq != 0) && (cy_pci_irq != 255))
4930 printk("Cyclades-Ze/PCI #%d: 0x%lx-0x%lx, IRQ%d, ",
4931 j + 1, (ulong) cy_pci_phys2,
4932 (ulong) (cy_pci_phys2 + CyPCI_Ze_win - 1), cy_pci_irq);
4933 else
4934#endif /* CONFIG_CYZ_INTR */
4935 printk("Cyclades-Ze/PCI #%d: 0x%lx-0x%lx, ",
4936 j + 1, (ulong) cy_pci_phys2,
4937 (ulong) (cy_pci_phys2 + CyPCI_Ze_win - 1));
4938 4921
4939 printk("%d channels starting from port %d.\n",
4940 cy_pci_nchan, cy_next_channel);
4941 for (j = cy_next_channel; j < cy_next_channel + cy_pci_nchan; j++) 4922 for (j = cy_next_channel; j < cy_next_channel + cy_pci_nchan; j++)
4942 tty_register_device(cy_serial_driver, j, &pdev->dev); 4923 tty_register_device(cy_serial_driver, j, &pdev->dev);
4943 cy_next_channel += cy_pci_nchan; 4924 cy_next_channel += cy_pci_nchan;
@@ -4972,17 +4953,10 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
4972 4953
4973 if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo || 4954 if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo ||
4974 device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi) { 4955 device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi) {
4975#ifdef CY_PCI_DEBUG 4956 dev_dbg(&pdev->dev, "Cyclom-Y/PCI found\n");
4976 printk("Cyclom-Y/PCI (bus=0x0%x, pci_id=0x%x, ",
4977 pdev->bus->number, pdev->devfn);
4978 printk("rev_id=%d) IRQ%d\n", cyy_rev_id, cy_pci_irq);
4979 printk("Cyclom-Y/PCI:found winaddr=0x%lx "
4980 "ctladdr=0x%lx\n",
4981 (ulong)cy_pci_phys2, (ulong)cy_pci_phys0);
4982#endif
4983 4957
4984 if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) { 4958 if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) {
4985 printk(" Warning: PCI I/O bit incorrectly " 4959 dev_warn(&pdev->dev, "PCI I/O bit incorrectly "
4986 "set. Ignoring it...\n"); 4960 "set. Ignoring it...\n");
4987 pdev->resource[2].flags &= ~IORESOURCE_IO; 4961 pdev->resource[2].flags &= ~IORESOURCE_IO;
4988 } 4962 }
@@ -4992,47 +4966,33 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
4992 with other drivers accessing it. */ 4966 with other drivers accessing it. */
4993 retval = pci_request_regions(pdev, "Cyclom-Y"); 4967 retval = pci_request_regions(pdev, "Cyclom-Y");
4994 if (retval) { 4968 if (retval) {
4995 printk(KERN_ERR "cyclades: failed to reserve " 4969 dev_err(&pdev->dev, "failed to reserve resources\n");
4996 "PCI resources\n");
4997 return retval; 4970 return retval;
4998 } 4971 }
4999#if defined(__alpha__) 4972#if defined(__alpha__)
5000 if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) { /* below 1M? */ 4973 if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) { /* below 1M? */
5001 printk("Cyclom-Y/PCI (bus=0x0%x, pci_id=0x%x, ", 4974 dev_err(&pdev->dev, "Cyclom-Y/PCI not supported for "
5002 pdev->bus->number, pdev->devfn); 4975 "low addresses on Alpha systems.\n");
5003 printk("rev_id=%d) IRQ%d\n",
5004 cyy_rev_id, cy_pci_irq);
5005 printk("Cyclom-Y/PCI:found winaddr=0x%lx "
5006 "ctladdr=0x%lx\n",
5007 (ulong)cy_pci_phys2,
5008 (ulong)cy_pci_phys0);
5009 printk("Cyclom-Y/PCI not supported for low "
5010 "addresses in Alpha systems.\n");
5011 return -EIO; 4976 return -EIO;
5012 } 4977 }
5013#endif 4978#endif
5014 cy_pci_addr0 = pci_iomap(pdev, 0, CyPCI_Yctl); 4979 cy_pci_addr0 = pci_iomap(pdev, 0, CyPCI_Yctl);
5015 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ywin); 4980 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ywin);
5016 4981
5017#ifdef CY_PCI_DEBUG 4982 dev_dbg(&pdev->dev, "Cyclom-Y/PCI: relocate winaddr=0x%p "
5018 printk("Cyclom-Y/PCI: relocate winaddr=0x%lx " 4983 "ctladdr=0x%p\n", cy_pci_addr2, cy_pci_addr0);
5019 "ctladdr=0x%lx\n", 4984
5020 (u_long)cy_pci_addr2, (u_long)cy_pci_addr0);
5021#endif
5022 cy_pci_nchan = (unsigned short)(CyPORTS_PER_CHIP * 4985 cy_pci_nchan = (unsigned short)(CyPORTS_PER_CHIP *
5023 cyy_init_card(cy_pci_addr2, 1)); 4986 cyy_init_card(cy_pci_addr2, 1));
5024 if (cy_pci_nchan == 0) { 4987 if (cy_pci_nchan == 0) {
5025 printk("Cyclom-Y PCI host card with "); 4988 dev_err(&pdev->dev, "Cyclom-Y PCI host card with no "
5026 printk("no Serial-Modules at 0x%lx.\n", 4989 "Serial-Modules\n");
5027 (ulong) cy_pci_phys2);
5028 return -EIO; 4990 return -EIO;
5029 } 4991 }
5030 if ((cy_next_channel + cy_pci_nchan) > NR_PORTS) { 4992 if ((cy_next_channel + cy_pci_nchan) > NR_PORTS) {
5031 printk("Cyclom-Y/PCI found at 0x%lx ", 4993 dev_err(&pdev->dev, "Cyclom-Y/PCI found, but no "
5032 (ulong) cy_pci_phys2); 4994 "channels are available. Change NR_PORTS in "
5033 printk("but no channels are available.\n"); 4995 "cyclades.c and recompile kernel.\n");
5034 printk("Change NR_PORTS in cyclades.c and "
5035 "recompile kernel.\n");
5036 return -EIO; 4996 return -EIO;
5037 } 4997 }
5038 /* fill the next cy_card structure available */ 4998 /* fill the next cy_card structure available */
@@ -5041,11 +5001,9 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5041 break; 5001 break;
5042 } 5002 }
5043 if (j == NR_CARDS) { /* no more cy_cards available */ 5003 if (j == NR_CARDS) { /* no more cy_cards available */
5044 printk("Cyclom-Y/PCI found at 0x%lx ", 5004 dev_err(&pdev->dev, "Cyclom-Y/PCI found, but no more "
5045 (ulong) cy_pci_phys2); 5005 "cards can be used. Change NR_CARDS in "
5046 printk("but no more cards can be used.\n"); 5006 "cyclades.c and recompile kernel.\n");
5047 printk("Change NR_CARDS in cyclades.c and "
5048 "recompile kernel.\n");
5049 return -EIO; 5007 return -EIO;
5050 } 5008 }
5051 5009
@@ -5053,10 +5011,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5053 retval = request_irq(cy_pci_irq, cyy_interrupt, 5011 retval = request_irq(cy_pci_irq, cyy_interrupt,
5054 IRQF_SHARED, "Cyclom-Y", &cy_card[j]); 5012 IRQF_SHARED, "Cyclom-Y", &cy_card[j]);
5055 if (retval) { 5013 if (retval) {
5056 printk("Cyclom-Y/PCI found at 0x%lx ", 5014 dev_err(&pdev->dev, "could not allocate IRQ\n");
5057 (ulong) cy_pci_phys2);
5058 printk("but could not allocate IRQ%d.\n",
5059 cy_pci_irq);
5060 return retval; 5015 return retval;
5061 } 5016 }
5062 5017
@@ -5096,37 +5051,22 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5096 break; 5051 break;
5097 } 5052 }
5098 5053
5099 /* print message */ 5054 dev_info(&pdev->dev, "Cyclom-Y/PCI #%d found: %d channels "
5100 printk("Cyclom-Y/PCI #%d: 0x%lx-0x%lx, IRQ%d, ", 5055 "starting from port %d.\n", j + 1, cy_pci_nchan,
5101 j + 1, (ulong)cy_pci_phys2, 5056 cy_next_channel);
5102 (ulong) (cy_pci_phys2 + CyPCI_Ywin - 1), cy_pci_irq); 5057
5103 printk("%d channels starting from port %d.\n",
5104 cy_pci_nchan, cy_next_channel);
5105 for (j = cy_next_channel; 5058 for (j = cy_next_channel;
5106 j < cy_next_channel + cy_pci_nchan; j++) 5059 j < cy_next_channel + cy_pci_nchan; j++)
5107 tty_register_device(cy_serial_driver, j, &pdev->dev); 5060 tty_register_device(cy_serial_driver, j, &pdev->dev);
5108 5061
5109 cy_next_channel += cy_pci_nchan; 5062 cy_next_channel += cy_pci_nchan;
5110 } else if (device_id == PCI_DEVICE_ID_CYCLOM_Z_Lo) { 5063 } else if (device_id == PCI_DEVICE_ID_CYCLOM_Z_Lo) {
5111 /* print message */ 5064 dev_err(&pdev->dev, "Cyclades-Z/PCI not supported for "
5112 printk("Cyclades-Z/PCI (bus=0x0%x, pci_id=0x%x, ", 5065 "low addresses\n");
5113 pdev->bus->number, pdev->devfn);
5114 printk("rev_id=%d) IRQ%d\n", cyy_rev_id, cy_pci_irq);
5115 printk("Cyclades-Z/PCI: found winaddr=0x%lx "
5116 "ctladdr=0x%lx\n",
5117 (ulong)cy_pci_phys2, (ulong)cy_pci_phys0);
5118 printk("Cyclades-Z/PCI not supported for low "
5119 "addresses\n");
5120 return -EIO; 5066 return -EIO;
5121 } else if (device_id == PCI_DEVICE_ID_CYCLOM_Z_Hi) { 5067 } else if (device_id == PCI_DEVICE_ID_CYCLOM_Z_Hi) {
5122#ifdef CY_PCI_DEBUG 5068 dev_dbg(&pdev->dev, "Cyclades-Z/PCI found\n");
5123 printk("Cyclades-Z/PCI (bus=0x0%x, pci_id=0x%x, ", 5069
5124 pdev->bus->number, pdev->devfn);
5125 printk("rev_id=%d) IRQ%d\n", cyy_rev_id, cy_pci_irq);
5126 printk("Cyclades-Z/PCI: found winaddr=0x%lx "
5127 "ctladdr=0x%lx\n",
5128 (ulong) cy_pci_phys2, (ulong) cy_pci_phys0);
5129#endif
5130 cy_pci_addr0 = pci_iomap(pdev, 0, CyPCI_Zctl); 5070 cy_pci_addr0 = pci_iomap(pdev, 0, CyPCI_Zctl);
5131 5071
5132 /* Disable interrupts on the PLX before resetting it */ 5072 /* Disable interrupts on the PLX before resetting it */
@@ -5145,7 +5085,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5145 cy_pci_addr0)->mail_box_0); 5085 cy_pci_addr0)->mail_box_0);
5146 5086
5147 if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) { 5087 if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) {
5148 printk(" Warning: PCI I/O bit incorrectly " 5088 dev_warn(&pdev->dev, "PCI I/O bit incorrectly "
5149 "set. Ignoring it...\n"); 5089 "set. Ignoring it...\n");
5150 pdev->resource[2].flags &= ~IORESOURCE_IO; 5090 pdev->resource[2].flags &= ~IORESOURCE_IO;
5151 } 5091 }
@@ -5155,8 +5095,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5155 with other drivers accessing it. */ 5095 with other drivers accessing it. */
5156 retval = pci_request_regions(pdev, "Cyclades-Z"); 5096 retval = pci_request_regions(pdev, "Cyclades-Z");
5157 if (retval) { 5097 if (retval) {
5158 printk(KERN_ERR "cyclades: failed to reserve " 5098 dev_err(&pdev->dev, "failed to reserve resources\n");
5159 "PCI resources\n");
5160 return retval; 5099 return retval;
5161 } 5100 }
5162 5101
@@ -5168,28 +5107,24 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5168 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Zwin); 5107 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Zwin);
5169 } 5108 }
5170 5109
5110 dev_dbg(&pdev->dev, "Cyclades-Z/PCI: relocate winaddr=0x%p "
5111 "ctladdr=0x%p\n", cy_pci_addr2, cy_pci_addr0);
5171#ifdef CY_PCI_DEBUG 5112#ifdef CY_PCI_DEBUG
5172 printk("Cyclades-Z/PCI: relocate winaddr=0x%lx "
5173 "ctladdr=0x%lx\n",
5174 (ulong) cy_pci_addr2, (ulong) cy_pci_addr0);
5175 if (mailbox == ZO_V1) { 5113 if (mailbox == ZO_V1) {
5176 cy_writel(&((struct RUNTIME_9060 *) 5114 cy_writel(&((struct RUNTIME_9060 *)
5177 (cy_pci_addr0))->loc_addr_base, 5115 (cy_pci_addr0))->loc_addr_base,
5178 WIN_CREG); 5116 WIN_CREG);
5179 printk("Cyclades-8Zo/PCI: FPGA id %lx, ver " 5117 dev_info(&pdev->dev, "Cyclades-8Zo/PCI: FPGA id %lx, "
5180 "%lx\n", (ulong) (0xff & 5118 "ver %lx\n", (ulong)(0xff &
5181 readl(&((struct CUSTOM_REG *)
5182 (cy_pci_addr2))->fpga_id)),
5183 (ulong)(0xff &
5184 readl(&((struct CUSTOM_REG *) 5119 readl(&((struct CUSTOM_REG *)
5185 (cy_pci_addr2))-> 5120 cy_pci_addr2)->fpga_id)),
5186 fpga_version))); 5121 (ulong)(0xff & readl(&((struct CUSTOM_REG *)
5122 cy_pci_addr2)->fpga_version)));
5187 cy_writel(&((struct RUNTIME_9060 *) 5123 cy_writel(&((struct RUNTIME_9060 *)
5188 (cy_pci_addr0))->loc_addr_base, 5124 cy_pci_addr0)->loc_addr_base, WIN_RAM);
5189 WIN_RAM);
5190 } else { 5125 } else {
5191 printk("Cyclades-Z/PCI: New Cyclades-Z board. " 5126 dev_info(&pdev->dev, "Cyclades-Z/PCI: New Cyclades-Z "
5192 "FPGA not loaded\n"); 5127 "board. FPGA not loaded\n");
5193 } 5128 }
5194#endif 5129#endif
5195 /* The following clears the firmware id word. This 5130 /* The following clears the firmware id word. This
@@ -5205,10 +5140,9 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5205 cy_pci_nchan = 8; 5140 cy_pci_nchan = 8;
5206 5141
5207 if ((cy_next_channel + cy_pci_nchan) > NR_PORTS) { 5142 if ((cy_next_channel + cy_pci_nchan) > NR_PORTS) {
5208 printk("Cyclades-8Zo/PCI found at 0x%lx but" 5143 dev_err(&pdev->dev, "Cyclades-8Zo/PCI found, but no "
5209 "no channels are available.\nChange " 5144 "channels are available. Change NR_PORTS in "
5210 "NR_PORTS in cyclades.c and recompile " 5145 "cyclades.c and recompile kernel.\n");
5211 "kernel.\n", (ulong)cy_pci_phys2);
5212 return -EIO; 5146 return -EIO;
5213 } 5147 }
5214 5148
@@ -5218,10 +5152,9 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5218 break; 5152 break;
5219 } 5153 }
5220 if (j == NR_CARDS) { /* no more cy_cards available */ 5154 if (j == NR_CARDS) { /* no more cy_cards available */
5221 printk("Cyclades-8Zo/PCI found at 0x%lx but" 5155 dev_err(&pdev->dev, "Cyclades-8Zo/PCI found, but no "
5222 "no more cards can be used.\nChange " 5156 "more cards can be used. Change NR_CARDS in "
5223 "NR_CARDS in cyclades.c and recompile " 5157 "cyclades.c and recompile kernel.\n");
5224 "kernel.\n", (ulong)cy_pci_phys2);
5225 return -EIO; 5158 return -EIO;
5226 } 5159 }
5227#ifdef CONFIG_CYZ_INTR 5160#ifdef CONFIG_CYZ_INTR
@@ -5231,10 +5164,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5231 IRQF_SHARED, "Cyclades-Z", 5164 IRQF_SHARED, "Cyclades-Z",
5232 &cy_card[j]); 5165 &cy_card[j]);
5233 if (retval) { 5166 if (retval) {
5234 printk("Cyclom-8Zo/PCI found at 0x%lx " 5167 dev_err(&pdev->dev, "could not allocate IRQ\n");
5235 "but could not allocate "
5236 "IRQ%d.\n", (ulong)cy_pci_phys2,
5237 cy_pci_irq);
5238 return retval; 5168 return retval;
5239 } 5169 }
5240 } 5170 }
@@ -5250,22 +5180,10 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
5250 cy_init_card(&cy_card[j], j); 5180 cy_init_card(&cy_card[j], j);
5251 pci_set_drvdata(pdev, &cy_card[j]); 5181 pci_set_drvdata(pdev, &cy_card[j]);
5252 5182
5253 /* print message */ 5183 dev_info(&pdev->dev, "Cyclades-8Zo/PCI #%d found: %d channels "
5254#ifdef CONFIG_CYZ_INTR 5184 "starting from port %d.\n", j + 1, cy_pci_nchan,
5255 /* don't report IRQ if board is no IRQ */ 5185 cy_next_channel);
5256 if ((cy_pci_irq != 0) && (cy_pci_irq != 255))
5257 printk("Cyclades-8Zo/PCI #%d: 0x%lx-0x%lx, "
5258 "IRQ%d, ", j + 1, (ulong)cy_pci_phys2,
5259 (ulong) (cy_pci_phys2 + CyPCI_Zwin - 1),
5260 cy_pci_irq);
5261 else
5262#endif /* CONFIG_CYZ_INTR */
5263 printk("Cyclades-8Zo/PCI #%d: 0x%lx-0x%lx, ",
5264 j + 1, (ulong)cy_pci_phys2,
5265 (ulong)(cy_pci_phys2 + CyPCI_Zwin - 1));
5266 5186
5267 printk("%d channels starting from port %d.\n",
5268 cy_pci_nchan, cy_next_channel);
5269 for (j = cy_next_channel; 5187 for (j = cy_next_channel;
5270 j < cy_next_channel + cy_pci_nchan; j++) 5188 j < cy_next_channel + cy_pci_nchan; j++)
5271 tty_register_device(cy_serial_driver, j, &pdev->dev); 5189 tty_register_device(cy_serial_driver, j, &pdev->dev);
@@ -5320,16 +5238,6 @@ static struct pci_driver cy_pci_driver = {
5320}; 5238};
5321#endif 5239#endif
5322 5240
5323/*
5324 * This routine prints out the appropriate serial driver version number
5325 * and identifies which options were configured into this driver.
5326 */
5327static inline void show_version(void)
5328{
5329 printk("Cyclades driver " CY_VERSION "\n");
5330 printk(" built %s %s\n", __DATE__, __TIME__);
5331} /* show_version */
5332
5333static int 5241static int
5334cyclades_get_proc_info(char *buf, char **start, off_t offset, int length, 5242cyclades_get_proc_info(char *buf, char **start, off_t offset, int length,
5335 int *eof, void *data) 5243 int *eof, void *data)
@@ -5436,7 +5344,9 @@ static int __init cy_init(void)
5436 cy_serial_driver = alloc_tty_driver(NR_PORTS); 5344 cy_serial_driver = alloc_tty_driver(NR_PORTS);
5437 if (!cy_serial_driver) 5345 if (!cy_serial_driver)
5438 goto err; 5346 goto err;
5439 show_version(); 5347
5348 printk(KERN_INFO "Cyclades driver " CY_VERSION " (built %s %s)\n",
5349 __DATE__, __TIME__);
5440 5350
5441 /* Initialize the tty_driver structure */ 5351 /* Initialize the tty_driver structure */
5442 5352
@@ -5505,8 +5415,8 @@ static void __exit cy_cleanup_module(void)
5505#endif /* CONFIG_CYZ_INTR */ 5415#endif /* CONFIG_CYZ_INTR */
5506 5416
5507 if ((e1 = tty_unregister_driver(cy_serial_driver))) 5417 if ((e1 = tty_unregister_driver(cy_serial_driver)))
5508 printk("cyc: failed to unregister Cyclades serial driver(%d)\n", 5418 printk(KERN_ERR "failed to unregister Cyclades serial "
5509 e1); 5419 "driver(%d)\n", e1);
5510 5420
5511 put_tty_driver(cy_serial_driver); 5421 put_tty_driver(cy_serial_driver);
5512 5422