diff options
Diffstat (limited to 'drivers/isdn/gigaset/common.c')
-rw-r--r-- | drivers/isdn/gigaset/common.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index db621db67f61..76792707f995 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c @@ -30,7 +30,7 @@ /* Module parameters */ int gigaset_debuglevel; EXPORT_SYMBOL_GPL(gigaset_debuglevel); -module_param_named(debug, gigaset_debuglevel, int, S_IRUGO|S_IWUSR); +module_param_named(debug, gigaset_debuglevel, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(debug, "debug level"); /* driver state flags */ @@ -123,7 +123,7 @@ int gigaset_enterconfigmode(struct cardstate *cs) if (r < 0) goto error; } - r = setflags(cs, TIOCM_RTS|TIOCM_DTR, 800); + r = setflags(cs, TIOCM_RTS | TIOCM_DTR, 800); if (r < 0) goto error; @@ -131,8 +131,8 @@ int gigaset_enterconfigmode(struct cardstate *cs) error: dev_err(cs->dev, "error %d on setuartbits\n", -r); - cs->control_state = TIOCM_RTS|TIOCM_DTR; - cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR); + cs->control_state = TIOCM_RTS | TIOCM_DTR; + cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS | TIOCM_DTR); return -1; } @@ -591,7 +591,7 @@ int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, if (head > tail) n = head - 1 - tail; else if (head == 0) - n = (RBUFSIZE-1) - tail; + n = (RBUFSIZE - 1) - tail; else n = RBUFSIZE - tail; if (!n) { @@ -720,12 +720,11 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, tasklet_init(&cs->event_tasklet, gigaset_handle_event, (unsigned long) cs); + tty_port_init(&cs->port); cs->commands_pending = 0; cs->cur_at_seq = 0; cs->gotfwver = -1; - cs->open_count = 0; cs->dev = NULL; - cs->tty = NULL; cs->tty_dev = NULL; cs->cidmode = cidmode != 0; cs->tabnocid = gigaset_tab_nocid; @@ -911,10 +910,10 @@ int gigaset_start(struct cardstate *cs) spin_unlock_irqrestore(&cs->lock, flags); if (cs->mstate != MS_LOCKED) { - cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS); + cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR | TIOCM_RTS); cs->ops->baud_rate(cs, B115200); cs->ops->set_line_ctrl(cs, CS8); - cs->control_state = TIOCM_DTR|TIOCM_RTS; + cs->control_state = TIOCM_DTR | TIOCM_RTS; } cs->waiting = 1; @@ -1051,8 +1050,6 @@ static struct cardstate *gigaset_get_cs_by_minor(unsigned minor) struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty) { - if (tty->index < 0 || tty->index >= tty->driver->num) - return NULL; return gigaset_get_cs_by_minor(tty->index + tty->driver->minor_start); } |