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>
This commit is contained in:
parent
9be73bae70
commit
a554aea67a
|
@ -887,11 +887,14 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
|
||||||
of_property_read_bool(np, "nvidia,has-legacy-mode");
|
of_property_read_bool(np, "nvidia,has-legacy-mode");
|
||||||
|
|
||||||
phy_type = of_usb_get_phy_mode(np);
|
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);
|
err = utmi_phy_probe(tegra_phy, pdev);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
} else if (phy_type == USBPHY_INTERFACE_MODE_ULPI) {
|
break;
|
||||||
|
|
||||||
|
case USBPHY_INTERFACE_MODE_ULPI:
|
||||||
tegra_phy->is_ulpi_phy = true;
|
tegra_phy->is_ulpi_phy = true;
|
||||||
|
|
||||||
tegra_phy->reset_gpio =
|
tegra_phy->reset_gpio =
|
||||||
|
@ -902,7 +905,9 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
|
||||||
return tegra_phy->reset_gpio;
|
return tegra_phy->reset_gpio;
|
||||||
}
|
}
|
||||||
tegra_phy->config = NULL;
|
tegra_phy->config = NULL;
|
||||||
} else {
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
dev_err(&pdev->dev, "phy_type is invalid or unsupported\n");
|
dev_err(&pdev->dev, "phy_type is invalid or unsupported\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue