[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1374780249-22207-1-git-send-email-ttynkkynen@nvidia.com>
Date: Thu, 25 Jul 2013 22:24:09 +0300
From: Tuomas Tynkkynen <ttynkkynen@...dia.com>
To: <balbi@...com>
CC: <linux-tegra@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-usb@...r.kernel.org>, <swarren@...dotorg.org>,
<gregkh@...uxfoundation.org>,
Tuomas Tynkkynen <ttynkkynen@...dia.com>
Subject: [PATCH] usb: phy: tegra: Use switch instead of if-else
Use switch() instead of if-else when checking for the PHY type.
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@...dia.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists