Skip to content

Commit 3c2760b

Browse files
yilunxu1984mfischer
authored andcommitted
fpga: dfl: pci: fix return value of cci_pci_sriov_configure
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: [email protected] Signed-off-by: Xu Yilun <[email protected]> Signed-off-by: Wu Hao <[email protected]> Signed-off-by: Moritz Fischer <[email protected]>
1 parent daec0f4 commit 3c2760b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/fpga/dfl-pci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,13 @@ static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs)
248248
return ret;
249249

250250
ret = pci_enable_sriov(pcidev, num_vfs);
251-
if (ret)
251+
if (ret) {
252252
dfl_fpga_cdev_config_ports_pf(cdev);
253+
return ret;
254+
}
253255
}
254256

255-
return ret;
257+
return num_vfs;
256258
}
257259

258260
static void cci_pci_remove(struct pci_dev *pcidev)

0 commit comments

Comments
 (0)