PCI: endpoint: Populate func_no before calling pci_epc_add_epf()
authorNiklas Cassel <niklas.cassel@axis.com>
Thu, 14 Dec 2017 13:01:45 +0000 (14:01 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 19 Dec 2017 11:05:44 +0000 (11:05 +0000)
commit0c47cd7a9b6c9c36c08113e594e9ad017fb17865
treecc2ea9f57c307359afbff21f465cbd36b9740b6e
parentad4a5becc689c3f32bbbc2b37eff89efe19dc2f9
PCI: endpoint: Populate func_no before calling pci_epc_add_epf()

func_no is a member of struct pci_epf.

Since struct pci_epf is used as an argument to pci_epc_add_epf() (to
bind an endpoint function to a controller), struct pci_epf.func_no
should be populated before calling pci_epc_add_epf().

Initialize the struct pci_epf.func_no member before calling
pci_epc_add_epf(), to fix the endpoint function binding to
an endpoint controller.

Fixes: d74679911610 ("PCI: endpoint: Introduce configfs entry for configuring EP functions")
Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
[lorenzo.pieralisi@arm.com: rewrote the commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Suggested-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/pci/endpoint/pci-ep-cfs.c