summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-23 08:33:09 +0000
committerDavid S. Miller <davem@davemloft.net>2009-10-24 04:27:24 -0700
commita5211bb5f72c55d936dab56363ca9755981164bd (patch)
tree34fa48857a1a5e4a1706a2f2921af884d6da3015 /drivers/net/sfc
parent2ed380a59b3725dc5fbda3627792172afbefc8eb (diff)
downloadblackbird-op-linux-a5211bb5f72c55d936dab56363ca9755981164bd.tar.gz
blackbird-op-linux-a5211bb5f72c55d936dab56363ca9755981164bd.zip
sfc: Move MTD probe after netdev registration and name allocation
The MTD partition is named based on the netdev name, which is set to 'eth%d' before registration. Also, the MTD partition will currently be left registered if netdev registration fails. Fix both these problems by moving the MTD probe after netdev registration. Hold the RTNL to serialise this with the netdev notifier that calls efx_mtd_rename(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/efx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 8fc6a6edc362..0d0243b7ac34 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -2209,13 +2209,15 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
* MAC stats succeeds. */
efx->state = STATE_RUNNING;
- efx_mtd_probe(efx); /* allowed to fail */
-
rc = efx_register_netdev(efx);
if (rc)
goto fail5;
EFX_LOG(efx, "initialisation successful\n");
+
+ rtnl_lock();
+ efx_mtd_probe(efx); /* allowed to fail */
+ rtnl_unlock();
return 0;
fail5:
OpenPOWER on IntegriCloud