From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH 9/9] bus: remove useless plug parameter Date: Sun, 9 Jul 2017 03:45:45 +0200 Message-ID: References: Cc: Gaetan Rivet To: dev@dpdk.org Return-path: Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com [209.85.128.181]) by dpdk.org (Postfix) with ESMTP id D3FF458D1 for ; Sun, 9 Jul 2017 03:46:08 +0200 (CEST) Received: by mail-wr0-f181.google.com with SMTP id r103so93871909wrb.0 for ; Sat, 08 Jul 2017 18:46:08 -0700 (PDT) In-Reply-To: In-Reply-To: References: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The prior scan should link the relevant rte_devargs to the newly allocated rte_device. As such, it is useless to pass device arguments to the plug callback. Those arguments are available within the devargs field of the rte_device structure. Fixes: 7c8810f43f6e ("bus: introduce device plug/unplug") Fixes: 00e62aae69c0 ("bus/pci: implement plug/unplug operations") Fixes: a3ee360f4440 ("eal: add hotplug add/remove device") Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_dev.c | 2 +- lib/librte_eal/common/eal_common_pci.c | 2 +- lib/librte_eal/common/eal_common_vdev.c | 2 +- lib/librte_eal/common/include/rte_bus.h | 6 +----- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 143c231..42e91db 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -188,7 +188,7 @@ rte_eal_hotplug_add(const char *busname, const char *devname, goto err_devarg; } - ret = bus->plug(dev, devargs); + ret = bus->plug(dev); if (ret) { RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n", dev->name); diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 7e82a31..a64d76c 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -533,7 +533,7 @@ pci_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, } static int -pci_plug(struct rte_device *dev, const char *devargs __rte_unused) +pci_plug(struct rte_device *dev) { return pci_probe_all_drivers(RTE_DEV_TO_PCI(dev)); } diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index f8b48b5..a2cdfa4 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -354,7 +354,7 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, } static int -vdev_plug(struct rte_device *dev, const char *args __rte_unused) +vdev_plug(struct rte_device *dev) { return vdev_probe_all_drivers(RTE_DEV_TO_VDEV(dev)); } diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index 37cc230..167635a 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -114,15 +114,11 @@ typedef struct rte_device * * @param dev * Device pointer that was returned by a previous call to find_device. * - * @param devargs - * Device declaration. - * * @return * 0 on success. * !0 on error. */ -typedef int (*rte_bus_plug_t)(struct rte_device *dev, - const char *devargs); +typedef int (*rte_bus_plug_t)(struct rte_device *dev); /** * Implementation specific remove function which is responsible for unlinking -- 2.1.4