aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/iov.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index a32bd9ad0931..bafd2bbcaf65 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -729,10 +729,10 @@ EXPORT_SYMBOL_GPL(pci_sriov_migration);
729 */ 729 */
730int pci_num_vf(struct pci_dev *dev) 730int pci_num_vf(struct pci_dev *dev)
731{ 731{
732 if (!dev || !dev->is_physfn) 732 if (!dev->is_physfn)
733 return 0; 733 return 0;
734 else 734
735 return dev->sriov->num_VFs; 735 return dev->sriov->num_VFs;
736} 736}
737EXPORT_SYMBOL_GPL(pci_num_vf); 737EXPORT_SYMBOL_GPL(pci_num_vf);
738 738
@@ -750,7 +750,7 @@ EXPORT_SYMBOL_GPL(pci_num_vf);
750 */ 750 */
751int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 751int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
752{ 752{
753 if (!dev || !dev->is_physfn || (numvfs > dev->sriov->total_VFs)) 753 if (!dev->is_physfn || (numvfs > dev->sriov->total_VFs))
754 return -EINVAL; 754 return -EINVAL;
755 755
756 /* Shouldn't change if VFs already enabled */ 756 /* Shouldn't change if VFs already enabled */
@@ -773,12 +773,12 @@ EXPORT_SYMBOL_GPL(pci_sriov_set_totalvfs);
773 */ 773 */
774int pci_sriov_get_totalvfs(struct pci_dev *dev) 774int pci_sriov_get_totalvfs(struct pci_dev *dev)
775{ 775{
776 if (!dev || !dev->is_physfn) 776 if (!dev->is_physfn)
777 return -EINVAL; 777 return -EINVAL;
778 778
779 if (dev->sriov->driver_max_VFs) 779 if (dev->sriov->driver_max_VFs)
780 return dev->sriov->driver_max_VFs; 780 return dev->sriov->driver_max_VFs;
781 else 781
782 return dev->sriov->total_VFs; 782 return dev->sriov->total_VFs;
783} 783}
784EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs); 784EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs);