Skip to content

Commit

Permalink
qed: Use DEFINE_SPINLOCK() for spinlock
Browse files Browse the repository at this point in the history
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Aug 8, 2016
1 parent a052517 commit 0caf5b2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/ethernet/qlogic/qed/qed_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
#include "qed_sriov.h"
#include "qed_vf.h"

static spinlock_t qm_lock;
static bool qm_lock_init = false;
static DEFINE_SPINLOCK(qm_lock);

/* API common to all protocols */
enum BAR_ID {
Expand Down Expand Up @@ -1004,11 +1003,6 @@ int qed_hw_init(struct qed_dev *cdev,
p_hwfn->first_on_engine = (load_code ==
FW_MSG_CODE_DRV_LOAD_ENGINE);

if (!qm_lock_init) {
spin_lock_init(&qm_lock);
qm_lock_init = true;
}

switch (load_code) {
case FW_MSG_CODE_DRV_LOAD_ENGINE:
rc = qed_hw_init_common(p_hwfn, p_hwfn->p_main_ptt,
Expand Down

0 comments on commit 0caf5b2

Please sign in to comment.