]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bnxt_en: Fix return code to "flash_device".
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Mon, 25 May 2020 21:41:18 +0000 (17:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 03:30:48 +0000 (20:30 -0700)
When NVRAM directory is not found, return the error code
properly as per firmware command failure instead of the hardcode
-ENOBUFS.

Fixes: 7f5f4f9d777a ("bnxt_en: Return -EAGAIN if fw command returns BUSY")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 34046a6286e8d0985bd0e195cd1bcd33c9c42dc8..360f9a95c1d50a44bad7862de594dec108af9443 100644 (file)
@@ -2012,11 +2012,12 @@ int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
 
        bnxt_hwrm_fw_set_time(bp);
 
-       if (bnxt_find_nvram_item(dev, BNX_DIR_TYPE_UPDATE,
-                                BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE,
-                                &index, &item_len, NULL) != 0) {
+       rc = bnxt_find_nvram_item(dev, BNX_DIR_TYPE_UPDATE,
+                                 BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE,
+                                 &index, &item_len, NULL);
+       if (rc) {
                netdev_err(dev, "PKG update area not created in nvram\n");
-               return -ENOBUFS;
+               return rc;
        }
 
        rc = request_firmware(&fw, filename, &dev->dev);