diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-27 12:23:58 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-13 18:40:50 -0500 |
commit | 7c43161c11d7f40e38db9a1adb61347f06127796 (patch) | |
tree | b56ad975f2ea903ee58048c13b78705aadaec822 | |
parent | 5b6262d0ccf759a16fabe11d904a2531125a4b71 (diff) |
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>
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mtd.c | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 2e6389c55cee..ce07aa516cd2 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -2502,9 +2502,14 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, | |||
2502 | 2502 | ||
2503 | netif_dbg(efx, probe, efx->net_dev, "initialisation successful\n"); | 2503 | netif_dbg(efx, probe, efx->net_dev, "initialisation successful\n"); |
2504 | 2504 | ||
2505 | /* Try to create MTDs, but allow this to fail */ | ||
2505 | rtnl_lock(); | 2506 | rtnl_lock(); |
2506 | efx_mtd_probe(efx); /* allowed to fail */ | 2507 | rc = efx_mtd_probe(efx); |
2507 | rtnl_unlock(); | 2508 | rtnl_unlock(); |
2509 | if (rc) | ||
2510 | netif_warn(efx, probe, efx->net_dev, | ||
2511 | "failed to create MTDs (%d)\n", rc); | ||
2512 | |||
2508 | return 0; | 2513 | return 0; |
2509 | 2514 | ||
2510 | fail4: | 2515 | fail4: |
diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c index 79c192272047..26b3c23b0b6f 100644 --- a/drivers/net/ethernet/sfc/mtd.c +++ b/drivers/net/ethernet/sfc/mtd.c | |||
@@ -280,7 +280,7 @@ fail: | |||
280 | --part; | 280 | --part; |
281 | efx_mtd_remove_partition(part); | 281 | efx_mtd_remove_partition(part); |
282 | } | 282 | } |
283 | /* mtd_device_register() returns 1 if the MTD table is full */ | 283 | /* Failure is unlikely here, but probably means we're out of memory */ |
284 | return -ENOMEM; | 284 | return -ENOMEM; |
285 | } | 285 | } |
286 | 286 | ||