return -ENODEV;
 }
 
-int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset)
+static void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset)
 {
        struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
-       int rc;
 
        if (!BNXT_NEW_RM(bp))
-               return 0; /* no resource reservations required */
-
-       rc = bnxt_hwrm_func_resc_qcaps(bp, true);
-       if (rc)
-               netdev_err(bp->dev, "resc_qcaps failed\n");
+               return; /* no resource reservations required */
 
        hw_resc->resv_cp_rings = 0;
        hw_resc->resv_stat_ctxs = 0;
                bp->tx_nr_rings = 0;
                bp->rx_nr_rings = 0;
        }
+}
+
+int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset)
+{
+       int rc;
+
+       if (!BNXT_NEW_RM(bp))
+               return 0; /* no resource reservations required */
+
+       rc = bnxt_hwrm_func_resc_qcaps(bp, true);
+       if (rc)
+               netdev_err(bp->dev, "resc_qcaps failed\n");
+
+       bnxt_clear_reservations(bp, fw_reset);
 
        return rc;
 }