]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Refactor _hwrm_send_message().
authorMichael Chan <michael.chan@broadcom.com>
Fri, 26 Feb 2016 09:00:07 +0000 (04:00 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 7 Jul 2016 00:37:00 +0000 (17:37 -0700)
Orabug: 23221795

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>
(cherry picked from commit fbfbc4851dd709cf1327afc283f9cca00235dcb3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 9ab3900c8330b6424ef5da18510047a8bc02a1c7..57177b855db2dfad34caa0b65a55616bca73a261 100644 (file)
@@ -2612,7 +2612,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;
@@ -2690,13 +2691,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)