PCI: endpoint: Assign function number for each PF in EPC core
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 24 Feb 2020 09:53:38 +0000 (15:23 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 24 Feb 2020 10:15:45 +0000 (10:15 +0000)
commit2499ee84e02774a8573b7b4c76c8f2ea38669313
tree49b7a2cb91f2ab36a6e9554a57b88e1f515e6f86
parent07301c982643a432212840a4b648b5d3f5a061fa
PCI: endpoint: Assign function number for each PF in EPC core

The PCIe endpoint core relies on the drivers that invoke the
pci_epc_add_epf() API to allocate and assign a function number
to each physical function (PF). Since endpoint function device can
be created by multiple mechanisms (configfs, devicetree, etc..),
allowing each of these mechanisms to assign a function number
would result in mutliple endpoint function devices having the
same function number. In order to avoid this, let EPC core assign
a function number to the endpoint device.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/endpoint/pci-ep-cfs.c
drivers/pci/endpoint/pci-epc-core.c
include/linux/pci-epc.h