aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-tegra.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-tegra.c')
-rw-r--r--drivers/usb/host/ehci-tegra.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 4f3cfb83f862..ed201ae879cb 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -773,16 +773,14 @@ static int tegra_ehci_probe(struct platform_device *pdev)
773 goto fail_phy; 773 goto fail_phy;
774 } 774 }
775 775
776#ifdef CONFIG_USB_OTG_UTILS
777 if (pdata->operating_mode == TEGRA_USB_OTG) { 776 if (pdata->operating_mode == TEGRA_USB_OTG) {
778 tegra->transceiver = 777 tegra->transceiver =
779 devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); 778 devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
780 if (!IS_ERR_OR_NULL(tegra->transceiver)) 779 if (!IS_ERR(tegra->transceiver))
781 otg_set_host(tegra->transceiver->otg, &hcd->self); 780 otg_set_host(tegra->transceiver->otg, &hcd->self);
782 } else { 781 } else {
783 tegra->transceiver = ERR_PTR(-ENODEV); 782 tegra->transceiver = ERR_PTR(-ENODEV);
784 } 783 }
785#endif
786 784
787 err = usb_add_hcd(hcd, irq, IRQF_SHARED); 785 err = usb_add_hcd(hcd, irq, IRQF_SHARED);
788 if (err) { 786 if (err) {
@@ -801,10 +799,8 @@ static int tegra_ehci_probe(struct platform_device *pdev)
801 return err; 799 return err;
802 800
803fail: 801fail:
804#ifdef CONFIG_USB_OTG_UTILS 802 if (!IS_ERR(tegra->transceiver))
805 if (!IS_ERR_OR_NULL(tegra->transceiver))
806 otg_set_host(tegra->transceiver->otg, NULL); 803 otg_set_host(tegra->transceiver->otg, NULL);
807#endif
808fail_phy: 804fail_phy:
809 usb_phy_shutdown(hcd->phy); 805 usb_phy_shutdown(hcd->phy);
810fail_io: 806fail_io:
@@ -823,10 +819,8 @@ static int tegra_ehci_remove(struct platform_device *pdev)
823 pm_runtime_disable(&pdev->dev); 819 pm_runtime_disable(&pdev->dev);
824 pm_runtime_put_noidle(&pdev->dev); 820 pm_runtime_put_noidle(&pdev->dev);
825 821
826#ifdef CONFIG_USB_OTG_UTILS 822 if (!IS_ERR(tegra->transceiver))
827 if (!IS_ERR_OR_NULL(tegra->transceiver))
828 otg_set_host(tegra->transceiver->otg, NULL); 823 otg_set_host(tegra->transceiver->otg, NULL);
829#endif
830 824
831 usb_phy_shutdown(hcd->phy); 825 usb_phy_shutdown(hcd->phy);
832 usb_remove_hcd(hcd); 826 usb_remove_hcd(hcd);