net/smsc911x: Fix deferred probe for interrupt
authorTony Lindgren <tony@atomide.com>
Fri, 28 Aug 2015 18:50:15 +0000 (11:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Aug 2015 20:09:17 +0000 (13:09 -0700)
The interrupt handler may not be available when smsc911x probes if the
interrupt handler is a GPIO controller for example. Let's fix that
by adding handling for -EPROBE_DEFER.

Cc: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/smsc/smsc911x.c

index 959aeeade0c97b8cbf5ee27024ecda185c6258b2..cb9f166f907ea4a7372915a18334decc2558da21 100644 (file)
@@ -2435,7 +2435,10 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
        res_size = resource_size(res);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
+       if (irq == -EPROBE_DEFER) {
+               retval = -EPROBE_DEFER;
+               goto out_0;
+       } else if (irq <= 0) {
                pr_warn("Could not allocate irq resource\n");
                retval = -ENODEV;
                goto out_0;