aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorTuomas Tynkkynen <ttynkkynen@nvidia.com>2013-07-25 15:24:09 -0400
committerFelipe Balbi <balbi@ti.com>2013-07-29 08:19:19 -0400
commita554aea67aaadb7f3396b2a8f940ab0b915b2a5e (patch)
tree42fcf64fc8a1d2317153f3c026ef5e0fffde73f2 /drivers/usb/phy
parent9be73bae70ac5b0149daa243eeae2bdacd970574 (diff)
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@nvidia.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-tegra-usb.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 01c30ff8874e..49fa2da56c4b 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)
887 of_property_read_bool(np, "nvidia,has-legacy-mode"); 887 of_property_read_bool(np, "nvidia,has-legacy-mode");
888 888
889 phy_type = of_usb_get_phy_mode(np); 889 phy_type = of_usb_get_phy_mode(np);
890 if (phy_type == USBPHY_INTERFACE_MODE_UTMI) { 890 switch (phy_type) {
891 case USBPHY_INTERFACE_MODE_UTMI:
891 err = utmi_phy_probe(tegra_phy, pdev); 892 err = utmi_phy_probe(tegra_phy, pdev);
892 if (err < 0) 893 if (err < 0)
893 return err; 894 return err;
894 } else if (phy_type == USBPHY_INTERFACE_MODE_ULPI) { 895 break;
896
897 case USBPHY_INTERFACE_MODE_ULPI:
895 tegra_phy->is_ulpi_phy = true; 898 tegra_phy->is_ulpi_phy = true;
896 899
897 tegra_phy->reset_gpio = 900 tegra_phy->reset_gpio =
@@ -902,7 +905,9 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
902 return tegra_phy->reset_gpio; 905 return tegra_phy->reset_gpio;
903 } 906 }
904 tegra_phy->config = NULL; 907 tegra_phy->config = NULL;
905 } else { 908 break;
909
910 default:
906 dev_err(&pdev->dev, "phy_type is invalid or unsupported\n"); 911 dev_err(&pdev->dev, "phy_type is invalid or unsupported\n");
907 return -EINVAL; 912 return -EINVAL;
908 } 913 }