diff options
author | Venu Byravarasu <vbyravarasu@nvidia.com> | 2012-03-28 18:09:14 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-03-30 18:51:28 -0700 |
commit | d5197d4955e72310f82185c611da4d42822bee3a (patch) | |
tree | 23b3d51dd8e5d98c913a274a51fccf5302c21b30 /drivers/usb/otg | |
parent | b29cd2ee3eb10528dcecf2c32fc6c382f1c4da27 (diff) |
usb: otg: tegra: code clean up
Modified multiple if conditions to switch case.
Included a new OTG state case: undefined
Change-Id: Iba4cf1a79b8c220fc873966bd8a89f43a5648863
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-on: http://git-master/r/92832
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/usb/otg')
-rw-r--r-- | drivers/usb/otg/tegra-otg.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c index e7a21f92f797..4c04e6e183f1 100644 --- a/drivers/usb/otg/tegra-otg.c +++ b/drivers/usb/otg/tegra-otg.c @@ -92,13 +92,18 @@ static void tegra_otg_disable_clk(void) static const char *tegra_state_name(enum usb_otg_state state) { - if (state == OTG_STATE_A_HOST) - return "HOST"; - if (state == OTG_STATE_B_PERIPHERAL) - return "PERIPHERAL"; - if (state == OTG_STATE_A_SUSPEND) - return "SUSPEND"; - return "INVALID"; + switch (state) { + case OTG_STATE_A_HOST: + return "HOST"; + case OTG_STATE_B_PERIPHERAL: + return "PERIPHERAL"; + case OTG_STATE_A_SUSPEND: + return "SUSPEND"; + case OTG_STATE_UNDEFINED: + return "UNDEFINED"; + default: + return "INVALID"; + } } static struct platform_device * |