From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH v2 15/18] ether: use new devargs parsing function Date: Thu, 12 Oct 2017 10:21:22 +0200 Message-ID: <4d9c051e8150888c8166e477cb16860a4adbee2a.1507796100.git.gaetan.rivet@6wind.com> References: Cc: Gaetan Rivet To: dev@dpdk.org Return-path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 7A0FC1B1EE for ; Thu, 12 Oct 2017 10:21:59 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id u138so11057863wmu.4 for ; Thu, 12 Oct 2017 01:21:59 -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 previous one is being deprecated. Signed-off-by: Gaetan Rivet --- lib/librte_ether/rte_ethdev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index bb08204..618f576 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -372,21 +372,24 @@ rte_eth_dev_is_detachable(uint16_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint16_t *port_id) +rte_eth_dev_attach(const char *devstr, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); + struct rte_devargs devargs; char *name = NULL; char *args = NULL; - if ((devargs == NULL) || (port_id == NULL)) { + if ((devstr == NULL) || (port_id == NULL)) { ret = -EINVAL; goto err; } - /* parse devargs, then retrieve device name and args */ - if (rte_eal_parse_devargs_str(devargs, &name, &args)) + /* parse device, then retrieve device name and args */ + if (rte_eal_devargs_parse(&devargs, "%s", devstr)) goto err; + name = devargs.name; + args = devargs.args; ret = rte_eal_dev_attach(name, args); if (ret < 0) -- 2.1.4