[dpdk-dev,v2,2/4] cryptodev: move initialization

Message ID 20170712195846.65286-3-jblunck@infradead.org (mailing list archive)
State Changes Requested, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jan Blunck July 12, 2017, 7:58 p.m. UTC
  Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 lib/librte_cryptodev/rte_cryptodev.c     | 3 +++
 lib/librte_cryptodev/rte_cryptodev_pmd.c | 6 ------
 2 files changed, 3 insertions(+), 6 deletions(-)
  

Patch

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 8ee5d47a9..09e4671be 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -587,6 +587,9 @@  rte_cryptodev_pmd_allocate(const char *name, int socket_id)
 		cryptodev->data->socket_id = socket_id;
 		cryptodev->data->dev_started = 0;
 
+		/* init user callbacks */
+		TAILQ_INIT(&(cryptodev->link_intr_cbs));
+
 		cryptodev->attached = RTE_CRYPTODEV_ATTACHED;
 
 		cryptodev_globals.nb_devs++;
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
index a57faadcf..ec6eeffa1 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -101,9 +101,6 @@  rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
 
 	cryptodev->device = &vdev->device;
 
-	/* initialise user call-back tail queue */
-	TAILQ_INIT(&(cryptodev->link_intr_cbs));
-
 	return cryptodev;
 }
 
@@ -188,9 +185,6 @@  rte_cryptodev_pci_generic_probe(struct rte_pci_device *pci_dev,
 
 	cryptodev->device = &pci_dev->device;
 
-	/* init user callbacks */
-	TAILQ_INIT(&(cryptodev->link_intr_cbs));
-
 	/* Invoke PMD device initialization function */
 	RTE_FUNC_PTR_OR_ERR_RET(*dev_init, -EINVAL);
 	retval = dev_init(cryptodev);