aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/bas-gigaset.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2008-02-06 04:38:28 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:12 -0500
commit9d4bee2b9de9e30057a860d2d6794f874caffc5e (patch)
treeda411b981460825d04298d59dc05bd4125974bba /drivers/isdn/gigaset/bas-gigaset.c
parent1ff0a5296ff4157e7c46861bccc8d61e168c4e2b (diff)
gigaset: atomic cleanup
Convert atomic_t variables that don't actually use atomic_t functionality to int. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/gigaset/bas-gigaset.c')
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c86
1 files changed, 41 insertions, 45 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 1c401b3f88e1..7c905305406b 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -113,7 +113,7 @@ struct bas_cardstate {
113 unsigned char int_in_buf[3]; 113 unsigned char int_in_buf[3];
114 114
115 spinlock_t lock; /* locks all following */ 115 spinlock_t lock; /* locks all following */
116 atomic_t basstate; /* bitmap (BS_*) */ 116 int basstate; /* bitmap (BS_*) */
117 int pending; /* uncompleted base request */ 117 int pending; /* uncompleted base request */
118 wait_queue_head_t waitqueue; 118 wait_queue_head_t waitqueue;
119 int rcvbuf_size; /* size of AT receive buffer */ 119 int rcvbuf_size; /* size of AT receive buffer */
@@ -370,27 +370,27 @@ static void check_pending(struct bas_cardstate *ucs)
370 case 0: 370 case 0:
371 break; 371 break;
372 case HD_OPEN_ATCHANNEL: 372 case HD_OPEN_ATCHANNEL:
373 if (atomic_read(&ucs->basstate) & BS_ATOPEN) 373 if (ucs->basstate & BS_ATOPEN)
374 ucs->pending = 0; 374 ucs->pending = 0;
375 break; 375 break;
376 case HD_OPEN_B1CHANNEL: 376 case HD_OPEN_B1CHANNEL:
377 if (atomic_read(&ucs->basstate) & BS_B1OPEN) 377 if (ucs->basstate & BS_B1OPEN)
378 ucs->pending = 0; 378 ucs->pending = 0;
379 break; 379 break;
380 case HD_OPEN_B2CHANNEL: 380 case HD_OPEN_B2CHANNEL:
381 if (atomic_read(&ucs->basstate) & BS_B2OPEN) 381 if (ucs->basstate & BS_B2OPEN)
382 ucs->pending = 0; 382 ucs->pending = 0;
383 break; 383 break;
384 case HD_CLOSE_ATCHANNEL: 384 case HD_CLOSE_ATCHANNEL:
385 if (!(atomic_read(&ucs->basstate) & BS_ATOPEN)) 385 if (!(ucs->basstate & BS_ATOPEN))
386 ucs->pending = 0; 386 ucs->pending = 0;
387 break; 387 break;
388 case HD_CLOSE_B1CHANNEL: 388 case HD_CLOSE_B1CHANNEL:
389 if (!(atomic_read(&ucs->basstate) & BS_B1OPEN)) 389 if (!(ucs->basstate & BS_B1OPEN))
390 ucs->pending = 0; 390 ucs->pending = 0;
391 break; 391 break;
392 case HD_CLOSE_B2CHANNEL: 392 case HD_CLOSE_B2CHANNEL:
393 if (!(atomic_read(&ucs->basstate) & BS_B2OPEN)) 393 if (!(ucs->basstate & BS_B2OPEN))
394 ucs->pending = 0; 394 ucs->pending = 0;
395 break; 395 break;
396 case HD_DEVICE_INIT_ACK: /* no reply expected */ 396 case HD_DEVICE_INIT_ACK: /* no reply expected */
@@ -456,8 +456,8 @@ inline static int update_basstate(struct bas_cardstate *ucs,
456 int state; 456 int state;
457 457
458 spin_lock_irqsave(&ucs->lock, flags); 458 spin_lock_irqsave(&ucs->lock, flags);
459 state = atomic_read(&ucs->basstate); 459 state = ucs->basstate;
460 atomic_set(&ucs->basstate, (state & ~clear) | set); 460 ucs->basstate = (state & ~clear) | set;
461 spin_unlock_irqrestore(&ucs->lock, flags); 461 spin_unlock_irqrestore(&ucs->lock, flags);
462 return state; 462 return state;
463} 463}
@@ -832,7 +832,7 @@ static void read_iso_callback(struct urb *urb)
832 urb->iso_frame_desc[i].status = 0; 832 urb->iso_frame_desc[i].status = 0;
833 urb->iso_frame_desc[i].actual_length = 0; 833 urb->iso_frame_desc[i].actual_length = 0;
834 } 834 }
835 if (likely(atomic_read(&ubc->running))) { 835 if (likely(ubc->running)) {
836 /* urb->dev is clobbered by USB subsystem */ 836 /* urb->dev is clobbered by USB subsystem */
837 urb->dev = bcs->cs->hw.bas->udev; 837 urb->dev = bcs->cs->hw.bas->udev;
838 urb->transfer_flags = URB_ISO_ASAP; 838 urb->transfer_flags = URB_ISO_ASAP;
@@ -909,7 +909,7 @@ static int starturbs(struct bc_state *bcs)
909 bcs->inputstate |= INS_flag_hunt; 909 bcs->inputstate |= INS_flag_hunt;
910 910
911 /* submit all isochronous input URBs */ 911 /* submit all isochronous input URBs */
912 atomic_set(&ubc->running, 1); 912 ubc->running = 1;
913 for (k = 0; k < BAS_INURBS; k++) { 913 for (k = 0; k < BAS_INURBS; k++) {
914 urb = ubc->isoinurbs[k]; 914 urb = ubc->isoinurbs[k];
915 if (!urb) { 915 if (!urb) {
@@ -992,7 +992,7 @@ static void stopurbs(struct bas_bc_state *ubc)
992{ 992{
993 int k, rc; 993 int k, rc;
994 994
995 atomic_set(&ubc->running, 0); 995 ubc->running = 0;
996 996
997 for (k = 0; k < BAS_INURBS; ++k) { 997 for (k = 0; k < BAS_INURBS; ++k) {
998 rc = usb_unlink_urb(ubc->isoinurbs[k]); 998 rc = usb_unlink_urb(ubc->isoinurbs[k]);
@@ -1068,7 +1068,7 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
1068 } 1068 }
1069 break; 1069 break;
1070 } 1070 }
1071 ucx->limit = atomic_read(&ubc->isooutbuf->nextread); 1071 ucx->limit = ubc->isooutbuf->nextread;
1072 ifd->status = 0; 1072 ifd->status = 0;
1073 ifd->actual_length = 0; 1073 ifd->actual_length = 0;
1074 } 1074 }
@@ -1115,7 +1115,7 @@ static void write_iso_tasklet(unsigned long data)
1115 1115
1116 /* loop while completed URBs arrive in time */ 1116 /* loop while completed URBs arrive in time */
1117 for (;;) { 1117 for (;;) {
1118 if (unlikely(!(atomic_read(&ubc->running)))) { 1118 if (unlikely(!(ubc->running))) {
1119 gig_dbg(DEBUG_ISO, "%s: not running", __func__); 1119 gig_dbg(DEBUG_ISO, "%s: not running", __func__);
1120 return; 1120 return;
1121 } 1121 }
@@ -1220,7 +1220,7 @@ static void write_iso_tasklet(unsigned long data)
1220 1220
1221 /* mark the write buffer area covered by this URB as free */ 1221 /* mark the write buffer area covered by this URB as free */
1222 if (done->limit >= 0) 1222 if (done->limit >= 0)
1223 atomic_set(&ubc->isooutbuf->read, done->limit); 1223 ubc->isooutbuf->read = done->limit;
1224 1224
1225 /* mark URB as free */ 1225 /* mark URB as free */
1226 spin_lock_irqsave(&ubc->isooutlock, flags); 1226 spin_lock_irqsave(&ubc->isooutlock, flags);
@@ -1294,7 +1294,7 @@ static void read_iso_tasklet(unsigned long data)
1294 } 1294 }
1295 spin_unlock_irqrestore(&ubc->isoinlock, flags); 1295 spin_unlock_irqrestore(&ubc->isoinlock, flags);
1296 1296
1297 if (unlikely(!(atomic_read(&ubc->running)))) { 1297 if (unlikely(!(ubc->running))) {
1298 gig_dbg(DEBUG_ISO, 1298 gig_dbg(DEBUG_ISO,
1299 "%s: channel not running, " 1299 "%s: channel not running, "
1300 "dropped URB with status: %s", 1300 "dropped URB with status: %s",
@@ -1488,7 +1488,7 @@ static void write_ctrl_callback(struct urb *urb)
1488 default: /* any failure */ 1488 default: /* any failure */
1489 /* don't retry if suspend requested */ 1489 /* don't retry if suspend requested */
1490 if (++ucs->retry_ctrl > BAS_RETRY || 1490 if (++ucs->retry_ctrl > BAS_RETRY ||
1491 (atomic_read(&ucs->basstate) & BS_SUSPEND)) { 1491 (ucs->basstate & BS_SUSPEND)) {
1492 dev_err(&ucs->interface->dev, 1492 dev_err(&ucs->interface->dev,
1493 "control request 0x%02x failed: %s\n", 1493 "control request 0x%02x failed: %s\n",
1494 ucs->dr_ctrl.bRequest, 1494 ucs->dr_ctrl.bRequest,
@@ -1603,7 +1603,7 @@ static int gigaset_init_bchannel(struct bc_state *bcs)
1603 return -ENODEV; 1603 return -ENODEV;
1604 } 1604 }
1605 1605
1606 if (atomic_read(&cs->hw.bas->basstate) & BS_SUSPEND) { 1606 if (cs->hw.bas->basstate & BS_SUSPEND) {
1607 dev_notice(cs->dev, 1607 dev_notice(cs->dev,
1608 "not starting isochronous I/O, " 1608 "not starting isochronous I/O, "
1609 "suspend in progress\n"); 1609 "suspend in progress\n");
@@ -1658,8 +1658,7 @@ static int gigaset_close_bchannel(struct bc_state *bcs)
1658 return -ENODEV; 1658 return -ENODEV;
1659 } 1659 }
1660 1660
1661 if (!(atomic_read(&cs->hw.bas->basstate) & 1661 if (!(cs->hw.bas->basstate & (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) {
1662 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) {
1663 /* channel not running: just signal common.c */ 1662 /* channel not running: just signal common.c */
1664 spin_unlock_irqrestore(&cs->lock, flags); 1663 spin_unlock_irqrestore(&cs->lock, flags);
1665 gigaset_bchannel_down(bcs); 1664 gigaset_bchannel_down(bcs);
@@ -1747,7 +1746,7 @@ static void write_command_callback(struct urb *urb)
1747 ucs->retry_cmd_out); 1746 ucs->retry_cmd_out);
1748 break; 1747 break;
1749 } 1748 }
1750 if (atomic_read(&ucs->basstate) & BS_SUSPEND) { 1749 if (ucs->basstate & BS_SUSPEND) {
1751 dev_warn(cs->dev, 1750 dev_warn(cs->dev,
1752 "command write: %s, " 1751 "command write: %s, "
1753 "won't retry - suspend requested\n", 1752 "won't retry - suspend requested\n",
@@ -1863,13 +1862,13 @@ static int start_cbsend(struct cardstate *cs)
1863 int retval = 0; 1862 int retval = 0;
1864 1863
1865 /* check if suspend requested */ 1864 /* check if suspend requested */
1866 if (atomic_read(&ucs->basstate) & BS_SUSPEND) { 1865 if (ucs->basstate & BS_SUSPEND) {
1867 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "suspending"); 1866 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "suspending");
1868 return -EHOSTUNREACH; 1867 return -EHOSTUNREACH;
1869 } 1868 }
1870 1869
1871 /* check if AT channel is open */ 1870 /* check if AT channel is open */
1872 if (!(atomic_read(&ucs->basstate) & BS_ATOPEN)) { 1871 if (!(ucs->basstate & BS_ATOPEN)) {
1873 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open"); 1872 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open");
1874 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT); 1873 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT);
1875 if (rc < 0) { 1874 if (rc < 0) {
@@ -1885,8 +1884,7 @@ static int start_cbsend(struct cardstate *cs)
1885 /* try to send first command in queue */ 1884 /* try to send first command in queue */
1886 spin_lock_irqsave(&cs->cmdlock, flags); 1885 spin_lock_irqsave(&cs->cmdlock, flags);
1887 1886
1888 while ((cb = cs->cmdbuf) != NULL && 1887 while ((cb = cs->cmdbuf) != NULL && (ucs->basstate & BS_ATREADY)) {
1889 atomic_read(&ucs->basstate) & BS_ATREADY) {
1890 ucs->retry_cmd_out = 0; 1888 ucs->retry_cmd_out = 0;
1891 rc = atwrite_submit(cs, cb->buf, cb->len); 1889 rc = atwrite_submit(cs, cb->buf, cb->len);
1892 if (unlikely(rc)) { 1890 if (unlikely(rc)) {
@@ -1924,7 +1922,7 @@ static int gigaset_write_cmd(struct cardstate *cs,
1924 unsigned long flags; 1922 unsigned long flags;
1925 int rc; 1923 int rc;
1926 1924
1927 gigaset_dbg_buffer(atomic_read(&cs->mstate) != MS_LOCKED ? 1925 gigaset_dbg_buffer(cs->mstate != MS_LOCKED ?
1928 DEBUG_TRANSCMD : DEBUG_LOCKCMD, 1926 DEBUG_TRANSCMD : DEBUG_LOCKCMD,
1929 "CMD Transmit", len, buf); 1927 "CMD Transmit", len, buf);
1930 1928
@@ -2039,7 +2037,7 @@ static int gigaset_freebcshw(struct bc_state *bcs)
2039 return 0; 2037 return 0;
2040 2038
2041 /* kill URBs and tasklets before freeing - better safe than sorry */ 2039 /* kill URBs and tasklets before freeing - better safe than sorry */
2042 atomic_set(&ubc->running, 0); 2040 ubc->running = 0;
2043 gig_dbg(DEBUG_INIT, "%s: killing iso URBs", __func__); 2041 gig_dbg(DEBUG_INIT, "%s: killing iso URBs", __func__);
2044 for (i = 0; i < BAS_OUTURBS; ++i) { 2042 for (i = 0; i < BAS_OUTURBS; ++i) {
2045 usb_kill_urb(ubc->isoouturbs[i].urb); 2043 usb_kill_urb(ubc->isoouturbs[i].urb);
@@ -2074,7 +2072,7 @@ static int gigaset_initbcshw(struct bc_state *bcs)
2074 return 0; 2072 return 0;
2075 } 2073 }
2076 2074
2077 atomic_set(&ubc->running, 0); 2075 ubc->running = 0;
2078 atomic_set(&ubc->corrbytes, 0); 2076 atomic_set(&ubc->corrbytes, 0);
2079 spin_lock_init(&ubc->isooutlock); 2077 spin_lock_init(&ubc->isooutlock);
2080 for (i = 0; i < BAS_OUTURBS; ++i) { 2078 for (i = 0; i < BAS_OUTURBS; ++i) {
@@ -2119,7 +2117,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
2119{ 2117{
2120 struct bas_bc_state *ubc = bcs->hw.bas; 2118 struct bas_bc_state *ubc = bcs->hw.bas;
2121 2119
2122 atomic_set(&bcs->hw.bas->running, 0); 2120 bcs->hw.bas->running = 0;
2123 atomic_set(&bcs->hw.bas->corrbytes, 0); 2121 atomic_set(&bcs->hw.bas->corrbytes, 0);
2124 bcs->hw.bas->numsub = 0; 2122 bcs->hw.bas->numsub = 0;
2125 spin_lock_init(&ubc->isooutlock); 2123 spin_lock_init(&ubc->isooutlock);
@@ -2150,7 +2148,7 @@ static int gigaset_initcshw(struct cardstate *cs)
2150 spin_lock_init(&ucs->lock); 2148 spin_lock_init(&ucs->lock);
2151 ucs->pending = 0; 2149 ucs->pending = 0;
2152 2150
2153 atomic_set(&ucs->basstate, 0); 2151 ucs->basstate = 0;
2154 init_timer(&ucs->timer_ctrl); 2152 init_timer(&ucs->timer_ctrl);
2155 init_timer(&ucs->timer_atrdy); 2153 init_timer(&ucs->timer_atrdy);
2156 init_timer(&ucs->timer_cmd_in); 2154 init_timer(&ucs->timer_cmd_in);
@@ -2307,7 +2305,7 @@ static int gigaset_probe(struct usb_interface *interface,
2307 2305
2308 /* tell common part that the device is ready */ 2306 /* tell common part that the device is ready */
2309 if (startmode == SM_LOCKED) 2307 if (startmode == SM_LOCKED)
2310 atomic_set(&cs->mstate, MS_LOCKED); 2308 cs->mstate = MS_LOCKED;
2311 2309
2312 /* save address of controller structure */ 2310 /* save address of controller structure */
2313 usb_set_intfdata(interface, cs); 2311 usb_set_intfdata(interface, cs);
@@ -2342,7 +2340,7 @@ static void gigaset_disconnect(struct usb_interface *interface)
2342 dev_info(cs->dev, "disconnecting Gigaset base\n"); 2340 dev_info(cs->dev, "disconnecting Gigaset base\n");
2343 2341
2344 /* mark base as not ready, all channels disconnected */ 2342 /* mark base as not ready, all channels disconnected */
2345 atomic_set(&ucs->basstate, 0); 2343 ucs->basstate = 0;
2346 2344
2347 /* tell LL all channels are down */ 2345 /* tell LL all channels are down */
2348 for (j = 0; j < BAS_CHANNELS; ++j) 2346 for (j = 0; j < BAS_CHANNELS; ++j)
@@ -2374,7 +2372,6 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
2374{ 2372{
2375 struct cardstate *cs = usb_get_intfdata(intf); 2373 struct cardstate *cs = usb_get_intfdata(intf);
2376 struct bas_cardstate *ucs = cs->hw.bas; 2374 struct bas_cardstate *ucs = cs->hw.bas;
2377 int basstate;
2378 int rc; 2375 int rc;
2379 2376
2380 /* set suspend flag; this stops AT command/response traffic */ 2377 /* set suspend flag; this stops AT command/response traffic */
@@ -2385,29 +2382,28 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
2385 2382
2386 /* wait a bit for blocking conditions to go away */ 2383 /* wait a bit for blocking conditions to go away */
2387 rc = wait_event_timeout(ucs->waitqueue, 2384 rc = wait_event_timeout(ucs->waitqueue,
2388 !(atomic_read(&ucs->basstate) & 2385 !(ucs->basstate &
2389 (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)), 2386 (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)),
2390 BAS_TIMEOUT*HZ/10); 2387 BAS_TIMEOUT*HZ/10);
2391 gig_dbg(DEBUG_SUSPEND, "wait_event_timeout() -> %d", rc); 2388 gig_dbg(DEBUG_SUSPEND, "wait_event_timeout() -> %d", rc);
2392 2389
2393 /* check for conditions preventing suspend */ 2390 /* check for conditions preventing suspend */
2394 basstate = atomic_read(&ucs->basstate); 2391 if (ucs->basstate & (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)) {
2395 if (basstate & (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)) {
2396 dev_warn(cs->dev, "cannot suspend:\n"); 2392 dev_warn(cs->dev, "cannot suspend:\n");
2397 if (basstate & BS_B1OPEN) 2393 if (ucs->basstate & BS_B1OPEN)
2398 dev_warn(cs->dev, " B channel 1 open\n"); 2394 dev_warn(cs->dev, " B channel 1 open\n");
2399 if (basstate & BS_B2OPEN) 2395 if (ucs->basstate & BS_B2OPEN)
2400 dev_warn(cs->dev, " B channel 2 open\n"); 2396 dev_warn(cs->dev, " B channel 2 open\n");
2401 if (basstate & BS_ATRDPEND) 2397 if (ucs->basstate & BS_ATRDPEND)
2402 dev_warn(cs->dev, " receiving AT reply\n"); 2398 dev_warn(cs->dev, " receiving AT reply\n");
2403 if (basstate & BS_ATWRPEND) 2399 if (ucs->basstate & BS_ATWRPEND)
2404 dev_warn(cs->dev, " sending AT command\n"); 2400 dev_warn(cs->dev, " sending AT command\n");
2405 update_basstate(ucs, 0, BS_SUSPEND); 2401 update_basstate(ucs, 0, BS_SUSPEND);
2406 return -EBUSY; 2402 return -EBUSY;
2407 } 2403 }
2408 2404
2409 /* close AT channel if open */ 2405 /* close AT channel if open */
2410 if (basstate & BS_ATOPEN) { 2406 if (ucs->basstate & BS_ATOPEN) {
2411 gig_dbg(DEBUG_SUSPEND, "closing AT channel"); 2407 gig_dbg(DEBUG_SUSPEND, "closing AT channel");
2412 rc = req_submit(cs->bcs, HD_CLOSE_ATCHANNEL, 0, 0); 2408 rc = req_submit(cs->bcs, HD_CLOSE_ATCHANNEL, 0, 0);
2413 if (rc) { 2409 if (rc) {
@@ -2546,25 +2542,25 @@ static void __exit bas_gigaset_exit(void)
2546 /* from now on, no isdn callback should be possible */ 2542 /* from now on, no isdn callback should be possible */
2547 2543
2548 /* close all still open channels */ 2544 /* close all still open channels */
2549 if (atomic_read(&ucs->basstate) & BS_B1OPEN) { 2545 if (ucs->basstate & BS_B1OPEN) {
2550 gig_dbg(DEBUG_INIT, "closing B1 channel"); 2546 gig_dbg(DEBUG_INIT, "closing B1 channel");
2551 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0), 2547 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2552 HD_CLOSE_B1CHANNEL, OUT_VENDOR_REQ, 0, 0, 2548 HD_CLOSE_B1CHANNEL, OUT_VENDOR_REQ, 0, 0,
2553 NULL, 0, BAS_TIMEOUT); 2549 NULL, 0, BAS_TIMEOUT);
2554 } 2550 }
2555 if (atomic_read(&ucs->basstate) & BS_B2OPEN) { 2551 if (ucs->basstate & BS_B2OPEN) {
2556 gig_dbg(DEBUG_INIT, "closing B2 channel"); 2552 gig_dbg(DEBUG_INIT, "closing B2 channel");
2557 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0), 2553 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2558 HD_CLOSE_B2CHANNEL, OUT_VENDOR_REQ, 0, 0, 2554 HD_CLOSE_B2CHANNEL, OUT_VENDOR_REQ, 0, 0,
2559 NULL, 0, BAS_TIMEOUT); 2555 NULL, 0, BAS_TIMEOUT);
2560 } 2556 }
2561 if (atomic_read(&ucs->basstate) & BS_ATOPEN) { 2557 if (ucs->basstate & BS_ATOPEN) {
2562 gig_dbg(DEBUG_INIT, "closing AT channel"); 2558 gig_dbg(DEBUG_INIT, "closing AT channel");
2563 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0), 2559 usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),
2564 HD_CLOSE_ATCHANNEL, OUT_VENDOR_REQ, 0, 0, 2560 HD_CLOSE_ATCHANNEL, OUT_VENDOR_REQ, 0, 0,
2565 NULL, 0, BAS_TIMEOUT); 2561 NULL, 0, BAS_TIMEOUT);
2566 } 2562 }
2567 atomic_set(&ucs->basstate, 0); 2563 ucs->basstate = 0;
2568 2564
2569 /* deregister this driver with the USB subsystem */ 2565 /* deregister this driver with the USB subsystem */
2570 usb_deregister(&gigaset_usb_driver); 2566 usb_deregister(&gigaset_usb_driver);