diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-07-06 10:56:26 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-07-06 10:56:26 -0500 |
commit | 524e6b0395988b93791ffe576cb671d4a6a7bf34 (patch) | |
tree | 017c65c6a4831b723c4bea61d7086f2d051170bd /drivers/pci/iov.c | |
parent | 7132700067f234d37c234e5d711bb49ea06d2352 (diff) | |
parent | e9c3bbd68ec7dc5dd986f7270d9233d27b092816 (diff) | |
download | linux-524e6b0395988b93791ffe576cb671d4a6a7bf34.tar.gz linux-524e6b0395988b93791ffe576cb671d4a6a7bf34.tar.bz2 linux-524e6b0395988b93791ffe576cb671d4a6a7bf34.zip |
Merge branch 'pci/virtualization'
- Clarify error message for unbound devices (Moritz Fischer)
* pci/virtualization:
PCI/IOV: Clarify error message for unbound devices
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r-- | drivers/pci/iov.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index a71258347323..dafdc652fcd0 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -391,9 +391,16 @@ static ssize_t sriov_numvfs_store(struct device *dev, if (num_vfs == pdev->sriov->num_VFs) goto exit; + /* is PF driver loaded */ + if (!pdev->driver) { + pci_info(pdev, "no driver bound to device; cannot configure SR-IOV\n"); + ret = -ENOENT; + goto exit; + } + /* is PF driver loaded w/callback */ - if (!pdev->driver || !pdev->driver->sriov_configure) { - pci_info(pdev, "Driver does not support SRIOV configuration via sysfs\n"); + if (!pdev->driver->sriov_configure) { + pci_info(pdev, "driver does not support SR-IOV configuration via sysfs\n"); ret = -ENOENT; goto exit; } |