diff options
Diffstat (limited to 'drivers/isdn/gigaset/usb-gigaset.c')
-rw-r--r-- | drivers/isdn/gigaset/usb-gigaset.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c index a977dd570751..e1a3eeb3c21a 100644 --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c | |||
@@ -365,18 +365,12 @@ static void gigaset_modem_fill(unsigned long data) | |||
365 | */ | 365 | */ |
366 | static void gigaset_read_int_callback(struct urb *urb, struct pt_regs *regs) | 366 | static void gigaset_read_int_callback(struct urb *urb, struct pt_regs *regs) |
367 | { | 367 | { |
368 | struct inbuf_t *inbuf = urb->context; | ||
369 | struct cardstate *cs = inbuf->cs; | ||
368 | int resubmit = 0; | 370 | int resubmit = 0; |
369 | int r; | 371 | int r; |
370 | struct cardstate *cs; | ||
371 | unsigned numbytes; | 372 | unsigned numbytes; |
372 | unsigned char *src; | 373 | unsigned char *src; |
373 | struct inbuf_t *inbuf; | ||
374 | |||
375 | IFNULLRET(urb); | ||
376 | inbuf = (struct inbuf_t *) urb->context; | ||
377 | IFNULLRET(inbuf); | ||
378 | cs = inbuf->cs; | ||
379 | IFNULLRET(cs); | ||
380 | 374 | ||
381 | if (!atomic_read(&cs->connected)) { | 375 | if (!atomic_read(&cs->connected)) { |
382 | err("%s: disconnected", __func__); | 376 | err("%s: disconnected", __func__); |
@@ -421,9 +415,8 @@ static void gigaset_read_int_callback(struct urb *urb, struct pt_regs *regs) | |||
421 | /* This callback routine is called when data was transmitted to the device. */ | 415 | /* This callback routine is called when data was transmitted to the device. */ |
422 | static void gigaset_write_bulk_callback(struct urb *urb, struct pt_regs *regs) | 416 | static void gigaset_write_bulk_callback(struct urb *urb, struct pt_regs *regs) |
423 | { | 417 | { |
424 | struct cardstate *cs = (struct cardstate *) urb->context; | 418 | struct cardstate *cs = urb->context; |
425 | 419 | ||
426 | IFNULLRET(cs); | ||
427 | #ifdef CONFIG_GIGASET_DEBUG | 420 | #ifdef CONFIG_GIGASET_DEBUG |
428 | if (!atomic_read(&cs->connected)) { | 421 | if (!atomic_read(&cs->connected)) { |
429 | err("%s: not connected", __func__); | 422 | err("%s: not connected", __func__); |
@@ -632,20 +625,13 @@ static int gigaset_initcshw(struct cardstate *cs) | |||
632 | /* Send data from current skb to the device. */ | 625 | /* Send data from current skb to the device. */ |
633 | static int write_modem(struct cardstate *cs) | 626 | static int write_modem(struct cardstate *cs) |
634 | { | 627 | { |
635 | int ret; | 628 | int ret = 0; |
636 | int count; | 629 | int count; |
637 | struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ | 630 | struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ |
638 | struct usb_cardstate *ucs = cs->hw.usb; | 631 | struct usb_cardstate *ucs = cs->hw.usb; |
639 | 632 | ||
640 | IFNULLRETVAL(bcs->tx_skb, -EINVAL); | ||
641 | |||
642 | gig_dbg(DEBUG_WRITE, "len: %d...", bcs->tx_skb->len); | 633 | gig_dbg(DEBUG_WRITE, "len: %d...", bcs->tx_skb->len); |
643 | 634 | ||
644 | ret = -ENODEV; | ||
645 | IFNULLGOTO(ucs->bulk_out_buffer, error); | ||
646 | IFNULLGOTO(ucs->bulk_out_urb, error); | ||
647 | ret = 0; | ||
648 | |||
649 | if (!bcs->tx_skb->len) { | 635 | if (!bcs->tx_skb->len) { |
650 | dev_kfree_skb_any(bcs->tx_skb); | 636 | dev_kfree_skb_any(bcs->tx_skb); |
651 | bcs->tx_skb = NULL; | 637 | bcs->tx_skb = NULL; |
@@ -683,11 +669,6 @@ static int write_modem(struct cardstate *cs) | |||
683 | } | 669 | } |
684 | 670 | ||
685 | return ret; | 671 | return ret; |
686 | error: | ||
687 | dev_kfree_skb_any(bcs->tx_skb); | ||
688 | bcs->tx_skb = NULL; | ||
689 | return ret; | ||
690 | |||
691 | } | 672 | } |
692 | 673 | ||
693 | static int gigaset_probe(struct usb_interface *interface, | 674 | static int gigaset_probe(struct usb_interface *interface, |