From da4cbebd60eab9feb65055ea849eae75683dde43 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Wed, 9 Oct 2024 04:50:30 +0000
Subject: [PATCH] common/nfp: use new kvargs process API

[ upstream commit 3977d07df186e6f4c79802db19451f51703a3d60 ]

The nfp_parse_class_options() function could handle both key=value and
only-key, so it should use rte_kvargs_process_opt() instead of
rte_kvargs_process() to parse.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/common/nfp/nfp_common_pci.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/common/nfp/nfp_common_pci.c b/drivers/common/nfp/nfp_common_pci.c
index 723035d..5c36052 100644
--- a/drivers/common/nfp/nfp_common_pci.c
+++ b/drivers/common/nfp/nfp_common_pci.c
@@ -170,10 +170,8 @@ nfp_parse_class_options(const struct rte_devargs *devargs)
 	if (kvargs == NULL)
 		return dev_class;
 
-	if (rte_kvargs_count(kvargs, RTE_DEVARGS_KEY_CLASS) != 0) {
-		rte_kvargs_process(kvargs, RTE_DEVARGS_KEY_CLASS,
-				nfp_kvarg_dev_class_handler, &dev_class);
-	}
+	rte_kvargs_process_opt(kvargs, RTE_DEVARGS_KEY_CLASS,
+			       nfp_kvarg_dev_class_handler, &dev_class);
 
 	rte_kvargs_free(kvargs);
 
-- 
2.33.0

