From: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
To: <balbi@ti.com>
Cc: <linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-usb@vger.kernel.org>, <swarren@wwwdotorg.org>,
<gregkh@linuxfoundation.org>,
Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Subject: [PATCH v2 2/9] usb: host: tegra: Remove leftover code
Date: Mon, 15 Jul 2013 22:53:42 +0300 [thread overview]
Message-ID: <1373918029-28977-3-git-send-email-ttynkkynen@nvidia.com> (raw)
In-Reply-To: <1373918029-28977-1-git-send-email-ttynkkynen@nvidia.com>
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>
---
drivers/usb/host/ehci-tegra.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 14c1f35..06e8feb 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,
struct tegra_ehci_hcd {
struct tegra_usb_phy *phy;
struct clk *clk;
- struct usb_phy *transceiver;
int port_resuming;
bool needs_double_reset;
enum tegra_usb_phy_port_speed port_speed;
@@ -436,26 +435,18 @@ static int tegra_ehci_probe(struct platform_device *pdev)
goto cleanup_phy;
}
- if (pdata->operating_mode == TEGRA_USB_OTG) {
- tegra->transceiver =
- devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
- if (!IS_ERR(tegra->transceiver))
- otg_set_host(tegra->transceiver->otg, &hcd->self);
- } else {
- tegra->transceiver = ERR_PTR(-ENODEV);
- }
+ otg_set_host(u_phy->otg, &hcd->self);
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err) {
dev_err(&pdev->dev, "Failed to add USB HCD\n");
- goto cleanup_transceiver;
+ goto cleanup_otg_set_host;
}
return err;
-cleanup_transceiver:
- if (!IS_ERR(tegra->transceiver))
- otg_set_host(tegra->transceiver->otg, NULL);
+cleanup_otg_set_host:
+ otg_set_host(u_phy->otg, NULL);
cleanup_phy:
usb_phy_shutdown(hcd->phy);
cleanup_clk_en:
@@ -473,8 +464,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
struct tegra_ehci_hcd *tegra =
(struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv;
- if (!IS_ERR(tegra->transceiver))
- otg_set_host(tegra->transceiver->otg, NULL);
+ otg_set_host(hcd->phy->otg, NULL);
usb_phy_shutdown(hcd->phy);
usb_remove_hcd(hcd);
--
1.8.1.5
next prev parent reply other threads:[~2013-07-15 19:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 19:53 [PATCH v2 0/9] Tegra USB cleanup series Tuomas Tynkkynen
2013-07-15 19:53 ` [PATCH v2 1/9] usb: phy: tegra: Remove unnecessary 'dev' field Tuomas Tynkkynen
2013-07-15 19:53 ` Tuomas Tynkkynen [this message]
2013-07-15 19:53 ` [PATCH v2 3/9] usb: tegra: host: Remove references to plat data Tuomas Tynkkynen
2013-07-15 19:53 ` [PATCH v2 4/9] ARM: tegra: Remove USB platform data Tuomas Tynkkynen
2013-07-15 23:22 ` Stephen Warren
2013-07-15 19:53 ` [PATCH v2 5/9] usb: phy: tegra: Register as an USB PHY Tuomas Tynkkynen
2013-07-15 19:53 ` [PATCH v2 6/9] usb: host: tegra: Locate a PHY via standard API Tuomas Tynkkynen
2013-07-15 19:53 ` [PATCH v2 7/9] usb: phy: tegra: Remove custom PHY locating APIs Tuomas Tynkkynen
2013-07-15 19:53 ` [PATCH v2 8/9] usb: phy: tegra: Use DT helpers for phy_type Tuomas Tynkkynen
2013-07-15 19:53 ` [PATCH v2 9/9] usb: phy: tegra: Use DT helpers for dr_mode Tuomas Tynkkynen
2013-07-15 23:28 ` [PATCH v2 0/9] Tegra USB cleanup series Stephen Warren
2013-07-25 17:51 ` Felipe Balbi
2013-07-25 18:22 ` Tuomas Tynkkynen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373918029-28977-3-git-send-email-ttynkkynen@nvidia.com \
--to=ttynkkynen@nvidia.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=swarren@wwwdotorg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®