]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/gigaset/common.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / isdn / gigaset / common.c
index 4f75cce6fdff41df1a1375356d4cd0438856bb9c..b460a73a7c8590fb39640598e02376d223256093 100644 (file)
@@ -640,7 +640,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 +737,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 +753,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 +906,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 +929,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);