sfc: Warn if unable to create MTDs
Log an explicit warning if we are unable to create MTDs for a net device. Also correct the comment about why mtd_device_register() may fail; there is no longer an MTD table to fill up. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
This commit is contained in:
parent
5b6262d0cc
commit
7c43161c11
@ -2502,9 +2502,14 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
|
|||||||
|
|
||||||
netif_dbg(efx, probe, efx->net_dev, "initialisation successful\n");
|
netif_dbg(efx, probe, efx->net_dev, "initialisation successful\n");
|
||||||
|
|
||||||
|
/* Try to create MTDs, but allow this to fail */
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
efx_mtd_probe(efx); /* allowed to fail */
|
rc = efx_mtd_probe(efx);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
if (rc)
|
||||||
|
netif_warn(efx, probe, efx->net_dev,
|
||||||
|
"failed to create MTDs (%d)\n", rc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail4:
|
fail4:
|
||||||
|
@ -280,7 +280,7 @@ static int efx_mtd_probe_device(struct efx_nic *efx, struct efx_mtd *efx_mtd)
|
|||||||
--part;
|
--part;
|
||||||
efx_mtd_remove_partition(part);
|
efx_mtd_remove_partition(part);
|
||||||
}
|
}
|
||||||
/* mtd_device_register() returns 1 if the MTD table is full */
|
/* Failure is unlikely here, but probably means we're out of memory */
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user