ice: Fix return value when SR-IOV is not supported
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Wed, 9 Oct 2019 14:09:53 +0000 (07:09 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 7 Nov 2019 00:41:45 +0000 (16:41 -0800)
When the device is not capable of supporting SR-IOV -ENODEV is being
returned; -EOPNOTSUPP is more appropriate.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c

index 7ef2cc73958724eba17b0f7e0750e8a25aeddce7..b4813ccc467dfdc030443f60fc55afadfefe7208 100644 (file)
@@ -1408,7 +1408,7 @@ static int ice_pci_sriov_ena(struct ice_pf *pf, int num_vfs)
 
        if (!test_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags)) {
                dev_err(dev, "This device is not capable of SR-IOV\n");
-               return -ENODEV;
+               return -EOPNOTSUPP;
        }
 
        if (pre_existing_vfs && pre_existing_vfs != num_vfs)