Skip to content

Commit

Permalink
tty: moxa: Kill off the throttle method
Browse files Browse the repository at this point in the history
The tty flag can be tested so the shadow flag isn't needed

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Alan Cox authored and gregkh committed Dec 11, 2009
1 parent a808ac0 commit f9b412a
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions drivers/char/moxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ struct mon_str {
#define TXSTOPPED 1
#define LOWWAIT 2
#define EMPTYWAIT 3
#define THROTTLE 4

#define SERIAL_DO_RESTART

Expand Down Expand Up @@ -194,8 +193,6 @@ static int moxa_write(struct tty_struct *, const unsigned char *, int);
static int moxa_write_room(struct tty_struct *);
static void moxa_flush_buffer(struct tty_struct *);
static int moxa_chars_in_buffer(struct tty_struct *);
static void moxa_throttle(struct tty_struct *);
static void moxa_unthrottle(struct tty_struct *);
static void moxa_set_termios(struct tty_struct *, struct ktermios *);
static void moxa_stop(struct tty_struct *);
static void moxa_start(struct tty_struct *);
Expand Down Expand Up @@ -415,8 +412,6 @@ static const struct tty_operations moxa_ops = {
.flush_buffer = moxa_flush_buffer,
.chars_in_buffer = moxa_chars_in_buffer,
.ioctl = moxa_ioctl,
.throttle = moxa_throttle,
.unthrottle = moxa_unthrottle,
.set_termios = moxa_set_termios,
.stop = moxa_stop,
.start = moxa_start,
Expand Down Expand Up @@ -1327,20 +1322,6 @@ static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
return 0;
}

static void moxa_throttle(struct tty_struct *tty)
{
struct moxa_port *ch = tty->driver_data;

set_bit(THROTTLE, &ch->statusflags);
}

static void moxa_unthrottle(struct tty_struct *tty)
{
struct moxa_port *ch = tty->driver_data;

clear_bit(THROTTLE, &ch->statusflags);
}

static void moxa_set_termios(struct tty_struct *tty,
struct ktermios *old_termios)
{
Expand Down Expand Up @@ -1418,7 +1399,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
tty_wakeup(tty);
}

if (inited && !test_bit(THROTTLE, &p->statusflags) &&
if (inited && !test_bit(TTY_THROTTLED, &tty->flags) &&
MoxaPortRxQueue(p) > 0) { /* RX */
MoxaPortReadData(p);
tty_schedule_flip(tty);
Expand Down

0 comments on commit f9b412a

Please sign in to comment.