Skip to content

Commit 9794476

Browse files
Roger Quadrosgregkh
authored andcommitted
usb: cdns3: Error out if USB_DR_MODE_UNKNOWN in cdns3_core_init_role()
USB_DR_MODE_UNKNOWN should be treated as error as it is done in cdns3_drd_update_mode(). Fixes: 02ffc26 ("usb: cdns3: fix cdns3_core_init_role()") Signed-off-by: Roger Quadros <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7a6f22d commit 9794476

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/cdns3/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
166166
goto err;
167167

168168
switch (cdns->dr_mode) {
169-
case USB_DR_MODE_UNKNOWN:
170169
case USB_DR_MODE_OTG:
171170
ret = cdns3_hw_role_switch(cdns);
172171
if (ret)
@@ -182,6 +181,9 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
182181
if (ret)
183182
goto err;
184183
break;
184+
default:
185+
ret = -EINVAL;
186+
goto err;
185187
}
186188

187189
return ret;

0 commit comments

Comments
 (0)