X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fisdn%2Fgigaset%2Fcommon.c;h=acd417197d03dd6f46078bff2eff31fb05bf5414;hb=a9e82d3a02247af6b729be0a963862d70cb25bf9;hp=4f75cce6fdff41df1a1375356d4cd0438856bb9c;hpb=4222721ebb50a8640860eeca0caeb63fe1cce935;p=linux-2.6-omap-h63xx.git diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index 4f75cce6fdf..acd417197d0 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c @@ -534,7 +534,8 @@ int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, n = RBUFSIZE - tail; if (!n) { dev_err(inbuf->cs->dev, - "buffer overflow (%u bytes lost)", bytesleft); + "buffer overflow (%u bytes lost)\n", + bytesleft); break; } if (n > bytesleft) @@ -640,7 +641,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, return NULL; } mutex_init(&cs->mutex); - mutex_lock(&cs->mutex); gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1); cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); @@ -738,6 +738,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, ++cs->cs_init; + /* set up character device */ gigaset_if_init(cs); /* set up device sysfs */ @@ -753,11 +754,9 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, add_timer(&cs->timer); gig_dbg(DEBUG_INIT, "cs initialized"); - mutex_unlock(&cs->mutex); return cs; error: - mutex_unlock(&cs->mutex); gig_dbg(DEBUG_INIT, "failed"); gigaset_freecs(cs); return NULL; @@ -908,20 +907,7 @@ void gigaset_shutdown(struct cardstate *cs) gig_dbg(DEBUG_CMD, "scheduling SHUTDOWN"); gigaset_schedule_event(cs); - if (wait_event_interruptible(cs->waitqueue, !cs->waiting)) { - warn("%s: aborted", __func__); - //FIXME - } - - if (atomic_read(&cs->mstate) != MS_LOCKED) { - //FIXME? - //gigaset_baud_rate(cs, B115200); - //gigaset_set_line_ctrl(cs, CS8); - //gigaset_set_modem_ctrl(cs, TIOCM_DTR|TIOCM_RTS, 0); - //cs->control_state = 0; - } else { - //FIXME use some saved values? - } + wait_event(cs->waitqueue, !cs->waiting); cleanup_cs(cs); @@ -944,10 +930,7 @@ void gigaset_stop(struct cardstate *cs) gig_dbg(DEBUG_CMD, "scheduling STOP"); gigaset_schedule_event(cs); - if (wait_event_interruptible(cs->waitqueue, !cs->waiting)) { - warn("%s: aborted", __func__); - //FIXME - } + wait_event(cs->waitqueue, !cs->waiting); cleanup_cs(cs); @@ -962,8 +945,8 @@ static DEFINE_SPINLOCK(driver_lock); struct cardstate *gigaset_get_cs_by_id(int id) { unsigned long flags; - static struct cardstate *ret = NULL; - static struct cardstate *cs; + struct cardstate *ret = NULL; + struct cardstate *cs; struct gigaset_driver *drv; unsigned i; @@ -1017,7 +1000,7 @@ void gigaset_debugdrivers(void) static struct cardstate *gigaset_get_cs_by_minor(unsigned minor) { unsigned long flags; - static struct cardstate *ret = NULL; + struct cardstate *ret = NULL; struct gigaset_driver *drv; unsigned index;