net: stmmac: make reset control an optional requirement
authorDinh Nguyen <dinguyen@opensource.altera.com>
Fri, 6 Mar 2015 23:48:28 +0000 (17:48 -0600)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Mar 2015 02:52:45 +0000 (22:52 -0400)
Not having a reset control line to the ethernet controller should not be a
hard failure. Instead, add support for deferred probing and just print out
a debug statement.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Vince Bridgers <vbridger@opensource.altera.com>
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

index e97074cd5800a7c67466b60925cb6dfaf6aaab0b..5a36bd2c7837d3f4c84e9344ba6bc040e872af2c 100644 (file)
@@ -91,7 +91,9 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
                                                  STMMAC_RESOURCE_NAME);
        if (IS_ERR(dwmac->stmmac_rst)) {
                dev_info(dev, "Could not get reset control!\n");
-               return -EINVAL;
+               if (PTR_ERR(dwmac->stmmac_rst) == -EPROBE_DEFER)
+                       return -EPROBE_DEFER;
+               dwmac->stmmac_rst = NULL;
        }
 
        dwmac->interface = of_get_phy_mode(np);