usb: phy: tegra: don't call into tegra-ehci directly
[deliverable/linux.git] / drivers / usb / host / ehci-tegra.c
index 4f3cfb83f86294828dba2520f7cfa7af7053b8d9..e3eddc31ac83fd4f2065a5815967700fa6932ef7 100644 (file)
@@ -611,7 +611,7 @@ static const struct dev_pm_ops tegra_ehci_pm_ops = {
 /* Bits of PORTSC1, which will get cleared by writing 1 into them */
 #define TEGRA_PORTSC1_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC)
 
-void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val)
+static void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val)
 {
        unsigned long val;
        struct usb_hcd *hcd = bus_to_hcd(x->otg->host);
@@ -622,9 +622,8 @@ void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val)
        val |= TEGRA_USB_PORTSC1_PTS(pts_val & 3);
        writel(val, base + TEGRA_USB_PORTSC1);
 }
-EXPORT_SYMBOL_GPL(tegra_ehci_set_pts);
 
-void tegra_ehci_set_phcd(struct usb_phy *x, bool enable)
+static void tegra_ehci_set_phcd(struct usb_phy *x, bool enable)
 {
        unsigned long val;
        struct usb_hcd *hcd = bus_to_hcd(x->otg->host);
@@ -637,7 +636,6 @@ void tegra_ehci_set_phcd(struct usb_phy *x, bool enable)
                val &= ~TEGRA_USB_PORTSC1_PHCD;
        writel(val, base + TEGRA_USB_PORTSC1);
 }
-EXPORT_SYMBOL_GPL(tegra_ehci_set_phcd);
 
 static u64 tegra_ehci_dma_mask = DMA_BIT_MASK(32);
 
@@ -738,7 +736,9 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 
        tegra->phy = tegra_usb_phy_open(&pdev->dev, instance, hcd->regs,
                                        pdata->phy_config,
-                                       TEGRA_USB_PHY_MODE_HOST);
+                                       TEGRA_USB_PHY_MODE_HOST,
+                                       tegra_ehci_set_pts,
+                                       tegra_ehci_set_phcd);
        if (IS_ERR(tegra->phy)) {
                dev_err(&pdev->dev, "Failed to open USB phy\n");
                err = -ENXIO;
@@ -773,16 +773,14 @@ static int tegra_ehci_probe(struct platform_device *pdev)
                goto fail_phy;
        }
 
-#ifdef CONFIG_USB_OTG_UTILS
        if (pdata->operating_mode == TEGRA_USB_OTG) {
                tegra->transceiver =
                        devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
-               if (!IS_ERR_OR_NULL(tegra->transceiver))
+               if (!IS_ERR(tegra->transceiver))
                        otg_set_host(tegra->transceiver->otg, &hcd->self);
        } else {
                tegra->transceiver = ERR_PTR(-ENODEV);
        }
-#endif
 
        err = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (err) {
@@ -801,10 +799,8 @@ static int tegra_ehci_probe(struct platform_device *pdev)
        return err;
 
 fail:
-#ifdef CONFIG_USB_OTG_UTILS
-       if (!IS_ERR_OR_NULL(tegra->transceiver))
+       if (!IS_ERR(tegra->transceiver))
                otg_set_host(tegra->transceiver->otg, NULL);
-#endif
 fail_phy:
        usb_phy_shutdown(hcd->phy);
 fail_io:
@@ -823,10 +819,8 @@ static int tegra_ehci_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
        pm_runtime_put_noidle(&pdev->dev);
 
-#ifdef CONFIG_USB_OTG_UTILS
-       if (!IS_ERR_OR_NULL(tegra->transceiver))
+       if (!IS_ERR(tegra->transceiver))
                otg_set_host(tegra->transceiver->otg, NULL);
-#endif
 
        usb_phy_shutdown(hcd->phy);
        usb_remove_hcd(hcd);
This page took 0.026764 seconds and 5 git commands to generate.