aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2019-08-29 23:54:46 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-30 14:02:18 -0700
commitd4f1420d365633490aa134abfe408453d1c7c238 (patch)
tree6a721ef7a3ec508fde9564fc30fefa3355dd0373 /drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
parentbnxt_en: Remove the -1 error return code from bnxt_hwrm_do_send_msg(). (diff)
downloadlinux-dev-d4f1420d365633490aa134abfe408453d1c7c238.tar.xz
linux-dev-d4f1420d365633490aa134abfe408453d1c7c238.zip
bnxt_en: Convert error code in firmware message response to standard code.
The main firmware messaging function returns the firmware defined error code and many callers have to convert to standard error code for proper propagation to userspace. Convert bnxt_hwrm_do_send_msg() to return standard error code so we can do away with all the special error code handling by the many callers. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index c05d663212b2..7d9a8c4be182 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -109,13 +109,9 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
memcpy(buf, data_addr, bytesize);
dma_free_coherent(&bp->pdev->dev, bytesize, data_addr, data_dma_addr);
- if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) {
+ if (rc == -EACCES)
netdev_err(bp->dev, "PF does not have admin privileges to modify NVM config\n");
- return -EACCES;
- } else if (rc) {
- return -EIO;
- }
- return 0;
+ return rc;
}
static int bnxt_dl_nvm_param_get(struct devlink *dl, u32 id,