sfc: Warn if unable to create MTDs
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 27 Jan 2012 17:23:58 +0000 (17:23 +0000)
committerBen Hutchings <bhutchings@solarflare.com>
Mon, 13 Feb 2012 23:40:50 +0000 (23:40 +0000)
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>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/mtd.c

index 2e6389c55ceed8847439aa115bd2bd914b505db3..ce07aa516cd2d7bd7df23472464507621142abe3 100644 (file)
@@ -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");
 
+       /* Try to create MTDs, but allow this to fail */
        rtnl_lock();
-       efx_mtd_probe(efx); /* allowed to fail */
+       rc = efx_mtd_probe(efx);
        rtnl_unlock();
+       if (rc)
+               netif_warn(efx, probe, efx->net_dev,
+                          "failed to create MTDs (%d)\n", rc);
+
        return 0;
 
  fail4:
index 79c1922720470cf33d0a74e77343399be85eb3d9..26b3c23b0b6f263a72678675eadb8ff673be5f2c 100644 (file)
@@ -280,7 +280,7 @@ fail:
                --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;
 }
 
This page took 0.040003 seconds and 5 git commands to generate.