Skip to content

Commit

Permalink
bnxt_en: Refactor _hwrm_send_message().
Browse files Browse the repository at this point in the history
Add a new function bnxt_do_send_msg() to do essentially the same thing
with an additional paramter to silence error response messages.  All
current callers will set silent to false.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Mar 1, 2016
1 parent 3ebf6f0 commit fbfbc48
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,8 @@ void bnxt_hwrm_cmd_hdr_init(struct bnxt *bp, void *request, u16 req_type,
req->resp_addr = cpu_to_le64(bp->hwrm_cmd_resp_dma_addr);
}

int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
int timeout, bool silent)
{
int i, intr_process, rc;
struct input *req = msg;
Expand Down Expand Up @@ -2686,13 +2687,16 @@ int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
}

rc = le16_to_cpu(resp->error_code);
if (rc) {
if (rc && !silent)
netdev_err(bp->dev, "hwrm req_type 0x%x seq id 0x%x error 0x%x\n",
le16_to_cpu(resp->req_type),
le16_to_cpu(resp->seq_id), rc);
return rc;
}
return 0;
return rc;
}

int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
{
return bnxt_hwrm_do_send_msg(bp, msg, msg_len, timeout, false);
}

int hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
Expand Down

0 comments on commit fbfbc48

Please sign in to comment.