summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2003-06-11 07:40:51 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-11 07:40:51 -0700
commita689e686b140e6e89656e91ef058d5b82e73d641 (patch)
tree076414269194efcdf2a270b30b4447db390a2ab3 /drivers
parent4b19f739f33fea1e5d63424072dbaf0fa949274f (diff)
[PATCH] tty_driver refcounting
->refcount switched from int * to int. Per-driver variables gone since we had switched from int foo = 0; driver.refcount = &foo; to driver.refcount = 0;
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/amiserial.c4
-rw-r--r--drivers/char/cyclades.c2
-rw-r--r--drivers/char/dz.c1
-rw-r--r--drivers/char/dz.h2
-rw-r--r--drivers/char/epca.c3
-rw-r--r--drivers/char/esp.c4
-rw-r--r--drivers/char/hvc_console.c2
-rw-r--r--drivers/char/ip2main.c7
-rw-r--r--drivers/char/isicom.c2
-rw-r--r--drivers/char/istallion.c2
-rw-r--r--drivers/char/moxa.c2
-rw-r--r--drivers/char/mxser.c2
-rw-r--r--drivers/char/pcmcia/synclink_cs.c2
-rw-r--r--drivers/char/pcxx.c2
-rw-r--r--drivers/char/pty.c2
-rw-r--r--drivers/char/rio/rio_linux.c2
-rw-r--r--drivers/char/riscom8.c2
-rw-r--r--drivers/char/rocket.c2
-rw-r--r--drivers/char/ser_a2232.c2
-rw-r--r--drivers/char/serial167.c2
-rw-r--r--drivers/char/serial_tx3912.c2
-rw-r--r--drivers/char/sh-sci.c2
-rw-r--r--drivers/char/specialix.c2
-rw-r--r--drivers/char/stallion.c2
-rw-r--r--drivers/char/sx.c2
-rw-r--r--drivers/char/synclink.c2
-rw-r--r--drivers/char/synclinkmp.c2
-rw-r--r--drivers/char/tty_io.c10
-rw-r--r--drivers/char/vme_scc.c2
-rw-r--r--drivers/char/vt.c3
-rw-r--r--drivers/isdn/capi/capi.c2
-rw-r--r--drivers/isdn/i4l/isdn_tty.c1
-rw-r--r--drivers/isdn/i4l/isdn_tty.h1
-rw-r--r--drivers/macintosh/macserial.c2
-rw-r--r--drivers/net/wan/pc300_tty.c10
-rw-r--r--drivers/net/wan/sdla_chdlc.c5
-rw-r--r--drivers/s390/char/con3215.c2
-rw-r--r--drivers/s390/char/sclp_tty.c2
-rw-r--r--drivers/s390/char/tubtty.c4
-rw-r--r--drivers/s390/net/ctctty.c2
-rw-r--r--drivers/sbus/char/aurora.c2
-rw-r--r--drivers/serial/68328serial.c2
-rw-r--r--drivers/serial/68360serial.c2
-rw-r--r--drivers/serial/core.c10
-rw-r--r--drivers/serial/mcfserial.c2
-rw-r--r--drivers/sgi/char/sgiserial.c2
-rw-r--r--drivers/tc/zs.c2
-rw-r--r--drivers/usb/class/bluetty.c2
-rw-r--r--drivers/usb/class/cdc-acm.c4
-rw-r--r--drivers/usb/serial/usb-serial.c2
50 files changed, 19 insertions, 120 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 77f771e581d1..13564c819a2d 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", \
- tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_driver.refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
@@ -103,7 +103,6 @@ static char *serial_version = "4.30";
static char *serial_name = "Amiga-builtin serial driver";
static struct tty_driver serial_driver;
-static int serial_refcount;
/* serial subtype definitions */
#ifndef SERIAL_TYPE_NORMAL
@@ -2087,7 +2086,6 @@ static int __init rs_init(void)
serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 4e8c68999dc6..228ab61fbd10 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -713,7 +713,6 @@ cy_get_user(unsigned long *addr)
#define JIFFIES_DIFF(n, j) ((j) - (n))
static struct tty_driver cy_serial_driver;
-static int serial_refcount;
#ifdef CONFIG_ISA
/* This is the address lookup table. The driver will probe for
@@ -5456,7 +5455,6 @@ cy_init(void)
cy_serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
cy_serial_driver.flags = TTY_DRIVER_REAL_RAW;
- cy_serial_driver.refcount = &serial_refcount;
cy_serial_driver.table = serial_table;
cy_serial_driver.termios = serial_termios;
cy_serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/dz.c b/drivers/char/dz.c
index 5b87268f803f..7f6d3e0a8c12 100644
--- a/drivers/char/dz.c
+++ b/drivers/char/dz.c
@@ -1307,7 +1307,6 @@ int __init dz_init(void)
serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL |
CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/dz.h b/drivers/char/dz.h
index 6765eaa0f1e5..f019cfc4002e 100644
--- a/drivers/char/dz.h
+++ b/drivers/char/dz.h
@@ -172,8 +172,6 @@ static struct tty_struct *serial_table[DZ_NB_PORT];
static struct termios *serial_termios[DZ_NB_PORT];
static struct termios *serial_termios_locked[DZ_NB_PORT];
-static int serial_refcount;
-
/*
* tmp_buf is used as a temporary buffer by serial_write. We need to
* lock it in case the copy_from_user blocks while swapping in a page,
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index bdac768eb7a2..9f0e7cb8b096 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -82,7 +82,7 @@
/* ----------------- Begin global definitions ------------------- */
static char mesg[100];
-static int pc_refcount, nbdevs, num_cards, liloconfig;
+static int nbdevs, num_cards, liloconfig;
static int digi_poller_inhibited = 1 ;
static int setup_error_code;
@@ -1663,7 +1663,6 @@ int __init pc_init(void)
pc_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
pc_driver.init_termios.c_lflag = 0;
pc_driver.flags = TTY_DRIVER_REAL_RAW;
- pc_driver.refcount = &pc_refcount;
pc_driver.table = pc_table;
/* pc_termios is an array of pointers pointing at termios structs */
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 6ca3f4a08b24..d94a1a5a7a15 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -110,7 +110,6 @@ static char serial_version[] __initdata = "2.2";
static DECLARE_TASK_QUEUE(tq_esp);
static struct tty_driver esp_driver;
-static int serial_refcount;
/* serial subtype definitions */
#define SERIAL_TYPE_NORMAL 1
@@ -134,7 +133,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", \
- tty->name, (info->flags), serial_refcount,info->count,tty->count,s)
+ tty->name, (info->flags), serial_driver.refcount,info->count,tty->count,s)
#else
#define DBG_CNT(s)
#endif
@@ -2519,7 +2518,6 @@ int __init espserial_init(void)
esp_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
esp_driver.flags = TTY_DRIVER_REAL_RAW;
- esp_driver.refcount = &serial_refcount;
esp_driver.table = serial_table;
esp_driver.termios = serial_termios;
esp_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 9a9f0d79e10c..6c7648976985 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -42,7 +42,6 @@ extern int hvc_put_chars(int index, const char *buf, int count);
#define TIMEOUT ((HZ + 99) / 100)
struct tty_driver hvc_driver;
-static int hvc_refcount;
static struct tty_struct *hvc_table[MAX_NR_HVC_CONSOLES];
static struct termios *hvc_termios[MAX_NR_HVC_CONSOLES];
static struct termios *hvc_termios_locked[MAX_NR_HVC_CONSOLES];
@@ -268,7 +267,6 @@ int __init hvc_init(void)
hvc_driver.type = TTY_DRIVER_TYPE_SYSTEM;
hvc_driver.init_termios = tty_std_termios;
hvc_driver.flags = TTY_DRIVER_REAL_RAW;
- hvc_driver.refcount = &hvc_refcount;
hvc_driver.table = hvc_table;
hvc_driver.termios = hvc_termios;
hvc_driver.termios_locked = hvc_termios_locked;
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index b8720fec4462..c4ec475658c6 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -297,8 +297,6 @@ static unsigned short find_eisa_board(int);
static struct tty_driver ip2_tty_driver;
-static int ref_count;
-
/* Here, then is a table of board pointers which the interrupt routine should
* scan through to determine who it must service.
*/
@@ -354,7 +352,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", \
- tty->name,(pCh->flags),ref_count, \
+ tty->name,(pCh->flags),ip2_tty_driver.refcount, \
tty->count,/*GET_USE_COUNT(module)*/0,s)
#else
#define DBG_CNT(s)
@@ -788,7 +786,6 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
ip2_tty_driver.init_termios = tty_std_termios;
ip2_tty_driver.init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL;
ip2_tty_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
- ip2_tty_driver.refcount = &ref_count;
ip2_tty_driver.table = TtyTable;
ip2_tty_driver.termios = Termios;
ip2_tty_driver.termios_locked = TermiosLocked;
@@ -3039,7 +3036,7 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg )
case 13:
switch ( cmd ) {
case 64: /* Driver - ip2stat */
- PUT_USER(rc, ref_count, pIndex++ );
+ PUT_USER(rc, ip2_tty_driver.refcount, pIndex++ );
PUT_USER(rc, irq_counter, pIndex++ );
PUT_USER(rc, bh_counter, pIndex++ );
break;
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 55e05201248a..7e4c323c734a 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -73,7 +73,6 @@ static struct pci_device_id isicom_pci_tbl[] = {
};
MODULE_DEVICE_TABLE(pci, isicom_pci_tbl);
-static int isicom_refcount;
static int prev_card = 3; /* start servicing isi_card[0] */
static struct isi_board * irq_to_board[16];
static struct tty_driver isicom_normal;
@@ -1676,7 +1675,6 @@ static int register_drivers(void)
isicom_normal.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL |CLOCAL;
isicom_normal.flags = TTY_DRIVER_REAL_RAW;
- isicom_normal.refcount = &isicom_refcount;
isicom_normal.table = isicom_table;
isicom_normal.termios = isicom_termios;
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 6e7564dbcb01..98859a334b3b 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -174,7 +174,6 @@ static struct tty_driver stli_serial;
static struct tty_struct *stli_ttys[STL_MAXDEVS];
static struct termios *stli_termios[STL_MAXDEVS];
static struct termios *stli_termioslocked[STL_MAXDEVS];
-static int stli_refcount;
/*
* We will need to allocate a temporary write buffer for chars that
@@ -5301,7 +5300,6 @@ int __init stli_init(void)
stli_serial.subtype = SERIAL_TYPE_NORMAL;
stli_serial.init_termios = stli_deftermios;
stli_serial.flags = TTY_DRIVER_REAL_RAW;
- stli_serial.refcount = &stli_refcount;
stli_serial.table = stli_ttys;
stli_serial.termios = stli_termios;
stli_serial.termios_locked = stli_termioslocked;
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index d3d5aa86a6a6..77febc2eaba1 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -211,7 +211,6 @@ static struct tty_struct *moxaTable[MAX_PORTS + 1];
static struct termios *moxaTermios[MAX_PORTS + 1];
static struct termios *moxaTermiosLocked[MAX_PORTS + 1];
static struct moxa_str moxaChannels[MAX_PORTS];
-static int moxaRefcount;
static unsigned char *moxaXmitBuff;
static int moxaTimer_on;
static struct timer_list moxaTimer;
@@ -344,7 +343,6 @@ int moxa_init(void)
moxaDriver.init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
moxaDriver.init_termios.c_lflag = 0;
moxaDriver.flags = TTY_DRIVER_REAL_RAW;
- moxaDriver.refcount = &moxaRefcount;
moxaDriver.table = moxaTable;
moxaDriver.termios = moxaTermios;
moxaDriver.termios_locked = moxaTermiosLocked;
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 7d3c681e87b7..21faddbaf9fa 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -289,7 +289,6 @@ static int mxserBoardCAP[MXSER_BOARDS] =
static struct tty_driver mxvar_sdriver;
-static int mxvar_refcount;
static struct mxser_struct mxvar_table[MXSER_PORTS];
static struct tty_struct *mxvar_tty[MXSER_PORTS + 1];
static struct termios *mxvar_termios[MXSER_PORTS + 1];
@@ -502,7 +501,6 @@ static int __init mxser_module_init(void)
mxvar_sdriver.init_termios = tty_std_termios;
mxvar_sdriver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
mxvar_sdriver.flags = TTY_DRIVER_REAL_RAW;
- mxvar_sdriver.refcount = &mxvar_refcount;
mxvar_sdriver.table = mxvar_tty;
mxvar_sdriver.termios = mxvar_termios;
mxvar_sdriver.termios_locked = mxvar_termios_locked;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 72515034646c..0cdb126c313c 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -498,7 +498,6 @@ static char *driver_name = "SyncLink PC Card driver";
static char *driver_version = "$Revision: 4.10 $";
static struct tty_driver serial_driver;
-static int serial_refcount;
/* number of characters left in xmit buffer before we ask for more */
#define WAKEUP_CHARS 256
@@ -3171,7 +3170,6 @@ static int __init synclink_cs_init(void)
serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/pcxx.c b/drivers/char/pcxx.c
index 3055eba0ddc4..86c8066a3765 100644
--- a/drivers/char/pcxx.c
+++ b/drivers/char/pcxx.c
@@ -144,7 +144,6 @@ int pcxx_nbios=sizeof(pcxx_bios);
#define PCXE_EVENT_HANGUP 1
struct tty_driver pcxe_driver;
-static int pcxe_refcount;
static struct timer_list pcxx_timer;
@@ -1193,7 +1192,6 @@ int __init pcxe_init(void)
pcxe_driver.init_termios = tty_std_termios;
pcxe_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
pcxe_driver.flags = TTY_DRIVER_REAL_RAW;
- pcxe_driver.refcount = &pcxe_refcount;
pcxe_driver.table = pcxe_table;
pcxe_driver.termios = pcxe_termios;
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index fa74f8c24d2d..98dad3f771b4 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -39,7 +39,6 @@ struct pty_struct {
#define PTY_MAGIC 0x5001
static struct tty_driver pty_driver, pty_slave_driver;
-static int pty_refcount;
/* Note: one set of tables for BSD and one for Unix98 */
static struct tty_struct *pty_table[NR_PTYS];
@@ -360,7 +359,6 @@ int __init pty_init(void)
pty_driver.init_termios.c_cflag = B38400 | CS8 | CREAD;
pty_driver.init_termios.c_lflag = 0;
pty_driver.flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW;
- pty_driver.refcount = &pty_refcount;
pty_driver.table = pty_table;
pty_driver.termios = pty_termios;
pty_driver.termios_locked = pty_termios_locked;
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 2627fcb3f699..e587cd4de817 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -214,7 +214,6 @@ struct rio_info *p;
/* struct rio_board boards[RIO_HOSTS]; */
struct rio_port *rio_ports;
-int rio_refcount;
int rio_initialized;
int rio_nports;
int rio_debug;
@@ -886,7 +885,6 @@ static int rio_init_drivers(void)
rio_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
rio_driver.flags = TTY_DRIVER_REAL_RAW;
- rio_driver.refcount = &rio_refcount;
rio_driver.table = rio_table;
rio_driver.termios = rio_termios;
rio_driver.termios_locked = rio_termios_locked;
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 94df86a89c96..18917d85b5cf 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -85,7 +85,6 @@ static DECLARE_TASK_QUEUE(tq_riscom);
static struct riscom_board * IRQ_to_board[16];
static struct tty_driver riscom_driver;
-static int riscom_refcount;
static struct tty_struct * riscom_table[RC_NBOARD * RC_NPORT];
static struct termios * riscom_termios[RC_NBOARD * RC_NPORT];
static struct termios * riscom_termios_locked[RC_NBOARD * RC_NPORT];
@@ -1718,7 +1717,6 @@ static inline int rc_init_drivers(void)
riscom_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
riscom_driver.flags = TTY_DRIVER_REAL_RAW;
- riscom_driver.refcount = &riscom_refcount;
riscom_driver.table = riscom_table;
riscom_driver.termios = riscom_termios;
riscom_driver.termios_locked = riscom_termios_locked;
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index caca17cc2d00..40f20c3e8142 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -174,7 +174,6 @@ static struct tty_struct *rocket_table[MAX_RP_PORTS]; /* TTY required variables
static struct termios *rocket_termios[MAX_RP_PORTS];
static struct termios *rocket_termios_locked[MAX_RP_PORTS];
static struct tty_driver rocket_driver;
-static int rocket_refcount;
static struct rocket_version driver_version = {
ROCKET_VERSION, ROCKET_DATE
@@ -2661,7 +2660,6 @@ int __init rp_init(void)
#ifdef ROCKET_SOFT_FLOW
rocket_driver.flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
#endif
- rocket_driver.refcount = &rocket_refcount;
rocket_driver.table = rocket_table;
rocket_driver.termios = rocket_termios;
rocket_driver.termios_locked = rocket_termios_locked;
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 7d023a5b6112..dd0ae666dae5 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -174,7 +174,6 @@ static struct a2232_port a2232_ports[MAX_A2232_BOARDS*NUMLINES];
static struct tty_driver a2232_driver;
/* Variables used by the TTY driver */
-static int a2232_refcount;
static struct tty_struct *a2232_table[MAX_A2232_BOARDS*NUMLINES] = { NULL, };
static struct termios *a2232_termios[MAX_A2232_BOARDS*NUMLINES];
static struct termios *a2232_termios_locked[MAX_A2232_BOARDS*NUMLINES];
@@ -704,7 +703,6 @@ static int a2232_init_drivers(void)
a2232_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
a2232_driver.flags = TTY_DRIVER_REAL_RAW;
- a2232_driver.refcount = &a2232_refcount;
a2232_driver.table = a2232_table;
a2232_driver.termios = a2232_termios;
a2232_driver.termios_locked = a2232_termios_locked;
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 5ae35e3bd658..3cf7ddb99678 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -127,7 +127,6 @@ struct cyclades_port cy_port[] = {
};
#define NR_PORTS (sizeof(cy_port)/sizeof(struct cyclades_port))
-static int serial_refcount;
static struct tty_struct *serial_table[NR_PORTS];
static struct termios *serial_termios[NR_PORTS];
@@ -2370,7 +2369,6 @@ scrn[1] = '\0';
cy_serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
cy_serial_driver.flags = TTY_DRIVER_REAL_RAW;
- cy_serial_driver.refcount = &serial_refcount;
cy_serial_driver.table = serial_table;
cy_serial_driver.termios = serial_termios;
cy_serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/serial_tx3912.c b/drivers/char/serial_tx3912.c
index 65c3de17682b..c8ca4ef6f1ce 100644
--- a/drivers/char/serial_tx3912.c
+++ b/drivers/char/serial_tx3912.c
@@ -64,7 +64,6 @@ static struct tty_struct * rs_table[TX3912_UART_NPORTS] = { NULL, };
static struct termios ** rs_termios;
static struct termios ** rs_termios_locked;
struct rs_port *rs_ports;
-int rs_refcount;
int rs_initialized = 0;
/*
@@ -810,7 +809,6 @@ static int rs_init_drivers(void)
rs_driver.init_termios = tty_std_termios;
rs_driver.init_termios.c_cflag =
B115200 | CS8 | CREAD | HUPCL | CLOCAL;
- rs_driver.refcount = &rs_refcount;
rs_driver.table = rs_table;
rs_driver.termios = rs_termios;
rs_driver.termios_locked = rs_termios_locked;
diff --git a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c
index 9091039dcdf1..9b4c64ec06a5 100644
--- a/drivers/char/sh-sci.c
+++ b/drivers/char/sh-sci.c
@@ -83,7 +83,6 @@ static struct tty_struct *sci_table[SCI_NPORTS] = { NULL, };
static struct termios *sci_termios[SCI_NPORTS];
static struct termios *sci_termios_locked[SCI_NPORTS];
-static int sci_refcount;
static int sci_debug = 0;
#ifdef MODULE
@@ -1005,7 +1004,6 @@ static int sci_init_drivers(void)
sci_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL | CRTSCTS;
sci_driver.flags = TTY_DRIVER_REAL_RAW;
- sci_driver.refcount = &sci_refcount;
sci_driver.table = sci_table;
sci_driver.termios = sci_termios;
sci_driver.termios_locked = sci_termios_locked;
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index c092d8bf8291..6536d73bc015 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -177,7 +177,6 @@ DECLARE_TASK_QUEUE(tq_specialix);
#define RS_EVENT_WRITE_WAKEUP 0
static struct tty_driver specialix_driver;
-static int specialix_refcount;
static struct tty_struct * specialix_table[SX_NBOARD * SX_NPORT];
static struct termios * specialix_termios[SX_NBOARD * SX_NPORT];
static struct termios * specialix_termios_locked[SX_NBOARD * SX_NPORT];
@@ -2191,7 +2190,6 @@ static int sx_init_drivers(void)
specialix_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
specialix_driver.flags = TTY_DRIVER_REAL_RAW;
- specialix_driver.refcount = &specialix_refcount;
specialix_driver.table = specialix_table;
specialix_driver.termios = specialix_termios;
specialix_driver.termios_locked = specialix_termios_locked;
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index a5ce89e1f567..caf13fd7c084 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -141,7 +141,6 @@ static struct tty_driver stl_serial;
static struct tty_struct *stl_ttys[STL_MAXDEVS];
static struct termios *stl_termios[STL_MAXDEVS];
static struct termios *stl_termioslocked[STL_MAXDEVS];
-static int stl_refcount;
/*
* We will need to allocate a temporary write buffer for chars that
@@ -3179,7 +3178,6 @@ int __init stl_init(void)
stl_serial.subtype = SERIAL_TYPE_NORMAL;
stl_serial.init_termios = stl_deftermios;
stl_serial.flags = TTY_DRIVER_REAL_RAW;
- stl_serial.refcount = &stl_refcount;
stl_serial.table = stl_ttys;
stl_serial.termios = stl_termios;
stl_serial.termios_locked = stl_termioslocked;
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 55492725c603..236fc807fd85 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -316,7 +316,6 @@ static struct termios ** sx_termios_locked;
static struct sx_board boards[SX_NBOARDS];
static struct sx_port *sx_ports;
-static int sx_refcount;
static int sx_initialized;
static int sx_nports;
static int sx_debug;
@@ -2240,7 +2239,6 @@ static int sx_init_drivers(void)
sx_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
sx_driver.flags = TTY_DRIVER_REAL_RAW;
- sx_driver.refcount = &sx_refcount;
sx_driver.table = sx_table;
sx_driver.termios = sx_termios;
sx_driver.termios_locked = sx_termios_locked;
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index ec5b1125b32c..bc6834240d0c 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -935,7 +935,6 @@ static struct pci_driver synclink_pci_driver = {
};
static struct tty_driver serial_driver;
-static int serial_refcount;
/* number of characters left in xmit buffer before we ask for more */
#define WAKEUP_CHARS 256
@@ -4478,7 +4477,6 @@ int mgsl_init_tty()
serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 202e6e7d6137..4bff0c2c4594 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -522,7 +522,6 @@ static struct pci_driver synclinkmp_pci_driver = {
static struct tty_driver serial_driver;
-static int serial_refcount;
/* number of characters left in xmit buffer before we ask for more */
#define WAKEUP_CHARS 256
@@ -3807,7 +3806,6 @@ static int __init synclinkmp_init(void)
serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 5d47b9e74dad..1b11a1a9b09f 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -896,7 +896,7 @@ static int init_dev(struct tty_driver *driver, int idx,
*o_ltp_loc = o_ltp;
o_tty->termios = *o_tp_loc;
o_tty->termios_locked = *o_ltp_loc;
- (*driver->other->refcount)++;
+ driver->other->refcount++;
if (driver->subtype == PTY_TYPE_MASTER)
o_tty->count++;
@@ -918,7 +918,7 @@ static int init_dev(struct tty_driver *driver, int idx,
*ltp_loc = ltp;
tty->termios = *tp_loc;
tty->termios_locked = *ltp_loc;
- (*driver->refcount)++;
+ driver->refcount++;
tty->count++;
/*
@@ -1017,7 +1017,7 @@ static void release_mem(struct tty_struct *tty, int idx)
kfree(tp);
}
o_tty->magic = 0;
- (*o_tty->driver->refcount)--;
+ o_tty->driver->refcount--;
file_list_lock();
list_del(&o_tty->tty_files);
file_list_unlock();
@@ -1031,7 +1031,7 @@ static void release_mem(struct tty_struct *tty, int idx)
kfree(tp);
}
tty->magic = 0;
- (*tty->driver->refcount)--;
+ tty->driver->refcount--;
file_list_lock();
list_del(&tty->tty_files);
file_list_unlock();
@@ -2275,7 +2275,7 @@ int tty_unregister_driver(struct tty_driver *driver)
int i;
struct termios *tp;
- if (*driver->refcount)
+ if (driver->refcount)
return -EBUSY;
cdev_unmap(MKDEV(driver->major, driver->minor_start), driver->num);
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index 26180a70ecba..621649f5838d 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -97,7 +97,6 @@ static struct termios * scc_termios[2];
static struct termios * scc_termios_locked[2];
struct scc_port scc_ports[2];
-int scc_refcount;
int scc_initialized = 0;
/*---------------------------------------------------------------------------
@@ -142,7 +141,6 @@ static int scc_init_drivers(void)
scc_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
scc_driver.flags = TTY_DRIVER_REAL_RAW;
- scc_driver.refcount = &scc_refcount;
scc_driver.table = scc_table;
scc_driver.termios = scc_termios;
scc_driver.termios_locked = scc_termios_locked;
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 18406503d135..85512f77fe60 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2473,8 +2473,6 @@ static void vc_init(unsigned int currcons, unsigned int rows, unsigned int cols,
* the appropriate escape-sequence.
*/
-static int console_refcount;
-
static int __init con_init(void)
{
const char *display_desc = NULL;
@@ -2541,7 +2539,6 @@ int __init vty_init(void)
console_driver.type = TTY_DRIVER_TYPE_CONSOLE;
console_driver.init_termios = tty_std_termios;
console_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
- console_driver.refcount = &console_refcount;
console_driver.table = console_table;
console_driver.termios = console_termios;
console_driver.termios_locked = console_termios_locked;
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 483a701ab5a1..8830b48adfa0 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1264,7 +1264,6 @@ static int capinc_tty_read_proc(char *page, char **start, off_t off,
#define CAPINC_NR_PORTS 256
static struct tty_driver capinc_tty_driver;
-static int capinc_tty_refcount;
static struct tty_struct *capinc_tty_table[CAPINC_NR_PORTS];
static struct termios *capinc_tty_termios[CAPINC_NR_PORTS];
static struct termios *capinc_tty_termios_locked[CAPINC_NR_PORTS];
@@ -1291,7 +1290,6 @@ static int capinc_tty_init(void)
drv->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
drv->init_termios.c_lflag = 0;
drv->flags = TTY_DRIVER_REAL_RAW|TTY_DRIVER_RESET_TERMIOS;
- drv->refcount = &capinc_tty_refcount;
drv->table = capinc_tty_table;
drv->termios = capinc_tty_termios;
drv->termios_locked = capinc_tty_termios_locked;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 58ae39f1dd7a..63fa749a9756 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -2017,7 +2017,6 @@ isdn_tty_init(void)
m->tty_modem.init_termios = tty_std_termios;
m->tty_modem.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
m->tty_modem.flags = TTY_DRIVER_REAL_RAW;
- m->tty_modem.refcount = &m->refcount;
m->tty_modem.table = m->modem_table;
m->tty_modem.termios = m->modem_termios;
m->tty_modem.termios_locked = m->modem_termios_locked;
diff --git a/drivers/isdn/i4l/isdn_tty.h b/drivers/isdn/i4l/isdn_tty.h
index b2462b991c50..eaba6060b819 100644
--- a/drivers/isdn/i4l/isdn_tty.h
+++ b/drivers/isdn/i4l/isdn_tty.h
@@ -114,7 +114,6 @@ extern int isdn_tty_init(void);
extern void isdn_tty_exit(void);
struct isdn_modem {
- int refcount; /* Number of opens */
struct tty_driver tty_modem; /* tty-device */
struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
struct termios *modem_termios[ISDN_MAX_CHANNELS];
diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c
index 917ce0d7b0db..6c832dca03c7 100644
--- a/drivers/macintosh/macserial.c
+++ b/drivers/macintosh/macserial.c
@@ -106,7 +106,6 @@ static unsigned char scc_inittab[] = {
#define ZS_CLOCK 3686400 /* Z8530 RTxC input clock rate */
static struct tty_driver serial_driver;
-static int serial_refcount;
/* serial subtype definitions */
#define SERIAL_TYPE_NORMAL 1
@@ -2580,7 +2579,6 @@ no_dma:
serial_driver.init_termios.c_cflag =
B38400 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index 73efcb7a0706..149bd2cbf4aa 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -119,7 +119,6 @@ static struct tty_driver serial_drv;
st_cpc_tty_area cpc_tty_area[CPC_TTY_NPORTS];
int cpc_tty_cnt=0; /* number of intrfaces configured with MLPPP */
-int cpc_tty_refcount;
int cpc_tty_unreg_flag = 0;
/* TTY functions prototype */
@@ -227,7 +226,6 @@ void cpc_tty_init(pc300dev_t *pc300dev)
serial_drv.init_termios = tty_std_termios;
serial_drv.init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL;
serial_drv.flags = TTY_DRIVER_REAL_RAW;
- serial_drv.refcount = &cpc_tty_refcount;
/* tty data structures */
serial_drv.table = cpc_tty_serial_table;
@@ -415,7 +413,7 @@ static void cpc_tty_close(struct tty_struct *tty, struct file *flip)
CPC_TTY_DBG("%s: TTY closed\n",cpc_tty->name);
- if (!cpc_tty_refcount && cpc_tty_unreg_flag) {
+ if (!serial_drv.refcount && cpc_tty_unreg_flag) {
cpc_tty_unreg_flag = 0;
CPC_TTY_DBG("%s: unregister the tty driver\n", cpc_tty->name);
if ((res=tty_unregister_driver(&serial_drv))) {
@@ -663,7 +661,7 @@ static void cpc_tty_hangup(struct tty_struct *tty)
CPC_TTY_DBG("%s: TTY is not opened\n",cpc_tty->name);
return ;
}
- if (!cpc_tty_refcount && cpc_tty_unreg_flag) {
+ if (!serial_drv.refcount && cpc_tty_unreg_flag) {
cpc_tty_unreg_flag = 0;
CPC_TTY_DBG("%s: unregister the tty driver\n", cpc_tty->name);
if ((res=tty_unregister_driver(&serial_drv))) {
@@ -1058,9 +1056,9 @@ void cpc_tty_unregister_service(pc300dev_t *pc300dev)
}
if (--cpc_tty_cnt == 0) {
- if (cpc_tty_refcount) {
+ if (serial_drv.refcount) {
CPC_TTY_DBG("%s: unregister is not possible, refcount=%d",
- cpc_tty->name, cpc_tty_refcount);
+ cpc_tty->name, serial_drv.refcount);
cpc_tty_cnt++;
cpc_tty_unreg_flag = 1;
return;
diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c
index 8847c1d79972..c71461930136 100644
--- a/drivers/net/wan/sdla_chdlc.c
+++ b/drivers/net/wan/sdla_chdlc.c
@@ -285,7 +285,6 @@ static void wanpipe_tty_receive(sdla_t *, unsigned, unsigned int);
static void wanpipe_tty_trigger_poll(sdla_t *card);
static struct tty_driver serial_driver;
-static int serial_refcount=1;
static int tty_init_cnt=0;
static struct serial_state rs_table[NR_PORTS];
@@ -1057,7 +1056,7 @@ static void disable_comm (sdla_t *card)
struct serial_state * state;
if (!(--tty_init_cnt)){
int e1;
- *serial_driver.refcount=0;
+ serial_driver.refcount=0;
if ((e1 = tty_unregister_driver(&serial_driver)))
printk("SERIAL: failed to unregister serial driver (%d)\n",
@@ -4415,7 +4414,7 @@ int wanpipe_tty_init(sdla_t *card)
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
+ serial_driver.refcount = 1; /* !@!@^#^&!! */
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index d663c8b2ff63..6e91eebff137 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -111,7 +111,6 @@ static struct tty_driver tty3215_driver;
static struct tty_struct *tty3215_table[NR_3215];
static struct termios *tty3215_termios[NR_3215];
static struct termios *tty3215_termios_locked[NR_3215];
-static int tty3215_refcount;
/*
* Get a request structure from the free list
@@ -1192,7 +1191,6 @@ tty3215_init(void)
tty3215_driver.init_termios.c_oflag = ONLCR | XTABS;
tty3215_driver.init_termios.c_lflag = ISIG;
tty3215_driver.flags = TTY_DRIVER_REAL_RAW;
- tty3215_driver.refcount = &tty3215_refcount;
tty3215_driver.table = tty3215_table;
tty3215_driver.termios = tty3215_termios;
tty3215_driver.termios_locked = tty3215_termios_locked;
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 57bdce0f673c..cf6039b8f9f8 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -61,7 +61,6 @@ struct tty_driver sclp_tty_driver;
static struct tty_struct * sclp_tty_table[1];
static struct termios * sclp_tty_termios[1];
static struct termios * sclp_tty_termios_locked[1];
-static int sclp_tty_refcount = 0;
extern struct termios tty_std_termios;
@@ -774,7 +773,6 @@ sclp_tty_init(void)
sclp_tty_driver.init_termios.c_oflag = ONLCR | XTABS;
sclp_tty_driver.init_termios.c_lflag = ISIG | ECHO;
sclp_tty_driver.flags = TTY_DRIVER_REAL_RAW;
- sclp_tty_driver.refcount = &sclp_tty_refcount;
/* sclp_tty_driver.proc_entry ? */
sclp_tty_driver.table = sclp_tty_table;
sclp_tty_driver.termios = sclp_tty_termios;
diff --git a/drivers/s390/char/tubtty.c b/drivers/s390/char/tubtty.c
index a79e289c282c..28148a3ffd0d 100644
--- a/drivers/s390/char/tubtty.c
+++ b/drivers/s390/char/tubtty.c
@@ -49,7 +49,6 @@ static int tty3270_show_tube(int, char *, int);
static int tty3270_major = -1;
struct tty_driver tty3270_driver;
-static int tty3270_refcount;
static struct tty_struct *tty3270_table[TUBMAXMINS];
static struct termios *tty3270_termios[TUBMAXMINS];
static struct termios *tty3270_termios_locked[TUBMAXMINS];
@@ -57,7 +56,6 @@ static struct termios *tty3270_termios_locked[TUBMAXMINS];
static int con3270_major = -1;
static struct tty_driver con3270_driver;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-static int con3270_refcount;
static struct tty_struct *con3270_table[1];
static struct termios *con3270_termios[1];
static struct termios *con3270_termios_locked[1];
@@ -91,7 +89,6 @@ tty3270_init(void)
td->init_termios = tty_std_termios;
td->flags = TTY_DRIVER_RESET_TERMIOS;
td->flags |= TTY_DRIVER_NO_DEVFS;
- td->refcount = &tty3270_refcount;
td->table = tty3270_table;
td->termios = tty3270_termios;
td->termios_locked = tty3270_termios_locked;
@@ -137,7 +134,6 @@ tty3270_init(void)
td->major = MAJOR(S390_CONSOLE_DEV);
td->minor_start = MINOR(S390_CONSOLE_DEV);
td->num = 1;
- td->refcount = &con3270_refcount;
td->table = con3270_table;
td->termios = con3270_termios;
td->termios_locked = con3270_termios_locked;
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index a868cd2ab0dc..3d08775662fd 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -71,7 +71,6 @@ typedef struct {
/* Description of one CTC-tty */
typedef struct {
- int refcount; /* Number of opens */
struct tty_driver ctc_tty_device; /* tty-device */
struct tty_struct *modem_table[CTC_TTY_MAX_DEVICES];
struct termios *modem_termios[CTC_TTY_MAX_DEVICES];
@@ -1172,7 +1171,6 @@ ctc_tty_init(void)
device->init_termios = tty_std_termios;
device->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
device->flags = TTY_DRIVER_REAL_RAW;
- device->refcount = &driver->refcount;
device->table = driver->modem_table;
device->termios = driver->modem_termios;
device->termios_locked = driver->modem_termios_locked;
diff --git a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c
index 9a7a2625241d..98d7d579aeeb 100644
--- a/drivers/sbus/char/aurora.c
+++ b/drivers/sbus/char/aurora.c
@@ -97,7 +97,6 @@ static struct Aurora_port aurora_port[AURORA_TNPORTS] = {
/* no longer used. static struct Aurora_board * IRQ_to_board[16] = { NULL, } ;*/
static unsigned char * tmp_buf = NULL;
static DECLARE_MUTEX(tmp_buf_sem);
-static int aurora_refcount = 0;
static struct tty_struct * aurora_table[AURORA_TNPORTS] = { NULL, };
static struct termios * aurora_termios[AURORA_TNPORTS] = { NULL, };
static struct termios * aurora_termios_locked[AURORA_TNPORTS] = { NULL, };
@@ -2296,7 +2295,6 @@ static int aurora_init_drivers(void)
aurora_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
aurora_driver.flags = TTY_DRIVER_REAL_RAW;
- aurora_driver.refcount = &aurora_refcount;
aurora_driver.table = aurora_table;
aurora_driver.termios = aurora_termios;
aurora_driver.termios_locked = aurora_termios_locked;
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
index 53e5e3dc3c6c..3dd295844a70 100644
--- a/drivers/serial/68328serial.c
+++ b/drivers/serial/68328serial.c
@@ -84,7 +84,6 @@ extern wait_queue_head_t keypress_wait;
#endif
struct tty_driver serial_driver;
-static int serial_refcount;
/* serial subtype definitions */
#define SERIAL_TYPE_NORMAL 1
@@ -1460,7 +1459,6 @@ rs68328_init(void)
serial_driver.init_termios.c_cflag =
m68328_console_cbaud | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index 6acdd17a8e46..edb33028c938 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -74,7 +74,6 @@ static char *serial_name = "CPM UART driver";
static char *serial_version = "0.03";
static struct tty_driver serial_driver;
-static int serial_refcount;
int serial_console_setup(struct console *co, char *options);
/*
@@ -2550,7 +2549,6 @@ int rs_360_init(void)
serial_driver.init_termios.c_cflag =
baud_idx | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/serial/core.c b/drivers/serial/core.c
index e56baaf1f0e2..6b82a991bc49 100644
--- a/drivers/serial/core.c
+++ b/drivers/serial/core.c
@@ -2084,17 +2084,14 @@ int uart_register_driver(struct uart_driver *drv)
/*
* Maybe we should be using a slab cache for this, especially if
- * we have a large number of ports to handle. Note that we also
- * allocate space for an integer for reference counting.
+ * we have a large number of ports to handle.
*/
- drv->state = kmalloc(sizeof(struct uart_state) * drv->nr +
- sizeof(int), GFP_KERNEL);
+ drv->state = kmalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL);
retval = -ENOMEM;
if (!drv->state)
goto out;
- memset(drv->state, 0, sizeof(struct uart_state) * drv->nr +
- sizeof(int));
+ memset(drv->state, 0, sizeof(struct uart_state) * drv->nr);
termios = kmalloc(sizeof(struct termios *) * drv->nr * 2 +
sizeof(struct tty_struct *) * drv->nr, GFP_KERNEL);
@@ -2125,7 +2122,6 @@ int uart_register_driver(struct uart_driver *drv)
normal->init_termios = tty_std_termios;
normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
- normal->refcount = (int *)(drv->state + drv->nr);
normal->termios = termios;
normal->termios_locked = termios + drv->nr;
normal->table = (struct tty_struct **)(termios + drv->nr * 2);
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 2f8852d1216f..e78846e944e7 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -77,7 +77,6 @@ int mcfrs_console_cbaud = DEFAULT_CBAUD;
* Driver data structures.
*/
struct tty_driver mcfrs_serial_driver;
-static int mcfrs_serial_refcount;
/* serial subtype definitions */
#define SERIAL_TYPE_NORMAL 1
@@ -1596,7 +1595,6 @@ mcfrs_init(void)
mcfrs_serial_driver.init_termios.c_cflag =
mcfrs_console_cbaud | CS8 | CREAD | HUPCL | CLOCAL;
mcfrs_serial_driver.flags = TTY_DRIVER_REAL_RAW;
- mcfrs_serial_driver.refcount = &mcfrs_serial_refcount;
mcfrs_serial_driver.table = mcfrs_serial_table;
mcfrs_serial_driver.termios = mcfrs_serial_termios;
mcfrs_serial_driver.termios_locked = mcfrs_serial_termios_locked;
diff --git a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c
index 7ff8a706b19a..46c861ef9544 100644
--- a/drivers/sgi/char/sgiserial.c
+++ b/drivers/sgi/char/sgiserial.c
@@ -99,7 +99,6 @@ DECLARE_TASK_QUEUE(tq_serial);
struct tty_driver serial_driver;
struct console *sgisercon;
-static int serial_refcount;
/* serial subtype definitions */
#define SERIAL_TYPE_NORMAL 1
@@ -1841,7 +1840,6 @@ int rs_init(void)
serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index d4e0c26c4263..ecbc9903e829 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -181,7 +181,6 @@ static unsigned char zs_init_regs[16] __initdata = {
DECLARE_TASK_QUEUE(tq_zs_serial);
struct tty_driver serial_driver;
-static int serial_refcount;
/* serial subtype definitions */
#define SERIAL_TYPE_NORMAL 1
@@ -1852,7 +1851,6 @@ int __init zs_init(void)
serial_driver.init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
- serial_driver.refcount = &serial_refcount;
serial_driver.table = serial_table;
serial_driver.termios = serial_termios;
serial_driver.termios_locked = serial_termios_locked;
diff --git a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c
index bed2d12f008a..ab5d7a7ece25 100644
--- a/drivers/usb/class/bluetty.c
+++ b/drivers/usb/class/bluetty.c
@@ -241,7 +241,6 @@ static struct usb_driver usb_bluetooth_driver = {
.id_table = usb_bluetooth_ids,
};
-static int bluetooth_refcount;
static struct tty_driver bluetooth_tty_driver;
static struct tty_struct * bluetooth_tty[BLUETOOTH_TTY_MINORS];
static struct termios * bluetooth_termios[BLUETOOTH_TTY_MINORS];
@@ -1307,7 +1306,6 @@ static struct tty_driver bluetooth_tty_driver = {
.subtype = SERIAL_TYPE_NORMAL,
.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS,
- .refcount = &bluetooth_refcount,
.table = bluetooth_tty,
.termios = bluetooth_termios,
.termios_locked = bluetooth_termios_locked,
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 17ce8623ab84..66fb415ce83f 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -736,8 +736,6 @@ static struct usb_driver acm_driver = {
* TTY driver structures.
*/
-static int acm_tty_refcount;
-
static struct tty_struct *acm_tty_table[ACM_TTY_MINORS];
static struct termios *acm_tty_termios[ACM_TTY_MINORS];
static struct termios *acm_tty_termios_locked[ACM_TTY_MINORS];
@@ -754,8 +752,6 @@ static struct tty_driver acm_tty_driver = {
.subtype = SERIAL_TYPE_NORMAL,
.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS,
- .refcount = &acm_tty_refcount,
-
.table = acm_tty_table,
.termios = acm_tty_termios,
.termios_locked = acm_tty_termios_locked,
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index d154003e540e..206cbc490bb4 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -382,7 +382,6 @@ static struct usb_driver usb_serial_driver = {
drivers depend on it.
*/
-static int serial_refcount;
static struct tty_struct * serial_tty[SERIAL_TTY_MINORS];
static struct termios * serial_termios[SERIAL_TTY_MINORS];
static struct termios * serial_termios_locked[SERIAL_TTY_MINORS];
@@ -1313,7 +1312,6 @@ struct tty_driver usb_serial_tty_driver = {
.subtype = SERIAL_TYPE_NORMAL,
.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS,
- .refcount = &serial_refcount,
.table = serial_tty,
.termios = serial_termios,
.termios_locked = serial_termios_locked,