RDMA/cxgb4: Use refcount_t instead of atomic_t for reference counting
[linux-2.6-microblaze.git] / drivers / infiniband / hw / cxgb4 / ev.c
index 4cd877b..7798d09 100644 (file)
@@ -151,7 +151,7 @@ void c4iw_ev_dispatch(struct c4iw_dev *dev, struct t4_cqe *err_cqe)
        }
 
        c4iw_qp_add_ref(&qhp->ibqp);
-       atomic_inc(&chp->refcnt);
+       refcount_inc(&chp->refcnt);
        xa_unlock_irq(&dev->qps);
 
        /* Bad incoming write */
@@ -213,7 +213,7 @@ void c4iw_ev_dispatch(struct c4iw_dev *dev, struct t4_cqe *err_cqe)
                break;
        }
 done:
-       if (atomic_dec_and_test(&chp->refcnt))
+       if (refcount_dec_and_test(&chp->refcnt))
                wake_up(&chp->wait);
        c4iw_qp_rem_ref(&qhp->ibqp);
 out:
@@ -228,13 +228,13 @@ int c4iw_ev_handler(struct c4iw_dev *dev, u32 qid)
        xa_lock_irqsave(&dev->cqs, flag);
        chp = xa_load(&dev->cqs, qid);
        if (chp) {
-               atomic_inc(&chp->refcnt);
+               refcount_inc(&chp->refcnt);
                xa_unlock_irqrestore(&dev->cqs, flag);
                t4_clear_cq_armed(&chp->cq);
                spin_lock_irqsave(&chp->comp_handler_lock, flag);
                (*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context);
                spin_unlock_irqrestore(&chp->comp_handler_lock, flag);
-               if (atomic_dec_and_test(&chp->refcnt))
+               if (refcount_dec_and_test(&chp->refcnt))
                        wake_up(&chp->wait);
        } else {
                pr_debug("unknown cqid 0x%x\n", qid);