提交 8b49a4c7 编写于 作者: D Dmitry Kravkov 提交者: David S. Miller

bnx2x: fix compilation without CONFIG_BNX2X_SRIOV

Move mutex initialization by allocation of the mailbox it protects.

introduced in commit 1d6f3cd8 'bnx2x: Prevent VF race'
Signed-off-by: NDmitry Kravkov <dmitry@broadcom.com>
Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f3d40392
......@@ -12522,7 +12522,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
*/
if (IS_VF(bp)) {
bp->doorbells = bnx2x_vf_doorbells(bp);
mutex_init(&bp->vf2pf_mutex);
rc = bnx2x_vf_pci_alloc(bp);
if (rc)
goto init_one_exit;
......
......@@ -3425,6 +3425,8 @@ void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
int bnx2x_vf_pci_alloc(struct bnx2x *bp)
{
mutex_init(&bp->vf2pf_mutex);
/* allocate vf2pf mailbox for vf to pf channel */
BNX2X_PCI_ALLOC(bp->vf2pf_mbox, &bp->vf2pf_mbox_mapping,
sizeof(struct bnx2x_vf_mbx_msg));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册