aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/usb-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/usb-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/usb-gigaset.c')
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index 7028911d91ed..c58ddee68dea 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -133,7 +133,7 @@ static struct usb_driver gigaset_usb_driver = {
133struct usb_cardstate { 133struct usb_cardstate {
134 struct usb_device *udev; /* usb device pointer */ 134 struct usb_device *udev; /* usb device pointer */
135 struct usb_interface *interface; /* interface for this device */ 135 struct usb_interface *interface; /* interface for this device */
136 atomic_t busy; /* bulk output in progress */ 136 int busy; /* bulk output in progress */
137 137
138 /* Output buffer */ 138 /* Output buffer */
139 unsigned char *bulk_out_buffer; 139 unsigned char *bulk_out_buffer;
@@ -325,7 +325,7 @@ static void gigaset_modem_fill(unsigned long data)
325 325
326 gig_dbg(DEBUG_OUTPUT, "modem_fill"); 326 gig_dbg(DEBUG_OUTPUT, "modem_fill");
327 327
328 if (atomic_read(&cs->hw.usb->busy)) { 328 if (cs->hw.usb->busy) {
329 gig_dbg(DEBUG_OUTPUT, "modem_fill: busy"); 329 gig_dbg(DEBUG_OUTPUT, "modem_fill: busy");
330 return; 330 return;
331 } 331 }
@@ -430,7 +430,7 @@ static void gigaset_write_bulk_callback(struct urb *urb)
430 break; 430 break;
431 case -ENOENT: /* killed */ 431 case -ENOENT: /* killed */
432 gig_dbg(DEBUG_ANY, "%s: killed", __func__); 432 gig_dbg(DEBUG_ANY, "%s: killed", __func__);
433 atomic_set(&cs->hw.usb->busy, 0); 433 cs->hw.usb->busy = 0;
434 return; 434 return;
435 default: 435 default:
436 dev_err(cs->dev, "bulk transfer failed (status %d)\n", 436 dev_err(cs->dev, "bulk transfer failed (status %d)\n",
@@ -443,7 +443,7 @@ static void gigaset_write_bulk_callback(struct urb *urb)
443 if (!cs->connected) { 443 if (!cs->connected) {
444 err("%s: not connected", __func__); 444 err("%s: not connected", __func__);
445 } else { 445 } else {
446 atomic_set(&cs->hw.usb->busy, 0); 446 cs->hw.usb->busy = 0;
447 tasklet_schedule(&cs->write_tasklet); 447 tasklet_schedule(&cs->write_tasklet);
448 } 448 }
449 spin_unlock_irqrestore(&cs->lock, flags); 449 spin_unlock_irqrestore(&cs->lock, flags);
@@ -491,14 +491,14 @@ static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb)
491 491
492 cb->offset += count; 492 cb->offset += count;
493 cb->len -= count; 493 cb->len -= count;
494 atomic_set(&ucs->busy, 1); 494 ucs->busy = 1;
495 495
496 spin_lock_irqsave(&cs->lock, flags); 496 spin_lock_irqsave(&cs->lock, flags);
497 status = cs->connected ? usb_submit_urb(ucs->bulk_out_urb, GFP_ATOMIC) : -ENODEV; 497 status = cs->connected ? usb_submit_urb(ucs->bulk_out_urb, GFP_ATOMIC) : -ENODEV;
498 spin_unlock_irqrestore(&cs->lock, flags); 498 spin_unlock_irqrestore(&cs->lock, flags);
499 499
500 if (status) { 500 if (status) {
501 atomic_set(&ucs->busy, 0); 501 ucs->busy = 0;
502 err("could not submit urb (error %d)\n", 502 err("could not submit urb (error %d)\n",
503 -status); 503 -status);
504 cb->len = 0; /* skip urb => remove cb+wakeup 504 cb->len = 0; /* skip urb => remove cb+wakeup
@@ -517,7 +517,7 @@ static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf,
517 struct cmdbuf_t *cb; 517 struct cmdbuf_t *cb;
518 unsigned long flags; 518 unsigned long flags;
519 519
520 gigaset_dbg_buffer(atomic_read(&cs->mstate) != MS_LOCKED ? 520 gigaset_dbg_buffer(cs->mstate != MS_LOCKED ?
521 DEBUG_TRANSCMD : DEBUG_LOCKCMD, 521 DEBUG_TRANSCMD : DEBUG_LOCKCMD,
522 "CMD Transmit", len, buf); 522 "CMD Transmit", len, buf);
523 523
@@ -654,7 +654,7 @@ static int write_modem(struct cardstate *cs)
654 count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size); 654 count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size);
655 skb_copy_from_linear_data(bcs->tx_skb, ucs->bulk_out_buffer, count); 655 skb_copy_from_linear_data(bcs->tx_skb, ucs->bulk_out_buffer, count);
656 skb_pull(bcs->tx_skb, count); 656 skb_pull(bcs->tx_skb, count);
657 atomic_set(&ucs->busy, 1); 657 ucs->busy = 1;
658 gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count); 658 gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count);
659 659
660 spin_lock_irqsave(&cs->lock, flags); 660 spin_lock_irqsave(&cs->lock, flags);
@@ -672,7 +672,7 @@ static int write_modem(struct cardstate *cs)
672 672
673 if (ret) { 673 if (ret) {
674 err("could not submit urb (error %d)\n", -ret); 674 err("could not submit urb (error %d)\n", -ret);
675 atomic_set(&ucs->busy, 0); 675 ucs->busy = 0;
676 } 676 }
677 677
678 if (!bcs->tx_skb->len) { 678 if (!bcs->tx_skb->len) {
@@ -764,7 +764,7 @@ static int gigaset_probe(struct usb_interface *interface,
764 764
765 endpoint = &hostif->endpoint[1].desc; 765 endpoint = &hostif->endpoint[1].desc;
766 766
767 atomic_set(&ucs->busy, 0); 767 ucs->busy = 0;
768 768
769 ucs->read_urb = usb_alloc_urb(0, GFP_KERNEL); 769 ucs->read_urb = usb_alloc_urb(0, GFP_KERNEL);
770 if (!ucs->read_urb) { 770 if (!ucs->read_urb) {
@@ -797,7 +797,7 @@ static int gigaset_probe(struct usb_interface *interface,
797 797
798 /* tell common part that the device is ready */ 798 /* tell common part that the device is ready */
799 if (startmode == SM_LOCKED) 799 if (startmode == SM_LOCKED)
800 atomic_set(&cs->mstate, MS_LOCKED); 800 cs->mstate = MS_LOCKED;
801 801
802 if (!gigaset_start(cs)) { 802 if (!gigaset_start(cs)) {
803 tasklet_kill(&cs->write_tasklet); 803 tasklet_kill(&cs->write_tasklet);