twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node
authorNeilBrown <neil@brown.name>
Thu, 30 Jul 2015 00:11:24 +0000 (10:11 +1000)
committerSebastian Reichel <sre@kernel.org>
Wed, 5 Aug 2015 03:11:35 +0000 (05:11 +0200)
Now that twl4030_bci_probe can safely return -EPROBE_DEFER,
do so when devm_usb_get_phy_by_node returns that error.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/twl4030_charger.c

index 045238370d3f72b01e3ceced106ef08c9cadc3c5..ffc123fb715895091ac19d1d46e733538b1e8b28 100644 (file)
@@ -636,9 +636,13 @@ static int twl4030_bci_probe(struct platform_device *pdev)
 
                phynode = of_find_compatible_node(bci->dev->of_node->parent,
                                                  NULL, "ti,twl4030-usb");
-               if (phynode)
+               if (phynode) {
                        bci->transceiver = devm_usb_get_phy_by_node(
                                bci->dev, phynode, &bci->usb_nb);
+                       if (IS_ERR(bci->transceiver) &&
+                           PTR_ERR(bci->transceiver) == -EPROBE_DEFER)
+                               return -EPROBE_DEFER;
+               }
        }
 
        /* Enable interrupts now. */