summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorRob Radez <rob@osinvestor.com>2003-07-15 09:25:30 -0700
committerDavid S. Miller <davem@kernel.bkbits.net>2003-07-15 09:25:30 -0700
commit1cdade5e1f80b95a3e64192b198579cdb4df39c5 (patch)
tree49a3c1606c68fba8a7bfc3a06152cdfb3fca55cb /drivers/serial
parenteb40c469128fc8478ac3c7317ae8fda9b9e78959 (diff)
[SERIAL]: Do not use serio->private to track serio open status in sun drivers.
Issue discovered by Ricky Beam (jfbeam@bluetronic.net).
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/sunsu.c9
-rw-r--r--drivers/serial/sunzilog.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 57fc1906a4c1..3a65cef7f7ed 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -102,6 +102,7 @@ struct uart_sunsu_port {
int l1_down;
#ifdef CONFIG_SERIO
struct serio serio;
+ int serio_open;
#endif
};
@@ -1021,12 +1022,13 @@ static int sunsu_serio_write(struct serio *serio, unsigned char ch)
static int sunsu_serio_open(struct serio *serio)
{
+ struct uart_sunsu_port *up = serio->driver;
unsigned long flags;
int ret;
spin_lock_irqsave(&sunsu_serio_lock, flags);
- if (serio->private == NULL) {
- serio->private = (void *) -1L;
+ if (!up->serio_open) {
+ up->serio_open = 1;
ret = 0;
} else
ret = -EBUSY;
@@ -1037,10 +1039,11 @@ static int sunsu_serio_open(struct serio *serio)
static void sunsu_serio_close(struct serio *serio)
{
+ struct uart_sunsu_port *up = serio->driver;
unsigned long flags;
spin_lock_irqsave(&sunsu_serio_lock, flags);
- serio->private = NULL;
+ up->serio_open = 0;
spin_unlock_irqrestore(&sunsu_serio_lock, flags);
}
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 1f63f74fdf57..a86467c3619c 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -112,6 +112,7 @@ struct uart_sunzilog_port {
#ifdef CONFIG_SERIO
struct serio serio;
+ int serio_open;
#endif
};
@@ -1311,12 +1312,13 @@ static int sunzilog_serio_write(struct serio *serio, unsigned char ch)
static int sunzilog_serio_open(struct serio *serio)
{
+ struct uart_sunzilog_port *up = serio->driver;
unsigned long flags;
int ret;
spin_lock_irqsave(&sunzilog_serio_lock, flags);
- if (serio->private == NULL) {
- serio->private = (void *) -1L;
+ if (!up->serio_open) {
+ up->serio_open = 1;
ret = 0;
} else
ret = -EBUSY;
@@ -1327,10 +1329,11 @@ static int sunzilog_serio_open(struct serio *serio)
static void sunzilog_serio_close(struct serio *serio)
{
+ struct uart_sunzilog_port *up = serio->driver;
unsigned long flags;
spin_lock_irqsave(&sunzilog_serio_lock, flags);
- serio->private = NULL;
+ up->serio_open = 0;
spin_unlock_irqrestore(&sunzilog_serio_lock, flags);
}