summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorXu Yilun <yilun.xu@intel.com>2020-02-25 14:07:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-29 16:33:22 +0200
commita0f1f53ecd8d161d2e3d71a169b0971a1cbcefc4 (patch)
treefccd041e27f8adafec1ce8e299f67c8e53778e13 /drivers
parent22432bcf066c1017a08a4c05883f4008b04ba03d (diff)
downloadlinux-stable-a0f1f53ecd8d161d2e3d71a169b0971a1cbcefc4.tar.gz
linux-stable-a0f1f53ecd8d161d2e3d71a169b0971a1cbcefc4.tar.bz2
linux-stable-a0f1f53ecd8d161d2e3d71a169b0971a1cbcefc4.zip
fpga: dfl: pci: fix return value of cci_pci_sriov_configure
commit 3c2760b78f90db874401d97e3c17829e2e36f400 upstream. pci_driver.sriov_configure should return negative value on error and number of enabled VFs on success. But now the driver returns 0 on success. The sriov configure still works but will cause a warning message: XX VFs requested; only 0 enabled This patch changes the return value accordingly. Cc: stable@vger.kernel.org Signed-off-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Wu Hao <hao.wu@intel.com> Signed-off-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/fpga/dfl-pci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c
index 89ca292236ad..538755062ab7 100644
--- a/drivers/fpga/dfl-pci.c
+++ b/drivers/fpga/dfl-pci.c
@@ -248,11 +248,13 @@ static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs)
return ret;
ret = pci_enable_sriov(pcidev, num_vfs);
- if (ret)
+ if (ret) {
dfl_fpga_cdev_config_ports_pf(cdev);
+ return ret;
+ }
}
- return ret;
+ return num_vfs;
}
static void cci_pci_remove(struct pci_dev *pcidev)