usb: otg: tegra: Initialize id det gpio properly
Rakesh Bodla [Wed, 17 Apr 2013 12:51:25 +0000 (17:51 +0530)]
Initialize id det gpio value properly.

Bug 1273534

Change-Id: Id1946dd69a6f9a6cdb9139f455b5d18526587ab0
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/220204
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/usb/otg/tegra-otg.c

index e24ba00..b8ed565 100644 (file)
@@ -543,7 +543,8 @@ static int tegra_otg_probe(struct platform_device *pdev)
 
        if (pdata) {
                tegra->support_pmu_vbus = pdata->ehci_pdata->support_pmu_vbus;
-               tegra->id_det_gpio = pdata->id_det_gpio;
+               tegra->id_det_gpio = pdata->id_det_gpio ?
+                                       pdata->id_det_gpio : -1;
                tegra->pdata = pdata;
                tegra_otg_set_id_detection_type(tegra);
        }