net/sfc/base: add ef10 NIC board config method
authorAndy Moreton <amoreton@solarflare.com>
Tue, 20 Feb 2018 07:34:05 +0000 (07:34 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:42 +0000 (14:08 +0200)
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/ef10_nic.c

index b06c73e..b315e9f 100644 (file)
@@ -1541,12 +1541,29 @@ fail1:
        return (rc);
 }
 
+static __checkReturn   efx_rc_t
+ef10_nic_board_cfg(
+       __in            efx_nic_t *enp)
+{
+       const efx_nic_ops_t *enop = enp->en_enop;
+       efx_rc_t rc;
+
+       if ((rc = enop->eno_board_cfg(enp)) != 0)
+               if (rc != EACCES)
+                       goto fail1;
+
+       return (0);
+
+fail1:
+       EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+       return (rc);
+}
 
        __checkReturn   efx_rc_t
 ef10_nic_probe(
        __in            efx_nic_t *enp)
 {
-       const efx_nic_ops_t *enop = enp->en_enop;
        efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
        efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
        efx_rc_t rc;
@@ -1567,9 +1584,8 @@ ef10_nic_probe(
        if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0)
                goto fail3;
 
-       if ((rc = enop->eno_board_cfg(enp)) != 0)
-               if (rc != EACCES)
-                       goto fail4;
+       if ((rc = ef10_nic_board_cfg(enp)) != 0)
+               goto fail4;
 
        /*
         * Set default driver config limits (based on board config).