summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2003-04-23 04:18:48 -0700
committerChristoph Hellwig <hch@lst.de>2003-04-23 04:18:48 -0700
commit07462df3687e6a58846911460f4f4833fbe3d587 (patch)
tree1150b6d6b46e656d36e60cab8d01ef12127e8924
parent2dca0cd5b1ad40e8ebbc0220d3e3a21f3d3348da (diff)
[PATCH] tty cleanups (5/12)
new field - tty->tty_name; initialized to <driver->name><tty index+driver->base_name> when we allocate tty_struct. Drivers code switched to use of that beast (in debugging printks, mostly). Large, but trivial.
-rw-r--r--arch/cris/drivers/serial.c3
-rw-r--r--arch/ia64/hp/sim/simserial.c3
-rw-r--r--arch/mips/au1000/common/serial.c47
-rw-r--r--arch/mips/baget/vacserial.c47
-rw-r--r--arch/ppc/4xx_io/serial_sicc.c2
-rw-r--r--arch/ppc/8260_io/uart.c41
-rw-r--r--arch/ppc/8xx_io/uart.c41
-rw-r--r--drivers/char/amiserial.c47
-rw-r--r--drivers/char/cyclades.c40
-rw-r--r--drivers/char/epca.c2
-rw-r--r--drivers/char/esp.c45
-rw-r--r--drivers/char/ip2main.c9
-rw-r--r--drivers/char/isicom.c36
-rw-r--r--drivers/char/istallion.c4
-rw-r--r--drivers/char/moxa.c4
-rw-r--r--drivers/char/n_hdlc.c4
-rw-r--r--drivers/char/pcmcia/synclink_cs.c40
-rw-r--r--drivers/char/pcxx.c2
-rw-r--r--drivers/char/riscom8.c36
-rw-r--r--drivers/char/rocket.c59
-rw-r--r--drivers/char/serial167.c86
-rw-r--r--drivers/char/specialix.c36
-rw-r--r--drivers/char/stallion.c4
-rw-r--r--drivers/char/sx.c6
-rw-r--r--drivers/char/synclink.c40
-rw-r--r--drivers/char/synclinkmp.c40
-rw-r--r--drivers/char/tty_io.c43
-rw-r--r--drivers/isdn/i4l/isdn_tty.c36
-rw-r--r--drivers/macintosh/macserial.c46
-rw-r--r--drivers/net/irda/irtty.c8
-rw-r--r--drivers/s390/net/ctctty.c38
-rw-r--r--drivers/sbus/char/aurora.c36
-rw-r--r--drivers/serial/68328serial.c38
-rw-r--r--drivers/serial/68360serial.c41
-rw-r--r--drivers/serial/core.c4
-rw-r--r--drivers/serial/mcfserial.c41
-rw-r--r--drivers/sgi/char/sgiserial.c41
-rw-r--r--drivers/tc/zs.c47
-rw-r--r--include/linux/tty.h1
39 files changed, 553 insertions, 591 deletions
diff --git a/arch/cris/drivers/serial.c b/arch/cris/drivers/serial.c
index adf717dce819..c93bcd2ecb95 100644
--- a/arch/cris/drivers/serial.c
+++ b/arch/cris/drivers/serial.c
@@ -3302,8 +3302,7 @@ rs_open(struct tty_struct *tty, struct file * filp)
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("[%d] rs_open %s%d, count = %d\n", current->pid,
- tty->driver->name, info->line,
+ printk("[%d] rs_open %s, count = %d\n", current->pid, tty->name,
info->count);
#endif
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index dd723bf24654..48829c2b7e5f 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -893,8 +893,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
info->tty = tty;
#ifdef SIMSERIAL_DEBUG
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->state->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
diff --git a/arch/mips/au1000/common/serial.c b/arch/mips/au1000/common/serial.c
index d2d1eb2280d8..63d53dec081d 100644
--- a/arch/mips/au1000/common/serial.c
+++ b/arch/mips/au1000/common/serial.c
@@ -195,7 +195,7 @@ static struct termios *serial_termios_locked[NR_PORTS];
#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
- cdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
@@ -218,7 +218,7 @@ static struct semaphore tmp_buf_sem = MUTEX;
static inline int serial_paranoia_check(struct async_struct *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -227,11 +227,11 @@ static inline int serial_paranoia_check(struct async_struct *info,
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -273,7 +273,7 @@ static void rs_stop(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -289,7 +289,7 @@ static void rs_start(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
save_flags(flags); cli();
@@ -1144,7 +1144,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty || !info->xmit.buf)
@@ -1168,7 +1168,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit.head == info->xmit.tail
@@ -1190,7 +1190,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit.buf || !tmp_buf)
@@ -1264,7 +1264,7 @@ static int rs_write_room(struct tty_struct *tty)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
}
@@ -1273,7 +1273,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
}
@@ -1283,7 +1283,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
save_flags(flags); cli();
info->xmit.head = info->xmit.tail = 0;
@@ -1305,7 +1305,7 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_send_char"))
return;
info->x_char = ch;
@@ -1335,7 +1335,7 @@ static void rs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1360,7 +1360,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1697,7 +1697,7 @@ static void rs_break(struct tty_struct *tty, int break_state)
struct async_struct * info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_break"))
+ if (serial_paranoia_check(info, tty->name, "rs_break"))
return;
if (!CONFIGURED_SERIAL_PORT(info))
@@ -1720,7 +1720,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
struct serial_icounter_struct icount;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1887,7 +1887,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct serial_state *state;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
state = info->state;
@@ -1991,7 +1991,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
unsigned long orig_jiffies, char_time;
int lsr;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
if (info->state->type == PORT_UNKNOWN)
@@ -2055,7 +2055,7 @@ static void rs_hangup(struct tty_struct *tty)
struct async_struct * info = (struct async_struct *)tty->driver_data;
struct serial_state *state = info->state;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
state = info->state;
@@ -2276,14 +2276,13 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
}
tty->driver_data = info;
info->tty = tty;
- if (serial_paranoia_check(info, tty->device, "rs_open")) {
+ if (serial_paranoia_check(info, tty->name, "rs_open")) {
MOD_DEC_USE_COUNT;
return -ENODEV;
}
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->state->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
@@ -2353,7 +2352,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...", info->line);
+ printk("rs_open %s successful...", tty->name);
#endif
return 0;
}
diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c
index 8d11b469ae9b..f8eb66c8f56a 100644
--- a/arch/mips/baget/vacserial.c
+++ b/arch/mips/baget/vacserial.c
@@ -29,7 +29,7 @@
#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
#define DBG_CNT(s) baget_printk("(%s):[%x] refc=%d, serc=%d, ttyc=%d-> %s\n", \
- cdevname(tty->device),(info->flags),serial_refcount,info->count,tty->count,s)
+ tty->name,(info->flags),serial_refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
@@ -164,7 +164,7 @@ static unsigned char *tmp_buf;
static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct async_struct *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -173,11 +173,11 @@ static inline int serial_paranoia_check(struct async_struct *info,
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -266,7 +266,7 @@ static void rs_stop(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -282,7 +282,7 @@ static void rs_start(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
save_flags(flags); cli();
@@ -1023,7 +1023,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty || !info->xmit_buf)
@@ -1046,7 +1046,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1066,7 +1066,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit_buf || !tmp_buf)
@@ -1134,7 +1134,7 @@ static int rs_write_room(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -1146,7 +1146,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -1156,7 +1156,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
save_flags(flags); cli();
@@ -1177,7 +1177,7 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_send_char"))
return;
info->x_char = ch;
@@ -1207,7 +1207,7 @@ static void rs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1224,7 +1224,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1456,7 +1456,7 @@ static void rs_break(struct tty_struct *tty, int break_state)
struct async_struct * info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_break"))
+ if (serial_paranoia_check(info, tty->name, "rs_break"))
return;
if (!info->port)
@@ -1482,7 +1482,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
struct serial_icounter_struct *p_cuser; /* user space */
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1640,7 +1640,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct serial_state *state;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
state = info->state;
@@ -1747,7 +1747,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
unsigned long orig_jiffies, char_time;
int lsr;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
if (info->state->type == PORT_UNKNOWN)
@@ -1802,7 +1802,7 @@ static void rs_hangup(struct tty_struct *tty)
struct async_struct * info = (struct async_struct *)tty->driver_data;
struct serial_state *state = info->state;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
state = info->state;
@@ -2009,14 +2009,13 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
}
tty->driver_data = info;
info->tty = tty;
- if (serial_paranoia_check(info, tty->device, "rs_open")) {
+ if (serial_paranoia_check(info, tty->name, "rs_open")) {
/* MOD_DEC_USE_COUNT; "info->tty" will cause this */
return -ENODEV;
}
#ifdef SERIAL_DEBUG_OPEN
- baget_printk("rs_open %s%d, count = %d\n",
- tty->driver->name, info->line,
+ baget_printk("rs_open %s, count = %d\n", tty->name,
info->state->count);
#endif
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
@@ -2088,7 +2087,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- baget_printk("rs_open ttys%d successful...", info->line);
+ baget_printk("rs_open %s successful...", tty->name);
#endif
return 0;
}
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
index a01fef2c69d7..97f3470d9bc8 100644
--- a/arch/ppc/4xx_io/serial_sicc.c
+++ b/arch/ppc/4xx_io/serial_sicc.c
@@ -1482,7 +1482,7 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp)
state->count = 1;
}
if (--state->count < 0) {
- printk("rs_close: bad serial port count for %s%d: %d\n", tty->driver->name, info->state->line, state->count);
+ printk("rs_close: bad serial port count for %s: %d\n", tty->name, state->count);
state->count = 0;
}
if (state->count) {
diff --git a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c
index 133ed20eb356..efb16b89177d 100644
--- a/arch/ppc/8260_io/uart.c
+++ b/arch/ppc/8260_io/uart.c
@@ -219,7 +219,7 @@ static void change_speed(ser_info_t *info);
static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout);
static inline int serial_paranoia_check(ser_info_t *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -228,11 +228,11 @@ static inline int serial_paranoia_check(ser_info_t *info,
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -265,7 +265,7 @@ static void rs_8xx_stop(struct tty_struct *tty)
volatile scc_t *sccp;
volatile smc_t *smcp;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -288,7 +288,7 @@ static void rs_8xx_start(struct tty_struct *tty)
volatile scc_t *sccp;
volatile smc_t *smcp;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -964,7 +964,7 @@ static void rs_8xx_put_char(struct tty_struct *tty, unsigned char ch)
ser_info_t *info = (ser_info_t *)tty->driver_data;
volatile cbd_t *bdp;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty)
@@ -995,7 +995,7 @@ static int rs_8xx_write(struct tty_struct * tty, int from_user,
ser_info_t *info = (ser_info_t *)tty->driver_data;
volatile cbd_t *bdp;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty)
@@ -1047,7 +1047,7 @@ static int rs_8xx_write_room(struct tty_struct *tty)
ser_info_t *info = (ser_info_t *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
if ((info->tx_cur->cbd_sc & BD_SC_READY) == 0) {
@@ -1067,7 +1067,7 @@ static int rs_8xx_chars_in_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return 0;
}
@@ -1076,7 +1076,7 @@ static void rs_8xx_flush_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
/* There is nothing to "flush", whatever we gave the CPM
@@ -1099,7 +1099,7 @@ static void rs_8xx_send_xchar(struct tty_struct *tty, char ch)
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_send_char"))
return;
bdp = info->tx_cur;
@@ -1137,7 +1137,7 @@ static void rs_8xx_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1163,7 +1163,7 @@ static void rs_8xx_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1414,7 +1414,7 @@ static int rs_8xx_ioctl(struct tty_struct *tty, struct file * file,
struct async_icount cnow; /* kernel counter temps */
struct serial_icounter_struct *p_cuser; /* user space */
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
@@ -1619,7 +1619,7 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
volatile smc_t *smcp;
volatile scc_t *sccp;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
state = info->state;
@@ -1732,7 +1732,7 @@ static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout)
/*int lsr;*/
volatile cbd_t *bdp;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
#ifdef maybe
@@ -1789,7 +1789,7 @@ static void rs_8xx_hangup(struct tty_struct *tty)
ser_info_t *info = (ser_info_t *)tty->driver_data;
struct serial_state *state = info->state;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
state = info->state;
@@ -1981,12 +1981,11 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
retval = get_async_struct(line, &info);
if (retval)
return retval;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->state->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif
tty->driver_data = info;
info->tty = tty;
@@ -2021,7 +2020,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...", info->line);
+ printk("rs_open %s successful...", line);
#endif
return 0;
}
diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c
index 785dd8e3e58f..7e794775d6bb 100644
--- a/arch/ppc/8xx_io/uart.c
+++ b/arch/ppc/8xx_io/uart.c
@@ -233,7 +233,7 @@ static void change_speed(ser_info_t *info);
static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout);
static inline int serial_paranoia_check(ser_info_t *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -242,11 +242,11 @@ static inline int serial_paranoia_check(ser_info_t *info,
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -279,7 +279,7 @@ static void rs_8xx_stop(struct tty_struct *tty)
volatile scc_t *sccp;
volatile smc_t *smcp;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -303,7 +303,7 @@ static void rs_8xx_start(struct tty_struct *tty)
volatile scc_t *sccp;
volatile smc_t *smcp;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
idx = PORT_NUM(info->state->smc_scc_num);
@@ -1043,7 +1043,7 @@ static void rs_8xx_put_char(struct tty_struct *tty, unsigned char ch)
volatile cbd_t *bdp;
unsigned char *cp;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty)
@@ -1082,7 +1082,7 @@ static int rs_8xx_write(struct tty_struct * tty, int from_user,
return ret;
#endif
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty)
@@ -1135,7 +1135,7 @@ static int rs_8xx_write_room(struct tty_struct *tty)
ser_info_t *info = (ser_info_t *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
if ((info->tx_cur->cbd_sc & BD_SC_READY) == 0) {
@@ -1155,7 +1155,7 @@ static int rs_8xx_chars_in_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return 0;
}
@@ -1164,7 +1164,7 @@ static void rs_8xx_flush_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
/* There is nothing to "flush", whatever we gave the CPM
@@ -1188,7 +1188,7 @@ static void rs_8xx_send_xchar(struct tty_struct *tty, char ch)
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_send_char"))
return;
bdp = info->tx_cur;
@@ -1227,7 +1227,7 @@ static void rs_8xx_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1253,7 +1253,7 @@ static void rs_8xx_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1462,7 +1462,7 @@ static int rs_8xx_ioctl(struct tty_struct *tty, struct file * file,
struct async_icount cnow; /* kernel counter temps */
struct serial_icounter_struct *p_cuser; /* user space */
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
@@ -1667,7 +1667,7 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
volatile smc_t *smcp;
volatile scc_t *sccp;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
state = info->state;
@@ -1781,7 +1781,7 @@ static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout)
/*int lsr;*/
volatile cbd_t *bdp;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
#ifdef maybe
@@ -1849,7 +1849,7 @@ static void rs_8xx_hangup(struct tty_struct *tty)
ser_info_t *info = (ser_info_t *)tty->driver_data;
struct serial_state *state = info->state;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
state = info->state;
@@ -2041,12 +2041,11 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
retval = get_async_struct(line, &info);
if (retval)
return retval;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->state->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif
tty->driver_data = info;
info->tty = tty;
@@ -2082,7 +2081,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...", info->line);
+ printk("rs_open %s successful...", tty->name);
#endif
return 0;
}
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index b3e154117184..a4d7b8e9092e 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -50,7 +50,7 @@
#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
- cdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
@@ -153,7 +153,7 @@ static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct async_struct *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -162,11 +162,11 @@ static inline int serial_paranoia_check(struct async_struct *info,
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -208,7 +208,7 @@ static void rs_stop(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
local_irq_save(flags);
@@ -228,7 +228,7 @@ static void rs_start(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
local_irq_save(flags);
@@ -881,7 +881,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty || !info->xmit.buf)
@@ -905,7 +905,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit.head == info->xmit.tail
@@ -931,7 +931,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit.buf || !tmp_buf)
@@ -1009,7 +1009,7 @@ static int rs_write_room(struct tty_struct *tty)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
}
@@ -1018,7 +1018,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
}
@@ -1028,7 +1028,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
local_irq_save(flags);
info->xmit.head = info->xmit.tail = 0;
@@ -1048,7 +1048,7 @@ static void rs_send_xchar(struct tty_struct *tty, char ch)
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_send_char"))
return;
info->x_char = ch;
@@ -1089,7 +1089,7 @@ static void rs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1114,7 +1114,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1323,7 +1323,7 @@ static void rs_break(struct tty_struct *tty, int break_state)
struct async_struct * info = (struct async_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_break"))
+ if (serial_paranoia_check(info, tty->name, "rs_break"))
return;
local_irq_save(flags);
@@ -1344,7 +1344,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
struct serial_icounter_struct icount;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1519,7 +1519,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct serial_state *state;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
state = info->state;
@@ -1628,7 +1628,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
unsigned long orig_jiffies, char_time;
int lsr;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
if (info->xmit_fifo_size == 0)
@@ -1689,7 +1689,7 @@ static void rs_hangup(struct tty_struct *tty)
struct async_struct * info = (struct async_struct *)tty->driver_data;
struct serial_state *state = info->state;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
state = info->state;
@@ -1907,12 +1907,11 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
}
tty->driver_data = info;
info->tty = tty;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->state->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
@@ -1971,7 +1970,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...", info->line);
+ printk("rs_open %s successful...", tty->name);
#endif
return 0;
}
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index ac41f703148a..58008cf9a241 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -892,7 +892,7 @@ static struct timer_list cyz_rx_full_timer[NR_PORTS];
static inline int
serial_paranoia_check(struct cyclades_port *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -903,18 +903,18 @@ serial_paranoia_check(struct cyclades_port *info,
"cyc Warning: cyclades_port out of range for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if( (long)info < (long)(&cy_port[0])
|| (long)(&cy_port[NR_PORTS]) < (long)info ){
- printk(badrange, cdevname(device), routine);
+ printk(badrange, name, routine);
return 1;
}
if (info->magic != CYCLADES_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -2634,7 +2634,7 @@ cy_open(struct tty_struct *tty, struct file * filp)
#endif
tty->driver_data = info;
info->tty = tty;
- if (serial_paranoia_check(info, tty->device, "cy_open")){
+ if (serial_paranoia_check(info, tty->name, "cy_open")){
return -ENODEV;
}
#ifdef CY_DEBUG_OPEN
@@ -2711,7 +2711,7 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout)
int card,chip,channel,index;
unsigned long orig_jiffies, char_time;
- if (serial_paranoia_check(info, tty->device, "cy_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "cy_wait_until_sent"))
return;
if (info->xmit_fifo_size == 0)
@@ -2795,7 +2795,7 @@ cy_close(struct tty_struct *tty, struct file *filp)
printk("cyc:cy_close ttyC%d\n", info->line);
#endif
- if (!info || serial_paranoia_check(info, tty->device, "cy_close")){
+ if (!info || serial_paranoia_check(info, tty->name, "cy_close")){
return;
}
@@ -2961,7 +2961,7 @@ cy_write(struct tty_struct * tty, int from_user,
printk("cyc:cy_write ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_write")){
+ if (serial_paranoia_check(info, tty->name, "cy_write")){
return 0;
}
@@ -3047,7 +3047,7 @@ cy_put_char(struct tty_struct *tty, unsigned char ch)
printk("cyc:cy_put_char ttyC%d\n", info->line);
#endif
- if (serial_paranoia_check(info, tty->device, "cy_put_char"))
+ if (serial_paranoia_check(info, tty->name, "cy_put_char"))
return;
if (!tty || !info->xmit_buf)
@@ -3081,7 +3081,7 @@ cy_flush_chars(struct tty_struct *tty)
printk("cyc:cy_flush_chars ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "cy_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped
@@ -3108,7 +3108,7 @@ cy_write_room(struct tty_struct *tty)
printk("cyc:cy_write_room ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_write_room"))
+ if (serial_paranoia_check(info, tty->name, "cy_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -3123,7 +3123,7 @@ cy_chars_in_buffer(struct tty_struct *tty)
struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
int card, channel;
- if (serial_paranoia_check(info, tty->device, "cy_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer"))
return 0;
card = info->card;
@@ -4012,7 +4012,7 @@ cy_break(struct tty_struct *tty, int break_state)
struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "cy_break"))
+ if (serial_paranoia_check(info, tty->name, "cy_break"))
return;
CY_LOCK(info, flags);
@@ -4231,7 +4231,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
int ret_val = 0;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "cy_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "cy_ioctl"))
return -ENODEV;
#ifdef CY_DEBUG_OTHER
@@ -4469,7 +4469,7 @@ cy_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty), info->line);
#endif
- if (serial_paranoia_check(info, tty->device, "cy_throttle")){
+ if (serial_paranoia_check(info, tty->name, "cy_throttle")){
return;
}
@@ -4525,7 +4525,7 @@ cy_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty), info->line);
#endif
- if (serial_paranoia_check(info, tty->device, "cy_unthrottle")){
+ if (serial_paranoia_check(info, tty->name, "cy_unthrottle")){
return;
}
@@ -4579,7 +4579,7 @@ cy_stop(struct tty_struct *tty)
printk("cyc:cy_stop ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_stop"))
+ if (serial_paranoia_check(info, tty->name, "cy_stop"))
return;
cinfo = &cy_card[info->card];
@@ -4619,7 +4619,7 @@ cy_start(struct tty_struct *tty)
printk("cyc:cy_start ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_start"))
+ if (serial_paranoia_check(info, tty->name, "cy_start"))
return;
cinfo = &cy_card[info->card];
@@ -4657,7 +4657,7 @@ cy_flush_buffer(struct tty_struct *tty)
printk("cyc:cy_flush_buffer ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "cy_flush_buffer"))
return;
card = info->card;
@@ -4696,7 +4696,7 @@ cy_hangup(struct tty_struct *tty)
printk("cyc:cy_hangup ttyC%d\n", info->line); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_hangup"))
+ if (serial_paranoia_check(info, tty->name, "cy_hangup"))
return;
cy_flush_buffer(tty);
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 1992ab437f0a..6aea1c76213a 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -2888,7 +2888,7 @@ static void receive_data(struct channel *ch)
if (bc->orun)
{
bc->orun = 0;
- printk(KERN_WARNING "overrun! DigiBoard device minor = %d\n",minor(tty->device));
+ printk(KERN_WARNING "overrun! DigiBoard device %s\n",tty->name);
}
rxwinon(ch);
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 59391d5dcbe9..e61ca3935ecf 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -135,7 +135,7 @@ static int serial_refcount;
#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)
#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \
- cdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
@@ -175,7 +175,7 @@ static unsigned char *tmp_buf;
static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct esp_struct *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char badmagic[] = KERN_WARNING
@@ -184,11 +184,11 @@ static inline int serial_paranoia_check(struct esp_struct *info,
"Warning: null esp_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != ESP_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -219,7 +219,7 @@ static void rs_stop(struct tty_struct *tty)
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -237,7 +237,7 @@ static void rs_start(struct tty_struct *tty)
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
save_flags(flags); cli();
@@ -1256,7 +1256,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty || !info->xmit_buf)
@@ -1279,7 +1279,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped || !info->xmit_buf)
@@ -1301,7 +1301,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit_buf || !tmp_buf)
@@ -1368,7 +1368,7 @@ static int rs_write_room(struct tty_struct *tty)
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = ESP_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -1380,7 +1380,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -1389,7 +1389,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
{
struct esp_struct *info = (struct esp_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1418,7 +1418,7 @@ static void rs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
cli();
@@ -1440,7 +1440,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
cli();
@@ -1841,7 +1841,7 @@ static void esp_break(struct tty_struct *tty, int break_state)
struct esp_struct * info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "esp_break"))
+ if (serial_paranoia_check(info, tty->name, "esp_break"))
return;
save_flags(flags); cli();
@@ -1864,7 +1864,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
struct async_icount cprev, cnow; /* kernel counter temps */
struct serial_icounter_struct *p_cuser; /* user space */
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -2037,7 +2037,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct esp_struct * info = (struct esp_struct *)tty->driver_data;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
save_flags(flags); cli();
@@ -2140,7 +2140,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
unsigned long orig_jiffies, char_time;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
orig_jiffies = jiffies;
@@ -2179,7 +2179,7 @@ static void esp_hangup(struct tty_struct *tty)
{
struct esp_struct * info = (struct esp_struct *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "esp_hangup"))
+ if (serial_paranoia_check(info, tty->name, "esp_hangup"))
return;
rs_flush_buffer(tty);
@@ -2366,13 +2366,12 @@ static int esp_open(struct tty_struct *tty, struct file * filp)
info = info->next_port;
if (!info) {
- serial_paranoia_check(info, tty->device, "esp_open");
+ serial_paranoia_check(info, tty->name, "esp_open");
return -ENODEV;
}
#ifdef SERIAL_DEBUG_OPEN
- printk("esp_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->count);
+ printk("esp_open %s, count = %d\n", tty->name, info->count);
#endif
MOD_INC_USE_COUNT;
info->count++;
@@ -2413,7 +2412,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("esp_open ttys%d successful...", info->line);
+ printk("esp_open %s successful...", tty->name);
#endif
return 0;
}
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index f071fdb3411a..aa417bd7ca3a 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -366,7 +366,7 @@ static int tracewrap;
#if defined(MODULE) && defined(IP2DEBUG_OPEN)
#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] refc=%d, ttyc=%d, modc=%x -> %s\n", \
- cdevname(tty->device),(pCh->flags),ref_count, \
+ tty->name,(pCh->flags),ref_count, \
tty->count,/*GET_USE_COUNT(module)*/0,s)
#else
#define DBG_CNT(s)
@@ -1578,9 +1578,8 @@ ip2_open( PTTY tty, struct file *pFile )
#ifdef IP2DEBUG_OPEN
printk(KERN_DEBUG \
- "IP2:open(tty=%p,pFile=%p):dev=%x,maj=%d,min=%d,ch=%d,idx=%d\n",
- tty, pFile, tty->device, major(tty->device), minor(tty->device),
- pCh->infl.hd.i2sChannel, pCh->port_index);
+ "IP2:open(tty=%p,pFile=%p):dev=%s,ch=%d,idx=%d\n",
+ tty, pFile, tty->name, pCh->infl.hd.i2sChannel, pCh->port_index);
open_sanity_check ( pCh, pCh->pMyBord );
#endif
@@ -1771,7 +1770,7 @@ ip2_close( PTTY tty, struct file *pFile )
ip2trace (CHANN, ITRC_CLOSE, ITRC_ENTER, 0 );
#ifdef IP2DEBUG_OPEN
- printk(KERN_DEBUG "IP2:close ttyF%02X:\n",minor(tty->device));
+ printk(KERN_DEBUG "IP2:close %s:\n",tty->name);
#endif
if ( tty_hung_up_p ( pFile ) ) {
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 3140e956ee37..8487dbbc171b 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -338,7 +338,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
*
*/
-static inline int isicom_paranoia_check(struct isi_port const * port, kdev_t dev,
+static inline int isicom_paranoia_check(struct isi_port const * port, char *name,
const char * routine)
{
#ifdef ISICOM_DEBUG
@@ -347,11 +347,11 @@ static inline int isicom_paranoia_check(struct isi_port const * port, kdev_t dev
static const char * badport =
KERN_WARNING "ISICOM: Warning: NULL isicom port for dev %s in %s.\n";
if (!port) {
- printk(badport, cdevname(dev), routine);
+ printk(badport, name, routine);
return 1;
}
if (port->magic != ISICOM_MAGIC) {
- printk(badmagic, cdevname(dev), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -1049,7 +1049,7 @@ static int isicom_open(struct tty_struct * tty, struct file * filp)
return -ENODEV;
}
port = &isi_ports[line];
- if (isicom_paranoia_check(port, tty->device, "isicom_open"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_open"))
return -ENODEV;
#ifdef ISICOM_DEBUG
@@ -1146,7 +1146,7 @@ static void isicom_close(struct tty_struct * tty, struct file * filp)
if (!port)
return;
- if (isicom_paranoia_check(port, tty->device, "isicom_close"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_close"))
return;
#ifdef ISICOM_DEBUG
@@ -1232,7 +1232,7 @@ static int isicom_write(struct tty_struct * tty, int from_user,
printk(KERN_DEBUG "ISICOM: isicom_write for port%d: %d bytes.\n",
port->channel+1, count);
#endif
- if (isicom_paranoia_check(port, tty->device, "isicom_write"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_write"))
return 0;
if (!tty || !port->xmit_buf || !tmp_buf)
@@ -1290,7 +1290,7 @@ static void isicom_put_char(struct tty_struct * tty, unsigned char ch)
struct isi_port * port = (struct isi_port *) tty->driver_data;
unsigned long flags;
- if (isicom_paranoia_check(port, tty->device, "isicom_put_char"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_put_char"))
return;
if (!tty || !port->xmit_buf)
@@ -1317,7 +1317,7 @@ static void isicom_flush_chars(struct tty_struct * tty)
{
struct isi_port * port = (struct isi_port *) tty->driver_data;
- if (isicom_paranoia_check(port, tty->device, "isicom_flush_chars"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_flush_chars"))
return;
if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1334,7 +1334,7 @@ static int isicom_write_room(struct tty_struct * tty)
{
struct isi_port * port = (struct isi_port *) tty->driver_data;
int free;
- if (isicom_paranoia_check(port, tty->device, "isicom_write_room"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_write_room"))
return 0;
free = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1347,7 +1347,7 @@ static int isicom_write_room(struct tty_struct * tty)
static int isicom_chars_in_buffer(struct tty_struct * tty)
{
struct isi_port * port = (struct isi_port *) tty->driver_data;
- if (isicom_paranoia_check(port, tty->device, "isicom_chars_in_buffer"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_chars_in_buffer"))
return 0;
return port->xmit_cnt;
}
@@ -1495,7 +1495,7 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp,
struct isi_port * port = (struct isi_port *) tty->driver_data;
int retval;
- if (isicom_paranoia_check(port, tty->device, "isicom_ioctl"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
return -ENODEV;
switch(cmd) {
@@ -1556,7 +1556,7 @@ static void isicom_set_termios(struct tty_struct * tty, struct termios * old_ter
struct isi_port * port = (struct isi_port *) tty->driver_data;
unsigned long flags;
- if (isicom_paranoia_check(port, tty->device, "isicom_set_termios"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_set_termios"))
return;
if (tty->termios->c_cflag == old_termios->c_cflag &&
@@ -1581,7 +1581,7 @@ static void isicom_throttle(struct tty_struct * tty)
struct isi_board * card = port->card;
unsigned long flags;
- if (isicom_paranoia_check(port, tty->device, "isicom_throttle"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_throttle"))
return;
/* tell the card that this port cannot handle any more data for now */
@@ -1598,7 +1598,7 @@ static void isicom_unthrottle(struct tty_struct * tty)
struct isi_board * card = port->card;
unsigned long flags;
- if (isicom_paranoia_check(port, tty->device, "isicom_unthrottle"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_unthrottle"))
return;
/* tell the card that this port is ready to accept more data */
@@ -1613,7 +1613,7 @@ static void isicom_stop(struct tty_struct * tty)
{
struct isi_port * port = (struct isi_port *) tty->driver_data;
- if (isicom_paranoia_check(port, tty->device, "isicom_stop"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_stop"))
return;
/* this tells the transmitter not to consider this port for
@@ -1626,7 +1626,7 @@ static void isicom_start(struct tty_struct * tty)
{
struct isi_port * port = (struct isi_port *) tty->driver_data;
- if (isicom_paranoia_check(port, tty->device, "isicom_start"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_start"))
return;
/* this tells the transmitter to consider this port for
@@ -1650,7 +1650,7 @@ static void isicom_hangup(struct tty_struct * tty)
{
struct isi_port * port = (struct isi_port *) tty->driver_data;
- if (isicom_paranoia_check(port, tty->device, "isicom_hangup"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_hangup"))
return;
isicom_shutdown_port(port);
@@ -1666,7 +1666,7 @@ static void isicom_flush_buffer(struct tty_struct * tty)
struct isi_port * port = (struct isi_port *) tty->driver_data;
unsigned long flags;
- if (isicom_paranoia_check(port, tty->device, "isicom_flush_buffer"))
+ if (isicom_paranoia_check(port, tty->name, "isicom_flush_buffer"))
return;
save_flags(flags); cli();
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 5211ec885d84..b4feb4d94215 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -1031,8 +1031,8 @@ static int stli_open(struct tty_struct *tty, struct file *filp)
int brdnr, portnr, rc;
#if DEBUG
- printk("stli_open(tty=%x,filp=%x): device=%x\n", (int) tty,
- (int) filp, tty->device);
+ printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty,
+ (int) filp, tty->name);
#endif
minordev = minor(tty->device);
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index f3f7a71e0506..22755ea47f18 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -644,8 +644,8 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
ch->count = 1;
}
if (--ch->count < 0) {
- printk("moxa_close: bad serial port count, minor=%d\n",
- minor(tty->device));
+ printk("moxa_close: bad serial port count, device=%s\n",
+ tty->name);
ch->count = 0;
}
if (ch->count) {
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 6e8198c4988b..fabe928307ed 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -319,9 +319,9 @@ static int n_hdlc_tty_open (struct tty_struct *tty)
struct n_hdlc *n_hdlc = tty2n_hdlc (tty);
if (debuglevel >= DEBUG_LEVEL_INFO)
- printk("%s(%d)n_hdlc_tty_open() called (major=%u,minor=%u)\n",
+ printk("%s(%d)n_hdlc_tty_open() called (device=%s)\n",
__FILE__,__LINE__,
- major(tty->device), minor(tty->device));
+ tty->name);
/* There should not be an existing table for this slot. */
if (n_hdlc) {
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c2d58fd49aa6..751c1535d605 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -848,7 +848,7 @@ static int mgslpc_event(event_t event, int priority,
}
static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef MGSLPC_PARANOIA_CHECK
static const char *badmagic =
@@ -857,11 +857,11 @@ static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
"Warning: null mgslpc_info for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != MGSLPC_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -901,7 +901,7 @@ static void tx_pause(struct tty_struct *tty)
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned long flags;
- if (mgslpc_paranoia_check(info, tty->device, "tx_pause"))
+ if (mgslpc_paranoia_check(info, tty->name, "tx_pause"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("tx_pause(%s)\n",info->device_name);
@@ -917,7 +917,7 @@ static void tx_release(struct tty_struct *tty)
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned long flags;
- if (mgslpc_paranoia_check(info, tty->device, "tx_release"))
+ if (mgslpc_paranoia_check(info, tty->name, "tx_release"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("tx_release(%s)\n",info->device_name);
@@ -1703,7 +1703,7 @@ static void mgslpc_put_char(struct tty_struct *tty, unsigned char ch)
__FILE__,__LINE__,ch,info->device_name);
}
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_put_char"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char"))
return;
if (!tty || !info->tx_buf)
@@ -1734,7 +1734,7 @@ static void mgslpc_flush_chars(struct tty_struct *tty)
printk( "%s(%d):mgslpc_flush_chars() entry on %s tx_count=%d\n",
__FILE__,__LINE__,info->device_name,info->tx_count);
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_flush_chars"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_chars"))
return;
if (info->tx_count <= 0 || tty->stopped ||
@@ -1773,7 +1773,7 @@ static int mgslpc_write(struct tty_struct * tty, int from_user,
printk( "%s(%d):mgslpc_write(%s) count=%d\n",
__FILE__,__LINE__,info->device_name,count);
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_write") ||
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write") ||
!tty || !info->tx_buf)
goto cleanup;
@@ -1835,7 +1835,7 @@ static int mgslpc_write_room(struct tty_struct *tty)
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
int ret;
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_write_room"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_write_room"))
return 0;
if (info->params.mode == MGSL_MODE_HDLC) {
@@ -1867,7 +1867,7 @@ static int mgslpc_chars_in_buffer(struct tty_struct *tty)
printk("%s(%d):mgslpc_chars_in_buffer(%s)\n",
__FILE__,__LINE__, info->device_name );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_chars_in_buffer"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_chars_in_buffer"))
return 0;
if (info->params.mode == MGSL_MODE_HDLC)
@@ -1893,7 +1893,7 @@ static void mgslpc_flush_buffer(struct tty_struct *tty)
printk("%s(%d):mgslpc_flush_buffer(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_flush_buffer"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_flush_buffer"))
return;
spin_lock_irqsave(&info->lock,flags);
@@ -1918,7 +1918,7 @@ static void mgslpc_send_xchar(struct tty_struct *tty, char ch)
printk("%s(%d):mgslpc_send_xchar(%s,%d)\n",
__FILE__,__LINE__, info->device_name, ch );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_send_xchar"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_send_xchar"))
return;
info->x_char = ch;
@@ -1941,7 +1941,7 @@ static void mgslpc_throttle(struct tty_struct * tty)
printk("%s(%d):mgslpc_throttle(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_throttle"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_throttle"))
return;
if (I_IXOFF(tty))
@@ -1966,7 +1966,7 @@ static void mgslpc_unthrottle(struct tty_struct * tty)
printk("%s(%d):mgslpc_unthrottle(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_unthrottle"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -2393,7 +2393,7 @@ static void mgslpc_break(struct tty_struct *tty, int break_state)
printk("%s(%d):mgslpc_break(%s,%d)\n",
__FILE__,__LINE__, info->device_name, break_state);
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_break"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_break"))
return;
spin_lock_irqsave(&info->lock,flags);
@@ -2424,7 +2424,7 @@ static int mgslpc_ioctl(struct tty_struct *tty, struct file * file,
printk("%s(%d):mgslpc_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
info->device_name, cmd );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_ioctl"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -2560,7 +2560,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
{
MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
- if (!info || mgslpc_paranoia_check(info, tty->device, "mgslpc_close"))
+ if (!info || mgslpc_paranoia_check(info, tty->name, "mgslpc_close"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2659,7 +2659,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout)
printk("%s(%d):mgslpc_wait_until_sent(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_wait_until_sent"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_wait_until_sent"))
return;
if (!(info->flags & ASYNC_INITIALIZED))
@@ -2721,7 +2721,7 @@ static void mgslpc_hangup(struct tty_struct *tty)
printk("%s(%d):mgslpc_hangup(%s)\n",
__FILE__,__LINE__, info->device_name );
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_hangup"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_hangup"))
return;
mgslpc_flush_buffer(tty);
@@ -2887,7 +2887,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
tty->driver_data = info;
info->tty = tty;
- if (mgslpc_paranoia_check(info, tty->device, "mgslpc_open"))
+ if (mgslpc_paranoia_check(info, tty->name, "mgslpc_open"))
return -ENODEV;
if (debug_level >= DEBUG_LEVEL_INFO)
diff --git a/drivers/char/pcxx.c b/drivers/char/pcxx.c
index 200660e3101a..fda809c33b84 100644
--- a/drivers/char/pcxx.c
+++ b/drivers/char/pcxx.c
@@ -2070,7 +2070,7 @@ static void receive_data(struct channel *ch)
if(bc->orun) {
bc->orun = 0;
- printk("overrun! DigiBoard device minor=%d\n",minor(tty->device));
+ printk("overrun! DigiBoard device %s\n", tty->name);
}
rxwinon(ch);
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 9444ca8dec47..1c7b49883f00 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -131,7 +131,7 @@ static unsigned short rc_ioport[] = {
static inline int rc_paranoia_check(struct riscom_port const * port,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef RISCOM_PARANOIA_CHECK
static const char badmagic[] = KERN_INFO
@@ -140,11 +140,11 @@ static inline int rc_paranoia_check(struct riscom_port const * port,
"rc: Warning: null riscom port for device %s in %s\n";
if (!port) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (port->magic != RISCOM8_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -1095,7 +1095,7 @@ static int rc_open(struct tty_struct * tty, struct file * filp)
bp = &rc_board[board];
port = rc_port + board * RC_NPORT + RC_PORT(minor(tty->device));
- if (rc_paranoia_check(port, tty->device, "rc_open"))
+ if (rc_paranoia_check(port, tty->name, "rc_open"))
return -ENODEV;
if ((error = rc_setup_board(bp)))
@@ -1134,7 +1134,7 @@ static void rc_close(struct tty_struct * tty, struct file * filp)
unsigned long flags;
unsigned long timeout;
- if (!port || rc_paranoia_check(port, tty->device, "close"))
+ if (!port || rc_paranoia_check(port, tty->name, "close"))
return;
save_flags(flags); cli();
@@ -1226,7 +1226,7 @@ static int rc_write(struct tty_struct * tty, int from_user,
int c, total = 0;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_write"))
+ if (rc_paranoia_check(port, tty->name, "rc_write"))
return 0;
bp = port_Board(port);
@@ -1302,7 +1302,7 @@ static void rc_put_char(struct tty_struct * tty, unsigned char ch)
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_put_char"))
+ if (rc_paranoia_check(port, tty->name, "rc_put_char"))
return;
if (!tty || !port->xmit_buf)
@@ -1324,7 +1324,7 @@ static void rc_flush_chars(struct tty_struct * tty)
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_flush_chars"))
+ if (rc_paranoia_check(port, tty->name, "rc_flush_chars"))
return;
if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1343,7 +1343,7 @@ static int rc_write_room(struct tty_struct * tty)
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
int ret;
- if (rc_paranoia_check(port, tty->device, "rc_write_room"))
+ if (rc_paranoia_check(port, tty->name, "rc_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1356,7 +1356,7 @@ static int rc_chars_in_buffer(struct tty_struct *tty)
{
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
- if (rc_paranoia_check(port, tty->device, "rc_chars_in_buffer"))
+ if (rc_paranoia_check(port, tty->name, "rc_chars_in_buffer"))
return 0;
return port->xmit_cnt;
@@ -1367,7 +1367,7 @@ static void rc_flush_buffer(struct tty_struct *tty)
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_flush_buffer"))
+ if (rc_paranoia_check(port, tty->name, "rc_flush_buffer"))
return;
save_flags(flags); cli();
@@ -1531,7 +1531,7 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp,
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
int retval;
- if (rc_paranoia_check(port, tty->device, "rc_ioctl"))
+ if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
return -ENODEV;
switch (cmd) {
@@ -1581,7 +1581,7 @@ static void rc_throttle(struct tty_struct * tty)
struct riscom_board *bp;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_throttle"))
+ if (rc_paranoia_check(port, tty->name, "rc_throttle"))
return;
bp = port_Board(port);
@@ -1604,7 +1604,7 @@ static void rc_unthrottle(struct tty_struct * tty)
struct riscom_board *bp;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_unthrottle"))
+ if (rc_paranoia_check(port, tty->name, "rc_unthrottle"))
return;
bp = port_Board(port);
@@ -1627,7 +1627,7 @@ static void rc_stop(struct tty_struct * tty)
struct riscom_board *bp;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_stop"))
+ if (rc_paranoia_check(port, tty->name, "rc_stop"))
return;
bp = port_Board(port);
@@ -1645,7 +1645,7 @@ static void rc_start(struct tty_struct * tty)
struct riscom_board *bp;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_start"))
+ if (rc_paranoia_check(port, tty->name, "rc_start"))
return;
bp = port_Board(port);
@@ -1684,7 +1684,7 @@ static void rc_hangup(struct tty_struct * tty)
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
struct riscom_board *bp;
- if (rc_paranoia_check(port, tty->device, "rc_hangup"))
+ if (rc_paranoia_check(port, tty->name, "rc_hangup"))
return;
bp = port_Board(port);
@@ -1702,7 +1702,7 @@ static void rc_set_termios(struct tty_struct * tty, struct termios * old_termios
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
unsigned long flags;
- if (rc_paranoia_check(port, tty->device, "rc_set_termios"))
+ if (rc_paranoia_check(port, tty->name, "rc_set_termios"))
return;
if (tty->termios->c_cflag == old_termios->c_cflag &&
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index b16c7e40b82f..3c7b2c885e9c 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -176,15 +176,15 @@ static DECLARE_MUTEX(tmp_buf_sem);
static void rp_start(struct tty_struct *tty);
static inline int rocket_paranoia_check(struct r_port *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef ROCKET_PARANOIA_CHECK
static const char *badmagic =
- "Warning: bad magic number for rocketport struct (%d, %d) in %s\n";
+ "Warning: bad magic number for rocketport struct %s in %s\n";
if (!info)
return 1;
if (info->magic != RPORT_MAGIC) {
- printk(badmagic, major(device), minor(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -963,7 +963,7 @@ static void rp_close(struct tty_struct *tty, struct file * filp)
int timeout;
CHANNEL_t *cp;
- if (rocket_paranoia_check(info, tty->device, "rp_close"))
+ if (rocket_paranoia_check(info, tty->name, "rp_close"))
return;
#ifdef ROCKET_DEBUG_OPEN
@@ -1093,7 +1093,7 @@ static void rp_set_termios(struct tty_struct *tty, struct termios *old_termios)
unsigned cflag;
- if (rocket_paranoia_check(info, tty->device, "rp_set_termios"))
+ if (rocket_paranoia_check(info, tty->name, "rp_set_termios"))
return;
cflag = tty->termios->c_cflag;
@@ -1145,7 +1145,7 @@ static void rp_break(struct tty_struct *tty, int break_state)
struct r_port * info = (struct r_port *)tty->driver_data;
unsigned long flags;
- if (rocket_paranoia_check(info, tty->device, "rp_break"))
+ if (rocket_paranoia_check(info, tty->name, "rp_break"))
return;
save_flags(flags); cli();
@@ -1295,7 +1295,7 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file,
struct r_port * info = (struct r_port *)tty->driver_data;
if (cmd != RCKP_GET_PORTS &&
- rocket_paranoia_check(info, tty->device, "rp_ioctl"))
+ rocket_paranoia_check(info, tty->name, "rp_ioctl"))
return -ENODEV;
switch (cmd) {
@@ -1325,25 +1325,12 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file,
return 0;
}
-#if (defined(ROCKET_DEBUG_FLOW) || defined(ROCKET_DEBUG_THROTTLE))
-static char *rp_tty_name(struct tty_struct *tty, char *buf)
-{
- if (tty)
- sprintf(buf, "%s%d", tty->driver->name,
- minor(tty->device) - tty->driver->minor_start +
- tty->driver->name_base);
- else
- strcpy(buf, "NULL tty");
- return buf;
-}
-#endif
-
static void rp_send_xchar(struct tty_struct *tty, char ch)
{
struct r_port *info = (struct r_port *)tty->driver_data;
CHANNEL_t *cp;
- if (rocket_paranoia_check(info, tty->device, "rp_send_xchar"))
+ if (rocket_paranoia_check(info, tty->name, "rp_send_xchar"))
return;
cp = &info->channel;
@@ -1360,11 +1347,11 @@ static void rp_throttle(struct tty_struct * tty)
#ifdef ROCKET_DEBUG_THROTTLE
char buf[64];
- printk("throttle %s: %d....\n", rp_tty_name(tty, buf),
+ printk("throttle %s: %d....\n", tty->name,
tty->ldisc.chars_in_buffer(tty));
#endif
- if (rocket_paranoia_check(info, tty->device, "rp_throttle"))
+ if (rocket_paranoia_check(info, tty->name, "rp_throttle"))
return;
cp = &info->channel;
@@ -1381,11 +1368,11 @@ static void rp_unthrottle(struct tty_struct * tty)
#ifdef ROCKET_DEBUG_THROTTLE
char buf[64];
- printk("unthrottle %s: %d....\n", rp_tty_name(tty, buf),
+ printk("unthrottle %s: %d....\n", tty->name,
tty->ldisc.chars_in_buffer(tty));
#endif
- if (rocket_paranoia_check(info, tty->device, "rp_throttle"))
+ if (rocket_paranoia_check(info, tty->name, "rp_throttle"))
return;
cp = &info->channel;
@@ -1409,11 +1396,11 @@ static void rp_stop(struct tty_struct *tty)
#ifdef ROCKET_DEBUG_FLOW
char buf[64];
- printk("stop %s: %d %d....\n", rp_tty_name(tty, buf),
+ printk("stop %s: %d %d....\n", tty->name,
info->xmit_cnt, info->xmit_fifo_room);
#endif
- if (rocket_paranoia_check(info, tty->device, "rp_stop"))
+ if (rocket_paranoia_check(info, tty->name, "rp_stop"))
return;
if (sGetTxCnt(&info->channel))
@@ -1426,11 +1413,11 @@ static void rp_start(struct tty_struct *tty)
#ifdef ROCKET_DEBUG_FLOW
char buf[64];
- printk("start %s: %d %d....\n", rp_tty_name(tty, buf),
+ printk("start %s: %d %d....\n", tty->name,
info->xmit_cnt, info->xmit_fifo_room);
#endif
- if (rocket_paranoia_check(info, tty->device, "rp_stop"))
+ if (rocket_paranoia_check(info, tty->name, "rp_stop"))
return;
sEnTransmit(&info->channel);
@@ -1448,7 +1435,7 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout)
int check_time, exit_time;
int txcnt;
- if (rocket_paranoia_check(info, tty->device, "rp_wait_until_sent"))
+ if (rocket_paranoia_check(info, tty->name, "rp_wait_until_sent"))
return;
cp = &info->channel;
@@ -1498,7 +1485,7 @@ static void rp_hangup(struct tty_struct *tty)
CHANNEL_t *cp;
struct r_port * info = (struct r_port *)tty->driver_data;
- if (rocket_paranoia_check(info, tty->device, "rp_hangup"))
+ if (rocket_paranoia_check(info, tty->name, "rp_hangup"))
return;
#if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_HANGUP))
@@ -1553,7 +1540,7 @@ static void rp_put_char(struct tty_struct *tty, unsigned char ch)
struct r_port * info = (struct r_port *)tty->driver_data;
CHANNEL_t *cp;
- if (rocket_paranoia_check(info, tty->device, "rp_put_char"))
+ if (rocket_paranoia_check(info, tty->name, "rp_put_char"))
return;
#ifdef ROCKET_DEBUG_WRITE
@@ -1586,7 +1573,7 @@ static int rp_write(struct tty_struct * tty, int from_user,
int c, retval = 0;
unsigned long flags;
- if (count <= 0 || rocket_paranoia_check(info, tty->device, "rp_write"))
+ if (count <= 0 || rocket_paranoia_check(info, tty->name, "rp_write"))
return 0;
#ifdef ROCKET_DEBUG_WRITE
@@ -1687,7 +1674,7 @@ static int rp_write_room(struct tty_struct *tty)
struct r_port * info = (struct r_port *)tty->driver_data;
int ret;
- if (rocket_paranoia_check(info, tty->device, "rp_write_room"))
+ if (rocket_paranoia_check(info, tty->name, "rp_write_room"))
return 0;
ret = XMIT_BUF_SIZE - info->xmit_cnt - 1;
@@ -1708,7 +1695,7 @@ static int rp_chars_in_buffer(struct tty_struct *tty)
struct r_port * info = (struct r_port *)tty->driver_data;
CHANNEL_t *cp;
- if (rocket_paranoia_check(info, tty->device, "rp_chars_in_buffer"))
+ if (rocket_paranoia_check(info, tty->name, "rp_chars_in_buffer"))
return 0;
cp = &info->channel;
@@ -1724,7 +1711,7 @@ static void rp_flush_buffer(struct tty_struct *tty)
struct r_port * info = (struct r_port *)tty->driver_data;
CHANNEL_t *cp;
- if (rocket_paranoia_check(info, tty->device, "rp_flush_buffer"))
+ if (rocket_paranoia_check(info, tty->name, "rp_flush_buffer"))
return;
cli();
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 9d8f411972fd..a537a2b24f63 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -237,30 +237,30 @@ void my_udelay (long us)
}
static inline int
-serial_paranoia_check(struct cyclades_port *info, kdev_t device,
+serial_paranoia_check(struct cyclades_port *info, char *name,
const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
- "Warning: bad magic number for serial struct (%d, %d) in %s\n";
+ "Warning: bad magic number for serial struct (%s) in %s\n";
static const char *badinfo =
- "Warning: null cyclades_port for (%d, %d) in %s\n";
+ "Warning: null cyclades_port for (%s) in %s\n";
static const char *badrange =
- "Warning: cyclades_port out of range for (%d, %d) in %s\n";
+ "Warning: cyclades_port out of range for (%s) in %s\n";
if (!info) {
- printk(badinfo, major(device), minor(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if( (long)info < (long)(&cy_port[0])
|| (long)(&cy_port[NR_PORTS]) < (long)info ){
- printk(badrange, major(device), minor(device), routine);
+ printk(badrange, name, routine);
return 1;
}
if (info->magic != CYCLADES_MAGIC) {
- printk(badmagic, major(device), minor(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -339,10 +339,10 @@ cy_stop(struct tty_struct *tty)
unsigned long flags;
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_stop ttyS%d\n", info->line); /* */
+ printk("cy_stop %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_stop"))
+ if (serial_paranoia_check(info, tty->name, "cy_stop"))
return;
channel = info->line;
@@ -364,10 +364,10 @@ cy_start(struct tty_struct *tty)
unsigned long flags;
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_start ttyS%d\n", info->line); /* */
+ printk("cy_start %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_start"))
+ if (serial_paranoia_check(info, tty->name, "cy_start"))
return;
channel = info->line;
@@ -1171,10 +1171,10 @@ cy_put_char(struct tty_struct *tty, unsigned char ch)
unsigned long flags;
#ifdef SERIAL_DEBUG_IO
- printk("cy_put_char ttyS%d(0x%02x)\n", info->line, ch);
+ printk("cy_put_char %s(0x%02x)\n", tty->name, ch);
#endif
- if (serial_paranoia_check(info, tty->device, "cy_put_char"))
+ if (serial_paranoia_check(info, tty->name, "cy_put_char"))
return;
if (!tty || !info->xmit_buf)
@@ -1202,10 +1202,10 @@ cy_flush_chars(struct tty_struct *tty)
int channel;
#ifdef SERIAL_DEBUG_IO
- printk("cy_flush_chars ttyS%d\n", info->line); /* */
+ printk("cy_flush_chars %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "cy_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped
@@ -1236,10 +1236,10 @@ cy_write(struct tty_struct * tty, int from_user,
int c, total = 0;
#ifdef SERIAL_DEBUG_IO
- printk("cy_write ttyS%d\n", info->line); /* */
+ printk("cy_write %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_write")){
+ if (serial_paranoia_check(info, tty->name, "cy_write")){
return 0;
}
@@ -1312,10 +1312,10 @@ cy_write_room(struct tty_struct *tty)
int ret;
#ifdef SERIAL_DEBUG_IO
- printk("cy_write_room ttyS%d\n", info->line); /* */
+ printk("cy_write_room %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_write_room"))
+ if (serial_paranoia_check(info, tty->name, "cy_write_room"))
return 0;
ret = PAGE_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -1330,10 +1330,10 @@ cy_chars_in_buffer(struct tty_struct *tty)
struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
#ifdef SERIAL_DEBUG_IO
- printk("cy_chars_in_buffer ttyS%d %d\n", info->line, info->xmit_cnt); /* */
+ printk("cy_chars_in_buffer %s %d\n", tty->name, info->xmit_cnt); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer"))
return 0;
return info->xmit_cnt;
@@ -1347,10 +1347,10 @@ cy_flush_buffer(struct tty_struct *tty)
unsigned long flags;
#ifdef SERIAL_DEBUG_IO
- printk("cy_flush_buffer ttyS%d\n", info->line); /* */
+ printk("cy_flush_buffer %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "cy_flush_buffer"))
return;
local_irq_save(flags);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1379,10 +1379,10 @@ cy_throttle(struct tty_struct * tty)
printk("throttle %s: %d....\n", tty_name(tty, buf),
tty->ldisc.chars_in_buffer(tty));
- printk("cy_throttle ttyS%d\n", info->line);
+ printk("cy_throttle %s\n", tty->name);
#endif
- if (serial_paranoia_check(info, tty->device, "cy_nthrottle")){
+ if (serial_paranoia_check(info, tty->name, "cy_nthrottle")){
return;
}
@@ -1415,10 +1415,10 @@ cy_unthrottle(struct tty_struct * tty)
printk("throttle %s: %d....\n", tty_name(tty, buf),
tty->ldisc.chars_in_buffer(tty));
- printk("cy_unthrottle ttyS%d\n", info->line);
+ printk("cy_unthrottle %s\n", tty->name);
#endif
- if (serial_paranoia_check(info, tty->device, "cy_nthrottle")){
+ if (serial_paranoia_check(info, tty->name, "cy_nthrottle")){
return;
}
@@ -1743,7 +1743,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
int ret_val = 0;
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_ioctl ttyS%d, cmd = %x arg = %lx\n", info->line, cmd, arg); /* */
+ printk("cy_ioctl %s, cmd = %x arg = %lx\n", tty->name, cmd, arg); /* */
#endif
switch (cmd) {
@@ -1836,7 +1836,7 @@ cy_set_termios(struct tty_struct *tty, struct termios * old_termios)
struct cyclades_port *info = (struct cyclades_port *)tty->driver_data;
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_set_termios ttyS%d\n", info->line);
+ printk("cy_set_termios %s\n", tty->name);
#endif
if (tty->termios->c_cflag == old_termios->c_cflag)
@@ -1865,15 +1865,15 @@ cy_close(struct tty_struct * tty, struct file * filp)
/* CP('C'); */
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_close ttyS%d\n", info->line);
+ printk("cy_close %s\n", tty->name);
#endif
if (!info
- || serial_paranoia_check(info, tty->device, "cy_close")){
+ || serial_paranoia_check(info, tty->name, "cy_close")){
return;
}
#ifdef SERIAL_DEBUG_OPEN
- printk("cy_close ttyS%d, count = %d\n", info->line, info->count);
+ printk("cy_close %s, count = %d\n", tty->name, info->count);
#endif
if ((tty->count == 1) && (info->count != 1)) {
@@ -1954,10 +1954,10 @@ cy_hangup(struct tty_struct *tty)
struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_hangup ttyS%d\n", info->line); /* */
+ printk("cy_hangup %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_hangup"))
+ if (serial_paranoia_check(info, tty->name, "cy_hangup"))
return;
shutdown(info);
@@ -2048,8 +2048,8 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
retval = 0;
add_wait_queue(&info->open_wait, &wait);
#ifdef SERIAL_DEBUG_OPEN
- printk("block_til_ready before block: ttyS%d, count = %d\n",
- info->line, info->count);/**/
+ printk("block_til_ready before block: %s, count = %d\n",
+ tty->name, info->count);/**/
#endif
info->count--;
#ifdef SERIAL_DEBUG_COUNT
@@ -2098,8 +2098,8 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
break;
}
#ifdef SERIAL_DEBUG_OPEN
- printk("block_til_ready blocking: ttyS%d, count = %d\n",
- info->line, info->count);/**/
+ printk("block_til_ready blocking: %s, count = %d\n",
+ tty->name, info->count);/**/
#endif
schedule();
}
@@ -2113,8 +2113,8 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
}
info->blocked_open--;
#ifdef SERIAL_DEBUG_OPEN
- printk("block_til_ready after blocking: ttyS%d, count = %d\n",
- info->line, info->count);/**/
+ printk("block_til_ready after blocking: %s, count = %d\n",
+ tty->name, info->count);/**/
#endif
if (retval)
return retval;
@@ -2142,13 +2142,13 @@ cy_open(struct tty_struct *tty, struct file * filp)
return -ENODEV;
}
#ifdef SERIAL_DEBUG_OTHER
- printk("cy_open ttyS%d\n", info->line); /* */
+ printk("cy_open %s\n", tty->name); /* */
#endif
- if (serial_paranoia_check(info, tty->device, "cy_open")){
+ if (serial_paranoia_check(info, tty->name, "cy_open")){
return -ENODEV;
}
#ifdef SERIAL_DEBUG_OPEN
- printk("cy_open ttyS%d, count = %d\n", info->line, info->count);/**/
+ printk("cy_open %s, count = %d\n", tty->name, info->count);/**/
#endif
info->count++;
#ifdef SERIAL_DEBUG_COUNT
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index cdb9f2993313..452546e9535e 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -210,7 +210,7 @@ static void sx_interrupt(int irq, void * dev_id, struct pt_regs * regs);
static inline int sx_paranoia_check(struct specialix_port const * port,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SPECIALIX_PARANOIA_CHECK
static const char *badmagic =
@@ -219,11 +219,11 @@ static inline int sx_paranoia_check(struct specialix_port const * port,
KERN_ERR "sx: Warning: null specialix port for device %s in %s\n";
if (!port) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (port->magic != SPECIALIX_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -1467,7 +1467,7 @@ static int sx_open(struct tty_struct * tty, struct file * filp)
board, bp, port, SX_PORT(minor(tty->device)));
#endif
- if (sx_paranoia_check(port, tty->device, "sx_open"))
+ if (sx_paranoia_check(port, tty->name, "sx_open"))
return -ENODEV;
if ((error = sx_setup_board(bp)))
@@ -1506,7 +1506,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
unsigned long flags;
unsigned long timeout;
- if (!port || sx_paranoia_check(port, tty->device, "close"))
+ if (!port || sx_paranoia_check(port, tty->name, "close"))
return;
save_flags(flags); cli();
@@ -1605,7 +1605,7 @@ static int sx_write(struct tty_struct * tty, int from_user,
int c, total = 0;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_write"))
+ if (sx_paranoia_check(port, tty->name, "sx_write"))
return 0;
bp = port_Board(port);
@@ -1679,7 +1679,7 @@ static void sx_put_char(struct tty_struct * tty, unsigned char ch)
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_put_char"))
+ if (sx_paranoia_check(port, tty->name, "sx_put_char"))
return;
if (!tty || !port->xmit_buf)
@@ -1704,7 +1704,7 @@ static void sx_flush_chars(struct tty_struct * tty)
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_flush_chars"))
+ if (sx_paranoia_check(port, tty->name, "sx_flush_chars"))
return;
if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1724,7 +1724,7 @@ static int sx_write_room(struct tty_struct * tty)
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
int ret;
- if (sx_paranoia_check(port, tty->device, "sx_write_room"))
+ if (sx_paranoia_check(port, tty->name, "sx_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1738,7 +1738,7 @@ static int sx_chars_in_buffer(struct tty_struct *tty)
{
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
- if (sx_paranoia_check(port, tty->device, "sx_chars_in_buffer"))
+ if (sx_paranoia_check(port, tty->name, "sx_chars_in_buffer"))
return 0;
return port->xmit_cnt;
@@ -1750,7 +1750,7 @@ static void sx_flush_buffer(struct tty_struct *tty)
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_flush_buffer"))
+ if (sx_paranoia_check(port, tty->name, "sx_flush_buffer"))
return;
save_flags(flags); cli();
@@ -1976,7 +1976,7 @@ static int sx_ioctl(struct tty_struct * tty, struct file * filp,
int error;
int retval;
- if (sx_paranoia_check(port, tty->device, "sx_ioctl"))
+ if (sx_paranoia_check(port, tty->name, "sx_ioctl"))
return -ENODEV;
switch (cmd) {
@@ -2035,7 +2035,7 @@ static void sx_throttle(struct tty_struct * tty)
struct specialix_board *bp;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_throttle"))
+ if (sx_paranoia_check(port, tty->name, "sx_throttle"))
return;
bp = port_Board(port);
@@ -2070,7 +2070,7 @@ static void sx_unthrottle(struct tty_struct * tty)
struct specialix_board *bp;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_unthrottle"))
+ if (sx_paranoia_check(port, tty->name, "sx_unthrottle"))
return;
bp = port_Board(port);
@@ -2098,7 +2098,7 @@ static void sx_stop(struct tty_struct * tty)
struct specialix_board *bp;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_stop"))
+ if (sx_paranoia_check(port, tty->name, "sx_stop"))
return;
bp = port_Board(port);
@@ -2117,7 +2117,7 @@ static void sx_start(struct tty_struct * tty)
struct specialix_board *bp;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_start"))
+ if (sx_paranoia_check(port, tty->name, "sx_start"))
return;
bp = port_Board(port);
@@ -2158,7 +2158,7 @@ static void sx_hangup(struct tty_struct * tty)
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
struct specialix_board *bp;
- if (sx_paranoia_check(port, tty->device, "sx_hangup"))
+ if (sx_paranoia_check(port, tty->name, "sx_hangup"))
return;
bp = port_Board(port);
@@ -2177,7 +2177,7 @@ static void sx_set_termios(struct tty_struct * tty, struct termios * old_termios
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
unsigned long flags;
- if (sx_paranoia_check(port, tty->device, "sx_set_termios"))
+ if (sx_paranoia_check(port, tty->name, "sx_set_termios"))
return;
if (tty->termios->c_cflag == old_termios->c_cflag &&
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 9a18f77e22a5..28ec802d1ee0 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -1017,8 +1017,8 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
int brdnr, panelnr, portnr, rc;
#if DEBUG
- printk("stl_open(tty=%x,filp=%x): device=%x\n", (int) tty,
- (int) filp, tty->device);
+ printk("stl_open(tty=%x,filp=%x): device=%s\n", (int) tty,
+ (int) filp, tty->name);
#endif
minordev = minor(tty->device);
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 871a81b694cf..fcd63a23d169 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -441,7 +441,7 @@ static struct miscdevice sx_fw_device = {
/* This doesn't work. Who's paranoid around here? Not me! */
static inline int sx_paranoia_check(struct sx_port const * port,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
static const char *badmagic =
@@ -450,11 +450,11 @@ static inline int sx_paranoia_check(struct sx_port const * port,
KERN_ERR "sx: Warning: null sx port for device %s in %s\n";
if (!port) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (port->magic != SX_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index b73a13abbf81..ca8ed363ba33 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -978,7 +978,7 @@ static unsigned char *tmp_buf;
static DECLARE_MUTEX(tmp_buf_sem);
static inline int mgsl_paranoia_check(struct mgsl_struct *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef MGSL_PARANOIA_CHECK
static const char *badmagic =
@@ -987,11 +987,11 @@ static inline int mgsl_paranoia_check(struct mgsl_struct *info,
"Warning: null mgsl_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != MGSL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -1008,7 +1008,7 @@ static void mgsl_stop(struct tty_struct *tty)
struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
unsigned long flags;
- if (mgsl_paranoia_check(info, tty->device, "mgsl_stop"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_stop"))
return;
if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1031,7 +1031,7 @@ static void mgsl_start(struct tty_struct *tty)
struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
unsigned long flags;
- if (mgsl_paranoia_check(info, tty->device, "mgsl_start"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_start"))
return;
if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -2048,7 +2048,7 @@ static void mgsl_put_char(struct tty_struct *tty, unsigned char ch)
__FILE__,__LINE__,ch,info->device_name);
}
- if (mgsl_paranoia_check(info, tty->device, "mgsl_put_char"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char"))
return;
if (!tty || !info->xmit_buf)
@@ -2086,7 +2086,7 @@ static void mgsl_flush_chars(struct tty_struct *tty)
printk( "%s(%d):mgsl_flush_chars() entry on %s xmit_cnt=%d\n",
__FILE__,__LINE__,info->device_name,info->xmit_cnt);
- if (mgsl_paranoia_check(info, tty->device, "mgsl_flush_chars"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -2139,7 +2139,7 @@ static int mgsl_write(struct tty_struct * tty, int from_user,
printk( "%s(%d):mgsl_write(%s) count=%d\n",
__FILE__,__LINE__,info->device_name,count);
- if (mgsl_paranoia_check(info, tty->device, "mgsl_write"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_write"))
goto cleanup;
if (!tty || !info->xmit_buf || !tmp_buf)
@@ -2315,7 +2315,7 @@ static int mgsl_write_room(struct tty_struct *tty)
struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
int ret;
- if (mgsl_paranoia_check(info, tty->device, "mgsl_write_room"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -2353,7 +2353,7 @@ static int mgsl_chars_in_buffer(struct tty_struct *tty)
printk("%s(%d):mgsl_chars_in_buffer(%s)\n",
__FILE__,__LINE__, info->device_name );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_chars_in_buffer"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_chars_in_buffer"))
return 0;
if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2388,7 +2388,7 @@ static void mgsl_flush_buffer(struct tty_struct *tty)
printk("%s(%d):mgsl_flush_buffer(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_flush_buffer"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_buffer"))
return;
spin_lock_irqsave(&info->irq_spinlock,flags);
@@ -2420,7 +2420,7 @@ static void mgsl_send_xchar(struct tty_struct *tty, char ch)
printk("%s(%d):mgsl_send_xchar(%s,%d)\n",
__FILE__,__LINE__, info->device_name, ch );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_send_xchar"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_send_xchar"))
return;
info->x_char = ch;
@@ -2449,7 +2449,7 @@ static void mgsl_throttle(struct tty_struct * tty)
printk("%s(%d):mgsl_throttle(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_throttle"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_throttle"))
return;
if (I_IXOFF(tty))
@@ -2479,7 +2479,7 @@ static void mgsl_unthrottle(struct tty_struct * tty)
printk("%s(%d):mgsl_unthrottle(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_unthrottle"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -2989,7 +2989,7 @@ static void mgsl_break(struct tty_struct *tty, int break_state)
printk("%s(%d):mgsl_break(%s,%d)\n",
__FILE__,__LINE__, info->device_name, break_state);
- if (mgsl_paranoia_check(info, tty->device, "mgsl_break"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_break"))
return;
spin_lock_irqsave(&info->irq_spinlock,flags);
@@ -3021,7 +3021,7 @@ static int mgsl_ioctl(struct tty_struct *tty, struct file * file,
printk("%s(%d):mgsl_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
info->device_name, cmd );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_ioctl"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -3182,7 +3182,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
{
struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data;
- if (!info || mgsl_paranoia_check(info, tty->device, "mgsl_close"))
+ if (!info || mgsl_paranoia_check(info, tty->name, "mgsl_close"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
@@ -3291,7 +3291,7 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout)
printk("%s(%d):mgsl_wait_until_sent(%s) entry\n",
__FILE__,__LINE__, info->device_name );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_wait_until_sent"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_wait_until_sent"))
return;
if (!(info->flags & ASYNC_INITIALIZED))
@@ -3360,7 +3360,7 @@ static void mgsl_hangup(struct tty_struct *tty)
printk("%s(%d):mgsl_hangup(%s)\n",
__FILE__,__LINE__, info->device_name );
- if (mgsl_paranoia_check(info, tty->device, "mgsl_hangup"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_hangup"))
return;
mgsl_flush_buffer(tty);
@@ -3549,7 +3549,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
tty->driver_data = info;
info->tty = tty;
- if (mgsl_paranoia_check(info, tty->device, "mgsl_open"))
+ if (mgsl_paranoia_check(info, tty->name, "mgsl_open"))
return -ENODEV;
if (debug_level >= DEBUG_LEVEL_INFO)
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index d93f63873776..b0d7affd110b 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -710,7 +710,7 @@ static void* synclinkmp_get_text_ptr(void);
static void* synclinkmp_get_text_ptr() {return synclinkmp_get_text_ptr;}
static inline int sanity_check(SLMP_INFO *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SANITY_CHECK
static const char *badmagic =
@@ -719,11 +719,11 @@ static inline int sanity_check(SLMP_INFO *info,
"Warning: null synclinkmp_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != MGSL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -764,7 +764,7 @@ static int open(struct tty_struct *tty, struct file *filp)
tty->driver_data = info;
info->tty = tty;
- if (sanity_check(info, tty->device, "open"))
+ if (sanity_check(info, tty->name, "open"))
return -ENODEV;
if (debug_level >= DEBUG_LEVEL_INFO)
@@ -839,7 +839,7 @@ static void close(struct tty_struct *tty, struct file *filp)
{
SLMP_INFO * info = (SLMP_INFO *)tty->driver_data;
- if (!info || sanity_check(info, tty->device, "close"))
+ if (!info || sanity_check(info, tty->name, "close"))
return;
if (debug_level >= DEBUG_LEVEL_INFO)
@@ -936,7 +936,7 @@ static void hangup(struct tty_struct *tty)
printk("%s(%d):%s hangup()\n",
__FILE__,__LINE__, info->device_name );
- if (sanity_check(info, tty->device, "hangup"))
+ if (sanity_check(info, tty->name, "hangup"))
return;
flush_buffer(tty);
@@ -1020,7 +1020,7 @@ static int write(struct tty_struct *tty, int from_user,
printk("%s(%d):%s write() count=%d\n",
__FILE__,__LINE__,info->device_name,count);
- if (sanity_check(info, tty->device, "write"))
+ if (sanity_check(info, tty->name, "write"))
goto cleanup;
if (!tty || !info->tx_buf)
@@ -1109,7 +1109,7 @@ static void put_char(struct tty_struct *tty, unsigned char ch)
__FILE__,__LINE__,info->device_name,ch);
}
- if (sanity_check(info, tty->device, "put_char"))
+ if (sanity_check(info, tty->name, "put_char"))
return;
if (!tty || !info->tx_buf)
@@ -1142,7 +1142,7 @@ static void send_xchar(struct tty_struct *tty, char ch)
printk("%s(%d):%s send_xchar(%d)\n",
__FILE__,__LINE__, info->device_name, ch );
- if (sanity_check(info, tty->device, "send_xchar"))
+ if (sanity_check(info, tty->name, "send_xchar"))
return;
info->x_char = ch;
@@ -1169,7 +1169,7 @@ static void wait_until_sent(struct tty_struct *tty, int timeout)
printk("%s(%d):%s wait_until_sent() entry\n",
__FILE__,__LINE__, info->device_name );
- if (sanity_check(info, tty->device, "wait_until_sent"))
+ if (sanity_check(info, tty->name, "wait_until_sent"))
return;
if (!(info->flags & ASYNC_INITIALIZED))
@@ -1228,7 +1228,7 @@ static int write_room(struct tty_struct *tty)
SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
int ret;
- if (sanity_check(info, tty->device, "write_room"))
+ if (sanity_check(info, tty->name, "write_room"))
return 0;
if (info->params.mode == MGSL_MODE_HDLC) {
@@ -1257,7 +1257,7 @@ static void flush_chars(struct tty_struct *tty)
printk( "%s(%d):%s flush_chars() entry tx_count=%d\n",
__FILE__,__LINE__,info->device_name,info->tx_count);
- if (sanity_check(info, tty->device, "flush_chars"))
+ if (sanity_check(info, tty->name, "flush_chars"))
return;
if (info->tx_count <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1296,7 +1296,7 @@ static void flush_buffer(struct tty_struct *tty)
printk("%s(%d):%s flush_buffer() entry\n",
__FILE__,__LINE__, info->device_name );
- if (sanity_check(info, tty->device, "flush_buffer"))
+ if (sanity_check(info, tty->name, "flush_buffer"))
return;
spin_lock_irqsave(&info->lock,flags);
@@ -1317,7 +1317,7 @@ static void tx_hold(struct tty_struct *tty)
SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
unsigned long flags;
- if (sanity_check(info, tty->device, "tx_hold"))
+ if (sanity_check(info, tty->name, "tx_hold"))
return;
if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1337,7 +1337,7 @@ static void tx_release(struct tty_struct *tty)
SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
unsigned long flags;
- if (sanity_check(info, tty->device, "tx_release"))
+ if (sanity_check(info, tty->name, "tx_release"))
return;
if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -1374,7 +1374,7 @@ static int ioctl(struct tty_struct *tty, struct file *file,
printk("%s(%d):%s ioctl() cmd=%08X\n", __FILE__,__LINE__,
info->device_name, cmd );
- if (sanity_check(info, tty->device, "ioctl"))
+ if (sanity_check(info, tty->name, "ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1566,7 +1566,7 @@ static int chars_in_buffer(struct tty_struct *tty)
{
SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
- if (sanity_check(info, tty->device, "chars_in_buffer"))
+ if (sanity_check(info, tty->name, "chars_in_buffer"))
return 0;
if (debug_level >= DEBUG_LEVEL_INFO)
@@ -1587,7 +1587,7 @@ static void throttle(struct tty_struct * tty)
printk("%s(%d):%s throttle() entry\n",
__FILE__,__LINE__, info->device_name );
- if (sanity_check(info, tty->device, "throttle"))
+ if (sanity_check(info, tty->name, "throttle"))
return;
if (I_IXOFF(tty))
@@ -1612,7 +1612,7 @@ static void unthrottle(struct tty_struct * tty)
printk("%s(%d):%s unthrottle() entry\n",
__FILE__,__LINE__, info->device_name );
- if (sanity_check(info, tty->device, "unthrottle"))
+ if (sanity_check(info, tty->name, "unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1643,7 +1643,7 @@ static void set_break(struct tty_struct *tty, int break_state)
printk("%s(%d):%s set_break(%d)\n",
__FILE__,__LINE__, info->device_name, break_state);
- if (sanity_check(info, tty->device, "set_break"))
+ if (sanity_check(info, tty->name, "set_break"))
return;
spin_lock_irqsave(&info->lock,flags);
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e0f6d4627caa..2bbf720033f1 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -172,29 +172,16 @@ static inline void free_tty_struct(struct tty_struct *tty)
kfree(tty);
}
-/*
- * This routine returns the name of tty.
- */
-static char *
-_tty_make_name(struct tty_struct *tty, const char *name, char *buf)
-{
- int idx = (tty)? minor(tty->device) - tty->driver->minor_start:0;
-
- if (!tty) /* Hmm. NULL pointer. That's fun. */
- strcpy(buf, "NULL tty");
- else
- sprintf(buf, name,
- idx + tty->driver->name_base);
-
- return buf;
-}
-
#define TTY_NUMBER(tty) (minor((tty)->device) - (tty)->driver->minor_start + \
(tty)->driver->name_base)
char *tty_name(struct tty_struct *tty, char *buf)
{
- return _tty_make_name(tty, (tty)?tty->driver->name:NULL, buf);
+ if (!tty) /* Hmm. NULL pointer. That's fun. */
+ strcpy(buf, "NULL tty");
+ else
+ strcpy(buf, tty->name);
+ return buf;
}
EXPORT_SYMBOL(tty_name);
@@ -238,7 +225,7 @@ static int check_tty_count(struct tty_struct *tty, const char *routine)
if (tty->count != count) {
printk(KERN_WARNING "Warning: dev (%s) tty->count(%d) "
"!= #fd's(%d) in %s\n",
- cdevname(tty->device), tty->count, count, routine);
+ tty->name, tty->count, count, routine);
return count;
}
#endif
@@ -856,6 +843,8 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty)
initialize_tty_struct(tty);
tty->device = device;
tty->driver = driver;
+ sprintf(tty->name, "%s%d",
+ driver->name, idx + driver->name_base);
tp_loc = &driver->termios[idx];
if (!*tp_loc) {
@@ -883,6 +872,8 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty)
o_tty->device = mk_kdev(driver->other->major,
driver->other->minor_start + idx);
o_tty->driver = driver->other;
+ sprintf(o_tty->name, "%s%d",
+ driver->other->name, idx + driver->other->name_base);
o_tp_loc = &driver->other->termios[idx];
if (!*o_tp_loc) {
@@ -1086,24 +1077,24 @@ static void release_dev(struct file * filp)
#ifdef TTY_PARANOIA_CHECK
if (idx < 0 || idx >= tty->driver->num) {
printk(KERN_DEBUG "release_dev: bad idx when trying to "
- "free (%s)\n", cdevname(tty->device));
+ "free (%s)\n", tty->name);
return;
}
if (tty != tty->driver->table[idx]) {
printk(KERN_DEBUG "release_dev: driver.table[%d] not tty "
- "for (%s)\n", idx, cdevname(tty->device));
+ "for (%s)\n", idx, tty->name);
return;
}
if (tty->termios != tty->driver->termios[idx]) {
printk(KERN_DEBUG "release_dev: driver.termios[%d] not termios "
"for (%s)\n",
- idx, cdevname(tty->device));
+ idx, tty->name);
return;
}
if (tty->termios_locked != tty->driver->termios_locked[idx]) {
printk(KERN_DEBUG "release_dev: driver.termios_locked[%d] not "
"termios_locked for (%s)\n",
- idx, cdevname(tty->device));
+ idx, tty->name);
return;
}
#endif
@@ -1118,20 +1109,20 @@ static void release_dev(struct file * filp)
if (o_tty != tty->driver->other->table[idx]) {
printk(KERN_DEBUG "release_dev: other->table[%d] "
"not o_tty for (%s)\n",
- idx, cdevname(tty->device));
+ idx, tty->name);
return;
}
if (o_tty->termios != tty->driver->other->termios[idx]) {
printk(KERN_DEBUG "release_dev: other->termios[%d] "
"not o_termios for (%s)\n",
- idx, cdevname(tty->device));
+ idx, tty->name);
return;
}
if (o_tty->termios_locked !=
tty->driver->other->termios_locked[idx]) {
printk(KERN_DEBUG "release_dev: other->termios_locked["
"%d] not o_termios_locked for (%s)\n",
- idx, cdevname(tty->device));
+ idx, tty->name);
return;
}
if (o_tty->link != tty) {
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 6cc72a2762c7..1ed218e80f77 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1045,17 +1045,17 @@ isdn_tty_send_msg(modem_info * info, atemu * m, char *msg)
}
static inline int
-isdn_tty_paranoia_check(modem_info * info, kdev_t device, const char *routine)
+isdn_tty_paranoia_check(modem_info * info, char *name, const char *routine)
{
#ifdef MODEM_PARANOIA_CHECK
if (!info) {
- printk(KERN_WARNING "isdn_tty: null info_struct for (%d, %d) in %s\n",
- major(device), minor(device), routine);
+ printk(KERN_WARNING "isdn_tty: null info_struct for %s in %s\n",
+ name, routine);
return 1;
}
if (info->magic != ISDN_ASYNC_MAGIC) {
- printk(KERN_WARNING "isdn_tty: bad magic for modem struct (%d, %d) in %s\n",
- major(device), minor(device), routine);
+ printk(KERN_WARNING "isdn_tty: bad magic for modem struct %s in %s\n",
+ name, routine);
return 1;
}
#endif
@@ -1205,7 +1205,7 @@ isdn_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int co
modem_info *info = (modem_info *) tty->driver_data;
atemu *m = &info->emu;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_write"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_write"))
return 0;
if (from_user)
down(&info->write_sem);
@@ -1318,7 +1318,7 @@ isdn_tty_write_room(struct tty_struct *tty)
modem_info *info = (modem_info *) tty->driver_data;
int ret;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_write_room"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_write_room"))
return 0;
if (!info->online)
return info->xmit_size;
@@ -1331,7 +1331,7 @@ isdn_tty_chars_in_buffer(struct tty_struct *tty)
{
modem_info *info = (modem_info *) tty->driver_data;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_chars_in_buffer"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_chars_in_buffer"))
return 0;
if (!info->online)
return 0;
@@ -1351,7 +1351,7 @@ isdn_tty_flush_buffer(struct tty_struct *tty)
return;
}
info = (modem_info *) tty->driver_data;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_flush_buffer")) {
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_buffer")) {
restore_flags(flags);
return;
}
@@ -1369,7 +1369,7 @@ isdn_tty_flush_chars(struct tty_struct *tty)
{
modem_info *info = (modem_info *) tty->driver_data;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_flush_chars"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_chars"))
return;
if ((info->xmit_count) || (skb_queue_len(&info->xmit_queue)))
isdn_tty_modem_xmit(info);
@@ -1388,7 +1388,7 @@ isdn_tty_throttle(struct tty_struct *tty)
{
modem_info *info = (modem_info *) tty->driver_data;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_throttle"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_throttle"))
return;
if (I_IXOFF(tty))
info->x_char = STOP_CHAR(tty);
@@ -1400,7 +1400,7 @@ isdn_tty_unthrottle(struct tty_struct *tty)
{
modem_info *info = (modem_info *) tty->driver_data;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_unthrottle"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_unthrottle"))
return;
if (I_IXOFF(tty)) {
if (info->x_char)
@@ -1542,7 +1542,7 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
modem_info *info = (modem_info *) tty->driver_data;
int retval;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_ioctl"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_ioctl"))
return -ENODEV;
if (tty->flags & (1 << TTY_IO_ERROR))
return -EIO;
@@ -1770,11 +1770,11 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp)
if (line < 0 || line > ISDN_MAX_CHANNELS)
return -ENODEV;
info = &isdn_mdm.info[line];
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_open"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open"))
return -ENODEV;
#ifdef ISDN_DEBUG_MODEM_OPEN
- printk(KERN_DEBUG "isdn_tty_open %s%d, count = %d\n", tty->driver->name,
- info->line, info->count);
+ printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name,
+ info->count);
#endif
info->count++;
tty->driver_data = info;
@@ -1822,7 +1822,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
ulong flags;
ulong timeout;
- if (!info || isdn_tty_paranoia_check(info, tty->device, "isdn_tty_close"))
+ if (!info || isdn_tty_paranoia_check(info, tty->name, "isdn_tty_close"))
goto out;
save_flags(flags);
@@ -1923,7 +1923,7 @@ isdn_tty_hangup(struct tty_struct *tty)
{
modem_info *info = (modem_info *) tty->driver_data;
- if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_hangup"))
+ if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_hangup"))
return;
isdn_tty_shutdown(info);
info->count = 0;
diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c
index f447ac31d627..5b1e8859a599 100644
--- a/drivers/macintosh/macserial.c
+++ b/drivers/macintosh/macserial.c
@@ -183,20 +183,20 @@ static DECLARE_MUTEX(tmp_buf_sem);
static inline int __pmac
serial_paranoia_check(struct mac_serial *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char badmagic[] = KERN_WARNING
- "Warning: bad magic number for serial struct (%d, %d) in %s\n";
+ "Warning: bad magic number for serial struct %s in %s\n";
static const char badinfo[] = KERN_WARNING
- "Warning: null mac_serial for (%d, %d) in %s\n";
+ "Warning: null mac_serial for %s in %s\n";
if (!info) {
- printk(badinfo, major(device), minor(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, major(device), minor(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -667,7 +667,7 @@ static void rs_stop(struct tty_struct *tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
#if 0
@@ -691,7 +691,7 @@ static void rs_start(struct tty_struct *tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
spin_lock_irqsave(&info->lock, flags);
@@ -1459,7 +1459,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct mac_serial *info = (struct mac_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
spin_lock_irqsave(&info->lock, flags);
@@ -1477,7 +1477,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct mac_serial *info = (struct mac_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit_buf || !tmp_buf)
@@ -1544,7 +1544,7 @@ static int rs_write_room(struct tty_struct *tty)
struct mac_serial *info = (struct mac_serial *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -1556,7 +1556,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct mac_serial *info = (struct mac_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -1566,7 +1566,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
struct mac_serial *info = (struct mac_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
spin_lock_irqsave(&info->lock, flags);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1593,7 +1593,7 @@ static void rs_throttle(struct tty_struct * tty)
printk(KERN_DEBUG "throttle %ld....\n",tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty)) {
@@ -1647,7 +1647,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1833,7 +1833,7 @@ static void rs_break(struct tty_struct *tty, int break_state)
struct mac_serial *info = (struct mac_serial *) tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_break"))
+ if (serial_paranoia_check(info, tty->name, "rs_break"))
return;
spin_lock_irqsave(&info->lock, flags);
@@ -1854,7 +1854,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
if (info->kgdb_channel)
return -ENODEV;
#endif
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1921,7 +1921,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct mac_serial * info = (struct mac_serial *)tty->driver_data;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
spin_lock_irqsave(&info->lock, flags);
@@ -2032,7 +2032,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
struct mac_serial *info = (struct mac_serial *) tty->driver_data;
unsigned long orig_jiffies, char_time;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
/* printk("rs_wait_until_sent, timeout:%d, tty_stopped:%d, tx_stopped:%d\n",
@@ -2078,7 +2078,7 @@ static void rs_hangup(struct tty_struct *tty)
{
struct mac_serial * info = (struct mac_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
@@ -2242,10 +2242,10 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
return -ENODEV;
}
#endif
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
- OPNDBG("rs_open %s%d, count = %d, tty=%p\n", tty->driver->name,
- info->line, info->count, tty);
+ OPNDBG("rs_open %s, count = %d, tty=%p\n", tty->name,
+ info->count, tty);
info->count++;
tty->driver_data = info;
@@ -2309,7 +2309,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
info->session = current->session;
info->pgrp = current->pgrp;
- OPNDBG("rs_open ttyS%d successful...\n", info->line);
+ OPNDBG("rs_open %s successful...\n", tty->name);
return 0;
}
diff --git a/drivers/net/irda/irtty.c b/drivers/net/irda/irtty.c
index 4c6d89c222ba..579f329c4cbe 100644
--- a/drivers/net/irda/irtty.c
+++ b/drivers/net/irda/irtty.c
@@ -170,9 +170,7 @@ static int irtty_open(struct tty_struct *tty)
tty->disc_data = self;
/* Give self a name */
- sprintf(name, "%s%d", tty->driver->name,
- minor(tty->device) - tty->driver->minor_start +
- tty->driver->name_base);
+ strcpy(name, tty->name);
hashbin_insert(irtty, (irda_queue_t *) self, (int) self, NULL);
@@ -957,9 +955,7 @@ static int irtty_net_open(struct net_device *dev)
irtty_stop_receiver(self, FALSE);
/* Give self a hardware name */
- sprintf(hwname, "%s%d", tty->driver->name,
- minor(tty->device) - tty->driver->minor_start +
- tty->driver->name_base);
+ sprintf(hwname, "%s", tty->name);
/*
* Open new IrLAP layer instance, now that everything should be
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index c55ee5796c9b..1e85b8df866e 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -332,17 +332,17 @@ ctc_tty_tint(ctc_tty_info * info)
************************************************************/
static inline int
-ctc_tty_paranoia_check(ctc_tty_info * info, kdev_t device, const char *routine)
+ctc_tty_paranoia_check(ctc_tty_info * info, char *name, const char *routine)
{
#ifdef MODEM_PARANOIA_CHECK
if (!info) {
- printk(KERN_WARNING "ctc_tty: null info_struct for (%d, %d) in %s\n",
- major(device), minor(device), routine);
+ printk(KERN_WARNING "ctc_tty: null info_struct for %s in %s\n",
+ name, routine);
return 1;
}
if (info->magic != CTC_ASYNC_MAGIC) {
- printk(KERN_WARNING "ctc_tty: bad magic for info struct (%d, %d) in %s\n",
- major(device), minor(device), routine);
+ printk(KERN_WARNING "ctc_tty: bad magic for info struct %s in %s\n",
+ name, routine);
return 1;
}
#endif
@@ -502,7 +502,7 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
if (ctc_tty_shuttingdown)
return 0;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_write"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_write"))
return 0;
if (!tty)
return 0;
@@ -551,7 +551,7 @@ ctc_tty_write_room(struct tty_struct *tty)
{
ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_write_room"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_write_room"))
return 0;
return CTC_TTY_XMIT_SIZE;
}
@@ -561,7 +561,7 @@ ctc_tty_chars_in_buffer(struct tty_struct *tty)
{
ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_chars_in_buffer"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_chars_in_buffer"))
return 0;
return 0;
}
@@ -576,7 +576,7 @@ ctc_tty_flush_buffer(struct tty_struct *tty)
return;
spin_lock_irqsave(&ctc_tty_lock, flags);
info = (ctc_tty_info *) tty->driver_data;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_flush_buffer")) {
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_flush_buffer")) {
spin_unlock_irqrestore(&ctc_tty_lock, flags);
return;
}
@@ -596,7 +596,7 @@ ctc_tty_flush_chars(struct tty_struct *tty)
if (ctc_tty_shuttingdown)
return;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_flush_chars"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_flush_chars"))
return;
if (tty->stopped || tty->hw_stopped || (!skb_queue_len(&info->tx_queue)))
return;
@@ -616,7 +616,7 @@ ctc_tty_throttle(struct tty_struct *tty)
{
ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_throttle"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_throttle"))
return;
info->mcr &= ~UART_MCR_RTS;
if (I_IXOFF(tty))
@@ -629,7 +629,7 @@ ctc_tty_unthrottle(struct tty_struct *tty)
{
ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_unthrottle"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_unthrottle"))
return;
info->mcr |= UART_MCR_RTS;
if (I_IXOFF(tty))
@@ -744,7 +744,7 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file,
int error;
int retval;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_ioctl"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
return -ENODEV;
if (tty->flags & (1 << TTY_IO_ERROR))
return -EIO;
@@ -977,13 +977,13 @@ ctc_tty_open(struct tty_struct *tty, struct file *filp)
if (line < 0 || line > CTC_TTY_MAX_DEVICES)
return -ENODEV;
info = &driver->info[line];
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_open"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_open"))
return -ENODEV;
if (!info->netdev)
return -ENODEV;
#ifdef CTC_DEBUG_MODEM_OPEN
- printk(KERN_DEBUG "ctc_tty_open %s%d, count = %d\n", tty->driver->name,
- info->line, info->count);
+ printk(KERN_DEBUG "ctc_tty_open %s, count = %d\n", tty->name,
+ info->count);
#endif
spin_lock_irqsave(&ctc_tty_lock, saveflags);
info->count++;
@@ -1012,7 +1012,7 @@ ctc_tty_open(struct tty_struct *tty, struct file *filp)
ctc_tty_change_speed(info);
}
#ifdef CTC_DEBUG_MODEM_OPEN
- printk(KERN_DEBUG "ctc_tty_open %s%d successful...\n", CTC_TTY_NAME, info->line);
+ printk(KERN_DEBUG "ctc_tty_open %s successful...\n", tty->name);
#endif
return 0;
}
@@ -1024,7 +1024,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
ulong flags;
ulong timeout;
- if (!info || ctc_tty_paranoia_check(info, tty->device, "ctc_tty_close"))
+ if (!info || ctc_tty_paranoia_check(info, tty->name, "ctc_tty_close"))
return;
spin_lock_irqsave(&ctc_tty_lock, flags);
if (tty_hung_up_p(filp)) {
@@ -1119,7 +1119,7 @@ ctc_tty_hangup(struct tty_struct *tty)
ctc_tty_info *info = (ctc_tty_info *)tty->driver_data;
unsigned long saveflags;
- if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_hangup"))
+ if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_hangup"))
return;
ctc_tty_shutdown(info);
info->count = 0;
diff --git a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c
index f57a82d23cf8..13b67d5a178c 100644
--- a/drivers/sbus/char/aurora.c
+++ b/drivers/sbus/char/aurora.c
@@ -107,7 +107,7 @@ static struct termios * aurora_termios_locked[AURORA_TNPORTS] = { NULL, };
DECLARE_TASK_QUEUE(tq_aurora);
static inline int aurora_paranoia_check(struct Aurora_port const * port,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef AURORA_PARANOIA_CHECK
static const char *badmagic =
@@ -116,11 +116,11 @@ static inline int aurora_paranoia_check(struct Aurora_port const * port,
KERN_DEBUG "aurora: Warning: null aurora port for device %s in %s\n";
if (!port) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (port->magic != AURORA_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -1433,7 +1433,7 @@ static int aurora_open(struct tty_struct * tty, struct file * filp)
bp = &aurora_board[board];
port = aurora_port + board * AURORA_NPORT * AURORA_NCD180 + AURORA_PORT(minor(tty->device));
- if (aurora_paranoia_check(port, tty->device, "aurora_open")) {
+ if ((aurora_paranoia_check(port, tty->name, "aurora_open")) {
#ifdef AURORA_DEBUG
printk("aurora_open: error paranoia check\n");
#endif
@@ -1485,7 +1485,7 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
printk("aurora_close: start\n");
#endif
- if (!port || aurora_paranoia_check(port, tty->device, "close"))
+ if (!port || (aurora_paranoia_check(port, tty->name, "close"))
return;
chip = AURORA_CD180(port_No(port));
@@ -1599,7 +1599,7 @@ static int aurora_write(struct tty_struct * tty, int from_user,
#ifdef AURORA_DEBUG
printk("aurora_write: start %d\n",count);
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_write"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_write"))
return 0;
chip = AURORA_CD180(port_No(port));
@@ -1681,7 +1681,7 @@ static void aurora_put_char(struct tty_struct * tty, unsigned char ch)
#ifdef AURORA_DEBUG
printk("aurora_put_char: start %c\n",ch);
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_put_char"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_put_char"))
return;
if (!tty || !port->xmit_buf)
@@ -1712,7 +1712,7 @@ static void aurora_flush_chars(struct tty_struct * tty)
/*#ifdef AURORA_DEBUG
printk("aurora_flush_chars: start\n");
#endif*/
- if (aurora_paranoia_check(port, tty->device, "aurora_flush_chars"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_flush_chars"))
return;
chip = AURORA_CD180(port_No(port));
@@ -1742,7 +1742,7 @@ static int aurora_write_room(struct tty_struct * tty)
#ifdef AURORA_DEBUG
printk("aurora_write_room: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_write_room"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
@@ -1758,7 +1758,7 @@ static int aurora_chars_in_buffer(struct tty_struct *tty)
{
struct Aurora_port *port = (struct Aurora_port *) tty->driver_data;
- if (aurora_paranoia_check(port, tty->device, "aurora_chars_in_buffer"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_chars_in_buffer"))
return 0;
return port->xmit_cnt;
@@ -1772,7 +1772,7 @@ static void aurora_flush_buffer(struct tty_struct *tty)
#ifdef AURORA_DEBUG
printk("aurora_flush_buffer: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_flush_buffer"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_flush_buffer"))
return;
save_flags(flags); cli();
@@ -2001,7 +2001,7 @@ static int aurora_ioctl(struct tty_struct * tty, struct file * filp,
#ifdef AURORA_DEBUG
printk("aurora_ioctl: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_ioctl"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_ioctl"))
return -ENODEV;
switch (cmd) {
@@ -2062,7 +2062,7 @@ static void aurora_throttle(struct tty_struct * tty)
#ifdef AURORA_DEBUG
printk("aurora_throttle: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_throttle"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_throttle"))
return;
bp = port_Board(port);
@@ -2094,7 +2094,7 @@ static void aurora_unthrottle(struct tty_struct * tty)
#ifdef AURORA_DEBUG
printk("aurora_unthrottle: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_unthrottle"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_unthrottle"))
return;
bp = port_Board(port);
@@ -2129,7 +2129,7 @@ static void aurora_stop(struct tty_struct * tty)
#ifdef AURORA_DEBUG
printk("aurora_stop: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_stop"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_stop"))
return;
bp = port_Board(port);
@@ -2159,7 +2159,7 @@ static void aurora_start(struct tty_struct * tty)
#ifdef AURORA_DEBUG
printk("aurora_start: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_start"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_start"))
return;
bp = port_Board(port);
@@ -2215,7 +2215,7 @@ static void aurora_hangup(struct tty_struct * tty)
#ifdef AURORA_DEBUG
printk("aurora_hangup: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_hangup"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_hangup"))
return;
bp = port_Board(port);
@@ -2239,7 +2239,7 @@ static void aurora_set_termios(struct tty_struct * tty, struct termios * old_ter
#ifdef AURORA_DEBUG
printk("aurora_set_termios: start\n");
#endif
- if (aurora_paranoia_check(port, tty->device, "aurora_set_termios"))
+ if ((aurora_paranoia_check(port, tty->name, "aurora_set_termios"))
return;
if (tty->termios->c_cflag == old_termios->c_cflag &&
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
index b7ad9f03a4ff..1372a11335bc 100644
--- a/drivers/serial/68328serial.c
+++ b/drivers/serial/68328serial.c
@@ -151,20 +151,20 @@ static unsigned char tmp_buf[SERIAL_XMIT_SIZE]; /* This is cheating */
DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct m68k_serial *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
- "Warning: bad magic number for serial struct (%d, %d) in %s\n";
+ "Warning: bad magic number for serial struct %s in %s\n";
static const char *badinfo =
- "Warning: null m68k_serial for (%d, %d) in %s\n";
+ "Warning: null m68k_serial for %s in %s\n";
if (!info) {
- printk(badinfo, major(device), minor(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, major(device), minor(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -216,7 +216,7 @@ static void rs_stop(struct tty_struct *tty)
m68328_uart *uart = &uart_addr[info->line];
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -246,7 +246,7 @@ static void rs_start(struct tty_struct *tty)
m68328_uart *uart = &uart_addr[info->line];
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
save_flags(flags); cli();
@@ -711,7 +711,7 @@ static void rs_set_ldisc(struct tty_struct *tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_set_ldisc"))
+ if (serial_paranoia_check(info, tty->name, "rs_set_ldisc"))
return;
info->is_cons = (tty->termios->c_line == N_TTY);
@@ -725,7 +725,7 @@ static void rs_flush_chars(struct tty_struct *tty)
m68328_uart *uart = &uart_addr[info->line];
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
#ifndef USE_INTS
for(;;) {
@@ -774,7 +774,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
m68328_uart *uart = &uart_addr[info->line];
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit_buf)
@@ -838,7 +838,7 @@ static int rs_write_room(struct tty_struct *tty)
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -850,7 +850,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -859,7 +859,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -882,7 +882,7 @@ static void rs_throttle(struct tty_struct * tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -895,7 +895,7 @@ static void rs_unthrottle(struct tty_struct * tty)
{
struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1035,7 +1035,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
int retval;
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1140,7 +1140,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
m68328_uart *uart = &uart_addr[info->line];
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
save_flags(flags); cli();
@@ -1233,7 +1233,7 @@ void rs_hangup(struct tty_struct *tty)
{
struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
@@ -1381,7 +1381,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
info = &m68k_soft[line];
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
info->count++;
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index a40c6553be47..47594f7c280a 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -282,7 +282,7 @@ static void change_speed(ser_info_t *info);
static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout);
static inline int serial_paranoia_check(ser_info_t *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
@@ -291,11 +291,11 @@ static inline int serial_paranoia_check(ser_info_t *info,
"Warning: null async_struct for (%s) in %s\n";
if (!info) {
- printk(badinfo, cdevname(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -339,7 +339,7 @@ static void rs_360_stop(struct tty_struct *tty)
volatile struct scc_regs *sccp;
volatile struct smc_regs *smcp;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
local_irq_save(flags);
@@ -364,7 +364,7 @@ static void rs_360_start(struct tty_struct *tty)
volatile struct scc_regs *sccp;
volatile struct smc_regs *smcp;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
local_irq_save(flags);
@@ -1036,7 +1036,7 @@ static void rs_360_put_char(struct tty_struct *tty, unsigned char ch)
ser_info_t *info = (ser_info_t *)tty->driver_data;
volatile QUICC_BD *bdp;
- if (serial_paranoia_check(info, tty->device, "rs_put_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_put_char"))
return;
if (!tty)
@@ -1074,7 +1074,7 @@ static int rs_360_write(struct tty_struct * tty, int from_user,
return ret;
#endif
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty)
@@ -1127,7 +1127,7 @@ static int rs_360_write_room(struct tty_struct *tty)
ser_info_t *info = (ser_info_t *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
if ((info->tx_cur->status & BD_SC_READY) == 0) {
@@ -1147,7 +1147,7 @@ static int rs_360_chars_in_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return 0;
}
@@ -1156,7 +1156,7 @@ static void rs_360_flush_buffer(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
/* There is nothing to "flush", whatever we gave the CPM
@@ -1179,7 +1179,7 @@ static void rs_360_send_xchar(struct tty_struct *tty, char ch)
ser_info_t *info = (ser_info_t *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_send_char"))
+ if (serial_paranoia_check(info, tty->name, "rs_send_char"))
return;
bdp = info->tx_cur;
@@ -1218,7 +1218,7 @@ static void rs_360_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1244,7 +1244,7 @@ static void rs_360_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1458,7 +1458,7 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
/* struct async_icount_24 cnow;*/ /* kernel counter temps */
struct serial_icounter_struct *p_cuser; /* user space */
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
@@ -1671,7 +1671,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
volatile struct smc_regs *smcp;
volatile struct scc_regs *sccp;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
state = info->state;
@@ -1785,7 +1785,7 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout)
/*int lsr;*/
volatile QUICC_BD *bdp;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
#ifdef maybe
@@ -1852,7 +1852,7 @@ static void rs_360_hangup(struct tty_struct *tty)
ser_info_t *info = (ser_info_t *)tty->driver_data;
struct serial_state *state = info->state;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
state = info->state;
@@ -2047,12 +2047,11 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
retval = get_async_struct(line, &info);
if (retval)
return retval;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->state->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif
tty->driver_data = info;
info->tty = tty;
@@ -2088,7 +2087,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...", info->line);
+ printk("rs_open %s successful...", tty->name);
#endif
return 0;
}
diff --git a/drivers/serial/core.c b/drivers/serial/core.c
index c242f8f6e8bd..f38106f0e9f8 100644
--- a/drivers/serial/core.c
+++ b/drivers/serial/core.c
@@ -1233,8 +1233,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
state->count = 1;
}
if (--state->count < 0) {
- printk("rs_close: bad serial port count for %s%d: %d\n",
- tty->driver->name, port->line, state->count);
+ printk("rs_close: bad serial port count for %s: %d\n",
+ tty->name, state->count);
state->count = 0;
}
if (state->count)
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index b89dfd95d1fa..fc9e28c4d249 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -148,20 +148,20 @@ static void mcfrs_change_speed(struct mcf_serial *info);
static inline int serial_paranoia_check(struct mcf_serial *info,
- kdev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
- "MCFRS(warning): bad magic number for serial struct (%d, %d) in %s\n";
+ "MCFRS(warning): bad magic number for serial struct %s in %s\n";
static const char *badinfo =
- "MCFRS(warning): null mcf_serial for (%d, %d) in %s\n";
+ "MCFRS(warning): null mcf_serial for %s in %s\n";
if (!info) {
- printk(badinfo, MAJOR(device), MINOR(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, MAJOR(device), MINOR(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -257,7 +257,7 @@ static void mcfrs_stop(struct tty_struct *tty)
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "mcfrs_stop"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_stop"))
return;
local_irq_save(flags);
@@ -273,7 +273,7 @@ static void mcfrs_start(struct tty_struct *tty)
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "mcfrs_start"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_start"))
return;
local_irq_save(flags);
@@ -712,7 +712,7 @@ static void mcfrs_flush_chars(struct tty_struct *tty)
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "mcfrs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -740,7 +740,7 @@ static int mcfrs_write(struct tty_struct * tty, int from_user,
__FILE__, __LINE__, tty, from_user, buf, count);
#endif
- if (serial_paranoia_check(info, tty->device, "mcfrs_write"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_write"))
return 0;
if (!tty || !info->xmit_buf)
@@ -792,7 +792,7 @@ static int mcfrs_write_room(struct tty_struct *tty)
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "mcfrs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -804,7 +804,7 @@ static int mcfrs_chars_in_buffer(struct tty_struct *tty)
{
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "mcfrs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -814,7 +814,7 @@ static void mcfrs_flush_buffer(struct tty_struct *tty)
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "mcfrs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_flush_buffer"))
return;
local_irq_save(flags);
@@ -845,7 +845,7 @@ static void mcfrs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "mcfrs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_throttle"))
return;
if (I_IXOFF(tty))
@@ -864,7 +864,7 @@ static void mcfrs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "mcfrs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1002,7 +1002,7 @@ static int mcfrs_ioctl(struct tty_struct *tty, struct file * file,
int retval, error;
int dtr, rts;
- if (serial_paranoia_check(info, tty->device, "mcfrs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1159,7 +1159,7 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp)
struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "mcfrs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "mcfrs_close"))
return;
local_irq_save(flags);
@@ -1264,7 +1264,7 @@ void mcfrs_hangup(struct tty_struct *tty)
{
struct mcf_serial * info = (struct mcf_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "mcfrs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_hangup"))
return;
mcfrs_flush_buffer(tty);
@@ -1420,11 +1420,10 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp)
if ((line < 0) || (line >= NR_PORTS))
return -ENODEV;
info = mcfrs_table + line;
- if (serial_paranoia_check(info, tty->device, "mcfrs_open"))
+ if (serial_paranoia_check(info, tty->name, "mcfrs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("mcfrs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->count);
+ printk("mcfrs_open %s, count = %d\n", tty->name, info->count);
#endif
info->count++;
tty->driver_data = info;
@@ -1458,7 +1457,7 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("mcfrs_open ttyS%d successful...\n", info->line);
+ printk("mcfrs_open %s successful...\n", tty->name);
#endif
return 0;
}
diff --git a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c
index 54b8c88a1ab7..1a5cd1bb00f2 100644
--- a/drivers/sgi/char/sgiserial.c
+++ b/drivers/sgi/char/sgiserial.c
@@ -143,20 +143,20 @@ static unsigned char tmp_buf[4096]; /* This is cheating */
static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct sgi_serial *info,
- dev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic = KERN_WARNING
- "Warning: bad magic number for serial struct (%d, %d) in %s\n";
+ "Warning: bad magic number for serial struct %s in %s\n";
static const char *badinfo = KERN_WARNING
- "Warning: null sgi_serial for (%d, %d) in %s\n";
+ "Warning: null sgi_serial for %s in %s\n";
if (!info) {
- printk(badinfo, MAJOR(device), MINOR(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, MAJOR(device), MINOR(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -293,7 +293,7 @@ static void rs_stop(struct tty_struct *tty)
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
save_flags(flags); cli();
@@ -310,7 +310,7 @@ static void rs_start(struct tty_struct *tty)
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
save_flags(flags); cli();
@@ -1003,7 +1003,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit_buf)
@@ -1076,7 +1076,7 @@ static int rs_write_room(struct tty_struct *tty)
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -1088,7 +1088,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -1097,7 +1097,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
{
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1113,7 +1113,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct sgi_serial *info = (struct sgi_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
@@ -1167,7 +1167,7 @@ static void rs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty))
@@ -1191,7 +1191,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1377,7 +1377,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
struct sgi_serial * info = (struct sgi_serial *) tty->driver_data;
int retval;
- if (serial_paranoia_check(info, tty->device, "zs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "zs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1473,7 +1473,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct sgi_serial * info = (struct sgi_serial *)tty->driver_data;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
save_flags(flags); cli();
@@ -1574,7 +1574,7 @@ void rs_hangup(struct tty_struct *tty)
{
struct sgi_serial * info = (struct sgi_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
@@ -1735,11 +1735,10 @@ int rs_open(struct tty_struct *tty, struct file * filp)
/* Is the kgdb running over this line? */
if (info->kgdb_channel)
return -ENODEV;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->count);
#endif
info->count++;
tty->driver_data = info;
@@ -1781,7 +1780,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...\n", info->line);
+ printk("rs_open %s successful...\n", tty->name);
#endif
return 0;
}
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index a24d5c4eea4c..ad814df91191 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -235,20 +235,20 @@ static unsigned char tmp_buf[4096]; /* This is cheating */
static DECLARE_MUTEX(tmp_buf_sem);
static inline int serial_paranoia_check(struct dec_serial *info,
- dev_t device, const char *routine)
+ char *name, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
- "Warning: bad magic number for serial struct (%d, %d) in %s\n";
+ "Warning: bad magic number for serial struct %s in %s\n";
static const char *badinfo =
- "Warning: null mac_serial for (%d, %d) in %s\n";
+ "Warning: null mac_serial for %s in %s\n";
if (!info) {
- printk(badinfo, MAJOR(device), MINOR(device), routine);
+ printk(badinfo, name, routine);
return 1;
}
if (info->magic != SERIAL_MAGIC) {
- printk(badmagic, MAJOR(device), MINOR(device), routine);
+ printk(badmagic, name, routine);
return 1;
}
#endif
@@ -631,7 +631,7 @@ static void rs_stop(struct tty_struct *tty)
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_stop"))
+ if (serial_paranoia_check(info, tty->name, "rs_stop"))
return;
#if 1
@@ -649,7 +649,7 @@ static void rs_start(struct tty_struct *tty)
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_start"))
+ if (serial_paranoia_check(info, tty->name, "rs_start"))
return;
save_flags(flags); cli();
@@ -928,7 +928,7 @@ static void rs_flush_chars(struct tty_struct *tty)
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
return;
if (info->xmit_cnt <= 0 || tty->stopped || info->tx_stopped ||
@@ -948,7 +948,7 @@ static int rs_write(struct tty_struct * tty, int from_user,
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_write"))
+ if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;
if (!tty || !info->xmit_buf)
@@ -991,7 +991,7 @@ static int rs_write_room(struct tty_struct *tty)
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
int ret;
- if (serial_paranoia_check(info, tty->device, "rs_write_room"))
+ if (serial_paranoia_check(info, tty->name, "rs_write_room"))
return 0;
ret = SERIAL_XMIT_SIZE - info->xmit_cnt - 1;
if (ret < 0)
@@ -1003,7 +1003,7 @@ static int rs_chars_in_buffer(struct tty_struct *tty)
{
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
return 0;
return info->xmit_cnt;
}
@@ -1012,7 +1012,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
{
struct dec_serial *info = (struct dec_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
+ if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
return;
cli();
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
@@ -1043,7 +1043,7 @@ static void rs_throttle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_throttle"))
+ if (serial_paranoia_check(info, tty->name, "rs_throttle"))
return;
if (I_IXOFF(tty)) {
@@ -1071,7 +1071,7 @@ static void rs_unthrottle(struct tty_struct * tty)
tty->ldisc.chars_in_buffer(tty));
#endif
- if (serial_paranoia_check(info, tty->device, "rs_unthrottle"))
+ if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
return;
if (I_IXOFF(tty)) {
@@ -1251,7 +1251,7 @@ static void rs_break(struct tty_struct *tty, int break_state)
struct dec_serial *info = (struct dec_serial *) tty->driver_data;
unsigned long flags;
- if (serial_paranoia_check(info, tty->device, "rs_break"))
+ if (serial_paranoia_check(info, tty->name, "rs_break"))
return;
if (!info->port)
return;
@@ -1274,7 +1274,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
if (info->hook)
return -ENODEV;
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1356,7 +1356,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
struct dec_serial * info = (struct dec_serial *)tty->driver_data;
unsigned long flags;
- if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
+ if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
return;
save_flags(flags); cli();
@@ -1452,7 +1452,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
struct dec_serial *info = (struct dec_serial *) tty->driver_data;
unsigned long orig_jiffies, char_time;
- if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
+ if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent"))
return;
orig_jiffies = jiffies;
@@ -1485,7 +1485,7 @@ void rs_hangup(struct tty_struct *tty)
{
struct dec_serial * info = (struct dec_serial *)tty->driver_data;
- if (serial_paranoia_check(info, tty->device, "rs_hangup"))
+ if (serial_paranoia_check(info, tty->name, "rs_hangup"))
return;
rs_flush_buffer(tty);
@@ -1639,7 +1639,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
struct dec_serial *info;
int retval, line;
- line = MINOR(tty->device) - tty->driver->minor_start;
+ line = minor(tty->device) - tty->driver->minor_start;
if ((line < 0) || (line >= zs_channels_found))
return -ENODEV;
info = zs_soft + line;
@@ -1647,11 +1647,10 @@ int rs_open(struct tty_struct *tty, struct file * filp)
if (info->hook)
return -ENODEV;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->name, "rs_open"))
return -ENODEV;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line,
- info->count);
+ printk("rs_open %s, count = %d\n", tty->name, info->count);
#endif
info->count++;
@@ -1708,7 +1707,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttyS%02d successful...", info->line);
+ printk("rs_open %s successful...", tty->name);
#endif
/* tty->low_latency = 1; */
return 0;
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 1ee727bd536c..f48a081bf8cb 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -262,6 +262,7 @@ struct tty_struct {
struct tty_driver *driver;
struct tty_ldisc ldisc;
struct termios *termios, *termios_locked;
+ char name[64];
int pgrp;
int session;
kdev_t device;