aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-23 04:33:09 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-24 07:27:24 -0400
commita5211bb5f72c55d936dab56363ca9755981164bd (patch)
tree34fa48857a1a5e4a1706a2f2921af884d6da3015 /drivers/net/sfc/efx.c
parent2ed380a59b3725dc5fbda3627792172afbefc8eb (diff)
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/efx.c')
-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,
2209 * MAC stats succeeds. */ 2209 * MAC stats succeeds. */
2210 efx->state = STATE_RUNNING; 2210 efx->state = STATE_RUNNING;
2211 2211
2212 efx_mtd_probe(efx); /* allowed to fail */
2213
2214 rc = efx_register_netdev(efx); 2212 rc = efx_register_netdev(efx);
2215 if (rc) 2213 if (rc)
2216 goto fail5; 2214 goto fail5;
2217 2215
2218 EFX_LOG(efx, "initialisation successful\n"); 2216 EFX_LOG(efx, "initialisation successful\n");
2217
2218 rtnl_lock();
2219 efx_mtd_probe(efx); /* allowed to fail */
2220 rtnl_unlock();
2219 return 0; 2221 return 0;
2220 2222
2221 fail5: 2223 fail5: