mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
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: 02ffc26df9
("usb: cdns3: fix cdns3_core_init_role()")
Signed-off-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20191017075801.8734-1-rogerq@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7a6f22d747
commit
9794476942
1 changed files with 3 additions and 1 deletions
|
@ -166,7 +166,6 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
switch (cdns->dr_mode) {
|
switch (cdns->dr_mode) {
|
||||||
case USB_DR_MODE_UNKNOWN:
|
|
||||||
case USB_DR_MODE_OTG:
|
case USB_DR_MODE_OTG:
|
||||||
ret = cdns3_hw_role_switch(cdns);
|
ret = cdns3_hw_role_switch(cdns);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -182,6 +181,9 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue