diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2017-03-27 15:15:01 +0530 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-04-11 14:18:37 -0500 |
commit | 3a401a2ce1cb6f6e52b78f21aa82e5d90e35c430 (patch) | |
tree | 348b395dea242f37306da3a493c779fc3fd88ca8 /drivers/pci/endpoint | |
parent | bea37d3d3121d051b12541f06327d7ac63996fc0 (diff) | |
download | linux-3a401a2ce1cb6f6e52b78f21aa82e5d90e35c430.tar.gz linux-3a401a2ce1cb6f6e52b78f21aa82e5d90e35c430.tar.bz2 linux-3a401a2ce1cb6f6e52b78f21aa82e5d90e35c430.zip |
PCI: endpoint: Create configfs entry for EPC device and EPF driver
Invoke APIs provided by pci-ep-cfs to create configfs entry for every EPC
device and EPF driver to help users in creating EPF device and binding the
EPF device to the EPC device.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/endpoint')
-rw-r--r-- | drivers/pci/endpoint/pci-epc-core.c | 4 | ||||
-rw-r--r-- | drivers/pci/endpoint/pci-epf-core.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index 7c71dd94721c..caa7be10e473 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -24,6 +24,7 @@ #include <linux/pci-epc.h> #include <linux/pci-epf.h> +#include <linux/pci-ep-cfs.h> static struct class *pci_epc_class; @@ -442,6 +443,7 @@ EXPORT_SYMBOL_GPL(pci_epc_linkup); */ void pci_epc_destroy(struct pci_epc *epc) { + pci_ep_cfs_remove_epc_group(epc->group); device_unregister(&epc->dev); kfree(epc); } @@ -508,6 +510,8 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops, if (ret) goto put_dev; + epc->group = pci_ep_cfs_add_epc_group(dev_name(dev)); + return epc; put_dev: diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index a281c599a504..6877d6a5bcc9 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -24,6 +24,7 @@ #include <linux/pci-epc.h> #include <linux/pci-epf.h> +#include <linux/pci-ep-cfs.h> static struct bus_type pci_epf_bus_type; static struct device_type pci_epf_type; @@ -149,6 +150,7 @@ EXPORT_SYMBOL_GPL(pci_epf_alloc_space); */ void pci_epf_unregister_driver(struct pci_epf_driver *driver) { + pci_ep_cfs_remove_epf_group(driver->group); driver_unregister(&driver->driver); } EXPORT_SYMBOL_GPL(pci_epf_unregister_driver); @@ -178,6 +180,8 @@ int __pci_epf_register_driver(struct pci_epf_driver *driver, if (ret) return ret; + driver->group = pci_ep_cfs_add_epf_group(driver->driver.name); + return 0; } EXPORT_SYMBOL_GPL(__pci_epf_register_driver); |