summaryrefslogtreecommitdiffstats
path: root/drivers/pci/endpoint/pci-epc-core.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2021-08-19 18:03:37 +0530
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2021-08-19 14:13:28 +0100
commit1cf362e907f36f104b9cf590ee6ced786226b388 (patch)
tree6cc906653e21e5815634944fcd88ad423051ac4b /drivers/pci/endpoint/pci-epc-core.c
parentf00bfc6489952528947cba05af158a4badf41688 (diff)
downloadlinux-1cf362e907f36f104b9cf590ee6ced786226b388.tar.bz2
PCI: endpoint: Add support to add virtual function in endpoint core
Add support to add virtual function in endpoint core. The virtual function can only be associated with a physical function instead of a endpoint controller. Provide APIs to associate a virtual function with a physical function here. [weiyongjun1@huawei.com: PCI: endpoint: Fix missing unlock on error in pci_epf_add_vepf() - Reported-by: Hulk Robot <hulkci@huawei.com>] Link: https://lore.kernel.org/r/20210819123343.1951-3-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Diffstat (limited to 'drivers/pci/endpoint/pci-epc-core.c')
-rw-r--r--drivers/pci/endpoint/pci-epc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index adec9bee72cf..01c58ca84dcc 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -548,7 +548,7 @@ int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf,
u32 func_no;
int ret = 0;
- if (IS_ERR_OR_NULL(epc))
+ if (IS_ERR_OR_NULL(epc) || epf->is_vf)
return -EINVAL;
if (type == PRIMARY_INTERFACE && epf->epc)