From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5DB978DAB for ; Sun, 20 May 2018 21:53:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 May 2018 12:53:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,423,1520924400"; d="scan'208";a="52394171" Received: from imail001.iil.intel.com ([10.184.207.12]) by orsmga003.jf.intel.com with ESMTP; 20 May 2018 12:53:01 -0700 Received: from rr.iil.intel.com (rr.iil.intel.com [143.185.141.70]) by imail001.iil.intel.com with ESMTP id w4KJqmBV011125; Sun, 20 May 2018 22:52:48 +0300 From: Rami Rosen To: dev@dpdk.org Cc: Rami Rosen Date: Sun, 20 May 2018 22:52:58 +0300 Message-Id: <1526845978-19222-1-git-send-email-rami.rosen@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] pci: remove unused function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2018 19:53:04 -0000 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 --- 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