diff options
author | Tuomas Tynkkynen <ttynkkynen@nvidia.com> | 2013-07-25 14:38:02 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-07-29 06:58:21 -0400 |
commit | de3f233703080bfbbd5861d27660db7a2e476238 (patch) | |
tree | 3698cd25b41abc4a78924e6014b7b19b2a5f1c5e /drivers/usb/host/ehci-tegra.c | |
parent | 185d0fd570c121c0c3d4527842a097e50e3e7a79 (diff) |
usb: host: tegra: Remove leftover code
ehci-tegra calls devm_usb_get_phy, which will never succeed since the Tegra
PHY does not register itself with the PHY subsystem. It is also completely
redundant since the code has already located a PHY via an internal API.
Call otg_set_host unconditionally to simplify the code since it should
be safe to do so.
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/host/ehci-tegra.c')
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 14c1f35a4b10..06e8febdcc2c 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -58,7 +58,6 @@ static int (*orig_hub_control)(struct usb_hcd *hcd, | |||
58 | struct tegra_ehci_hcd { | 58 | struct tegra_ehci_hcd { |
59 | struct tegra_usb_phy *phy; | 59 | struct tegra_usb_phy *phy; |
60 | struct clk *clk; | 60 | struct clk *clk; |
61 | struct usb_phy *transceiver; | ||
62 | int port_resuming; | 61 | int port_resuming; |
63 | bool needs_double_reset; | 62 | bool needs_double_reset; |
64 | enum tegra_usb_phy_port_speed port_speed; | 63 | enum tegra_usb_phy_port_speed port_speed; |
@@ -436,26 +435,18 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
436 | goto cleanup_phy; | 435 | goto cleanup_phy; |
437 | } | 436 | } |
438 | 437 | ||
439 | if (pdata->operating_mode == TEGRA_USB_OTG) { | 438 | otg_set_host(u_phy->otg, &hcd->self); |
440 | tegra->transceiver = | ||
441 | devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); | ||
442 | if (!IS_ERR(tegra->transceiver)) | ||
443 | otg_set_host(tegra->transceiver->otg, &hcd->self); | ||
444 | } else { | ||
445 | tegra->transceiver = ERR_PTR(-ENODEV); | ||
446 | } | ||
447 | 439 | ||
448 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); | 440 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); |
449 | if (err) { | 441 | if (err) { |
450 | dev_err(&pdev->dev, "Failed to add USB HCD\n"); | 442 | dev_err(&pdev->dev, "Failed to add USB HCD\n"); |
451 | goto cleanup_transceiver; | 443 | goto cleanup_otg_set_host; |
452 | } | 444 | } |
453 | 445 | ||
454 | return err; | 446 | return err; |
455 | 447 | ||
456 | cleanup_transceiver: | 448 | cleanup_otg_set_host: |
457 | if (!IS_ERR(tegra->transceiver)) | 449 | otg_set_host(u_phy->otg, NULL); |
458 | otg_set_host(tegra->transceiver->otg, NULL); | ||
459 | cleanup_phy: | 450 | cleanup_phy: |
460 | usb_phy_shutdown(hcd->phy); | 451 | usb_phy_shutdown(hcd->phy); |
461 | cleanup_clk_en: | 452 | cleanup_clk_en: |
@@ -473,8 +464,7 @@ static int tegra_ehci_remove(struct platform_device *pdev) | |||
473 | struct tegra_ehci_hcd *tegra = | 464 | struct tegra_ehci_hcd *tegra = |
474 | (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv; | 465 | (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv; |
475 | 466 | ||
476 | if (!IS_ERR(tegra->transceiver)) | 467 | otg_set_host(hcd->phy->otg, NULL); |
477 | otg_set_host(tegra->transceiver->otg, NULL); | ||
478 | 468 | ||
479 | usb_phy_shutdown(hcd->phy); | 469 | usb_phy_shutdown(hcd->phy); |
480 | usb_remove_hcd(hcd); | 470 | usb_remove_hcd(hcd); |