drivers/isdn/gigaset: tasklet_init - Remove unnecessary leading & from second arg
[deliverable/linux.git] / drivers / isdn / gigaset / common.c
index 1d2ae2e05e0b350de43772729bbe600d69d7cd9a..82ed1cd14ff50c7d8279e2cf4f7d62ca65a14a5e 100644 (file)
@@ -108,7 +108,7 @@ int gigaset_enterconfigmode(struct cardstate *cs)
 {
        int i, r;
 
-       cs->control_state = TIOCM_RTS; //FIXME
+       cs->control_state = TIOCM_RTS;
 
        r = setflags(cs, TIOCM_DTR, 200);
        if (r < 0)
@@ -132,10 +132,10 @@ int gigaset_enterconfigmode(struct cardstate *cs)
 
 error:
        dev_err(cs->dev, "error %d on setuartbits\n", -r);
-       cs->control_state = TIOCM_RTS|TIOCM_DTR; // FIXME is this a good value?
+       cs->control_state = TIOCM_RTS|TIOCM_DTR;
        cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR);
 
-       return -1; //r
+       return -1;
 }
 
 static int test_timeout(struct at_state_t *at_state)
@@ -150,10 +150,9 @@ static int test_timeout(struct at_state_t *at_state)
        }
 
        if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL,
-                              at_state->timer_index, NULL)) {
-               //FIXME what should we do?
-       }
-
+                              at_state->timer_index, NULL))
+                       dev_err(at_state->cs->dev, "%s: out of memory\n",
+                               __func__);
        return 1;
 }
 
@@ -393,16 +392,15 @@ static void gigaset_freebcs(struct bc_state *bcs)
        int i;
 
        gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel);
-       if (!bcs->cs->ops->freebcshw(bcs)) {
+       if (!bcs->cs->ops->freebcshw(bcs))
                gig_dbg(DEBUG_INIT, "failed");
-       }
 
        gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel);
        clear_at_state(&bcs->at_state);
        gig_dbg(DEBUG_INIT, "freeing bcs[%d]->skb", bcs->channel);
+       dev_kfree_skb(bcs->skb);
+       bcs->skb = NULL;
 
-       if (bcs->skb)
-               dev_kfree_skb(bcs->skb);
        for (i = 0; i < AT_NUM; ++i) {
                kfree(bcs->commands[i]);
                bcs->commands[i] = NULL;
@@ -503,8 +501,6 @@ void gigaset_freecs(struct cardstate *cs)
                gig_dbg(DEBUG_INIT, "clearing hw");
                cs->ops->freecshw(cs);
 
-               //FIXME cmdbuf
-
                /* fall through */
        case 2: /* error in initcshw */
                /* Deregister from LL */
@@ -560,16 +556,13 @@ void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
 }
 
 
-static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct bc_state *bcs,
-                              struct cardstate *cs, int inputstate)
+static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct cardstate *cs)
 /* inbuf->read must be allocated before! */
 {
        inbuf->head = 0;
        inbuf->tail = 0;
        inbuf->cs = cs;
-       inbuf->bcs = bcs; /*base driver: NULL*/
-       inbuf->rcvbuf = NULL;
-       inbuf->inputstate = inputstate;
+       inbuf->inputstate = INS_command;
 }
 
 /**
@@ -625,7 +618,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
 {
        int i;
 
-       bcs->tx_skb = NULL; //FIXME -> hw part
+       bcs->tx_skb = NULL;
 
        skb_queue_head_init(&bcs->squeue);
 
@@ -644,16 +637,13 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
        bcs->fcs = PPP_INITFCS;
        bcs->inputstate = 0;
        if (cs->ignoreframes) {
-               bcs->inputstate |= INS_skip_frame;
                bcs->skb = NULL;
        } else {
                bcs->skb = dev_alloc_skb(SBUFSIZE + cs->hw_hdr_len);
                if (bcs->skb != NULL)
                        skb_reserve(bcs->skb, cs->hw_hdr_len);
-               else {
+               else
                        pr_err("out of memory\n");
-                       bcs->inputstate |= INS_skip_frame;
-               }
        }
 
        bcs->channel = channel;
@@ -674,8 +664,8 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
        gig_dbg(DEBUG_INIT, "  failed");
 
        gig_dbg(DEBUG_INIT, "  freeing bcs[%d]->skb", channel);
-       if (bcs->skb)
-               dev_kfree_skb(bcs->skb);
+       dev_kfree_skb(bcs->skb);
+       bcs->skb = NULL;
 
        return NULL;
 }
@@ -702,12 +692,13 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
                                 int onechannel, int ignoreframes,
                                 int cidmode, const char *modulename)
 {
-       struct cardstate *cs = NULL;
+       struct cardstate *cs;
        unsigned long flags;
        int i;
 
        gig_dbg(DEBUG_INIT, "allocating cs");
-       if (!(cs = alloc_cs(drv))) {
+       cs = alloc_cs(drv);
+       if (!cs) {
                pr_err("maximum number of devices exceeded\n");
                return NULL;
        }
@@ -736,7 +727,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
        cs->ev_tail = 0;
        cs->ev_head = 0;
 
-       tasklet_init(&cs->event_tasklet, &gigaset_handle_event,
+       tasklet_init(&cs->event_tasklet, gigaset_handle_event,
                     (unsigned long) cs);
        cs->commands_pending = 0;
        cs->cur_at_seq = 0;
@@ -764,10 +755,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
        cs->cbytes = 0;
 
        gig_dbg(DEBUG_INIT, "setting up inbuf");
-       if (onechannel) {                       //FIXME distinction necessary?
-               gigaset_inbuf_init(cs->inbuf, cs->bcs, cs, INS_command);
-       } else
-               gigaset_inbuf_init(cs->inbuf, NULL,    cs, INS_command);
+       gigaset_inbuf_init(cs->inbuf, cs);
 
        cs->connected = 0;
        cs->isdn_up = 0;
@@ -854,9 +842,10 @@ void gigaset_bcs_reinit(struct bc_state *bcs)
        bcs->chstate = 0;
 
        bcs->ignore = cs->ignoreframes;
-       if (bcs->ignore)
-               bcs->inputstate |= INS_skip_frame;
-
+       if (bcs->ignore) {
+               dev_kfree_skb(bcs->skb);
+               bcs->skb = NULL;
+       }
 
        cs->ops->reinitbcshw(bcs);
 }
@@ -877,8 +866,6 @@ static void cleanup_cs(struct cardstate *cs)
        free_strings(&cs->at_state);
        gigaset_at_init(&cs->at_state, NULL, cs, 0);
 
-       kfree(cs->inbuf->rcvbuf);
-       cs->inbuf->rcvbuf = NULL;
        cs->inbuf->inputstate = INS_command;
        cs->inbuf->head = 0;
        cs->inbuf->tail = 0;
@@ -941,15 +928,13 @@ int gigaset_start(struct cardstate *cs)
                cs->ops->baud_rate(cs, B115200);
                cs->ops->set_line_ctrl(cs, CS8);
                cs->control_state = TIOCM_DTR|TIOCM_RTS;
-       } else {
-               //FIXME use some saved values?
        }
 
        cs->waiting = 1;
 
        if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) {
                cs->waiting = 0;
-               //FIXME what should we do?
+               dev_err(cs->dev, "%s: out of memory\n", __func__);
                goto error;
        }
 
@@ -989,7 +974,7 @@ int gigaset_shutdown(struct cardstate *cs)
        cs->waiting = 1;
 
        if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL)) {
-               //FIXME what should we do?
+               dev_err(cs->dev, "%s: out of memory\n", __func__);
                goto exit;
        }
 
@@ -1020,7 +1005,7 @@ void gigaset_stop(struct cardstate *cs)
        cs->waiting = 1;
 
        if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL)) {
-               //FIXME what should we do?
+               dev_err(cs->dev, "%s: out of memory\n", __func__);
                goto exit;
        }
 
This page took 0.028148 seconds and 5 git commands to generate.