DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pci: remove unused function
@ 2018-05-17 23:44 Stephen Hemminger
  2018-05-20 19:51 ` Rosen, Rami
  2018-06-27 16:39 ` Thomas Monjalon
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2018-05-17 23:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The function rte_pci_probe_one is private to PCI and is
not used anywhere in current code base. Remove dead code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/pci/pci_common.c | 38 ------------------------------------
 drivers/bus/pci/private.h    | 15 --------------
 2 files changed, 53 deletions(-)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 7215aaec3add..3d21d7373b60 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -254,44 +254,6 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
 	return 1;
 }
 
-/*
- * Find the pci device specified by pci address, then invoke probe function of
- * the driver of the device.
- */
-int
-rte_pci_probe_one(const struct rte_pci_addr *addr)
-{
-	struct rte_pci_device *dev = NULL;
-
-	int ret = 0;
-
-	if (addr == NULL)
-		return -1;
-
-	/* update current pci device in global list, kernel bindings might have
-	 * changed since last time we looked at it.
-	 */
-	if (pci_update_device(addr) < 0)
-		goto err_return;
-
-	FOREACH_DEVICE_ON_PCIBUS(dev) {
-		if (rte_pci_addr_cmp(&dev->addr, addr))
-			continue;
-
-		ret = pci_probe_all_drivers(dev);
-		if (ret)
-			goto err_return;
-		return 0;
-	}
-	return -1;
-
-err_return:
-	RTE_LOG(WARNING, EAL,
-		"Requested device " PCI_PRI_FMT " cannot be used\n",
-		addr->domain, addr->bus, addr->devid, addr->function);
-	return -1;
-}
-
 /*
  * Detach device specified by its pci address.
  */
diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h
index 88fa587e74dc..748abb6617fe 100644
--- a/drivers/bus/pci/private.h
+++ b/drivers/bus/pci/private.h
@@ -32,21 +32,6 @@ rte_pci_probe(void);
  */
 int rte_pci_scan(void);
 
-/**
- * Probe the single PCI device.
- *
- * Scan the content of the PCI bus, and find the pci device specified by pci
- * address, then call the probe() function for registered driver that has a
- * matching entry in its id_table for discovered device.
- *
- * @param addr
- *	The PCI Bus-Device-Function address to probe.
- * @return
- *   - 0 on success.
- *   - Negative on error.
- */
-int rte_pci_probe_one(const struct rte_pci_addr *addr);
-
 /**
  * Close the single PCI device.
  *
-- 
2.17.0

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH] pci: remove unused function
@ 2018-05-20 19:52 Rami Rosen
  2018-06-27 20:54 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Rami Rosen @ 2018-05-20 19:52 UTC (permalink / raw)
  To: dev; +Cc: Rami Rosen

The function rte_pci_detach() is private to PCI and is
not used anywhere in current code base. Remove dead code.

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
---
 drivers/bus/pci/pci_common.c | 36 ------------------------------------
 drivers/bus/pci/private.h    | 14 --------------
 2 files changed, 50 deletions(-)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 7215aae..e6d2c1c 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -292,42 +292,6 @@ static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)
 	return -1;
 }
 
-/*
- * Detach device specified by its pci address.
- */
-int
-rte_pci_detach(const struct rte_pci_addr *addr)
-{
-	struct rte_pci_device *dev = NULL;
-	int ret = 0;
-
-	if (addr == NULL)
-		return -1;
-
-	FOREACH_DEVICE_ON_PCIBUS(dev) {
-		if (rte_pci_addr_cmp(&dev->addr, addr))
-			continue;
-
-		ret = rte_pci_detach_dev(dev);
-		if (ret < 0)
-			/* negative value is an error */
-			goto err_return;
-		if (ret > 0)
-			/* positive value means driver doesn't support it */
-			continue;
-
-		rte_pci_remove_device(dev);
-		free(dev);
-		return 0;
-	}
-	return -1;
-
-err_return:
-	RTE_LOG(WARNING, EAL, "Requested device " PCI_PRI_FMT
-			" cannot be used\n", dev->addr.domain, dev->addr.bus,
-			dev->addr.devid, dev->addr.function);
-	return -1;
-}
 
 /*
  * Scan the content of the PCI bus, and call the probe() function for
diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h
index 88fa587..63bd876 100644
--- a/drivers/bus/pci/private.h
+++ b/drivers/bus/pci/private.h
@@ -47,20 +47,6 @@
  */
 int rte_pci_probe_one(const struct rte_pci_addr *addr);
 
-/**
- * Close the single PCI device.
- *
- * Scan the content of the PCI bus, and find the pci device specified by pci
- * address, then call the remove() function for registered driver that has a
- * matching entry in its id_table for discovered device.
- *
- * @param addr
- *	The PCI Bus-Device-Function address to close.
- * @return
- *   - 0 on success.
- *   - Negative on error.
- */
-int rte_pci_detach(const struct rte_pci_addr *addr);
 
 /**
  * Find the name of a PCI device.
-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-27 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 23:44 [dpdk-dev] [PATCH] pci: remove unused function Stephen Hemminger
2018-05-20 19:51 ` Rosen, Rami
2018-06-27 16:39 ` Thomas Monjalon
2018-05-20 19:52 Rami Rosen
2018-06-27 20:54 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).