Merge "dwc3-msm: Fix dwc3_drd_state_string for undefined state"

This commit is contained in:
Linux Build Service Account 2019-06-11 04:12:22 -07:00 committed by Gerrit - the friendly Code Review server
commit 0434b31d56

View file

@ -145,6 +145,7 @@ enum dwc3_drd_state {
}; };
static const char *const state_names[] = { static const char *const state_names[] = {
[DRD_STATE_UNDEFINED] = "undefined",
[DRD_STATE_IDLE] = "idle", [DRD_STATE_IDLE] = "idle",
[DRD_STATE_PERIPHERAL] = "peripheral", [DRD_STATE_PERIPHERAL] = "peripheral",
[DRD_STATE_PERIPHERAL_SUSPEND] = "peripheral_suspend", [DRD_STATE_PERIPHERAL_SUSPEND] = "peripheral_suspend",
@ -155,7 +156,7 @@ static const char *const state_names[] = {
static const char *dwc3_drd_state_string(enum dwc3_drd_state state) static const char *dwc3_drd_state_string(enum dwc3_drd_state state)
{ {
if (state < 0 || state >= ARRAY_SIZE(state_names)) if (state < 0 || state >= ARRAY_SIZE(state_names))
return "UNDEFINED"; return "UNKNOWN";
return state_names[state]; return state_names[state];
} }