Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[powerpc.git] / drivers / isdn / gigaset / common.c
index 749b3da..acb7e26 100644 (file)
@@ -460,6 +460,9 @@ void gigaset_freecs(struct cardstate *cs)
 
        switch (cs->cs_init) {
        default:
+               /* clear device sysfs */
+               gigaset_free_dev_sysfs(cs);
+
                gigaset_if_free(cs);
 
                gig_dbg(DEBUG_INIT, "clearing hw");
@@ -699,6 +702,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
        cs->open_count = 0;
        cs->dev = NULL;
        cs->tty = NULL;
+       cs->class = NULL;
        cs->cidmode = cidmode != 0;
 
        //if(onechannel) { //FIXME
@@ -760,6 +764,9 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
 
        gigaset_if_init(cs);
 
+       /* set up device sysfs */
+       gigaset_init_dev_sysfs(cs);
+
        spin_lock_irqsave(&cs->lock, flags);
        cs->running = 1;
        spin_unlock_irqrestore(&cs->lock, flags);
@@ -781,8 +788,7 @@ error:      if (cs)
 }
 EXPORT_SYMBOL_GPL(gigaset_initcs);
 
-/* ReInitialize the b-channel structure */
-/* e.g. called on hangup, disconnect */
+/* ReInitialize the b-channel structure on hangup */
 void gigaset_bcs_reinit(struct bc_state *bcs)
 {
        struct sk_buff *skb;
@@ -903,9 +909,6 @@ int gigaset_start(struct cardstate *cs)
 
        wait_event(cs->waitqueue, !cs->waiting);
 
-       /* set up device sysfs */
-       gigaset_init_dev_sysfs(cs);
-
        mutex_unlock(&cs->mutex);
        return 1;
 
@@ -970,9 +973,6 @@ void gigaset_stop(struct cardstate *cs)
                //FIXME
        }
 
-       /* clear device sysfs */
-       gigaset_free_dev_sysfs(cs);
-
        cleanup_cs(cs);
 
 exit: