lkml.org 
[lkml]   [2019]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 10/21] PCI: endpoint: Make pci_epf_driver ops optional
Date
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@ti.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 c74c7cc6d8bd..67015c66d09f 100644
--- a/drivers/pci/endpoint/pci-epf-core.c
+++ b/drivers/pci/endpoint/pci-epf-core.c
@@ -446,11 +446,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
\
 
 \ /
  Last update: 2019-09-26 13:33    [W:0.082 / U:2.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site