[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200514145927.17555-11-kishon@ti.com>
Date: Thu, 14 May 2020 20:29:18 +0530
From: Kishon Vijay Abraham I <kishon@...com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Arnd Bergmann <arnd@...db.de>, Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>,
Allen Hubbe <allenbh@...il.com>,
Tom Joseph <tjoseph@...ence.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Rob Herring <robh+dt@...nel.org>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jonathan Corbet <corbet@....net>, <linux-pci@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-ntb@...glegroups.com>,
Kishon Vijay Abraham I <kishon@...com>
Subject: [PATCH 10/19] PCI: endpoint: Make pci_epf_driver ops optional
pci_epf_driver had two ops for bind and unbind which will be invoked
when an endpoint controller is bound to an endpoint function (using
configfs). Now that endpoint core has support to define an endpoint
function using device tree alone, the bind and unbind ops can be
optional. Make pci_epf_driver ops optional here.
Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
---
drivers/pci/endpoint/pci-epf-core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c
index f9ba2e8d4a99..f463eedcc3ad 100644
--- a/drivers/pci/endpoint/pci-epf-core.c
+++ b/drivers/pci/endpoint/pci-epf-core.c
@@ -201,11 +201,9 @@ int __pci_epf_register_driver(struct pci_epf_driver *driver,
{
int ret;
- if (!driver->ops)
- return -EINVAL;
-
- if (!driver->ops->bind || !driver->ops->unbind)
- return -EINVAL;
+ if (!driver->ops || !driver->ops->bind || !driver->ops->unbind)
+ pr_debug("%s: Supports only pci_epf device created using DT\n",
+ driver->driver.name);
driver->driver.bus = &pci_epf_bus_type;
driver->driver.owner = owner;
--
2.17.1
Powered by blists - more mailing lists