diff options
-rw-r--r-- | drivers/usb/otg/tegra-otg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c index 9aa155caaebd..8442fcfc2796 100644 --- a/drivers/usb/otg/tegra-otg.c +++ b/drivers/usb/otg/tegra-otg.c @@ -152,8 +152,6 @@ static void tegra_start_host(struct tegra_otg_data *tegra) memcpy(platform_data, pdata->ehci_pdata, sizeof(struct tegra_usb_platform_data)); pdev->dev.platform_data = platform_data; - tegra->builtin_host = !pdata->ehci_pdata->builtin_host_disabled; - val = platform_device_add(pdev); if (val) goto error_add; @@ -398,6 +396,7 @@ static int tegra_otg_probe(struct platform_device *pdev) { struct tegra_otg_data *tegra; struct resource *res; + struct tegra_usb_otg_data *pdata = dev_get_platdata(&pdev->dev); int err; tegra = kzalloc(sizeof(struct tegra_otg_data), GFP_KERNEL); @@ -413,6 +412,10 @@ static int tegra_otg_probe(struct platform_device *pdev) tegra->otg.set_power = tegra_otg_set_power; spin_lock_init(&tegra->lock); + if (pdata) { + tegra->builtin_host = !pdata->ehci_pdata->builtin_host_disabled; + } + platform_set_drvdata(pdev, tegra); tegra_clone = tegra; tegra->interrupt_mode = true; |