Skip to content

Commit

Permalink
Fix istallion build failure
Browse files Browse the repository at this point in the history
Commits b02f5ad ("istallion: use
tty_port") and a352def ("tty: Ldisc
revamp") broke the istallion driver.

Fix the compile error and silence a warning.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Wang Chen authored and Linus Torvalds committed Jul 21, 2008
1 parent 14b395e commit 42a77a1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/char/istallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ static int stli_parsebrd(struct stlconf *confp, char **argp);
static int stli_open(struct tty_struct *tty, struct file *filp);
static void stli_close(struct tty_struct *tty, struct file *filp);
static int stli_write(struct tty_struct *tty, const unsigned char *buf, int count);
static void stli_putchar(struct tty_struct *tty, unsigned char ch);
static int stli_putchar(struct tty_struct *tty, unsigned char ch);
static void stli_flushchars(struct tty_struct *tty);
static int stli_writeroom(struct tty_struct *tty);
static int stli_charsinbuffer(struct tty_struct *tty);
Expand Down Expand Up @@ -826,7 +826,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp)
*/
portp->port.tty = tty;
tty->driver_data = portp;
portp->refcount++;
portp->port.count++;

wait_event_interruptible(portp->raw_wait,
!test_bit(ST_INITIALIZING, &portp->state));
Expand Down Expand Up @@ -888,9 +888,9 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
spin_unlock_irqrestore(&stli_lock, flags);
return;
}
if ((tty->count == 1) && (portp->refcount != 1))
portp->refcount = 1;
if (portp->refcount-- > 1) {
if ((tty->count == 1) && (portp->port.count != 1))
portp->port.count = 1;
if (portp->port.count-- > 1) {
spin_unlock_irqrestore(&stli_lock, flags);
return;
}
Expand Down Expand Up @@ -925,8 +925,8 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
clear_bit(ST_TXBUSY, &portp->state);
clear_bit(ST_RXSTOP, &portp->state);
set_bit(TTY_IO_ERROR, &tty->flags);
if (tty->ldisc.flush_buffer)
(tty->ldisc.flush_buffer)(tty);
if (tty->ldisc.ops->flush_buffer)
(tty->ldisc.ops->flush_buffer)(tty);
set_bit(ST_DOFLUSHRX, &portp->state);
stli_flushbuffer(tty);

Expand Down Expand Up @@ -1202,7 +1202,7 @@ static int stli_waitcarrier(struct stlibrd *brdp, struct stliport *portp, struct
spin_lock_irqsave(&stli_lock, flags);
portp->openwaitcnt++;
if (! tty_hung_up_p(filp))
portp->refcount--;
portp->port.count--;
spin_unlock_irqrestore(&stli_lock, flags);

for (;;) {
Expand Down Expand Up @@ -1231,7 +1231,7 @@ static int stli_waitcarrier(struct stlibrd *brdp, struct stliport *portp, struct

spin_lock_irqsave(&stli_lock, flags);
if (! tty_hung_up_p(filp))
portp->refcount++;
portp->port.count++;
portp->openwaitcnt--;
spin_unlock_irqrestore(&stli_lock, flags);

Expand Down Expand Up @@ -1333,7 +1333,7 @@ static int stli_write(struct tty_struct *tty, const unsigned char *buf, int coun
* first them do the new ports.
*/

static void stli_putchar(struct tty_struct *tty, unsigned char ch)
static int stli_putchar(struct tty_struct *tty, unsigned char ch)
{
if (tty != stli_txcooktty) {
if (stli_txcooktty != NULL)
Expand All @@ -1342,6 +1342,7 @@ static void stli_putchar(struct tty_struct *tty, unsigned char ch)
}

stli_txcookbuf[stli_txcooksize++] = ch;
return 0;
}

/*****************************************************************************/
Expand Down Expand Up @@ -1660,7 +1661,6 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
{
struct stliport *portp;
struct stlibrd *brdp;
unsigned int ival;
int rc;
void __user *argp = (void __user *)arg;

Expand Down Expand Up @@ -1857,7 +1857,7 @@ static void stli_hangup(struct tty_struct *tty)
set_bit(TTY_IO_ERROR, &tty->flags);
portp->port.tty = NULL;
portp->port.flags &= ~ASYNC_NORMAL_ACTIVE;
portp->refcount = 0;
portp->port.count = 0;
spin_unlock_irqrestore(&stli_lock, flags);

wake_up_interruptible(&portp->port.open_wait);
Expand Down Expand Up @@ -4246,7 +4246,7 @@ static int stli_portcmdstats(struct stliport *portp)
stli_comstats.panel = portp->panelnr;
stli_comstats.port = portp->portnr;
stli_comstats.state = portp->state;
stli_comstats.flags = portp->port.flag;
stli_comstats.flags = portp->port.flags;

spin_lock_irqsave(&brd_lock, flags);
if (portp->port.tty != NULL) {
Expand Down

0 comments on commit 42a77a1

Please sign in to comment.