Skip to contentSkip to conversation

i40e:Return -ENODEV if hardware has no support for certain required features in the function i40e_init_pf_fcoe

PATCH Superseded Nicholas Krause 1 participant 1 message Jun 30, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e:Return -ENODEV if hardware has no support for certain required features in the function i40e_init_pf_fcoe

This makes the function i40e_init_pf_fcoe correctly return -ENODEV as a error return for when the underlying hardware does not have support for FCOE or DCB rather then 0 to it's callers in order to comply with checks run by these particular function's callers to find out if the underlying hardware supports these features.

---
 drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_fcoe.c +4 -3
index c8b621e..24a44dd 100644
@@ -273,7 +273,8 @@ out:
  * i40e_fcoe_sw_init - sets up the HW for FCoE
  * @pf: pointer to PF
  *
- * Returns 0 if FCoE is supported otherwise the error code
+ * Returns 0 if FCoE is supported otherwise  -ENODEV if
+ * the hardware does not support it
  **/
 int i40e_init_pf_fcoe(struct i40e_pf *pf)
 {
@@ -287,13 +288,13 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf)
 
 	if (!pf->hw.func_caps.fcoe) {
 		dev_info(&pf->pdev->dev, "FCoE capability is disabled\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	if (!pf->hw.func_caps.dcb) {
 		dev_warn(&pf->pdev->dev,
 			 "Hardware is not DCB capable not enabling FCoE.\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	/* enable FCoE hash filter */
Signature · 1 line
2.1.4