usb: xhci: tegra: try defer probe when reg fails
Krishna Yarlagadda [Tue, 19 Nov 2013 11:47:45 +0000 (16:47 +0530)]
Few regulators are dependant on gpio and might not be
available when xhci loads. Try defer probe to avoid this issue

Bug 1409005

Change-Id: I477fbbc2e0c868f04506fbb3d923bddf32ce4857
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/333429
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Jui Chang Kuo <jckuo@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Joy Wang <joyw@nvidia.com>

drivers/usb/host/xhci-tegra.c

index 81fa266..7c0f3e8 100644 (file)
@@ -4368,6 +4368,10 @@ static int tegra_xhci_probe(struct platform_device *pdev)
        ret = tegra_xusb_regulator_init(tegra, pdev);
        if (ret) {
                dev_err(&pdev->dev, "failed to initialize xusb regulator\n");
+               if (ret == -ENODEV) {
+                       ret = -EPROBE_DEFER;
+                       dev_err(&pdev->dev, "Retry at a later stage\n");
+               }
                goto err_deinit_xusb_partition_clk;
        }