Skip to content

Commit

Permalink
sfc: don't use netif_info et al before net_device is registered
Browse files Browse the repository at this point in the history
Using netif_info() before the net_device is registered results in ugly
messages like the following:
sfc 0000:01:00.1 (unnamed net_device) (uninitialized): Solarflare NIC detected
Therefore use pci_info() et al until net_device is registered.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed May 14, 2021
1 parent 3051583 commit fa44821
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/net/ethernet/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,7 @@ static int efx_register_netdev(struct efx_nic *efx)
efx->state = STATE_READY;
smp_mb(); /* ensure we change state before checking reset_pending */
if (efx->reset_pending) {
netif_err(efx, probe, efx->net_dev,
"aborting probe due to scheduled reset\n");
pci_err(efx->pci_dev, "aborting probe due to scheduled reset\n");
rc = -EIO;
goto fail_locked;
}
Expand Down Expand Up @@ -990,8 +989,7 @@ static int efx_pci_probe_main(struct efx_nic *efx)
rc = efx->type->init(efx);
up_write(&efx->filter_sem);
if (rc) {
netif_err(efx, probe, efx->net_dev,
"failed to initialise NIC\n");
pci_err(efx->pci_dev, "failed to initialise NIC\n");
goto fail3;
}

Expand Down Expand Up @@ -1038,8 +1036,8 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
if (efx->type->sriov_init) {
rc = efx->type->sriov_init(efx);
if (rc)
netif_err(efx, probe, efx->net_dev,
"SR-IOV can't be enabled rc %d\n", rc);
pci_err(efx->pci_dev, "SR-IOV can't be enabled rc %d\n",
rc);
}

/* Determine netdevice features */
Expand Down Expand Up @@ -1106,8 +1104,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
if (rc)
goto fail1;

netif_info(efx, probe, efx->net_dev,
"Solarflare NIC detected\n");
pci_info(pci_dev, "Solarflare NIC detected\n");

if (!efx->type->is_vf)
efx_probe_vpd_strings(efx);
Expand Down

0 comments on commit fa44821

Please sign in to comment.