From: Felipe Balbi <balbi@ti.com>
To: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Cc: <balbi@ti.com>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
<swarren@wwwdotorg.org>, <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v3 8/9] usb: phy: tegra: Use DT helpers for phy_type
Date: Thu, 25 Jul 2013 22:00:23 +0300 [thread overview]
Message-ID: <20130725190023.GA26858@radagast> (raw)
In-Reply-To: <1374777489-13093-9-git-send-email-ttynkkynen@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 1776 bytes --]
Hi,
On Thu, Jul 25, 2013 at 09:38:08PM +0300, Tuomas Tynkkynen wrote:
> Use the new of_usb_get_phy_mode helper function for parsing phy_type
> from the device tree.
>
> Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> Tested-by: Stephen Warren <swarren@nvidia.com>
> ---
> drivers/usb/phy/phy-tegra-usb.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
> index fb5bc8c..fb469f1 100644
> --- a/drivers/usb/phy/phy-tegra-usb.c
> +++ b/drivers/usb/phy/phy-tegra-usb.c
> @@ -31,6 +31,7 @@
> #include <linux/of_gpio.h>
> #include <linux/usb/otg.h>
> #include <linux/usb/ulpi.h>
> +#include <linux/usb/of.h>
> #include <asm/mach-types.h>
> #include <linux/usb/ehci_def.h>
> #include <linux/usb/tegra_usb_phy.h>
> @@ -860,6 +861,7 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
> struct resource *res;
> struct tegra_usb_phy *tegra_phy = NULL;
> struct device_node *np = pdev->dev.of_node;
> + enum usb_phy_interface phy_type;
> int err;
>
> tegra_phy = devm_kzalloc(&pdev->dev, sizeof(*tegra_phy), GFP_KERNEL);
> @@ -884,12 +886,12 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
> tegra_phy->is_legacy_phy =
> of_property_read_bool(np, "nvidia,has-legacy-mode");
>
> - err = of_property_match_string(np, "phy_type", "ulpi");
> - if (err < 0) {
> + phy_type = of_usb_get_phy_mode(np);
> + if (phy_type == USBPHY_INTERFACE_MODE_UTMI) {
can you add one more patch to your series converting this to a switch ?
I can apply this one as is, but this really looks like a good fit for a
switch statement
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-07-25 19:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 18:38 [PATCH v3 0/9] Tegra USB cleanup series Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 1/9] usb: phy: tegra: Remove unnecessary 'dev' field Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 2/9] usb: host: tegra: Remove leftover code Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 3/9] usb: tegra: host: Remove references to plat data Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 4/9] ARM: tegra: Remove USB platform data Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 5/9] usb: phy: tegra: Register as an USB PHY Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 6/9] usb: host: tegra: Locate a PHY via standard API Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 7/9] usb: phy: tegra: Remove custom PHY locating APIs Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 8/9] usb: phy: tegra: Use DT helpers for phy_type Tuomas Tynkkynen
2013-07-25 19:00 ` Felipe Balbi [this message]
2013-07-25 19:11 ` Tuomas Tynkkynen
2013-07-25 19:17 ` Felipe Balbi
2013-07-25 19:24 ` [PATCH] usb: phy: tegra: Use switch instead of if-else Tuomas Tynkkynen
2013-07-25 18:38 ` [PATCH v3 9/9] usb: phy: tegra: Use DT helpers for dr_mode 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=20130725190023.GA26858@radagast \
--to=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 \
--cc=ttynkkynen@nvidia.com \
/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®