fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / isdn / hisax / hfc_2bds0.c
index e84700c..8d98644 100644 (file)
@@ -40,7 +40,7 @@ ReadReg(struct IsdnCardState *cs, int data, u_char reg)
                        byteout(cs->hw.hfcD.addr | 1, reg);
                }
                ret = bytein(cs->hw.hfcD.addr);
-#if HFC_REG_DEBUG
+#ifdef HFC_REG_DEBUG
                if (cs->debug & L1_DEB_HSCX_FIFO && (data != 2))
                        debugl1(cs, "t3c RD %02x %02x", reg, ret);
 #endif
@@ -58,7 +58,7 @@ WriteReg(struct IsdnCardState *cs, int data, u_char reg, u_char value)
        }
        if (data)
                byteout(cs->hw.hfcD.addr, value);
-#if HFC_REG_DEBUG
+#ifdef HFC_REG_DEBUG
        if (cs->debug & L1_DEB_HSCX_FIFO && (data != HFCD_DATA_NODEB))
                debugl1(cs, "t3c W%c %02x %02x", data ? 'D' : 'C', reg, value);
 #endif
@@ -345,7 +345,7 @@ hfc_send_data(struct BCState *bcs)
                debugl1(cs,"send_data %d blocked", bcs->channel);
 }
 
-void
+static void
 main_rec_2bds0(struct BCState *bcs)
 {
        struct IsdnCardState *cs = bcs->cs;
@@ -399,7 +399,7 @@ main_rec_2bds0(struct BCState *bcs)
        return;
 }
 
-void
+static void
 mode_2bs0(struct BCState *bcs, int mode, int bc)
 {
        struct IsdnCardState *cs = bcs->cs;
@@ -505,7 +505,7 @@ hfc_l2l1(struct PStack *st, int pr, void *arg)
        }
 }
 
-void
+static void
 close_2bs0(struct BCState *bcs)
 {
        mode_2bs0(bcs, 0, bcs->channel);
@@ -534,7 +534,7 @@ open_hfcstate(struct IsdnCardState *cs, struct BCState *bcs)
        return (0);
 }
 
-int
+static int
 setstack_2b(struct PStack *st, struct BCState *bcs)
 {
        bcs->channel = st->l1.bc;
@@ -549,10 +549,11 @@ setstack_2b(struct PStack *st, struct BCState *bcs)
 }
 
 static void
-hfcd_bh(struct IsdnCardState *cs)
+hfcd_bh(struct work_struct *work)
 {
-       if (!cs)
-               return;
+       struct IsdnCardState *cs =
+               container_of(work, struct IsdnCardState, tqueue);
+
        if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
                switch (cs->dc.hfcd.ph_state) {
                        case (0):
@@ -1004,7 +1005,7 @@ HFCD_l1hw(struct PStack *st, int pr, void *arg)
        }
 }
 
-void
+static void
 setstack_hfcd(struct PStack *st, struct IsdnCardState *cs)
 {
        st->l1.l1hw = HFCD_l1hw;
@@ -1015,7 +1016,7 @@ hfc_dbusy_timer(struct IsdnCardState *cs)
 {
 }
 
-unsigned int __init
+static unsigned int
 *init_send_hfcd(int cnt)
 {
        int i, *send;
@@ -1030,7 +1031,7 @@ unsigned int __init
        return(send);
 }
 
-void __init
+void
 init2bds0(struct IsdnCardState *cs)
 {
        cs->setstack_d = setstack_hfcd;
@@ -1052,18 +1053,12 @@ init2bds0(struct IsdnCardState *cs)
 void
 release2bds0(struct IsdnCardState *cs)
 {
-       if (cs->bcs[0].hw.hfc.send) {
-               kfree(cs->bcs[0].hw.hfc.send);
-               cs->bcs[0].hw.hfc.send = NULL;
-       }
-       if (cs->bcs[1].hw.hfc.send) {
-               kfree(cs->bcs[1].hw.hfc.send);
-               cs->bcs[1].hw.hfc.send = NULL;
-       }
-       if (cs->hw.hfcD.send) {
-               kfree(cs->hw.hfcD.send);
-               cs->hw.hfcD.send = NULL;
-       }
+       kfree(cs->bcs[0].hw.hfc.send);
+       cs->bcs[0].hw.hfc.send = NULL;
+       kfree(cs->bcs[1].hw.hfc.send);
+       cs->bcs[1].hw.hfc.send = NULL;
+       kfree(cs->hw.hfcD.send);
+       cs->hw.hfcD.send = NULL;
 }
 
 void
@@ -1078,5 +1073,5 @@ set_cs_func(struct IsdnCardState *cs)
        cs->dbusytimer.function = (void *) hfc_dbusy_timer;
        cs->dbusytimer.data = (long) cs;
        init_timer(&cs->dbusytimer);
-       INIT_WORK(&cs->tqueue, (void *)(void *) hfcd_bh, cs);
+       INIT_WORK(&cs->tqueue, hfcd_bh);
 }