mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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] usb: phy: tegra: Use switch instead of if-else
Date: Thu, 25 Jul 2013 22:24:09 +0300	[thread overview]
Message-ID: <1374780249-22207-1-git-send-email-ttynkkynen@nvidia.com> (raw)
In-Reply-To: <20130725191734.GB26858@radagast>

Use switch() instead of if-else when checking for the PHY type.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
---
Ah :). Here.

 drivers/usb/phy/phy-tegra-usb.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 01c30ff..49fa2da 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -887,11 +887,14 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
 		of_property_read_bool(np, "nvidia,has-legacy-mode");
 
 	phy_type = of_usb_get_phy_mode(np);
-	if (phy_type == USBPHY_INTERFACE_MODE_UTMI) {
+	switch (phy_type) {
+	case USBPHY_INTERFACE_MODE_UTMI:
 		err = utmi_phy_probe(tegra_phy, pdev);
 		if (err < 0)
 			return err;
-	} else if (phy_type == USBPHY_INTERFACE_MODE_ULPI) {
+		break;
+
+	case USBPHY_INTERFACE_MODE_ULPI:
 		tegra_phy->is_ulpi_phy = true;
 
 		tegra_phy->reset_gpio =
@@ -902,7 +905,9 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
 			return tegra_phy->reset_gpio;
 		}
 		tegra_phy->config = NULL;
-	} else {
+		break;
+
+	default:
 		dev_err(&pdev->dev, "phy_type is invalid or unsupported\n");
 		return -EINVAL;
 	}
-- 
1.8.1.5


  reply	other threads:[~2013-07-25 19:24 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
2013-07-25 19:11     ` Tuomas Tynkkynen
2013-07-25 19:17       ` Felipe Balbi
2013-07-25 19:24         ` Tuomas Tynkkynen [this message]
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=1374780249-22207-1-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®