[06/14] net/sfc: start to make MCDI helpers interface shareable
diff mbox series

Message ID 1599556475-27820-8-git-send-email-arybchenko@solarflare.com
State Superseded
Delegated to: Ferruh Yigit
Headers show
Series
  • net/sfc: factor out common driver library
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Sept. 8, 2020, 9:14 a.m. UTC
sfc_adapter is network driver specific structure which finally
should not be used in shared MCDI helpers interface.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_mcdi.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c
index c716caabdf..35e1f3940d 100644
--- a/drivers/net/sfc/sfc_mcdi.c
+++ b/drivers/net/sfc/sfc_mcdi.c
@@ -248,17 +248,14 @@  sfc_efx_mcdi_ev_proxy_response(void *arg, uint32_t handle, efx_rc_t result)
 }
 
 static int
-sfc_efx_mcdi_init(struct sfc_adapter *sa)
+sfc_efx_mcdi_init(struct sfc_adapter *sa, struct sfc_efx_mcdi *mcdi)
 {
-	struct sfc_efx_mcdi *mcdi;
 	size_t max_msg_size;
 	efx_mcdi_transport_t *emtp;
 	int rc;
 
 	sfc_log_init(sa, "entry");
 
-	mcdi = &sa->mcdi;
-
 	SFC_ASSERT(mcdi->state == SFC_EFX_MCDI_UNINITIALIZED);
 
 	rte_spinlock_init(&mcdi->lock);
@@ -301,14 +298,12 @@  sfc_efx_mcdi_init(struct sfc_adapter *sa)
 }
 
 static void
-sfc_efx_mcdi_fini(struct sfc_adapter *sa)
+sfc_efx_mcdi_fini(struct sfc_adapter *sa, struct sfc_efx_mcdi *mcdi)
 {
-	struct sfc_efx_mcdi *mcdi;
 	efx_mcdi_transport_t *emtp;
 
 	sfc_log_init(sa, "entry");
 
-	mcdi = &sa->mcdi;
 	emtp = &mcdi->transport;
 
 	rte_spinlock_lock(&mcdi->lock);
@@ -328,11 +323,11 @@  sfc_efx_mcdi_fini(struct sfc_adapter *sa)
 int
 sfc_mcdi_init(struct sfc_adapter *sa)
 {
-	return sfc_efx_mcdi_init(sa);
+	return sfc_efx_mcdi_init(sa, &sa->mcdi);
 }
 
 void
 sfc_mcdi_fini(struct sfc_adapter *sa)
 {
-	sfc_efx_mcdi_fini(sa);
+	sfc_efx_mcdi_fini(sa, &sa->mcdi);
 }