dwc3-msm: Fix dwc3_drd_state_string for undefined state
dwc3_drd_state_string() will return null for undefined state and fix it by adding undefined name to state_names. Change-Id: I40be0b14c098fe2e9d77df3ff1108c3d4d55a30f Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
This commit is contained in:
parent
7d34ffa6c3
commit
92e370e629
1 changed files with 2 additions and 1 deletions
|
@ -142,6 +142,7 @@ enum dwc3_drd_state {
|
|||
};
|
||||
|
||||
static const char *const state_names[] = {
|
||||
[DRD_STATE_UNDEFINED] = "undefined",
|
||||
[DRD_STATE_IDLE] = "idle",
|
||||
[DRD_STATE_PERIPHERAL] = "peripheral",
|
||||
[DRD_STATE_PERIPHERAL_SUSPEND] = "peripheral_suspend",
|
||||
|
@ -152,7 +153,7 @@ static const char *const state_names[] = {
|
|||
static const char *dwc3_drd_state_string(enum dwc3_drd_state state)
|
||||
{
|
||||
if (state < 0 || state >= ARRAY_SIZE(state_names))
|
||||
return "UNDEFINED";
|
||||
return "UNKNOWN";
|
||||
|
||||
return state_names[state];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue